Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GLSL code for getting the colour of the depth
//float n = 5.0;
//float f = 800.0;
float getDepth(float z, float n, float f) {
return (2.0 * n) / (f + n - z*(f-n));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment