[Bug 76618] Gameplay-football graphics has wrong color

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Mar 28 07:43:06 PDT 2014


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

Samuel Iglesias <siglesias at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |siglesias at igalia.com

--- Comment #3 from Samuel Iglesias <siglesias at igalia.com> ---
I have tested this bug and reproduced successfully in my Sandybridge laptop
with git master Mesa.

Debugging the shaders (which are placed in media/shaders/ folder of the game),
I found that the issue is inside postprocess.frag which does these two things
among others:

1) It uses a simplification for the convolution which produces errors on the
output which could be due to rounding errors. It produces the random pixel
noise that can be seen clearly in the pitch and in the shadows.

2) It does a gamma correction which produced the color errors in the bottom
half of the screen (which seems to be the part not affected by the fog
algorithm).

So I did some changes to postprocess.frag shader to figure out which is the
source of the problem:

1) I disabled the convolution by substituting this line:

       vec3 fragColor = base * (1 - SSAO); // SSAO

by this line:
       vec3 fragColor = base;

So the pixel noise disappeared which, at the end, allowed me to focus only in
the color issue.

2) I disabled the gamma correction and I saw a good output. As
GammaCorrection() is calling to the pow() function, I created my own pow
function (called my_pow()) in order to compare both outputs.
I also modified the gamma correction value to be 2.0 to simplify my_pow()
function because GammaCorrection() would end up being a simple sqrt(color) when
choosing this specific gamma value.

So I compared two different cases:

* No convolution with original GammaCorrection() (pow()), gamma = 2.0.
* No convolution with modified GammaCorrection() (my_pow()), gamma = 2.0.

I found that the second case shows a proper output (attached image) while the
first case it is showing the same ugly color output.

Furthermore, I tested on a NVIDIA graphics card with nouveau driver (Mesa 10.1)
with the original (untouched) game and the game with both modifications. In all
cases the output is fine, indicating that its GLSL's pow() function is well
implemented.

I'm going to attach several files:

* Sandybridge output of each test case: no convolution, with original pow() and
with my_pow() call in GammaCorrection().
* NVIDIA output of each test case: no convolution. With original pow() and with
my_pow() call in GammaCorrection().
* The postprocessing fragment shader file with my modifications if you want to
play with it, reproduce the error and understand what it's happening.

In summary, it seems that the error is present in the implementation of the
GLSL's pow() function for Intel graphics.

I hope this information could help someone to fix this error. If you need more
information or you don't understand something, please tell me so.

-- 
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/20140328/5004b7ab/attachment-0001.html>


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