[Bug 76396] [IVB/HSW] ogl-samples: gl-320-fbo-depth-multisample render error (broken line at "horizon")

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Apr 3 05:00:20 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=76396

--- Comment #2 from Iago Toral <itoral at igalia.com> ---
The test renders a polygon tilted in the Zaxis to a FBO with a multisampled
texture attached to its depth component. Then renders to the main framebuffer
and uses a shader to map the recorder depth info to the frame buffer with a
gray scale (the darker the color the lower the depth value, where black should
be the near plane and white the far plane).

This is the fragment shader used by the test to map depth values to colors on 
the screen:

#version 150 core

uniform sampler2DMS Diffuse;

in vec4 gl_FragCoord;
out vec4 Color;

float LinearizeDepth(float Depth)
{
        float n = 0.1; // camera z near
        float f = 8.0; // camera z far
        return (2.0 * n) / (f + n - Depth * (f - n));
}

void main()
{
  float Depth = texelFetch(Diffuse, ivec2(gl_FragCoord.xy), 0).r;
  for(int i = 1; i < 4; ++i)
    Depth = min(Depth, texelFetch(Diffuse, ivec2(gl_FragCoord.xy), i).r);

  float LinearDepth = LinearizeDepth(Depth);

  Color = vec4(LinearDepth, LinearDepth, LinearDepth, 1.0);
}

Using max() instead of min() to select the depth sample to use for color
mapping gives the expected result so I guess what is going on here is that at
least one of the depth components for the furthest end of the polygon is 0 (or
close to 0), which is bogus.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20140403/ee576ed6/attachment.html>


More information about the intel-3d-bugs mailing list