![]() ![]() The exponent or shininess is useful to tweak how much we want the reflection to be focused in one single point or to be more spread along the surface instead. ![]() If the angle is close to 90º, the object is behaving like a mirror so most of the light should be reflected. But what does the dot product do? In this case, the dot product calculates the angle between the view direction V and the reflected vector R. This parameter is an exponent of the dot product. ![]() Here it appears a new parameter (from exponent, but commonly called shininess). Now we have Ks that weights the importance of the specular component in the equation, V is the outgoing view direction, R is the reflected vector at point P and Cm,s is the specular light color. ![]() Unlike before, these rays are reflected in one specific direction (mirror like).Īs before, we have to calculate the specular component for each light and then add them. This is called the Lambert cosine law.įinally, the specular component represents the light rays that arrive directly from a light source. If all rays hit the surface with a perpendicular angle (90º degrees) it receives more light than if the angle is glancing. To explain what the dot product does, let’s imagine that the light rays hit a certain surface. Lm is the outgoing light direction, N is the normal vector at point P and Cm,d is the diffuse light color. Thus, for each light, we calculate the diffuse contribution.Īs before, we have a constant Kd that weights the importance of the diffuse component in the equation. This means that we have to calculate how each light contributes to the diffuse component of the object and add them together to compute the final diffuse component. The diffuse component represents the light rays that arrive directly from a light source at the surface of the object and spread in multiple and different directions.įirst of all, we have sum over all lights. However, we could calculate K based on the number of lights in the scene to produce a more realistic result. In this equation, the ambient component is independent of the number or intensity of lights. The ambient component is the minimum scene light that arrives at the object surface. This is just a constant Ka that weights the importance of the ambient component in the equation and Ca is the ambient light color that is a RGB value. These are the light rays that don’t come directly from a light sources but light bounces around the scene that arrive at the surface of the object. The ambient component represents the light intensity equivalent to indirect lighting. The result of each of this components and, therefore of this equation, is an RGB value that represents the amount of light L (or intensity) in each RGB channel that is reflected at point P in the direction V given the color Cp of the point. The Phong equation is the sum of three different components: Ambient, Diffuse and Specular that try to produce the result of different light behaviors. Nowadays, most applications use Phong shading in combination with more complex techniques to generate good looking graphics. Phong equation is also very simple and cheap to compute. And that’s the first rule about graphics, if it looks good, it is good. Although the Phong model doesn’t produce physically realistic effects like the BRDF, it has been used a lot in many applications and it is still widely in use today.īut why? It turns out that the Phong model, produces fake lighting effects that look great. Its invention is previous to the formulation of the BRDF. The Phong equation is one of the most famous lighting models used in graphics for many decades. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |