Depth read fix for deferred quad pass

This commit is contained in:
Lubos Lenco 2017-12-07 20:46:41 +01:00
parent 46758cec5b
commit 34fd94af8a

View file

@ -76,9 +76,10 @@ out vec4 fragColor;
void main() {
vec4 g0 = texture(gbuffer0, texCoord); // Normal.xy, metallic/roughness, occlusion
vec4 g1 = texture(gbuffer1, texCoord); // Basecolor.rgb,
float depth = texture(gbufferD, texCoord).r * 2.0 - 1.0; // 0 - 1 => -1 - 1
// float depth = texture(gbufferD, texCoord).r * 2.0 - 1.0; // 0 - 1 => -1 - 1
// TODO: store_depth
// float depth = (1.0 - g0.a) * 2.0 - 1.0;
// TODO: Firefox throws feedback loop detected error, read depth from gbuffer0
float depth = (1.0 - g0.a) * 2.0 - 1.0;
vec3 n;
n.z = 1.0 - abs(g0.x) - abs(g0.y);