|
@@ -152,6 +152,6 @@ The following code retrieves the 3D position below the pixel being drawn:
|
|
|
|
|
|
void fragment() {
|
|
|
float depth = textureLod(DEPTH_TEXTURE, SCREEN_UV, 0.0).r;
|
|
|
- vec4 upos = INV_PROJECTION_MATRIX * vec4(SCREEN_UV * 2.0 - 1.0, depth * 2.0 - 1.0, 1.0);
|
|
|
+ vec4 upos = INV_PROJECTION_MATRIX * vec4(SCREEN_UV * 2.0 - 1.0, depth, 1.0);
|
|
|
vec3 pixel_position = upos.xyz / upos.w;
|
|
|
}
|