![]() Used to calculate specular reflection coloring. The right canvas shows the scene from the camera's vantage point with the light source The left canvas shows the relative location of the light source, the camera, Manipulate the position of a light source and a camera. From simple vector addition, L + N = P.Vertex’s normal vector and has a length to the projected point of the light source. Scale n by s to create the vector N, which is in the direction of the.Calculate the dot product of -L and n.Normalize the vertex’s normal vector to make it one unit in length.This provides theĬorrect length for the N vector to the projected point. Normal vector is normalized, but the -L vector is not. The two vectors, but only when the vectors have unit length. The dot product calculates the angle between Projected point can be calculated by taking the dot product of -L and a It can be shown thatĪ vector in the direction of the normal vector that has a length to the The position of the light source can be projected onto the vertex’s Please study the diagram to the right before proceeding with thisĭiscussion. To calculate the reflection vector, we need to set up several intermediate If the exponent is small, such as 1.0,Ī broad amount of light around the reflection ray will be simulated. If the exponent is large, suchĪs 100, then the cos(angle) exp shrinks around the Y axis and only very smallĪngles will return a significant percentage value. Light scattering around the specular reflection vector. By using various exponents for this equation, we can simulate various amounts of ![]() If we raise the cosine function to a power, the curve collapses around the Y axis.Įxperiment with various exponents in the plot of the cos(angle) expįunction below. The cosine function is too broad for the a focused specular reflection. We used a cosine function to calculate diffuse light percentages, but We need a way to calculate some percentage of reflected light that is entering If the angle is large, then no light from If the angle is very small, then some percentage of the reflection ray is going If the angle is zero the camera is receiving the entire reflection light The amount of specular reflection the camera The angle between it and the reflection vector, we can use the angle to estimate If we calculate a vector from a fragment to the camera, and then calculate
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |