Content deleted Content added
Des Vallee (talk | contribs) →Ambient: Adding Lightwarp |
Des Vallee (talk | contribs) Filled in 2 bare reference(s) with reFill 2 |
||
Line 4:
== Light sources ==
Light sources allow for different ways to introduce light into graphics scenes.<ref name=":
=== Point ===
Point sources emit light from a single point in all directions, with the intensity of the light decreasing with distance.<ref name=":
[[File:Real-time Raymarched Terrain.png|thumb|309x309px|A directional light source illuminating a terrain.]]
Line 20:
=== Lightwarp ===
A lightwarp is a technique of which an object in the geometrical world [[refracts]] light based off the [[direction]] and [[intensity]] of the light. The light is then [[warped]] using an ambient diffuse term with a range of the [[color spectrum]]. The light then may be [[reflectively]] scattered to produce a higher [[depth of field]], and [[refracted]]. The technique is used to produce a [[Style_(visual_arts)#Stylization|unique rendering style]] and can be used limit [[overexposure]] of objects. Games such as [[Team Fortress 2]] use the rendering technique to create a [[cartoon]] [[cel shaded]] stylized look.<ref>
== Lighting interactions ==
In computer graphics, light usually consists of multiple components.<ref name=":
[[File:Phong components revised.png|thumb|544x544px|Decomposition of lighting interactions.]]
=== Diffuse ===
Diffuse lighting (or [[diffuse reflection]]) is the direct illumination of an object by an even amount of light interacting with a [[Scattering|light-scattering]] surface.<ref name=":
=== Ambient ===
Line 69:
{{Main|Shading}}
Polygonal [[shading]] is part of the [[Rasterisation|rasterization]] process where [[3D computer graphics|3D]] models are drawn as [[2D computer graphics|2D]] pixel images.<ref name=":4">{{Cite web|url=https://cglearn.codelight.eu/pub/computer-graphics/shading-and-lighting|title=Computer Graphics: Shading and Lighting|website=cglearn.codelight.eu|access-date=2019-10-30}}</ref> Shading applies a lighting model, in conjunction with the geometric attributes of the 3D model, to determine how lighting should be represented at each [[Fragment (computer graphics)|fragment]] (or pixel) of the resulting image.<ref name=":4" /> The [[Polygon mesh|polygons]] of the 3D model store the geometric values needed for the shading process.<ref name=":11">{{Cite web|url=http://math.hws.edu/graphicsbook/c4/s1.html|title=Introduction to Computer Graphics, Section 4.1 -- Introduction to Lighting|website=math.hws.edu}}</ref> This information includes [[Vertex (geometry)|vertex]] positional values and [[Normal (geometry)|surface normals]], but can contain optional data, such as [[Texture mapping|texture]] and [[Bump mapping|bump]] maps.<ref>{{Cite web|url=https://www.khronos.org/opengl/wiki/Vertex_Specification#Primitives|title=Vertex Specification - OpenGL Wiki|website=www.khronos.org|access-date=2019-11-06}}</ref>
[[File:Flatshading00.png|alt=|thumb|165x165px|An example of flat shading.]]
[[File:Gouraudshading01.png|alt=|thumb|165x165px|An example of Gouraud shading.]]
Line 78:
=== Gouraud shading ===
[[Gouraud shading]] is a type of interpolated shading where the values inside of each polygon are a blend of its vertex values.<ref name=":4" /> Each vertex is given its own normal consisting of the average of the surface normals of the surrounding polygons.<ref name=":12" /> The lighting and shading at that vertex is then calculated using the average normal and the lighting model of choice.<ref name=":12" /> This process is repeated for all the vertices in the 3D model.<ref name=":7"
=== Phong shading ===
|