Code: Select all
bool ENABLE_EFFECT <
string UIName = "Enable a Effect";
> = {false};
Code: Select all
bool2 ENABLE_EFFECT <
string UIName = "Enable a Effect";
> = {false, true};
Code: Select all
bool ENABLE_EFFECT <
string UIName = "Enable a Effect";
> = {false};
Code: Select all
bool2 ENABLE_EFFECT <
string UIName = "Enable a Effect";
> = {false, true};
Code: Select all
color = frac(TextureDepth.Sample(Sampler0, IN.txcoord0.xy) * 1000);
Code: Select all
// Helper Function
float linearDepth(float d, float n, float f)
{
return (2.0 * n)/(f + n - d * (f - n));
}
// Pixel Shader
float Depth = TextureDepth.Sample(Sampler0, IN.txcoord0.xy ).x;
float linDepthFrom = linearDepth(Depth, 0.5f, fFromDepth);
float linDepthTo = linearDepth(Depth, 0.5f, fToDepth);
color = color * (1.0f - linDepthFrom);
color = color * linDepthTo;