aboutsummaryrefslogtreecommitdiff
path: root/BuddhaTest
diff options
context:
space:
mode:
Diffstat (limited to 'BuddhaTest')
-rw-r--r--BuddhaTest/Shaders/BuddhaCompute.glsl2
-rw-r--r--BuddhaTest/src/BuddhaTest.cpp12
-rw-r--r--BuddhaTest/src/Helpers.cpp2
3 files changed, 12 insertions, 4 deletions
diff --git a/BuddhaTest/Shaders/BuddhaCompute.glsl b/BuddhaTest/Shaders/BuddhaCompute.glsl
index 263e4c0..d42f506 100644
--- a/BuddhaTest/Shaders/BuddhaCompute.glsl
+++ b/BuddhaTest/Shaders/BuddhaCompute.glsl
@@ -147,7 +147,7 @@ vec2 getStartValue(uint seed)
for(int i = 0; i < 5; ++i)
{
vec2 random = hash2(hash,hash);
- vec2 point = vec2(random.x * 3.5-2.5,random.y*3.1-1.55);
+ vec2 point = vec2(random.x * 3.5-2.5,random.y*1.55);
float useThisPoint =1.0-(isInMainBulb(point) + isInMainCardioid(point));
retval = mix(retval,point,useThisPoint);
}
diff --git a/BuddhaTest/src/BuddhaTest.cpp b/BuddhaTest/src/BuddhaTest.cpp
index f8b9074..09a3cf1 100644
--- a/BuddhaTest/src/BuddhaTest.cpp
+++ b/BuddhaTest/src/BuddhaTest.cpp
@@ -21,6 +21,14 @@ int main()
unsigned int orbitLengthGreen = 100;
unsigned int orbitLengthBlue = 1000;
+ unsigned int localWorkgroupSizeX = 1024;
+ unsigned int localWorkgroupSizeY = 1;
+ unsigned int localWorkgroupSizeZ = 1;
+
+ unsigned int globalWorkGroupSizeX = 1024;
+ unsigned int globalWorkGroupSizeY = 1;
+ unsigned int globalWorkGroupSizeZ = 1;
+
GLFWwindow* window;
/* Initialize the library */
@@ -80,7 +88,7 @@ int main()
// Create and compile our GLSL program from the shaders
GLuint VertexAndFragmentShaders = Helpers::LoadShaders("Shaders/BuddhaVertex.glsl", "Shaders/BuddhaFragment.glsl");
//Do the same for the compute shader:
- GLuint ComputeShader = Helpers::LoadComputeShader("Shaders/BuddhaCompute.glsl", 1024, 1, 1);
+ GLuint ComputeShader = Helpers::LoadComputeShader("Shaders/BuddhaCompute.glsl", localWorkgroupSizeX, localWorkgroupSizeY, localWorkgroupSizeZ);
uint32_t iterationCount{0};
glUseProgram(ComputeShader);
@@ -97,7 +105,7 @@ int main()
glUseProgram(ComputeShader);
//increase iterationCount, which is used for pseudo random generation
glUniform1ui(iterationCountUniformHandle,++iterationCount);
- glDispatchCompute(1024, 1, 1);
+ glDispatchCompute(globalWorkGroupSizeX, globalWorkGroupSizeY, globalWorkGroupSizeZ);
//before reading the values in the ssbo, we need a memory barrier:
glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT); //I hope this is the correct (and only required) bit
diff --git a/BuddhaTest/src/Helpers.cpp b/BuddhaTest/src/Helpers.cpp
index b092dc2..abe09fd 100644
--- a/BuddhaTest/src/Helpers.cpp
+++ b/BuddhaTest/src/Helpers.cpp
@@ -174,7 +174,7 @@ namespace Helpers
}
for(int i = 0; i < height/2;++i)
{
- for(int j = 0; j < width;++j)
+ for(int j = 0; j < width*3;++j)
{
png_byte average = (rows[i][j] + rows[height-i-1][j])/2;
rows[i][j] = rows[height-i-1][j] = average;