[Bug 80018] [HSW] Ambient occlusion glitch in Planetary Annihilation on Intel HD4600
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Mon Jul 30 15:32:37 UTC 2018
https://bugs.freedesktop.org/show_bug.cgi?id=80018
Danylo <danylo.piliaiev at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |danylo.piliaiev at gmail.com
--- Comment #4 from Danylo <danylo.piliaiev at gmail.com> ---
I think I found the cause:
In sao_apply.fs random angle is calculated in the following way:
> ivec2 ssC = ivec2(gl_FragCoord.xy);
> float randomPatternRotationAngle = (3 * ssC.x ^ ssC.y + ssC.x * ssC.y) * 10;
This means that randomPatternRotationAngle will have huge values thus sin and
cos may give quite imprecise values. It is precise enough on Radeon and Nvidia
but not enough on Intel GPUs.
The documentation Volume 7: 3D-Media-GPGPU states:
> Precision:
> DirectX 10 and below Absolute error <= 0.0008 for the range of +/- 32767 * pi
> Outside of the above range the function will remain periodic,
> producing values between -1 and 1.
In practice passing values greater than 32767 * pi to cos or sin gives unusable
output for most purposes (I'm not exactly sure if it is true for all Intel
GPUs).
The easy fix will be calculating randomPatternRotationAngle like this:
> float randomPatternRotationAngle = mod(3 * ssC.x ^ ssC.y + ssC.x * ssC.y, 6.28318530718);
After the change there is no more artifacts.
--
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20180730/d45b9854/attachment.html>
More information about the intel-3d-bugs
mailing list