Re: Z-buffer as a texture?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Why don't you render with multiple rendertargets, and to one rendertarget you render the depth information (given by texture coordinates as you cant read positions in the pixel shader).
Afaik you can't access the z-buffer as a texture, its only used for that purpose and thats it.
Another thing you might consider, the z-buffer is not linear, which might screw things up when using its information for some unknown purpose.

.