How to run the pixel shader effcet??
Posted
by
Yashwinder
on Game Development
See other posts from Game Development
or by Yashwinder
Published on 2011-06-27T08:17:51Z
Indexed on
2011/06/27
8:31 UTC
Read the original article
Hit count: 354
slimdx
Below stated is the code for my pixel shader which I am rendering after the vertex shader. I have set the wordViewProjection matrix in my program but I don't know to set the progress variable i.e in my pixel shader file which will make the image displayed by the help of a quad to give out transition effect. Here is the code for my pixel shader program:::
As my pixel shader is giving a static effect and now I want to use it to give some effect. So for this I have to add a progress variable in my pixel shader and initialize to the Constant table function i.e
constantTable.SetValue(D3DDevice,"progress",progress );
I am having the problem in using this function for progress in my program. Anybody know how to set this variable in my program.
And my new pixel Shader code is
float progress : register(C0);
sampler2D implicitInput : register(s0); sampler2D oldInput : register(s1);
struct VS_OUTPUT
{
float4 Position : POSITION;
float4 Color : COLOR0;
float2 UV : TEXCOORD 0;
};
float4 Blinds(float2 uv)
{
if(frac(uv.y * 5) < progress)
{
return tex2D(implicitInput, uv);
}
else
{
return tex2D(oldInput, uv);
}
}
// Pixel Shader
{
return Blinds(input.UV);
}
© Game Development or respective owner