diff --git a/OpenGL/playground/output b/OpenGL/playground/output index 831eef8..fe61cb5 100755 Binary files a/OpenGL/playground/output and b/OpenGL/playground/output differ diff --git a/OpenGL/playground/resources/shaders/phong.frag b/OpenGL/playground/resources/shaders/phong.frag index c7e0609..4a3fb51 100644 --- a/OpenGL/playground/resources/shaders/phong.frag +++ b/OpenGL/playground/resources/shaders/phong.frag @@ -12,9 +12,6 @@ vec3 objectColour = vec3(0.58, 0.61, 0.627); vec3 lightColour = vec3(1.0, 0.0, 1.0); void main() { - float ambientStrength = 0.5; - vec3 ambient = ambientStrength * lightColour; - vec3 norm = normalize(Normal); vec3 lightDir = normalize(lightPos - FragPos); @@ -22,7 +19,6 @@ void main() { vec3 diffuse = diff * lightColour; - float specularStrength = 0.5; vec3 viewDir = normalize(viewPos - FragPos); @@ -32,7 +28,6 @@ void main() { vec3 specular = specularStrength * spec * lightColour; - - vec3 result = (ambient + diffuse + specular) * objectColour; + vec3 result = (diffuse + specular) * objectColour; outColour = vec4(result, 1.0); } diff --git a/OpenGL/playground/src/main.cpp b/OpenGL/playground/src/main.cpp index 1061f9c..cf459b1 100644 --- a/OpenGL/playground/src/main.cpp +++ b/OpenGL/playground/src/main.cpp @@ -113,7 +113,7 @@ int main(int argc, char** argv) { // Model matrice glm::mat4 model = glm::mat4(1.0f); - model = glm::translate(model, {-10.0f, -10.0f, -10.0f}); + model = glm::translate(model, {-15.0f, -15.0f, -15.0f}); // Gets uniform for model matrice, to be used later GLint uniTrans = glGetUniformLocation(simpleShader.getProgram(), "model"); @@ -143,8 +143,8 @@ int main(int argc, char** argv) { // Update tick (60ups) if (UPSTimer()) { model = glm::rotate(model, glm::radians(0.5f), glm::vec3(0.0f, 0.0f, 1.0f)); - model = glm::rotate(model, glm::radians(0.5f), glm::vec3(1.0f, 0.0f, 0.0f)); - // model = glm::rotate(model, glm::radians(0.5f), glm::vec3(0.0f, 1.0f, 0.0f)); + // model = glm::rotate(model, glm::radians(0.5f), glm::vec3(1.0f, 0.0f, 0.0f)); + model = glm::rotate(model, glm::radians(0.5f), glm::vec3(0.0f, 1.0f, 0.0f)); glm::vec4 result = model * glm::vec4(1.0f, 0.0f, 0.0f, 1.0f); glUniformMatrix4fv(uniTrans, 1, GL_FALSE, glm::value_ptr(model));