A bit more Deferred - CryEngine 3. Triangle Game Conference 2009 Martin Mittring Lead Graphics Programmer

Similar documents
GUERRILLA DEVELOP CONFERENCE JULY 07 BRIGHTON

DEFERRED RENDERING STEFAN MÜLLER ARISONA, ETH ZURICH SMA/

CS354R: Computer Game Technology

Render all data necessary into textures Process textures to calculate final image

MAXIS-mizing Darkspore*: A Case Study of Graphic Analysis and Optimizations in Maxis Deferred Renderer

Enabling immersive gaming experiences Intro to Ray Tracing

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

Dominic Filion, Senior Engineer Blizzard Entertainment. Rob McNaughton, Lead Technical Artist Blizzard Entertainment

Deferred Rendering Due: Wednesday November 15 at 10pm

Deus Ex is in the Details

3D Authoring Tool BS Content Studio supports Deferred Rendering for improved visual quality

CS 498 VR. Lecture 19-4/9/18. go.illinois.edu/vrlect19

Advanced Graphics. Global Illumination. Alex Benton, University of Cambridge Supported in part by Google UK, Ltd

Screen Space Ambient Occlusion TSBK03: Advanced Game Programming

Beyond Programmable Shading Course ACM SIGGRAPH 2010 Bending the Graphics Pipeline

Michal Valient Lead Tech Guerrilla Games

Advanced Computer Graphics CS 563: Screen Space GI Techniques: Real Time

Lecture 9: Deferred Shading. Visual Computing Systems CMU , Fall 2013

Game Graphics Programmers

Bringing AAA graphics to mobile platforms. Niklas Smedberg Senior Engine Programmer, Epic Games

AGGREGATE G-BUFFER ANTI-ALIASING

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

Soft shadows. Steve Marschner Cornell University CS 569 Spring 2008, 21 February

TSBK03 Screen-Space Ambient Occlusion

Introduction to Visualization and Computer Graphics

The Vegetation of Horizon Zero Dawn. Gilbert Sanders Principal Artist, Guerrilla Games

Computer Graphics. Shadows

CHAPTER 1 Graphics Systems and Models 3

Graphics Processing Unit Architecture (GPU Arch)

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Applications of Explicit Early-Z Z Culling. Jason Mitchell ATI Research

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

PowerVR Hardware. Architecture Overview for Developers

Direct3D 11 Performance Tips & Tricks

Evolution of GPUs Chris Seitz

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

global light baking software

Real - Time Rendering. Pipeline optimization. Michal Červeňanský Juraj Starinský

GLSL Applications: 2 of 2

The Making of Seemore WebGL. Will Eastcott, CEO, PlayCanvas

Render-To-Texture Caching. D. Sim Dietrich Jr.

SAMPLING AND NOISE. Increasing the number of samples per pixel gives an anti-aliased image which better represents the actual scene.

03 RENDERING PART TWO

Shadow Techniques. Sim Dietrich NVIDIA Corporation

Ambient Occlusion. Ambient Occlusion (AO) "shadowing of ambient light "darkening of the ambient shading contribution

Rendering Algorithms: Real-time indirect illumination. Spring 2010 Matthias Zwicker

PowerVR Series5. Architecture Guide for Developers

Optimizing DirectX Graphics. Richard Huddy European Developer Relations Manager

Enhancing Traditional Rasterization Graphics with Ray Tracing. March 2015

Mali Demos: Behind the Pixels. Stacy Smith

Tutorial on GPU Programming #2. Joong-Youn Lee Supercomputing Center, KISTI

Game Technology. Lecture Physically Based Rendering. Dipl-Inform. Robert Konrad Polona Caserman, M.Sc.

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Pipeline Operations. CS 4620 Lecture 10

COSC 448: REAL-TIME INDIRECT ILLUMINATION

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Deferred Renderer Proof of Concept Report

Computer Graphics 10 - Shadows

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

lecture 19 Shadows - ray tracing - shadow mapping - ambient occlusion Interreflections

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

There are many kinds of surface shaders, from those that affect basic surface color, to ones that apply bitmap textures and displacement.

GeForce4. John Montrym Henry Moreton

Graphics Performance Optimisation. John Spitzer Director of European Developer Technology

Hardware Accelerated Volume Visualization. Leonid I. Dimitrov & Milos Sramek GMI Austrian Academy of Sciences

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

Physically Based Shading in Unity. Aras Pranckevičius Rendering Dude

Interactive Methods in Scientific Visualization

Optimizing and Profiling Unity Games for Mobile Platforms. Angelo Theodorou Senior Software Engineer, MPG Gamelab 2014, 25 th -27 th June

Wednesday, July 24, 13

SHADERX 7 : ADVANCED RENDERING TECHNIQUES

Rendering Structures Analyzing modern rendering on mobile

LEVEL 1 ANIMATION ACADEMY2010

Next-Generation Graphics on Larrabee. Tim Foley Intel Corp

Ultimate Graphics Performance for DirectX 10 Hardware

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops.

rendering rasterization based rendering pipelined architecture, parallel mostly triangles (lines and points possible too)

Order Independent Transparency with Dual Depth Peeling. Louis Bavoil, Kevin Myers

Mattan Erez. The University of Texas at Austin

Game Graphics Programmers

Basic GPU techniques Josef Pelikán CGG MFF UK Praha.

CS 464 Review. Review of Computer Graphics for Final Exam

Canonical Shaders for Optimal Performance. Sébastien Dominé Manager of Developer Technology Tools

The Graphics Pipeline

Advanced Deferred Rendering Techniques. NCCA, Thesis Portfolio Peter Smith

Fog and Cloud Effects. Karl Smeltzer Alice Cao John Comstock

Mattan Erez. The University of Texas at Austin

Working with Metal Overview

Programming Graphics Hardware

3D Rasterization II COS 426

Enhancing Traditional Rasterization Graphics with Ray Tracing. October 2015

Com S 336 Final Project Ideas

Global Illumination CS334. Daniel G. Aliaga Department of Computer Science Purdue University

A Trip Down The (2011) Rasterization Pipeline

Radeon ProRender and Radeon Rays in a Gaming Rendering Workflow. Takahiro Harada, AMD 2017/3

POWERVR MBX. Technology Overview

Game Graphics Programmers

Graphics Hardware, Graphics APIs, and Computation on GPUs. Mark Segal

Transcription:

A bit more Deferred - CryEngine 3 Triangle Game Conference 2009 Martin Mittring Lead Graphics Programmer

Crytek Main office: Germany Frankfurt More studios: Kiev, Budapest, Sofia, Nottingham, Seoul English as company language 30+ nationalities CryEngine 1: PC only (Far Cry ) CryEngine 2: PC only (Crysis ) CryEngine 3: PC, XBox360, PS3 (announced GDC09)

32/64 Bit, WinXP/Vista, DX9/10, Multi CPU/GPU WYSIWYP ResourceCompiler Source asset -> Platform specific Direct Light: Shadow mapping Indirect Light (AO): SSAO / RAM /... No precomputed lighting Production time saver, Memory, Consistency, Dynamic content Übershaders [Mittring07]

Goals after CryEngine 2 PS3 / XBox360 GPU, CPU, memory Improve streaming Improve multithreading Improve lighting More predictable performance Tackle the shader combination issue

What is the shader combination issue? Übershader is one shader with many features (e.g. 0..4 lights, light types, CM reflection, fog, detail texture, normalmap, specular texture) Compiling all possible permutations is a memory, production and performance problem Usual solutions: dynamic branching / separating into multiple passes / reducing combinations and accepting less functionality and less performance Asynchronous shader compiling Distributed Job System to compile the shader cache

Why Deferred Rendering? Rendering is a multi-dimensional query: View x Geometry x Material x Light Classic Forward Rendering: for each light render geometry from scene query with shader Classic Deferred Rendering: render geometry from scene query outputting GBuffer render each light from scene query and shade with GBuffer => Decouples geometric complexity from lighting and shading => Helps on shader combination issue and predictable performance

GBuffer in CryEngine 2 Z Minimal GBuffer (depth) Slower Early Z pass when outputting linear depth Formats: R16 R16G16 R32 Proved to be very useful

Deferred in CryEngine 2 Main use: Deferred shadows, Per pixel fog Additionally: Soft Z clipped Particles, Motion Blur, Beach/Ocean, EdgeAA, Sun Rays, SSAO, Fake lights, 2.5D TerrainAO SSAO ShadowMask

Deferred Lighting in CryEngine 3 Z (native) Normal Specular Power Passes: 1) Forward GBuffer generation 2) Deferred light accumulation into texture (Phong) 3) Forward shading with light accumulation texture => No deferred shading Deferred Lighting* + Multiple light primitives are possible + even Image Based Lighting (IBL) + easy to extend Compared to Deferred Shading + Less bandwidth and memory problems (10MB EDRAM XBox360) + More flexibility on shading (besides Phong) * [Geldreich09] aka Light Pre-Pass Renderer [Engel08]

Options for the light accumulation texture 6 channels: Diffuse and Specular two 7e3 7e3 7e3, A16R16G16B16f or A8R8G8B8* 4 channels: Diffuse and Specular strength a single A16R16G16B16f or A8R8G8B8* (specular approximated by diffuse*strength) * srgb helps to distribute more details in dark areas The following pictures show lighting with two differently coloured lights: 6 channels (correct) 4 channels (fast)

Light accumulation texture in IBL The following pictures show lighting with Diffuse and Specular Cubemaps: Diffuse RGB Specular RGB High Quality (left) Diffuse RGB Specular Strength Fast Rendering (right) Difference often neglectable (depends on environment)

Storing normals in the GBuffer XYZ world space 8 bit: problematic with extreme reflections/specular 10 bit: good, but what about specular power and PS3 Solving Quantization Artefacts Detail Normalmaps, Noise, Dither XY view space (Z reconstruct) 8/10/16 bit, negate Z bit (perspective and normal mapping) => Problematic [Lee09] [Lob09]

Alternative: VS Normal in 2 scalars -1..1 => -1..1 Normal to GBufffer: G=normalize(N.xy)*sqrt(N.z*0.5+0.5) GBuffer to Normal: N.z=length2(G.xy)*2-1 N.xy=normalize(G.xy)*sqrt(1-N.z*N.z) + more precision where it matters (bright part) + framebuffer blending friendly + no z reconstruction issues - wasted area - more ALU than WS => still, WS normals are faster

Improved SSAO (with normals)

Light rasterization in 2D (Rectangle) or 3D (Convex Object) 2D 3D + cheap WS position reconstruction (Interpolator+MAD) + Combining multiple lights - Stencil prepass (if not fullscreen) - Coarse blocks can be rejected based on z min/max + Z buffer + tighter bounding object (less pixels to process) Depth bounds test (only on some HW)

Deferred Light Types 1/3: Directional light optional with cloud shadows, multiple shadowmaps Point/Projector lights optional with projector texture Procedural Caustics (before this was multi-pass, one drawcall for each object under water including terrain) Interleaved Shadowmap lookups no extra memory less bandwidth needed no limits on shadow mask channel count

Deferred Light Types 2/3: Image Based Lighting (IBL) Light Probes are the high quality solution for distant light Cubemaps allow efficient HDR lighting in real-time Diffuse CM can be computed from specular CM Mip adjusted lookup allows different specular power values Improves shading in ambient lighting condition by adding normal dependent and specular lighting Light Probes can be generated at specified level positions Deferred Lighting allows blending of localized Light Probes Looks even better with SSAO

Ambient without SSAO with hemispherical lighting

Bright ambient SSAO Black ambient Shadow casting light source SSAO Grey ambient (hemispherical) Shadow casting light source SSAO IBL ambient (Specular and Diffuse) Shadow casting light source SSAO

IBL ambient (Specular and Diffuse) SSAO * brightened up for better display

Deferred Light Types 3/3: Real-time Dynamic Global Illumination Details will be presented at upcoming Siggraph 2009 by Anton Kaplanyan who developed that at Crytek Implemented and fast on XBox360, PS3 and PC No precomputation Fully dynamic (geometry, materials and lights) Unified for static and dynamic objects

Global Illumination off black ambient (to emphasize where GI affects the image) color bleeding bump without light fully dynamic real-time Global Illumination on

Global Illumination * brightened up for better display

Something missing? Transparency => falling back to well known techniques: Per pixel global fog and fog volumes (deferred) Back to front sorted alpha transparent objects Volume texture clouds, Imposter clouds, Distance clouds Particle systems avoiding per particle sorting Anti-aliasing => Nasty but possible EdgeAA,... we work on it

References [Mittring07] Finding Next Gen CryEngine2 Siggraph 2007, Martin Mittring http://ati.amd.com/developer/gdc/2007/mittring-finding_nextgen_cryengine2(siggraph07).pdf [Engel08] The Light Pre-Pass Renderer ShaderX7, Wolfgang Engel http://diaryofagraphicsprogrammer.blogspot.com/2008/03/light-pre-pass-renderer.html [Lee09a] Prelighting Mark Lee http://www.insomniacgames.com/tech/articles/0209/files/prelighting.pdf [Lee09b] Pre-lighting in Resistance 2 GDC 2009, Mark Lee http://www.gdconf.com/conference/tutorial%20handouts/200_insomniac/gdc09_insomniac_prelighting.pdf [Geldreich09] Deferred Lighting and Shading GDC 2009, Rich Geldreich, Matt Pritchard, John Brooks http://archive.gdconf.com/gdc_2004/pritchard_matt.ppt [Shish05] Deferred Shading in S.T.A.L.K.E.R. GPU Gems 2, Oles Shishkovtsov http://http.developer.nvidia.com/gpugems2/gpugems2_chapter09.html [Lob09] S.T.A.L.K.E.R : Clear Sky a showcase for Direct3D 10.0/1 GDC 2009, Igor A. Lobanchikov, Holger Gruen http://www.gdconf.com/conference/tutorial%20handouts/100_advanced%20visual%20effects%20with%20direct3d/100_handout%202.pdf [Valient07] Deferred Rendering in Killzone 2 Develop Conference 2007, Michal Valient http://www.guerrilla-games.com/publications/dr_kz2_rsx_dev07.pdf Slides should be soon at http://www.crytek.com/technology/presentations Special thanks to all the passionate people at Crytek