Reconstructing world position from linear depth
问题 i have issues reconstructing world positions from previously stored linear depth in glsl. I read lots of info online, but can't find my problem... So this is what I got: VS (storing depth to 32F): float linDepth(float z) { return (-z-zNear)/(zFar-zNear); } void main() { vec4 position = uViewMatrix * uModelMatrix * vec4(aPosition, 1); depth = linDepth(position.z); //store linear view-depth } FS (reconstuction): void main() { vec3 vUV = vec2(0..1, 0..1); (from screen aligned quad) vec3 ndc =