From d9d395f85ec1ab1c8959118300d6e8be56d090e6 Mon Sep 17 00:00:00 2001 From: Andreas Grois Date: Fri, 9 Mar 2018 23:16:57 +0100 Subject: Colorize --- BuddhaTest/src/BuddhaTest.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'BuddhaTest/src') diff --git a/BuddhaTest/src/BuddhaTest.cpp b/BuddhaTest/src/BuddhaTest.cpp index 790b0b2..57edc14 100644 --- a/BuddhaTest/src/BuddhaTest.cpp +++ b/BuddhaTest/src/BuddhaTest.cpp @@ -14,7 +14,9 @@ int main() unsigned int bufferWidth = 1600; unsigned int bufferHeight = 900; - unsigned int orbitLength = 1000; + unsigned int orbitLengthRed = 100; + unsigned int orbitLengthGreen = 10; + unsigned int orbitLengthBlue = 1000; GLFWwindow* window; @@ -81,7 +83,7 @@ int main() glUseProgram(ComputeShader); GLint iterationCountUniformHandle = glGetUniformLocation(ComputeShader, "iterationCount"); GLint orbitLengthUniformHandle = glGetUniformLocation(ComputeShader, "orbitLength"); - glUniform1ui(orbitLengthUniformHandle,orbitLength); + glUniform3ui(orbitLengthUniformHandle,orbitLengthRed,orbitLengthGreen,orbitLengthBlue); glClearColor(0.0f, 0.0f, 0.4f, 0.0f); @@ -92,7 +94,7 @@ int main() glUseProgram(ComputeShader); //increase iterationCount, which is used for pseudo random generation glUniform1ui(iterationCountUniformHandle,++iterationCount); - glDispatchCompute(128, 1, 1); + glDispatchCompute(1024, 1, 1); //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 -- cgit v1.2.3