home *** CD-ROM | disk | FTP | other *** search
- //rain cylendar pixel shader:
- //mixes color of 2 layers of rain linearly
- //Luke Lenhart
- //(C)2004-2005 Digipen Institute of Technology
-
- //blend factor between 2 layers
- float blend;
-
- //layer 0 sampler
- sampler2D sampRain0;
-
- //layer 1 sampler
- sampler2D sampRain1;
-
- //shader input
- struct PS_INPUT
- {
- float4 Color : COLOR;
- float2 Tex0 : TEXCOORD0;
- };
-
- //shader code
- float4 PShader(PS_INPUT In) : COLOR
- {
- //sample textutes
- float4 rain0=tex2D(sampRain0,In.Tex0);
- float4 rain1=tex2D(sampRain1,In.Tex0);
-
- //simple blend of samples
- float4 clr=lerp(rain0,rain1,blend);
-
- //apply vert color
- clr*=In.Color;
-
- //spit out color
- return clr;
- }
-