diff options
author | Sebastian Park <SebPark03@gmail.com> | 2024-05-06 02:15:49 -0400 |
---|---|---|
committer | Sebastian Park <SebPark03@gmail.com> | 2024-05-06 02:15:49 -0400 |
commit | 85e2ef8c9d7cdb24715a7375e149d5d1e7d580b1 (patch) | |
tree | 92ca052fb3afcdb9c7e7a928029f944d4bd9b636 | |
parent | 72bcf6a346dfcaeaac9520d8c524711192e77c3d (diff) |
change clear colors and set input name from color to normal.
-rw-r--r-- | CMakeLists.txt.user | 2 | ||||
-rw-r--r-- | resources/shaders/color.vert | 4 | ||||
-rwxr-xr-x | src/glwidget.cpp | 5 |
3 files changed, 7 insertions, 4 deletions
diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user index 9cfaad8..bc65141 100644 --- a/CMakeLists.txt.user +++ b/CMakeLists.txt.user @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE QtCreatorProject> -<!-- Written by QtCreator 8.0.1, 2024-04-30T18:44:58. --> +<!-- Written by QtCreator 8.0.1, 2024-05-05T03:29:58. --> <qtcreator> <data> <variable>EnvironmentId</variable> diff --git a/resources/shaders/color.vert b/resources/shaders/color.vert index d449122..6aa941e 100644 --- a/resources/shaders/color.vert +++ b/resources/shaders/color.vert @@ -1,10 +1,10 @@ #version 330 core layout (location = 0) in vec3 position; -layout (location = 1) in vec3 color; +layout (location = 1) in vec3 normal; out vec3 col; void main() { gl_Position = vec4(position, 1.0); - col = color; + col = normal; } diff --git a/src/glwidget.cpp b/src/glwidget.cpp index c13d476..06461d0 100755 --- a/src/glwidget.cpp +++ b/src/glwidget.cpp @@ -64,7 +64,7 @@ void GLWidget::initializeGL() fprintf(stdout, "Successfully initialized GLEW %s\n", glewGetString(GLEW_VERSION)); // Set clear color to white - glClearColor(0, 0, 0, 1); + glClearColor(1, 0.98f, 0.85f, 1); // Enable depth-testing and backface culling glEnable(GL_DEPTH_TEST); @@ -168,6 +168,8 @@ void GLWidget::initializeGL() } void GLWidget::paintCaustics() { + glClearColor(0.68f, 0.58f, 0.38f, 1); + glBindFramebuffer(GL_FRAMEBUFFER, m_fbo); // Task 15: Clear the screen here @@ -303,6 +305,7 @@ void GLWidget::makeFBO() { void GLWidget::paintGL() { paintCaustics(); + glClearColor(0.56f, 0.69f, 0.74f, 1); glBindFramebuffer(GL_FRAMEBUFFER, m_defaultFBO); // return; // paintTexture(m_ground_texture, false); |