diff --git a/RASTER b/RASTER index a4f224b..c8e0a14 100755 Binary files a/RASTER and b/RASTER differ diff --git a/build/.cmake/api/v1/reply/index-2025-09-25T18-46-24-0283.json b/build/.cmake/api/v1/reply/index-2025-09-25T19-41-55-0596.json similarity index 100% rename from build/.cmake/api/v1/reply/index-2025-09-25T18-46-24-0283.json rename to build/.cmake/api/v1/reply/index-2025-09-25T19-41-55-0596.json diff --git a/build/CMakeFiles/RASTER.dir/source/main.cpp.o b/build/CMakeFiles/RASTER.dir/source/main.cpp.o index 4f0bcc7..fab1ad4 100644 Binary files a/build/CMakeFiles/RASTER.dir/source/main.cpp.o and b/build/CMakeFiles/RASTER.dir/source/main.cpp.o differ diff --git a/build/bin/RASTER b/build/bin/RASTER index a4f224b..c8e0a14 100755 Binary files a/build/bin/RASTER and b/build/bin/RASTER differ diff --git a/shaders/fragment.glsl b/shaders/fragment.glsl index c00a061..1f34b29 100644 --- a/shaders/fragment.glsl +++ b/shaders/fragment.glsl @@ -75,10 +75,10 @@ void main() { vec2 st = gl_FragCoord.xy / u_resolution; // Normalize coordinates st += 13.0 + (u_oscilator * 0.001); // Center the coordinates - vec2 pos = st * (3.0); + vec2 pos = st * (2.2); pos = rotate2d(perlinNoise(pos)) * pos; - pos -= (u_time * (float(u_oscilator) * 0.5) * 0.2); + pos -= (u_time * (float(u_oscilator) * 0.5) * 0.1); float n = perlinNoise(pos); vec3 color; diff --git a/source/main.cpp b/source/main.cpp index e6cd1db..ad1b6fc 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -108,7 +108,7 @@ int main() { glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_SAMPLES, 16); // 16x MSAA - GLFWwindow* window = glfwCreateWindow(SCR_WIDTH, SCR_HEIGHT, "OpenGL Template", nullptr, nullptr); + GLFWwindow* window = glfwCreateWindow((int)SCR_WIDTH, (int)SCR_HEIGHT, "OpenGL Template", nullptr, nullptr); if (!window) { glfwTerminate(); return -1; @@ -182,14 +182,14 @@ int main() { glm::mat4 view = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -1.0f)); glm::mat4 projection = glm::perspective(glm::radians(45.0f), SCR_WIDTH/SCR_HEIGHT, 0.1f, 100.0f); - GLuint modelLoc = glGetUniformLocation(shaderProgram, "model"); - GLuint viewLoc = glGetUniformLocation(shaderProgram, "view"); - GLuint projLoc = glGetUniformLocation(shaderProgram, "projection"); + GLuint modelLoc = (unsigned int) glGetUniformLocation(shaderProgram, "model"); + GLuint viewLoc = (unsigned int) glGetUniformLocation(shaderProgram, "view"); + GLuint projLoc = (unsigned int) glGetUniformLocation(shaderProgram, "projection"); glUseProgram(shaderProgram); - glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model)); - glUniformMatrix4fv(viewLoc, 1, GL_FALSE, glm::value_ptr(view)); - glUniformMatrix4fv(projLoc, 1, GL_FALSE, glm::value_ptr(projection)); + glUniformMatrix4fv((int) modelLoc, 1, GL_FALSE, glm::value_ptr(model)); + glUniformMatrix4fv((int) viewLoc, 1, GL_FALSE, glm::value_ptr(view)); + glUniformMatrix4fv((int) projLoc, 1, GL_FALSE, glm::value_ptr(projection)); GLint resLoc = glGetUniformLocation(shaderProgram, "u_resolution"); @@ -218,12 +218,12 @@ int main() { if (oscillation < 5) invert = 0; - if (invert) oscillation -= 0.001; - else oscillation += 0.001; + if (invert) oscillation -= 0.01f; + else oscillation += 0.001f; // Debug - std::cout << "Oscillation: " << oscillation << "\t"; - std::cout << "Invert: " << invert << std::endl; + // std::cout << "Oscillation: " << oscillation << "\t"; + // std::cout << "Invert: " << invert << std::endl; direction = rand() % 50; // change direction every 300 frames } @@ -235,29 +235,11 @@ int main() { glClearColor(0.01f, 0.01f, 0.01f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); - glBindVertexArray(VAO); glDrawElements(GL_TRIANGLES,6,GL_UNSIGNED_INT,0); glUseProgram(shaderProgram); - // Move WASD - if (glfwGetKey(window, GLFW_KEY_W) == GLFW_PRESS) - view = glm::translate(view, glm::vec3(0.0f, 0.01f, 0.0f)); - if (glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS) - view = glm::translate(view, glm::vec3(0.0f, -0.01f, 0.0f)); - if (glfwGetKey(window, GLFW_KEY_A) == GLFW_PRESS) - view = glm::translate(view, glm::vec3(-0.01f, 0.0f, 0.0f)); - if (glfwGetKey(window, GLFW_KEY_D) == GLFW_PRESS) - view = glm::translate(view, glm::vec3(0.01f, 0.0f, 0.0f)); - - // QE rotate - if (glfwGetKey(window, GLFW_KEY_Q) == GLFW_PRESS) - view = glm::rotate(view, glm::radians(1.0f), glm::vec3(0.0f, 0.0f, 1.0f)); - if (glfwGetKey(window, GLFW_KEY_E) == GLFW_PRESS) - view = glm::rotate(view, glm::radians(-1.0f), glm::vec3(0.0f, 0.0f, 1.0f)); - - glUniformMatrix4fv(viewLoc, 1, GL_FALSE, glm::value_ptr(view)); glfwSwapBuffers(window); }