aboutsummaryrefslogtreecommitdiff
path: root/BuddhaTest/Shaders
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2018-03-10 16:10:06 +0100
committerAndreas Grois <andi@grois.info>2018-03-10 16:10:06 +0100
commitbff9c8b80ac858a271cdff3da7daeb2b43fc75bc (patch)
tree0407b81ea46ba6d93a7e04ea9b5bce961721c676 /BuddhaTest/Shaders
parentd1cc4a53f5492d95c260a7871cc030c9b1b0a6e9 (diff)
Move buffer dimensions out of buffer into uniforms. No longer odd -2
everywhere.
Diffstat (limited to 'BuddhaTest/Shaders')
-rw-r--r--BuddhaTest/Shaders/BuddhaCompute.glsl6
-rw-r--r--BuddhaTest/Shaders/BuddhaFragment.glsl5
2 files changed, 6 insertions, 5 deletions
diff --git a/BuddhaTest/Shaders/BuddhaCompute.glsl b/BuddhaTest/Shaders/BuddhaCompute.glsl
index ddbaf93..458a4e3 100644
--- a/BuddhaTest/Shaders/BuddhaCompute.glsl
+++ b/BuddhaTest/Shaders/BuddhaCompute.glsl
@@ -4,13 +4,13 @@
layout(std430, binding=2) buffer renderedData
{
- uint width;
- uint height;
uint counts_SSBO[];
};
-uniform uint iterationCount;
+uniform uint width;
+uniform uint height;
+uniform uint iterationCount;
uniform uvec3 orbitLength;
void addToColorOfCell(uvec2 cell, uvec3 toAdd)
diff --git a/BuddhaTest/Shaders/BuddhaFragment.glsl b/BuddhaTest/Shaders/BuddhaFragment.glsl
index cb09628..9ef64b8 100644
--- a/BuddhaTest/Shaders/BuddhaFragment.glsl
+++ b/BuddhaTest/Shaders/BuddhaFragment.glsl
@@ -6,11 +6,12 @@ out vec3 color;
layout(std430, binding=2) buffer renderedData
{
- uint width;
- uint height;
uint counts_SSBO[];
};
+uniform uint width;
+uniform uint height;
+
uvec3 getColorAt(vec2 fragCoord)
{
uint xIndex = uint(max(0.0,(fragCoord.x+1.0)*0.5*width));