最近誰かがOBS Studioにモジュールを追加しました。誰も自分のシェーダをOBSに組み込むことができます。私はシェイダーを書いたことは一度も触れていませんでしたが、いくつかの資料を読んだら、要点を得ました。特定のピクセルのRGBA値を表すメモリを返す関数です。補間用のTexture2Dオブジェクトを保持するHLSL
ここに問題があります。これはあまりにも新しく、いくつかの異なる高水準シェーダ言語があるように私には見えますか? OBS Studioが使用している手がかりが1つもないので、https://github.com/nleseul/obs-shaderfilterの作者はわからないようです。どのような構文/どのドキュメンテーションがもちろん大いに感謝されるでしょうへのポインタ。
私がしようとしているのは、非常にぼんやりした動きのぼやけです。つまり、いくつかのフレームをいくつかのバッファに入れておきたいのですが、他のエフェクトではそれが非常に有用なものになると思います。それが私が立ち往生した場所です。ここで私はシェーダープラグイン/ wが機能するように適合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);
}