Hi…
I am trying to use fragment shader to encode each fragment’s depth into RGBA channels. So that i can do 4 rendering passes and then read back the depth buffer values using only one pass.
but somehow, the depth values i got back are wrong compared to those read back without using shaders.
right now i am multiplying the coordinates in the vertex shaders with modelviewproj. but somehow in the fragment shader… values computed dun seem to be correct.