280 likes | 563 Views
Lighting Effects in Computer Games. Stefan Felkel. Talk Outline. Importance of lighting Light Sources Lighting Model Material and OpenGL Shading Multipass Rendering Multitexturing Mapping Techniques Radiosity Examples and Screenshots. Importance of Lighting. Point Light.
E N D
Lighting Effects in Computer Games Stefan Felkel
Talk Outline • Importance of lighting • Light Sources • Lighting Model • Material and OpenGL • Shading • Multipass Rendering • Multitexturing • Mapping Techniques • Radiosity • Examples and Screenshots Stefan Felkel
Importance of Lighting Stefan Felkel
Point Light • Spot Light Light Sources • Directional Light • Parameters: color, intensity • OpenGL: up to 8 light sources Stefan Felkel
Material • Parameters: • Ambient (color) • Diffuse (color) • Specular (color) • Shininess (specular exponent) • Emissive (color) • Color determined by these params + params of light source + lighting model Stefan Felkel
Lighting Model (1) • Good approximation to reality • Illumination calculated with LM • OpenGL LM • Ambient Lighting • Diffuse Lighting • Specular Lighting • Total lighting intensity: Stefan Felkel
Lighting Model • Ambient Lighting Stefan Felkel
Lighting Model • Diffuse Lighting • View & light-vector: no lighting >= 90° Stefan Felkel
Lighting Model • Specular Lighting Stefan Felkel
Shading • Flat Shading • Gouraud Shading • Phong Shading Stefan Felkel
Cube Environment Mapping 6 Textures 1 Cubemap Stefan Felkel
Multipass Rendering • Lighting calculations done in separate passes • Each successive pass modifies the result of the pass before • Quake III: up to 10 passes • Base textures • Lightmaps • Fog • ... Stefan Felkel
Multitexturing • In a single pass, multiple textures are accessed • Multiple stage model: output of each stage becomes input for next • Input for 1st stage is fragment color Stefan Felkel
Light Mapping (1) • Light maps: low resolution & precalculated • Introduced by Quake + = Lightmap + Texture = Combined Texture Stefan Felkel
Light Mapping (2) Multiple light maps packed into single texture Stefan Felkel
Gloss Mapping • Gloss map: • monochrome texture • stores specular intensity values + = Gloss maptexture Diffuselighting Specularlighting Final combined result Stefan Felkel
Radiosity • Based on thermal heat transfer • Viewpoint independent • Radiosity = radiance exiting from a patch • Deals with area light sources • Radiosity is used for light map calculation Stefan Felkel
Radiosity Stefan Felkel
Meshing the Environment • Patch = surface, area, texel (light maps) • Every patch gets energy from surrounding patches Stefan Felkel
Examples • Wolfenstein 3D (1992) • Doom (1993) • GLQuake (1996) Stefan Felkel
Wolfenstein 3D (1992) Screenshot from Wolfenstein (“full-bright”) Stefan Felkel
Doom I (1993) Screenshot from Doom I (Depth Cueing) Stefan Felkel
GLQuake (1996) Screenshot from Quake II (Radiosity for light map calculation) Stefan Felkel
End Thanks for your attention!