Patrick Cozzi University of Pennsylvania CIS Fall 2013

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
POST-PROCESSING SET09115 Intro Graphics Programming.
Deferred Shading Optimizations
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
COMPUTER GRAPHICS CS 482 – FALL 2014 NOVEMBER 10, 2014 GRAPHICS HARDWARE GRAPHICS PROCESSING UNITS PARALLELISM.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
Game Programming 09 OGRE3D Lighting/shadow in Action
RealityEngine Graphics Kurt Akeley Silicon Graphics Computer Systems.
GAM532 DPS932 – Week 7 Introduction to shadows. Shadow Effects Light Surface No Shadows Shadows.
Pre-lighting in Resistance 2
Renderer Design for Multiple Lights by Wolfgang Engel 05/27/08.
9/25/2001CS 638, Fall 2001 Today Shadow Volume Algorithms Vertex and Pixel Shaders.
Deferred Shading Patrick Cozzi University of Pennsylvania CIS Fall 2014.
Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova.
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
GLSL Applications: 2 of 2 Patrick Cozzi University of Pennsylvania CIS Spring 2011.
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.
Status – Week 277 Victor Moya.
Z-Buffer Optimizations Patrick Cozzi Analytical Graphics, Inc.
Z-Buffer Optimizations Patrick Cozzi Analytical Graphics, Inc.
Paper by Alexander Keller
4.2. D EFERRED S HADING Exploration of deferred shading (rendering)
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Advanced Computer Graphics Bas Zalmstra Marries van de Hoef Tim de Jager.
SET09115 Intro Graphics Programming
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
CS 638, Fall 2001 Today Light Mapping (Continued) Bump Mapping with Multi-Texturing Multi-Pass Rendering.
CS 638, Fall 2001 Multi-Pass Rendering The pipeline takes one triangle at a time, so only local information, and pre-computed maps, are available Multi-Pass.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Tiled Forward Shading Johan Medeström. Project Goals Render a scene with lots of lights Learn more OpenGL and shading techniques Learn more about OpenCL/Compute.
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
- Laboratoire d'InfoRmatique en Image et Systèmes d'information
Emerging Technologies for Games Deferred Rendering CO3303 Week 22.
Mobile Graphics Patrick Cozzi University of Pennsylvania CIS Spring 2012.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
Single Pass Point Rendering and Transparent Shading Paper by Yanci Zhang and Renato Pajarola Presentation by Harmen de Weerd and Hedde Bosman.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
Parallel Lighting Directional Lighting Distant Lighting (take your pick) Paul Taylor 2010.
The Graphics Pipeline Revisited Real Time Rendering Instructor: David Luebke.
Compositing and Rendering
Ying Zhu Georgia State University
CS-378: Game Technology Lecture #7: More Mapping Prof. Okan Arikan
Reflective Shadow Mapping By: Mitchell Allen.
Chapter X Advanced Texturing
Renderer Design for Multiple Lights
Deferred Lighting.
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
Understanding Theory and application of 3D
The Graphics Pipeline Lecture 5 Mon, Sep 3, 2007.
Chapter XVI Texturing toward Global Illumination
UMBC Graphics for Games
Exploring Shaders in Unity
CS5500 Computer Graphics May 29, 2006
Last Time Presentation of your game and idea Environment mapping
Patrick Cozzi University of Pennsylvania CIS Fall 2012
Computer Graphics Material Colours and Lighting
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
Frame Buffer Applications
Frame Buffers Fall 2018 CS480/680.
Introduction to Ray Tracing
Presentation transcript:

Patrick Cozzi University of Pennsylvania CIS 565 - Fall 2013 Deferred Shading Patrick Cozzi University of Pennsylvania CIS 565 - Fall 2013

Announcements Project 6 Final Project Hackathon Due Friday 11/15 Kickoff this Wednesday Hackathon Next Saturday 11/16, 6pm-12am, SIG lab Inviting the “pros”

Renderer Design Design an engine that renders lots of Objects with different materials Dynamic lights Different light types Cleanly. Efficiently. Light types – point, spot, directional, etc.

Forward Rendering – Multi-Pass foreach light { foreach visible object Render using shader for this material/light; accumulate in framebuffer; } How do we accumulate? Blending. Pros and cons?

Forward Rendering – Multi-Pass One shader per material/light-type Performance Need to do vertex transform, rasterization, material part of fragment shader, etc. multiple times for each object. Occluded fragments are shaded Not all lights affect the entire object Front-to-back and/or z-prepass can reduce/eliminate shading occluded fragments Occluded fragments are shaded without a z-prepass. Not all lights affect the entire object (performance)

Forward Rendering – Single Pass foreach visible object { find lights affecting object; Render all lights and materials using a single shader; } Pros and cons?

Forward Rendering – Single Pass Lots of shaders One shader per material/light-combination Hard to author shaders May require runtime compile/link Long ubershader increase compile times More potential shaders to sort by Same as multi-pass Occluded fragments are shaded Not all lights affect the entire object Can’t compile in advance since there are so many combinations. Front-to-back and/or z-prepass can reduce/eliminate shading occluded fragments Occluded fragments are shaded without a z-prepass. Not all lights affect the entire object (performance)

Deferred Rendering Pros and cons? foreach visible object { write properties to g-buffer; } foreach light compute light using g-buffer; accumulate in framebuffer; Pros and cons?

Deferred Rendering Decouple lighting from scene complexity Few shaders One per material One per light type Only transform and rasterize each object once Only light non-occluded objects Lighting does not depend on the number of objects

Deferred Rendering Memory bandwidth usage - read g-buffer for each light Recalculate full lighting equation for each light Limited material properties in g-buffer MSAA and translucency are difficult Does not handle transparent objects? Why? We only have g-buffer for front-most fragment.

G-Buffer Layout in Leadwerks 2.1 “Depth, normal, and specular factor are used to calculate diffuse lighting and specular reflection, which is then combined with the albedo color for the final image.” Image from http://www.leadwerks.com/files/Deferred_Rendering_in_Leadwerks_Engine.pdf

G-Buffer Layout in Leadwerks 2.1 The position is reconstructed from the fragment position and depth. Image from http://www.leadwerks.com/files/Deferred_Rendering_in_Leadwerks_Engine.pdf

G-Buffer Layout in Killzone 2 Image from http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf

G-Buffer Layout in Killzone 2 Image from http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf

G-Buffer Layout in Killzone 2 Image from http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf

G-Buffer Layout in Killzone 2 Image from http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf

G-Buffer Layout in Killzone 2 Image from http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf

G-Buffer Layout in Killzone 2 Image from http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf

G-Buffer Layout in Killzone 2 Image from http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf

G-Buffer Layout in Killzone 2 Image from http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf

G-Buffer Layout in Killzone 2 Image from http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf

G-Buffer Layout in Killzone 2 * DS: 24-bit depth, 8-bit stencil * RT0-RT3: 32-bit RGBA * Light accumulation is output * Normal Z is reconstructed since it is normalized * Motion vector is in screen-space * Specular power - stored as log2(original)/10.5 - High range and still high precision for low shininess * Sun Occlusion - pre-rendered static sun shadows - Mixed with real-time sun shadow for higher quality Image from http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf

Light Accumulation Pass Geometry for each light Full-screen quad/triangle with scissor/stencil test 3D bounding geometry. Examples: Point light – sphere Spot light – cone Needs multiple passes. Why? Using geometry increases the vertex load but can decrease the fragment load since it can provide a tighter fit around the light’s area of influence. Some lights, like the sun, may not have bounding geometry and are better served by a full-screen quad. Killzone 2 uses two passes and the stencil buffer to determine lit pixels, and a third pass to finally do lighting. I’m skipping the middle pass since we’re not covering shadows.

Light Accumulation Pass Image from http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf

Light Accumulation Pass Image from http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf

References Deferred Rendering in Killzone 2 – Michal Valient http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf Deferred Rendering in Leadwerks Engine - Josh Klint http://www.leadwerks.com/files/Deferred_Rendering_in_Leadwerks_Engine.pdf Light Pre-Pass – Wolfgang Engel http://www.slideshare.net/cagetu/light-prepass Compact Normal Storage for Small G-Buffers – Aras Pranckevičius http://aras-p.info/texts/CompactNormalStorage.html