summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-08-23 08:10:06 +0200
committerGitHub <noreply@github.com>2017-08-23 08:10:06 +0200
commit1e55899dfe17d2f4908b66869ca9757b13e91ee9 (patch)
tree370285ed04868e63127219433a44be975b916998
parent35e91175212dfabca7c00f6cd95ec2bda4c21b85 (diff)
parent591a892c2e830df96bd4e7be240ad60b9c4c2fb3 (diff)
Merge pull request #10570 from groud/fix_ssao_issue
Fix SSAO issue with intel hd**** hardwares
-rw-r--r--drivers/gles3/shaders/ssao.glsl5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gles3/shaders/ssao.glsl b/drivers/gles3/shaders/ssao.glsl
index d8302bd46e..0e8fc89d6c 100644
--- a/drivers/gles3/shaders/ssao.glsl
+++ b/drivers/gles3/shaders/ssao.glsl
@@ -11,6 +11,7 @@ void main() {
[fragment]
+#define TWO_PI 6.283185307179586476925286766559
#define NUM_SAMPLES (15)
@@ -205,7 +206,7 @@ void main() {
// Hash function used in the HPG12 AlchemyAO paper
- float randomPatternRotationAngle = float((3 * ssC.x ^ ssC.y + ssC.x * ssC.y) * 10);
+ float randomPatternRotationAngle = mod(float((3 * ssC.x ^ ssC.y + ssC.x * ssC.y) * 10), TWO_PI);
// Reconstruct normals from positions. These will lead to 1-pixel black lines
// at depth discontinuities, however the blur will wipe those out so they are not visible
@@ -225,7 +226,7 @@ void main() {
#ifdef ENABLE_RADIUS2
//go again for radius2
- randomPatternRotationAngle = float((5 * ssC.x ^ ssC.y + ssC.x * ssC.y) * 11);
+ randomPatternRotationAngle = mod(float((5 * ssC.x ^ ssC.y + ssC.x * ssC.y) * 11), TWO_PI);
// Reconstruct normals from positions. These will lead to 1-pixel black lines
// at depth discontinuities, however the blur will wipe those out so they are not visible