최근에 누군가가 자신의 쉐이더를 OBS에 통합 할 수있는 모듈을 OBS Studio에 추가했습니다. 나는 쉐이더를 작성한 적이 없지만, 어떤 자료를 읽은 후에는 요점을 얻었습니다. 특정 픽셀의 RGBA 값을 나타내는 약간의 메모리를 반환하는 함수입니다.보간을위한 Texture2D 객체 유지하기 HLSL
여기에 문제가 있는데, 너무 익숙하지 않아 몇 가지 다른 고급 쉐이더 언어가있는 것처럼 보입니다. 나는 하나의 OBS Studio가 사용하고있는 단서를 가지고 있지 않다. https://github.com/nleseul/obs-shaderfilter의 저자는 어느 쪽도 모른다. 어떤 문법/어떤 문서가 물론 크게 감사 할 것입니다 어떤 포인터.
내가하고자하는 것은 매우 어수선한 모션 블러입니다. 즉, 제 목표는 작업 할 버퍼의 프레임을 몇 개 유지하고 싶지만, 다른 효과를 위해하는 것이 꽤 유용 할 것이라고 생각합니다. 그게 내가 붙어있는 곳입니다. . 여기에 내가 쉐이더 플러그인 승/작동하도록 Shaders for Game Programmers and Artists pg.87에서 다음있어 무엇 *
uniform float4 blur_factor;
texture2d previmage;
//texture2d image; //this is the input data we're playing around with
float4 mainImage(VertData v_in) : TARGET
{
float4 originalFrame = image.Sample(textureSampler, v_in.uv);
float4 oldFrame = previmage.Sample(textureSampler, v_in.uv);
//this function's going pixel by pixel, I should be pushing
//to the frame buffer here* or there should be some way of modifying
//the frame buffer pixel by pixel, second option makes more sense to do
if(v_in.uv.x == 1 && v_in.uv.y == 1){
//it couldn't have been this easy...it's never this easy
//uncommenting the line below clearly causes a problem, I don't have a debugger for this
//previmage = image;
//this doesn't work either, wishful thinking
//previmage = texture2d(image);
}
//this may not actually be the function to use for a motion blur but at the very least it's mixing two textures together so that I'd have a proof of concept working*
return lerp(originalFrame,oldFrame,blur_factor);
}