PDA

View Full Version : how to access cg fragment z value



soconne
11-06-2003, 09:43 AM
How do you access the z value of an incoming pixel in CG?

jra101
11-06-2003, 09:50 AM
Bind an input float4 variable to WPOS and access the z portion.

Here's an example:



float4 main(in float4 wpos : WPOS) : COLOR
{
return wpos.z;
}