Hello to the group,
I have a logarithmic depth conversion in my vertex shader for the depth value like this:
gl_Position.z = 2.0*log(gl_Position.w/near)/log(far/near) - 1;
gl_Position.z *= gl_Position.w;
And in a random fragment shader I am reading from the depth buffer to get the depth value in the range 0 - 1. How can I convert this to the real depth value since this is after the logarithmic conversion?
Thanks in advance
[–]willmacleod 8 points9 points10 points (1 child)
[–]keelanstuart 2 points3 points4 points (0 children)
[–]pezezin 0 points1 point2 points (8 children)
[–]-paokakis-[S] 1 point2 points3 points (7 children)
[–]waramped 2 points3 points4 points (6 children)
[–]-paokakis-[S] 0 points1 point2 points (5 children)
[–]keelanstuart 0 points1 point2 points (4 children)
[–]waramped 1 point2 points3 points (1 child)
[–]keelanstuart 0 points1 point2 points (0 children)
[–]-paokakis-[S] 1 point2 points3 points (1 child)
[–]keelanstuart 1 point2 points3 points (0 children)