Code doubt

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

It looks like some kind of texture projection with bias transformation.
Used for things like depth map shadows.

This code calculates a texture coordinate on the screen.
I used this and a dudv map to create refractive materials.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.