aboutsummaryrefslogtreecommitdiff
path: root/BuddhaTest/Shaders
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2018-03-10 13:55:50 +0100
committerAndreas Grois <andi@grois.info>2018-03-10 13:55:50 +0100
commita0afe4bf8c011222b85c481ae209b09f75189858 (patch)
tree16c8fa87fa5b5113b2186adfc0b58f3b3549ac90 /BuddhaTest/Shaders
parent710c12067531e6e05280d081203aeb3b945669a9 (diff)
Reduce buffer size by a factor of 2 (image is symmetric)
Diffstat (limited to 'BuddhaTest/Shaders')
-rw-r--r--BuddhaTest/Shaders/BuddhaCompute.glsl2
-rw-r--r--BuddhaTest/Shaders/BuddhaFragment.glsl2
2 files changed, 2 insertions, 2 deletions
diff --git a/BuddhaTest/Shaders/BuddhaCompute.glsl b/BuddhaTest/Shaders/BuddhaCompute.glsl
index d42f506..ddbaf93 100644
--- a/BuddhaTest/Shaders/BuddhaCompute.glsl
+++ b/BuddhaTest/Shaders/BuddhaCompute.glsl
@@ -23,7 +23,7 @@ void addToColorOfCell(uvec2 cell, uvec3 toAdd)
uvec2 getCell(vec2 complex)
{
- vec2 uv = clamp(vec2((complex.x+2.5)/3.5, 0.5*(complex.y + 1.0)),vec2(0.0),vec2(1.0));
+ vec2 uv = clamp(vec2((complex.x+2.5)/3.5, (abs(complex.y))),vec2(0.0),vec2(1.0));
return uvec2(width * uv.x, height * uv.y);
}
diff --git a/BuddhaTest/Shaders/BuddhaFragment.glsl b/BuddhaTest/Shaders/BuddhaFragment.glsl
index 4978765..cb09628 100644
--- a/BuddhaTest/Shaders/BuddhaFragment.glsl
+++ b/BuddhaTest/Shaders/BuddhaFragment.glsl
@@ -14,7 +14,7 @@ layout(std430, binding=2) buffer renderedData
uvec3 getColorAt(vec2 fragCoord)
{
uint xIndex = uint(max(0.0,(fragCoord.x+1.0)*0.5*width));
- uint yIndex = uint(max(0.0,(fragCoord.y+1.0)*0.5*height));
+ uint yIndex = uint(max(0.0,abs(fragCoord.y)*height));
uint firstIndex = 3*(xIndex + yIndex * width);
return uvec3(counts_SSBO[firstIndex],counts_SSBO[firstIndex+1],counts_SSBO[firstIndex+2]);
}