Top Banner
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
13

Lighting Effects in Computer Games Act II Ivan Viola Institute of Computer Graphics & Algorithms Vienna University of Technology Vienna / Austria.

Dec 20, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lighting Effects in Computer Games Act II Ivan Viola Institute of Computer Graphics & Algorithms Vienna University of Technology Vienna / Austria.

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

Page 2: Lighting Effects in Computer Games Act II Ivan Viola Institute of Computer Graphics & Algorithms Vienna University of Technology Vienna / 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

Page 3: Lighting Effects in Computer Games Act II Ivan Viola Institute of Computer Graphics & Algorithms Vienna University of Technology Vienna / Austria.

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

Page 4: Lighting Effects in Computer Games Act II Ivan Viola Institute of Computer Graphics & Algorithms Vienna University of Technology Vienna / Austria.

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)

Page 5: Lighting Effects in Computer Games Act II Ivan Viola Institute of Computer Graphics & Algorithms Vienna University of Technology Vienna / Austria.

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

Page 6: Lighting Effects in Computer Games Act II Ivan Viola Institute of Computer Graphics & Algorithms Vienna University of Technology Vienna / Austria.

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

Page 7: Lighting Effects in Computer Games Act II Ivan Viola Institute of Computer Graphics & Algorithms Vienna University of Technology Vienna / Austria.

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

Page 8: Lighting Effects in Computer Games Act II Ivan Viola Institute of Computer Graphics & Algorithms Vienna University of Technology Vienna / Austria.

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!

Page 9: Lighting Effects in Computer Games Act II Ivan Viola Institute of Computer Graphics & Algorithms Vienna University of Technology Vienna / Austria.

9 / 13Ivan Viola

Projective TexturesProjective Textures

projector simulationprojector simulation spotlight simulationspotlight simulation shadow mapsshadow maps

Page 10: Lighting Effects in Computer Games Act II Ivan Viola Institute of Computer Graphics & Algorithms Vienna University of Technology Vienna / Austria.

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

Page 11: Lighting Effects in Computer Games Act II Ivan Viola Institute of Computer Graphics & Algorithms Vienna University of Technology Vienna / Austria.

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

Page 12: Lighting Effects in Computer Games Act II Ivan Viola Institute of Computer Graphics & Algorithms Vienna University of Technology Vienna / Austria.

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)

Page 13: Lighting Effects in Computer Games Act II Ivan Viola Institute of Computer Graphics & Algorithms Vienna University of Technology Vienna / Austria.

Thank you

Ivan ViolaIvan Viola

[email protected]@cg.tuwien.ac.at