Original Post
Hi,
Well, suppose I have a depth map and just want to render pixels that are on the specific depth of the depth map.
Its not a common depth test, because I might have fragments that are closer to the camera but the depth on the depth map for that screen position is farther.
I thought on this approach:
1.Render Scene
2. At pixel shader consult the depth map, if current fragment depth is within the tolerance, shade and return fragment.
else
clip(-1);
Is this the correct approach, would it work?
Well, suppose I have a depth map and just want to render pixels that are on the specific depth of the depth map.
Its not a common depth test, because I might have fragments that are closer to the camera but the depth on the depth map for that screen position is farther.
I thought on this approach:
1.Render Scene
2. At pixel shader consult the depth map, if current fragment depth is within the tolerance, shade and return fragment.
else
clip(-1);
Is this the correct approach, would it work?