From a0afe4bf8c011222b85c481ae209b09f75189858 Mon Sep 17 00:00:00 2001 From: Andreas Grois Date: Sat, 10 Mar 2018 13:55:50 +0100 Subject: Reduce buffer size by a factor of 2 (image is symmetric) --- BuddhaTest/Shaders/BuddhaCompute.glsl | 2 +- BuddhaTest/Shaders/BuddhaFragment.glsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'BuddhaTest/Shaders') 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]); } -- cgit v1.2.3