home *** CD-ROM | disk | FTP | other *** search
- //extrudes object away from a light, fading out far edge
- //Luke Lenhart
- //(C)2004-2005 Digipen Institute of Technology
-
- //texture sampler
- sampler2D sampTex;
-
- //blend factor between 2 spots within texture
- float blend;
-
- //shader input
- struct PS_INPUT
- {
- float4 Color : COLOR;
- float2 Tex0 : TEXCOORD0;
- float4 Pos : TEXCOORD1;
- };
-
- //shader code
- float4 PShader(PS_INPUT In) : COLOR
- {
- //sample from here, and from 0.5 off
- float4 clr0=tex2D(sampTex,In.Tex0);
- float4 clr1=tex2D(sampTex,In.Tex0+float2(0.5f,0));
-
- //calc blend factor based on blendPos
- //float ipol=sin(blendPos)
- return lerp(clr0,clr1,blend)*In.Color;
- }
-