Lighting Effects in Computer Games Act II Ivan Viola Ivan Viola Institute of Computer Graphics & Institute of Computer Graphics & Algorithms Algorithms Vienna University of Technology Vienna University of Technology Vienna / Austria Vienna / Austria
Dec 20, 2015
Lighting Effects in Computer GamesAct II
Ivan ViolaIvan Viola
Institute of Computer Graphics & AlgorithmsInstitute of Computer Graphics & Algorithms
Vienna University of TechnologyVienna University of Technology
Vienna / AustriaVienna / Austria
2 / 13Ivan Viola
IntroductionIntroduction
speed & quality trade-offspeed & quality trade-off real-time rendering (>10 fps)real-time rendering (>10 fps) software based techniquessoftware based techniques hardware accelerationhardware acceleration QuakeQuake state of the art in HW acceleration techniquesstate of the art in HW acceleration techniques
3 / 13Ivan Viola
QuakeQuake
most important FPS gamemost important FPS game lighting of the worldlighting of the world lighting of creatures, weapons, particles and lighting of creatures, weapons, particles and
spritessprites
4 / 13Ivan Viola
Quake - World Lighting Model (I)Quake - World Lighting Model (I)
Gouraud shadingGouraud shading angle variance (for n-gons; n>3)angle variance (for n-gons; n>3) bad for big polygons (such as walls)bad for big polygons (such as walls)
5 / 13Ivan Viola
Quake - World Lighting Model (II)Quake - World Lighting Model (II)
LightmapsLightmaps lighting is precalculated (using eg. radiosity)lighting is precalculated (using eg. radiosity) stored in a 2D texturestored in a 2D texture easy to scale, translate to create various effectseasy to scale, translate to create various effects
6 / 13Ivan Viola
Quake - Lighting of Polygonal ObjectsQuake - Lighting of Polygonal Objects
Gouraud shadingGouraud shading polygons are trianglespolygons are triangles small enoughsmall enough
Subdivision rasterizerSubdivision rasterizer division until the polygon is smaller than pixel and division until the polygon is smaller than pixel and
then drawthen draw
7 / 13Ivan Viola
Quake - Following VersionsQuake - Following Versions
Verite QuakeVerite Quake HW acceleration using Verite chipHW acceleration using Verite chip
GLQuakeGLQuake downloadable upgrade that uses OpenGL HW downloadable upgrade that uses OpenGL HW
accelerationacceleration
Quake IIQuake II OpenGL HW acceleration OpenGL HW acceleration outout--of-of-the-boxthe-box
8 / 13Ivan Viola
State of the Art in FPS GamesState of the Art in FPS Games
Quake III ArenaQuake III Arena curved surfacescurved surfaces volumetric fogvolumetric fog shading languagesshading languages
Doom IIIDoom III unique style of lighting using HW accelerationunique style of lighting using HW acceleration
HW acceleration necessary!HW acceleration necessary!
9 / 13Ivan Viola
Projective TexturesProjective Textures
projector simulationprojector simulation spotlight simulationspotlight simulation shadow mapsshadow maps
10 / 13Ivan Viola
Environment MapsEnvironment Maps
cubic parameterizationcubic parameterization implemented in most nowadays graphics chipsimplemented in most nowadays graphics chips
spherical parameterizationspherical parameterization mapping is problematicmapping is problematic
parabolic parameterizationparabolic parameterization solves problem of spherical parameterizationsolves problem of spherical parameterization partly implemented in MESApartly implemented in MESA
11 / 13Ivan Viola
BRDF-Based LightingBRDF-Based Lighting
BRDF is a 4D functionBRDF is a 4D function 4D lookup table is needed4D lookup table is needed approximation of 4D lookup table through approximation of 4D lookup table through
decomposition into two 2D lookup tablesdecomposition into two 2D lookup tables efficient usage of the texture memoryefficient usage of the texture memory
12 / 13Ivan Viola
Anisotropic LightingAnisotropic Lighting
examples of anisotropic surfacesexamples of anisotropic surfaces satin cloth, CD surface, brushed metalsatin cloth, CD surface, brushed metal
setup and enable 2D texture that encodes setup and enable 2D texture that encodes lighting model as a function of <L·N> and <V·R>lighting model as a function of <L·N> and <V·R>
setup texture matrix for the dot productsetup texture matrix for the dot product pass per-vertex tangent vector of surface or pass per-vertex tangent vector of surface or
fiber as texture coordinate using fiber as texture coordinate using glTexCoord3f(Tx,Ty,Tz)glTexCoord3f(Tx,Ty,Tz)