Hey all, I’m new to this GLSL thing. I’ve got a single quad on the screen and am aiming to do everything in the fragment shader to get max performance. I’ve got one quad on screen and am basically writing a pixel shader. I’m trying to use gl_FragCoord.z / gl_FragDepth to actually represent depth in the render. That is, I would like a pixel with a depth of 0.98 to appear height than a pixel with a depth of 0.24.
Is the wrong approach? Please note that I’m only writing a pixel shader – I did everything with vertex shaders already and was not happy with the performance.
My first assumption was that I’d simply have to adjust shade based on distance, but that does not create a realistic effect. Any idea how I can use my lighting, etc along with some extra math to figure out how to represent height/depth in just the frag shader?