Pixel Shader
float
distance;
float3
offset
=
normalize
(v2f.tanEyeVec);
float3
texCoord = v2f.texCoord;
// March the ray
for
(
int
i = 0; i < NUM_ITERATIONS; i++)
{
distance
=
tex3D
(distanceTex, texCoord).x;
texCoord += distance * offset;
}