float4 shadow    = tex2D(ShadowMap);
float4 spotlight = tex2D(SpotLight);
float4 lighting  = IN.Color0;
OUT.COL = spotlight * shadow * lighting;

Example 2: Basic pixel shader program written in Cg.

Back to Article