Summary: | [HSW] Ambient occlusion glitch in Planetary Annihilation on Intel HD4600 | ||
---|---|---|---|
Product: | Mesa | Reporter: | sxx.public |
Component: | Drivers/DRI/i965 | Assignee: | Ian Romanick <idr> |
Status: | RESOLVED NOTOURBUG | QA Contact: | Intel 3D Bugs Mailing List <intel-3d-bugs> |
Severity: | normal | ||
Priority: | medium | CC: | danylo.piliaiev, eero.t.tamminen |
Version: | git | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Bug Depends on: | |||
Bug Blocks: | 77449 | ||
Attachments: |
Ambient occlusion on Intel: enabled
Ambient occlusion on Intel: disabled Ambient occlusion on R600g: enabled Ambient occlusion on R600g: disabled |
Description
sxx.public
2014-06-14 09:16:28 UTC
Created attachment 101034 [details]
Ambient occlusion on Intel: disabled
Created attachment 101035 [details]
Ambient occlusion on R600g: enabled
Created attachment 101036 [details]
Ambient occlusion on R600g: disabled
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. To summarize, I think that is not a mesa issue. I notified http://support.uberent.com about it (#771156 ticket id in their internal system). |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.