FIGURE 2.4: Types of lightsources, as seen in the Unity 5.6.1 Engine (Image from https://www.researchgate.net/publication/350578263_Real-Time_Global_Illumination_Using_OpenGL_And_Voxel_Cone_Tracing/figures)
Blinn–Phong reflection model
(Image fromhttps://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_reflection_model)
Phong reflection model
Ambient/Diffuse/Specular (Image from https://en.wikipedia.org/wiki/Phong_reflection_model)
lecture13
lecture13
lecture12
lecture12
z-fighting
Z-fighting, also called stitching, is a phenomenon in 3D rendering that occurs when two or more primitives have similar values in the z-buffer. This problem is usually caused by limited sub-pixel precision and floating point and fixed point round-off errors.
The more z-buffer precision one uses, the less likely it is that z-fighting will be encountered. But for coplanar polygons, the problem is inevitable unless corrective action is taken.
As the distance between near and far clip planes increases, and in particular the near plane is selected near the eye, the greater the likelihood exists that z-fighting between primitives will occur.
Z-fighting can be reduced through the use of a higher resolution depth buffer, by z-buffering in some scenarios, or by simply moving the polygons further apart.
Z-fighting that is caused by insufficient precision in the depth buffer can be resolved by simply reducing the visible distance in the world. This reduces the distance between the near and far planes and solves the precision issue.
Another technique that is utilized to reduce or completely eliminate Z-fighting is switching to a logarithmic Z-buffer, reversing Z. This technique is seen in the game Grand Theft Auto V. Due to the way they are encoded, floating-point numbers have much more precision when closer to 0. Here, reversing Z leads to more precision when storing the depth of very distant objects, hence greatly reducing Z-fighting.
https://en.wikipedia.org/wiki/Z-fighting
There is very high precision at the near plane, but very little precision at the far plane. If the range [-n, -f] is getting larger, it causes a depth precision problem (z-fighting); a small change of ze around the far plane does not affect on zn value. The distance between n and f should be short as possible to minimize the depth buffer precision problem.
http://www.songho.ca/opengl/gl_projectionmatrix.html
reversed-Z
lecture11
lecture10
Projection
Images from https://en.wikipedia.org/wiki/Axonometric_projection