PDA

View Full Version : Code doubt



iris_raj
02-26-2007, 11:32 PM
Dear shader programmers,

I am new to shader programming

What does the (((IN.Pos.xy / IN.Pos.w) + 1) / 2 indicate.

The code snippet is
float2 texc = ((IN.Pos.xy / IN.Pos.w) + 1) / 2;

With regards
RAJESH.R

zeoverlord
02-27-2007, 02:44 AM
It looks like some kind of texture projection with bias transformation.
Used for things like depth map shadows.

tomtrenki
02-27-2007, 07:15 AM
This code calculates a texture coordinate on the screen.
I used this and a dudv map to create refractive materials.