single

LearnOpenGL – Joey de Vries

January 19, 2024
The Impact of 5G Technology

LearnOpenGL – Joey de Vries

Advanced LightingIn the lighting chapters we briefly introduced the Phong lighting model to bring a basic amount of realism into our scenes. The Phong model looks nice, but has a few nuances we’ll focus on in this chapter.

Blinn-Phong
Phong lighting is a great and very efficient approximation of lighting, but its specular reflections break down in certain conditions, specifically when the shininess property is low resulting in a large (rough) specular area.

You can see at the edges that the specular area is immediately cut off. The reason this happens is because the angle between the view and reflection vector doesn’t go over 90 degrees. If the angle is larger than 90 degrees, the resulting dot product becomes negative and this results in a specular exponent of 0.0. You’re probably thinking this won’t be a problem since we shouldn’t get any light with angles higher than 90 degrees anyways, right?

Wrong, this only applies to the diffuse component where an angle higher than 90 degrees between the normal and light source means the light source is below the lighted surface and thus the light’s diffuse contribution should equal 0.0. However, with specular lighting we’re not measuring the angle between the light source and the normal, but between the view and reflection vector. Take a look at the following two images….

Source: https://learnopengl.com/Advanced-Lighting/Advanced-Lighting


OpenGL tutorial which helped me throughout my entire journey: https://learnopengl.com. In addition, I was especially inspired by the fact that a well-known graphics programming algorithm had a distinctly Vietnamese name (Phong).
Here is a link to the projects where I put this knowledge into practice: My Projects

1 Comment

  • 1 year ago / by wp_johnb

    Rather good!!!

    reply

Leave a comment

Your email address will not be published. Required fields are marked *