Contents
What is fog in OpenGL?
The basic idea behind fog is that the distance between the viewpoint and a fragment is computed. This distance is then used to blend the fragment color with a fog color. The OpenGL specification permits implementations to ap- proximate the fragment distance using only the fragment depth, or Z value.
What is fog in computer graphics?
Distance fog is a technique used in 3D computer graphics to enhance the perception of distance by shading distant objects differently. “Fogging” is another use of distance fog in mid-to-late 1990s games, when processing power was not enough to render far viewing distances, and clipping was employed.
Why is silent hill covered in fog?
The lingering thoughts of certain people who died suddenly and unexpectedly can cause their spirits to remain in the Fog World. Fog World-like states can affect areas outside of Silent Hill and Toluca Lake, but only under special circumstances.
How does antialiasing and fog work in OpenGL?
“Antialiasing”explains this relatively subtle technique that alters colors so that the edges of points, lines, and polygons appear smooth rather than angular and jagged. “Fog”describes how to create the illusion of depth by computing the color values of an object based on its distance from the viewpoint.
How to enable or disable blending in OpenGL?
To have blending take effect, you also need to enable it: glEnable(GL_BLEND); Use glDisable()with GL_BLEND to disable blending. Also note that using the constants GL_ONE (source) and GL_ZERO (destination) gives the same results as when blending is disabled; these values are the default.
When to use alpha value in blending in OpenGL?
Blending occurs after your scene has been rasterized and converted to fragments, but just before the final pixels are drawn in the framebuffer. Alpha values can also be used in the alpha test to accept or reject a fragment based on its alpha value. (See Chapter 10for more information about this process.)
What do polygon offset and blending do in OpenGL?
“Polygon Offset”shows you how to tweak (offset) depth values to make an outlined, shaded object look beautiful. Blending You’ve already seen alpha values (alpha is the A in RGBA), but they’ve been ignored until now.