Advanced Computer Graphics Bas Zalmstra Marries van de Hoef Tim de Jager.

Slides:



Advertisements
Similar presentations
Accelerating Real-Time Shading with Reverse Reprojection Caching Diego Nehab 1 Pedro V. Sander 2 Jason Lawrence 3 Natalya Tatarchuk 4 John R. Isidoro 4.
Advertisements

Exploration of advanced lighting and shading techniques
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Computer graphics & visualization Global Illumination Effects.
SDSM SAMPLE DISTRIBUTION SHADOW MAPS The Evolution Of PSSM.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
CAP4730: Computational Structures in Computer Graphics Visible Surface Determination.
Chapter 6: Vertices to Fragments Part 2 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
Shadow Silhouette Maps Pradeep Sen, Mike Cammarano, Pat Hanrahan Stanford University.
Skin Rendering GPU Graphics Gary J. Katz University of Pennsylvania CIS 665 Adapted from David Gosselin’s Power Point and article, Real-time skin rendering,
3D Graphics Processor Architecture Victor Moya. PhD Project Research on architecture improvements for future Graphic Processor Units (GPUs). Research.
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
Real-Time High Quality Rendering COMS 6160 [Fall 2004], Lecture 4 Shadow and Environment Mapping
02/04/03 Page 1 Rendering Visibility Lighting Texturing.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
4.2. D EFERRED S HADING Exploration of deferred shading (rendering)
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
Ray Tracing and Photon Mapping on GPUs Tim PurcellStanford / NVIDIA.
1 Perception and VR MONT 104S, Spring 2008 Lecture 22 Other Graphics Considerations Review.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CSE 381 – Advanced Game Programming Basic 3D Graphics
NVIDIA PROPRIETARY AND CONFIDENTIAL Occlusion (HP and NV Extensions) Ashu Rege.
Visibility Queries Using Graphics Hardware Presented by Jinzhu Gao.
Shading. What is Shading? Assigning of a color to a pixel in the final image. So, everything in shading is about how to select and combine colors to get.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
TERRAIN SET09115 Intro to Graphics Programming. Breakdown  Basics  What do we mean by terrain?  How terrain rendering works  Generating terrain 
Real-Time Rendering SPEEDING UP RENDERING Lecture 04 Marina Gavrilova.
Week 10 - Wednesday.  What did we talk about last time?  Shadow volumes and shadow mapping  Ambient occlusion.
Fast Cascade VSM By Zhang Jian.
Tiger Woods 2008: Advancements in Environments Peter Arisman Technical Art Director Tiger Woods 2008.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
2 COEN Computer Graphics I Evening’s Goals n Discuss application bottleneck determination n Discuss various optimizations for making programs execute.
Implementation II Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Implementation II.
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20.
CSCE 552 Spring D Models By Jijun Tang. Triangles Fundamental primitive of pipelines  Everything else constructed from them  (except lines and.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Emerging Technologies for Games Deferred Rendering CO3303 Week 22.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
Computer Graphics 3 Lecture 6: Other Hardware-Based Extensions Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
Bounding Volume Hierarchy. The space within the scene is divided into a grid. When a ray travels through a scene, it only passes a few boxes within the.
Maths & Technologies for Games Graphics Optimisation - Batching CO3303 Week 5.
Computer Graphics I, Fall 2010 Implementation II.
Honours Graphics 2008 Session 5. Today’s focus Rasterization Visibility determination Coarse / fine visibility determination.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
Parallel Lighting Directional Lighting Distant Lighting (take your pick) Paul Taylor 2010.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Postmortem: Deferred Shading in Tabula Rasa Rusty Koonce NCsoft September 15, 2008.
Image Fusion In Real-time, on a PC. Goals Interactive display of volume data in 3D –Allow more than one data set –Allow fusion of different modalities.
Computer Graphics Implementation II
Real-Time Soft Shadows with Adaptive Light Source Sampling
Photorealistic Rendering vs. Interactive 3D Graphics
Patrick Cozzi University of Pennsylvania CIS Fall 2013
Deferred Lighting.
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
GPU Graphics Gary J. Katz University of Pennsylvania CIS 665
UMBC Graphics for Games
UMBC Graphics for Games
CS5500 Computer Graphics May 29, 2006
CSCE 441: Computer Graphics Ray Tracing
Chapter XV Shadow Mapping
Frame Buffer Applications
Presentation transcript:

Advanced Computer Graphics Bas Zalmstra Marries van de Hoef Tim de Jager

Ask questions

Who the.. are these guys?! Graphics teaching assistants

Who the.. are these guys?! Marries van de Hoef Experimental Game

Seven Dimensions PLAY NAO ->

Who the.. are these guys?! Bas Zalmstra Lead Abbey

Who the.. are these guys?! Tim de Jager Game Abbey

Reus

What are we talking about? Deferred shading variants Culling Variance Shadow mapping Subsurface scattering GPU Particle Physics

DEFERRED SHADING VARIANTS

Dynamic lighting – Calculating lighting real-time – Moving objects – Moving light sources

A lot of variants Forward Shading Deferred Shading Deferred Lighting Inferred Lighting Tile based deferred shading Forward+ Light indexed deferred shading

FORWARD SHADING Forward Shading Deferred Shading Deferred Lighting Inferred Lighting Tile based deferred shading Forward+ Light indexed deferred shading

Forward shading Multiple light sources – Graphics practical 3 assignment E3 – Additive blending of light sources

Forward shading Lighting is calculated while rendering geometry – Calculated for the entire surface Two methods: Add multiple light sources in single shader – Variable number of light sources in a shader Render the object multiple times (additively) – Unnecessary vertex shader calculations

DEFERRED SHADING Forward Shading Deferred Shading Deferred Lighting Inferred Lighting Tile based deferred shading Forward+ Light indexed deferred shading

Deferred shading Render lighting per light source – Render the bounding volume

Deferred shading What do we need for (Lambertian) shading? – Object: Normals Position Surface color (albedo) – Light source: Position Lighting color Object data is not available when rendering light volumes

Deferred shading Store object properties in buffers (Texture2D’s)! – Everything has to be rendered once – Lighting uses data from buffers Geometry-Buffer (G-buffer): NormalsDepth (Position)Albedo

Deferred shading For each light source – Use data from the G-buffer – Light source properties as shader parameters NormalsDepth (Position)Albedo

DEFERRED LIGHTING Forward Shading Deferred Shading Deferred Lighting Inferred Lighting Tile based deferred shading Forward+ Light indexed deferred shading

Deferred lighting Deferred shading has limited object variability. – Defined by the properties in the G-Buffer. What if we want a different shader per object?

Deferred lighting (Also called Light pre-pass rendering) Only calculate lighting – Specular lighting, diffuse lighting – DON’T combine with diffuse/specular color yet

Deferred lighting Render all objects again For each object – Use lighting buffer as lighting information – We can use a different shader for each object!

Deferred lighting Recap: – Render each object to G-Buffer: – Use G-Buffer to calculate lighting: – Render each object again: Use lighting buffer for shading

Deferred lighting We also want different lighting per object Still not possible…

INFERRED LIGHTING Forward Shading Deferred Shading Deferred Lighting Inferred Lighting Tile based deferred shading Forward+ Light indexed deferred shading

Inferred lighting What about transparency – A buffer can store 1 value per pixel – Use stippling for the lighting Search for surface when fetching the lighting

Inferred lighting Lighting does not vary much over a surface – Lighting could be calculated at a lower resolution Also search for the correct surface when sampling from the lighting buffer

Inferred lighting At lower resolution – Render each object to G-Buffer: – Use G-Buffer to calculate lighting: Render each object again: – Use lighting buffer for shading

TILE BASED DEFERRED SHADING Forward Shading Deferred Shading Deferred Lighting Inferred Lighting Tile based deferred shading Forward+ Light indexed deferred shading

Tile based deferred shading Rendering light volumes is slow – A lot of overdraw Render lighting per tile – List of active light sources per tile Frustum culling (on GPU?)

FORWARD+ Forward Shading Deferred Shading Deferred Lighting Inferred Lighting Tile based deferred shading Forward+ Light indexed deferred shading

Forward+ We want different lighting per object Don’t calculate lighting, but store which light sources are active Store light indices per tile – Similar to tile based deferred rendering

Forward+ Light indexed deferred rendering – Store light indices for each pixel in a texture Limited number of light indices Forward+ – Published in 2012 – Store light indices in DX11 linked list structure

Usage in games Forward shading: Half-life 2, Portal, etc. Deferred shading: Killzone 2, Starcraft 2, etc. Deferred lighting: Most games Inferred lighting: Red faction / Saints Row Tile based def. sh.: Battlefield 3, Uncharted, …? Forward+ : Dirt Showdown (so far)

Questions?

CULLING

What is culling? You No culling

What is culling? You No culling

What is culling? You Frustum culling Cannot see that!

What is culling? You Frustum + Occlusion culling Cannot see that!

CULLING Frustum culling Occlusion culling

Frustum culling: Traditional approaches Culling a few thousand objects is slow – Need optimizations Create spatial hierarchy – Useful for quickly culling a lot of objects – Bounding Volume Hierarchy (BVH) Battlefield 1 and 2 use a Bounding Sphere Hierarchy

Bounding Sphere Hierarchy A B C A BC B+C A+B+C

Problems Hierarchical culling doesn’t scale well – Most computers have 4 or more cores Hard to handle dynamic objects Streaming in new parts of a level

Solution Just do it parallel brute force – Scales over all available cores – No overhead of tree – CPU can do a lot more low level optimizations Statistics (DICE): – 3 times faster – 1/5 of the original code – Seamlessly handles dynamic objects – Easy to optimize further

Grid

CULLING Frustum culling Occlusion culling

Oclusion culling: Traditional approaches Generate a static occlusion culling data structure Used in Quake1-3 Also used in newer engines like Unity3 Umbra (used in Unreal Engine 3)

Occlusion grid

Visible from within the yellow cell Not visible from within the yellow cell

Problems Doesn’t handle dynamic objects as occluders CANT BLOW UP THE EVERYTHING!!

Solution 1 Simply render the object and see if pixels made it on the screen – Low detail version Supported by todays hardware – Hardware Occlusion Queries Downside – The GPU is already busy enough with cool effects – CPU has to wait for the GPU to answer Stalls the CPU

Solution 2 Do the same thing but on the CPU – Moves the burden from the GPU to the CPU – Used in the Frostbite engine and the Cryengine Artists make occlusion geometry for occluders – Very large objects CPU rasterizes these occluders – 256x114 depth buffer – Parallel Test all objects in the frustum in parallel against the depth buffer

Software rasterizer

Recap Frustum culling – Selecting the objects in the viewing volume Occlusion culling – GPU: Hardware Occlusion Queries – CPU: Software Rasterizer References – Battlefield 3: Culling the Battlefield - Daniel Collin (DICE) – Practical Occlusion Culling on the PS3 - Will Vale

Questions?

VARIANCE SHADOW MAPPING

Regular shadow mapping Stage 1:

Regular shadow mapping Stage 2:

Shadow mapping problems Problem is: – Biasing Hard edges Depth

Shadow mapping problems Biasing: – Shadow acne

Improving shadow mapping We can’t filter the images

Improving shadow maps Percentage Close Filtering PCF Result Regular

Filtering We need to think of something So that we can filter...

Variance shadow maps Represent not as a single depth but as a distribution Use first and second moments to recover distribution: – M1 & M2

Algorithm 1. Store both depth and squared depth 2. Recover mean and variance using M1 & M2 3. Use Chebychev’s inequality to compute an upper bound 4. Use the upper bound to compute the lighting percentage

Expected value

First and Second Moment First and second moment can be recovered by: The mean and variance can be recovered by:

Chebychev!

Single occluder and surface

Computing the mean and variance: Where p represent the fraction that is onoccluded

Single occluder and surface Chebychev’s inequality returns the fraction that is unfiltered:

Single occluder and surface

Results

Problems Light bleeding: Solutions offered by: – – s3_ch08.html s3_ch08.html

Questions?

SUBSURFACE SCATTERING

Subsurface Scattering Simulate partial translucency

Subsurface Scattering Affected by volume and internal structure Makes some objects look more lively

Subsurface Scattering Light scatters diffusely through the material Very complex

Subsurface Scattering To use this in games: approximate (cheat) As long as it looks good

Subsurface Scattering By Colin Barré-Brisebois and Marc Bouchard from EA – Used in Battlefield 3

Subsurface Scattering Translucency depends on – The position of the light source – The position of the camera V · -L

Subsurface Scattering Translucency depends on – The position of the light source – The position of the camera – The thickness of the object Camera thickness Light

Subsurface Scattering Precompute local thickness

Subsurface Scattering Local thickness map – Add color to simulate internal color – Add detail to simulate internal structure

Subsurface Scattering

Can be incorrect with concave objects

Subsurface Scattering More information? Check

Questions?

GPU PARTICLE PHYSICS

GPU Particle Physics Particles colliding with the environment CPU processing not an option – Slow CPU-GPU communication – A lot of physics

GPU Particle Physics By Chris Tchou from Bungie – Used in Halo Reach Do everything on the GPU

GPU Particle Physics Particles are stored in buffers (Texture2D’s) Texture2D for: – Position – Velocity – Particle data (lifetime, appearance, lighting,...) One pixel in the Texture2D contains data for one particle

GPU Particle Physics Spawning new particles – CPU draws on the next pixels in the Texture2D – Set position, velocity, etc Old particles Add new particles here

GPU Particle Physics

GPU Particle Physics Collision detection Normal collision detection is not an option – For every particle, world geometry would have to be retrieved and checked... – Very inefficient

GPU Particle Physics Use deferred shading buffers instead! NormalsDepth (Position)

GPU Particle Physics Detect collision – Compare depth of particle with depth in buffer Depth (Position) Camera Particle Depthbuffer Depth to Particle Depth from buffer

GPU Particle Physics Detect collision – Compare depth of particle with depth in buffer Depth (Position) Camera Particle Depthbuffer Depth to Particle Depth from buffer

GPU Particle Physics Handle collision – Retrieve surface normal Camera Particle Normals Normal Velocity

GPU Particle Physics Handle collision – Retrieve surface normal Reflect velocity Apply damping Camera Particle Normals Normal Velocity

GPU Particle Physics

GPU Particle Physics Disadvantages: – Particles can only bounce against objects on screen – Collision errors can occur with high speed particles

Questions?

Thanks! Thanks for listening

Shout outs Wolfgang Hürst DGDARC for the juizz DGG for being awesome Vleeschtorpedo