Phong lighting: add specular lighting separately or with ambient and diffuse?
问题 I am trying to implement Phong lighting. In some tutorials specular lighting is added to ambient and diffuse lighting and then total lighting is multiplied by texture color. I also saw a tutorial where specular lighting was added separately after the addition of ambient and diffuse lights was multiplied with texture color. Here is a fragment shader with both options present and with screenshots. #version 330 core out vec4 FragColor; in vec2 TexCoord; in vec3 normals; in vec3 fragPosition; /