3D Graphics Illumination and Surface Shading Techniques
Classified in Physics
Written on in
English with a size of 2.92 KB
Ambient: simulate global lighting, constant in all surfaces. Objects not lighted by extrnl source of light. Lghts parts that cannot be reached by source of light, but seen by observer I = Ia*Ka
Diffuse: after a source of light incides in a surface, the reflected rays are dispersed in many directions (common: rough surfaces).A surface is an ideal diffuse reflector (Lambert reflector) if it reflects light in all directions with the = intensity → surface equally shiny from any perspective. I =Ip*Kp*(N*L)
Specular: effect of "bright spots" that see in a surface reflecting light, can only be observed from certain directions (common glossy surfaces) ▪ direction of specular reflection determined by the angle of reflection (𝜙) with respect to the surface normal (is = to the angle of incident light). ▪ Specular light I depends on properties of the surface and color of the light source. I =Ip*Ks*(R*V)
Phong Specular Reflection: Specular reflection intensity is proportional to ▪ As n increases, brightness is perceived as more concentrated on a point ▪ glossy surfaces: large values of n (ideal reflector = inf) ▪ opaque, rough surfaces: n close to 1
Constant Shading (facete shading) ▪ assign a single I value to the whole polygon ▪ It is very fast, but it only achieves realistic scenes if the object faces are made by very small polygons ▪ convenient when: 1) The source of light is in the infinite → constant in the whole polygon 2) The observer is in the infinite → constant in the whole polygon 3) The polygon represents the real modelled surface (it is not an approximation to a curved surface) If any of the first 2 assumptions are now fulfilled, we compute the
reflection vector on the center of the polygon.
Gouraud Shading (interpolación of intensities) 1) Compute average normal unit vector in each vertex of the polygon (average of polygon normals with that vertex in common) 2) Compute I in each vertex using a lighting model 3) Perform linear interpolation of the intensities in the vertices to find the I over each point of the polygon
Phong Shading (interpolation of normal vectors) 1) Compute the average normal unit vector in each vertex of the polygon (average of polygon normals with that vertex in common) 2) Perform linear interpolation of the normal in the vertices over the surface of the polygon 3) Apply a lighting model to each line▪ The difference versus Gouraud is that we interpolate normals instead of intensities• Phong achieves a + realistic scene when compared to Gouraud• it is + computationally expensive:• When recalculating, N, and then normalizing it, we need to compute a square root• We need to recalculate I• Nowadays, this can be HW-accelerated