texture tex0;
texture noise;
float timer;
sampler s0 = sampler_state { texture = (tex0); };
sampler s1 = sampler_state { texture = (noise); };
float4 FilmGrain( in float2 Tex : TEXCOORD0 ) : COLOR0
{
float grain = tex3D( s1, float3(15*Tex, timer) ).r;
float4 image = tex2D( s0, Tex );
float4 result = 0.032 * grain + image;
float intensity = result.r * 0.299 + result.g * 0.587 + result.b * 0.184;
return float4(intensity, intensity, intensity, 1);
}
technique T0
{
pass p0 { PixelShader = compile ps_2_0 FilmGrain(); }
}
