diff --git a/frag.glsl b/frag.glsl index 95275bd..63a0030 100644 --- a/frag.glsl +++ b/frag.glsl @@ -4,5 +4,12 @@ out vec4 FragColor; void main() { - FragColor = vec4(1.0, 0.5, 0.2, 1.0); + vec3 objectColor = vec3(1.0, 0.5, 0.2); + vec3 lightColor = vec3(1.0, 1.0, 1.0); + float ambientStrength = 0.1; + + vec3 ambient = ambientStrength * lightColor; + vec3 result = ambient * objectColor; + + FragColor = vec4(ambient, 1.0); } diff --git a/src/hello.cpp b/src/hello.cpp index f17e268..45d5e23 100644 --- a/src/hello.cpp +++ b/src/hello.cpp @@ -130,9 +130,6 @@ int main() GLuint shaderProgram = compileShaderProgram(); Icosphere sphere(2); - // Wireframe - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - // Main loop while (!glfwWindowShouldClose(window)) {