SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
The Rendering Technology of
Lords of the Fallen
Philip Hammer
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Intro
● Deck13 Interactive is one of the leading game developers in Germany
○ In-house multiplatform technology FLEDGE
(PS4, XB1, PC, PS3, XB360, iOS)
○ Previously: Venetica, Jack Keane, Blood Knights, Tiger&Chicken, etc.
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Intro
● Currently working on “Lords of the Fallen”
○ 3rd-person challenging Action-RPG
○ Platforms PS4, XB1, PC
○ Development together with CI Games
○ Release End of 2014
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Development
● LotF started as a PS3/XB360 title
● Gradually shifted to (back then) “Next-Gen”
○ Lot of changes in content
● Tech challenges
○ Switch from Light-Prepass to Deferred Rendering
○ Drop of DX9-support unlocked a lot of freedom
○ Feature a lot more multithreading
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Overview
● Our Deferred Rendering Approach
● Deferred Material Parameter Buffer
● Deferred Particle Lighting
● Short Teaser
○ Transparent Shadows
○ Volumetric Lighting
○ GPU Particles
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Our Deferred Rendering Approach
● Switch from Light-Prepass Rendering to more traditional Deferred
Rendering
○ Getting rid of the second geometry-pass
○ Overhead for Geometry and API was horrible on consoles
○ Memory amount and bandwidth is good nowadays
■ can afford a lot more rendertarget memory
○ Had to move a lot effects from object-shaders to deferred stages
(reflections, fog, etc.)
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Our Deferred Rendering Approach
● Want have more freedom in lighting
○ IBL / localized cubemaps for ambient specular
○ Translucency should *not* be a hacky corner case anymore
○ Transparent objects should receive lighting and cast transparent shadows
○ Dynamic Global Illumination
■ We use dynamic directional irradiance lightmaps generated by Geomerics
Enlighten© Middleware
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Our Deferred Rendering Approach
● Render minimal G-Buffer
○ 2x RGBA8_UNORM +
R11G11B10_FLOAT + D24S8 = 128 bpp
● Render L-Buffer
○ 2x R11G11B10_FLOAT
○ separate diffuse + specular lighting
● Render deferred reflections
○ Several Environment-Probes
Cubemaps + Screenspace Reflections
● Render combine pass
○ Composite Albedo, Spec-Color, Lighting, Reflections
● Render transparent objects
● Render deferred fog
● Render postprocessing
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
G-Buffer Layout
● Should be still as small as possible
● Parameter encoding
○ 2-channel normals
○ Compact YCoCg for albedo + specular-color [Mavridis12]
■ Interleave chroma component
○ Parameter packing
■ Pack single bits and use lower precision for some attributes
○ Share channels for mutual exclusive parameters
● Material-ID/-Index for referencing per-material parameters
○ more on this later
● 128 bpp (31,64 MB @ 1080p) even fits into XB1 ESRAM
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
G-Buffer Layout
RED GREEN BLUE ALPHA
MRT0
RGBA8_UNORM
Encoded Normal Material-
ID / Index
Specular
Exponent
MRT1
RGBA8_UNORM
Albedo
Luma
Albedo
Chroma
Spec.
Luma
Spec. Chroma /
Translucency
L-Buffer (Diffuse)
R11G11B10_F
Irradiance Lightmap -
Depth/Stencil
D24S8
Depth Stencil
● Colored Specular and Translucency are mutual
exclusive!
○ Determined by Material-ID
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
G-Buffer Layout
RED GREEN BLUE ALPHA
MRT0
RGBA8_UNORM
Encoded Normal Material-
ID / Index
Specular
Exponent
MRT1
RGBA8_UNORM
Albedo
Luma
Albedo
Chroma
Spec.
Luma
Spec. Chroma /
Translucency
L-Buffer (Diffuse)
R11G11B10_F
Irradiance Lightmap -
Depth/Stencil
D24S8
Depth Stencil
● 1 Bit Material-ID determines whether MRT1.a
contains Translucency or Spec. Chroma.
● 7 Bit Material-Index used to reference Material
Parameter Buffers
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
G-Buffer Layout
RED GREEN BLUE ALPHA
MRT0
RGBA8_UNORM
Encoded Normal Material-
ID / Index
Specular
Exponent
MRT1
RGBA8_UNORM
Albedo
Luma
Albedo
Chroma
Spec.
Luma
Spec. Chroma /
Translucency
L-Buffer (Diffuse)
R11G11B10_F
Irradiance Lightmap -
Depth/Stencil
D24S8
Depth Stencil
● 1 Bit Material-ID determines whether MRT1.a
contains Translucency or Spec. Chroma.
● 7 Bit Material-Index used to reference Material
Parameter Buffers
// extract material-id from g-buffer
float unpackMaterialID ( float packedIndexID )
{
return floor( ( packedIndexID * 255.0 ) / 128.0 ) ;
}
// extract material-index from g-buffer
uint unpackMaterialIndex ( float packedIndexID )
{
const uint bufferElements = 4 ;
uint index = uint( packedIndexID * 255.0 ) & 0x7f ;
return index * bufferElements ;
}
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
G-Buffer Layout
RED GREEN BLUE ALPHA
MRT0
RGBA8_UNORM
Encoded Normal Material-
ID / Index
Specular
Exponent
MRT1
RGBA8_UNORM
Albedo
Luma
Albedo
Chroma
Spec.
Luma
Spec. Chroma /
Translucency
L-Buffer (Diffuse)
R11G11B10_F
Irradiance Lightmap -
Depth/Stencil
D24S8
Depth Stencil
● Stencil used for masking
○ 3 Bits for Decals, Reflections, Skin/SSSSS
● 2 Bits Light-Volume Stenciling
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
G-Buffer Layout
● Other Attributes affecting only a few objects will be rendered in a
separate pass
○ Tangents for smooth alpha-test
○ Per-object rimlights, emissive/glow & other FX
○ Motion-Vectors of moving objects for motionblur
■ vectors for static geometry are computed by reprojecting the depthbuffer
(“camera-motionblur”)
○ Distortion-Vectors for Post-Distort
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Material Parameter Buffer (MP-Buffers)
● What to do with additional material parameters when G-Buffer is full?
○ Increasing G-Buffer size not always an option
○ Information is sometimes only needed per-material, not necessarily per-
pixel frequency
● Examples
○ Reflection-Parameters (Strength, Fresnel)
○ Subsurface-Scattering Parameters (Distortion, Tint)
○ etc.
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Material Parameter Buffer (MP-Buffers)
● Our solution: Material Parameter Buffers
● Generate buffer every frame on CPU and bind to lighting-/reflection-
shader
○ Lookup Table for material parameters
■ DX9: multiple 1D RGBA8 textures
■ DX11: structured buffer
○ Stores parameters from material
○ Indexed by Material-Index (G-Buffer)
■ can index up to 128 different materials per frame
● 7 Bit, because 1 Bit reserved for Material-ID
■ determine for each drawcall a set of parameters
● Smart value quantization and interleaving
● Allows a lot more material variety for deferred rendering
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
MP-Buffers Example
● Subsurface-scattering / backscattering inspired by [Brisebois12]
● Some problems in deferred rendering
○ Too many per-surface parameters
○ Parametrization per light can work, but inflexible (e.g. white light
filters through differently colored objects)
● We store a single scalar translucency value per-pixel
● Other parameters (e.g. fresnel parameters and tint) are stored in MP-
Buffers and can therefore only vary per material
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
● Subsurface-scattering / backscattering inspired by [Brisebois12]
MP-Buffers Example
G-Buffer MRT0.a = Material-ID/-Index
Translates to LUT / structured buffer
Material-
Index
sssDistortion sssPower sssMaterialColor …
0 4.5 2.4 0.43, 0.39, 0.84 …
1 8.0 3.5 0.22, 0.51, 0.52 …
2 5.6 4.1 0.41, 0.43, 0.11 …
... ... ... ... ...
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
● Subsurface-scattering / backscattering inspired by [Brisebois12]
MP-Buffers Example
// deferred light-volume fragment shader
Buffer<float4> parameterBuffer ;
uint materialIndex = unpackMaterialIndex(gbuffer0Value . a);
float4 matParamBuffer0 = parameterBuffer[materialIndex];
float4 matParamBuffer1 = parameterBuffer[materialIndex + 1];
float sssDistortion = matParamBuffer0 . x ;
// backscattering according to [Brisebois12]
float3 sssLightVector = L + N * sssDistortion ;
float sssDot = exp2 ( saturate ( dot ( V, -sssLightVector ) ) * sssPower - sssPower ) * sssScale ;
float3 sssColor = ( sssDot * sssMaterialColor * sssLightColor ) * backscattering_mask ;
Parameters per Light (cbuffer)
Parameters per Material (mp-buffer)
Parameters per Pixel (g-bufer)
Material-
Index
sssDistortion sssPower sssMaterialColor …
0 4.5 2.4 0.43, 0.39, 0.84 …
1 8.0 3.5 0.22, 0.51, 0.52 …
2 5.6 4.1 0.41, 0.43, 0.11 …
... ... ... ... ...
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Lighting
● 4 different light-types: directional, point, spot, box (local directional)
○ currently around dynamic 500 lights per level
○ most of them featuring animated gobo-textures & shadow-casting
● Classic light-volume accumulation into L-Buffer
○ With optional double-sided stencil masking for large lights
○ Tiled Deferred is currently under development
Digital Dragons 2014
Lighting
● Diffuse L-Buffer
○ Indirect lighting
○ Filled in G-Buffer stage
○ Directional irradiance lightmaps for static
geometry
○ SH lightprobes for dynamic objects
○ We use Geomerics Enlighten
Digital Dragons 2014
Lighting
● Diffuse L-Buffer
○ Accumulate direct diffuse +
translucent light
Digital Dragons 2014
Lighting
● Specular L-Buffer
○ Accumulate specular light
Digital Dragons 2014
Lighting
● Reflection Buffer
○ Shared with specular L-Buffer
○ Static reflections (indirect specular lighting)
○ IBL with localized, parallax corrected cubemaps [Largarde12]
Digital Dragons 2014
Lighting
● Reflection Buffer
○ Shared with specular L-Buffer
○ Static reflections (indirect specular lighting)
○ IBL with localized, parallax corrected cubemaps [Largarde12]
● Environment-Probes
○ Create 6 “screenshots” (raw RGBA16_F) with 90° Fov and 1:1
aspect. Skip postprocessing, gui etc.
○ Make cubemap out of 6 screenshots (256x256x256 / BC6)
○ Use ATI CubemapGen API to filter mipmap-chain + Edge-Fixup
○ Doesn’t match BRDF, but looks good with some artist tweaks
● All reflections done in a single fullscreen pass [Drobot12]
○ Gather 8 most influential env-probes and check if inside one or
more env-probe AABB
Digital Dragons 2014
Lighting
● Final Frame
○ Composite
○ Volumetric Light Scattering
○ Transparent Objects
○ Postprocessing
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Deferred Particle Lighting
● We wanted to have lit particles
○ Better integration into scene
○ Reuse particle effects under different lighting conditions or in shadow
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Deferred Particle Lighting
● Common type of particles: atmospheric, smoke, dust & fog effects
○ Usually transparent, dense ... and cause a lot of overdraw
○ Cost explosion when lighting every fragment
○ Non-directional, low-frequency information
○ Perfect for vertex-lighting
● Deferred vertex-lighting
○ No compromise in number of affecting lights and shadows
○ Fits perfectly into deferred pipeline
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Deferred Particle Lighting: G-Buffer
● Step 1: render a non-screenspace particle “G-Buffer”
○ Basically a sequential list
○ Render particle vertex-buffer as point-list
(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST)
○ Rasterize viewspace-positions of particles subsequently into a buffer
■ Currently a 1024x512 RGBA16F texture for all visible lit particles
○ G-Buffer currently contains only vertex-positions
■ Could be extended with more surface attributes like translucency or
normals (which doesn’t make too much sense with billboard-particles)
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Deferred Particle Lighting: G-Buffer
● Step 1: render a non-screenspace particle “G-Buffer”
○ Compute the next list index in vertex shader and rasterize
■ Based on current SV_VertexID and the previously rendered particles count
as shader constant vertexCountPerInstance
■ When using instanced particles, also factor in SV_InstanceID
// vertex-shader
// pos = SV_Position
float4 pos = 1.0 ;
// vertexId = SV_VertexID, instanceId = SV_InstanceID
// param_vertexcount = shader constant holding the currently rendered number of vertices
float vertexIndex = vertexId + ( instanceId * vertexCountPerInstance) + param_vertexcount ;
float rasterPosY = trunc ( vertexIndex / textureWidth ) ;
float rasterPosX = trunc ( vertexIndex - rasterPosY * textureWidth ) ;
pos . x = ( ( rasterPosX * 2.0 ) - textureWidth ) / textureWidth ;
pos . y = ( ( rasterPosY * 2.0 ) - textureHeight ) / textureHeight ;
pos . zw = 1.0 ;
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Deferred Particle Lighting: Lighting
● Step 2: Apply lighting similar to normal deferred lighting
○ Use fullscreen-quads instead of light-volumes, because the fragments
have no spatial relationship (Non-Screenspace Fragment-List)
○ Different light-types, shadows, projected textures, etc. “just works”
○ Very simple “lighting model”
○ Shadowing: PCF with large kernel width reduces flickering in shadow/light
transitions
○ Optimization: Stencil-Mask each fragment in Per-Vertex G-Buffer
// pixel shader
// trivial implementation (different for each light type):
// - sample g-buffer containing the viewspace positions of particle vertices
// - compute light attenuation base on position and light parameters (...)
float3 positionVS = SAMPLE ( perVertexGBufferSampler, screenUV . xy ) . rgb ;
col0 . rgb = light_color . rgb * getLightAttenuation ( positionVS ) * getShadowing ( positionVS ) ;
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Deferred Particle Lighting: Material
● Step 3: Render particles with lighting applied
○ Take care of exact rendering order (same as G-Buffer stage)
○ Sample particle L-Buffer in vertexshader
○ Interpolate lighting to fragment shader and modulate with particle texture
// vertex-shader
// vertexId = SV_VertexID, instanceId = SV_InstanceID
// param_vertexcount = shader constant holding the currently rendered number of vertices
float vertexIndex = vertexId + ( instanceId * vertexCountPerInstance ) + param_vertexcount ;
float3 perVertexLightBufferUV = 0;
perVertexLightBufferUV . y =trunc ( vertexIndex / textureWidth ) ;
perVertexLightBufferUV . x =trunc ( vertexIndex - perVertexLightBufferUV . y * textureWidth ) ;
perVertexLightBufferUV . y = ( textureHeight - 1.0 ) - perVertexLightBufferUV . y ;
float4 lbufferValue = perVertexLightBufferTexture .Load ( (int3)perVertexLightBufferUV . xyz ) ;
// pixel-shader
col0 . rgb = particleTextureColor . rgb * f_in . lbufferValue . rgb ;
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Deferred Particle Lighting - Conclusion
● Great for many types of particles
○ Cheap and effective
● Inherits problems of all per-vertex techniques
○ Low spatial resolution
● Works best with small particles
● Very small and bright lights can lead to flickering if only one corner of
particle gets suddenly lit
● Be wary of buffer overflow with many lit particles
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Transparent Shadows
● Shadowmask for PSSM
○ Accumulate cascades in screenspace
○ Depth-preserving gauss-blur
○ Can accumulate up to 4 different monochromatic shadow-sources
● Each light can also cast colored transparent shadows
○ Simple approach:
■ Render certain objects alpha-blended into shadowmap-sized RGBA8 buffer
■ Use shadowmap as depth buffer
■ Sample RGBA8 buffer with shadowmap uv and multiply with lighting
■ Works seamless with volumetric lights and particle lighting
○ Problems:
■ Shadowmask reduced to 1 shadow-source
■ Self-shadowing not correct, but normally not an issue
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
● All lights can cast depth-tested transparent shadows
Transparent Shadows
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Transparent Shadows
● Works also with volumetric lights, transparent particles, etc.
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Volumetric Lighting
● For details, see Benjamin Glatzels talk yesterday
● Raymarching in light’s view space while evaluating the shadowmap
○ Also evaluate projector-texture, transparent shadows, IES light-profiles,
noise volume-texture, etc
● Based on the technique presented by [Toth09]
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Volumetric Lighting
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
GPU Particles
● Yeah, we have GPU particles as well
● Compute Shader-based simulations of large amounts of particles
○ Screenspace collisions (test against depthbuffer)
○ Lots of different emitter types
○ Driven by prebaked 3D vector fields and other force-field types
○ Topic would fill another 45 minutes, so just a teaser
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
GPU Particles
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
Things for the future
● Physical Based Rendering
○ We already have a PBR renderpath, but a lot of content was already
done, so it didn’t make it into LotF
● Re-introduce a pure z-prepass
○ Z-Layout done before G-Buffer
○ Reduces Overdraw and can use implicit alpha-test per depth-test=equal
○ Helps with decals
● Tools, tools tools
○ Optimized workflows, better tools and therefore faster iteration times are
more important than more funky graphics effects
Digital Dragons 2014
@philiphammer0
phammer@deck13.com
http://www.deck13.com
Thanks for listening!
...and special thanks to the amazing Deck13 tech-team
Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’
References
[Mavridis12] "The Compact YCoCg Frame Buffer", Journal of Computer Graphics Techniques, Vol. 1, No. 1, 2012
[Lagarde12] “Local Image-based Lighting With Parallax-corrected Cubemap”, Siggraph, 2012
[Brisebois12] “Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look”, GDC 2011
http://dice.se/wp-content/uploads/Colin_BarreBrisebois_Programming_ApproximatingTranslucency.pdf
[Drobot12] "Lighting of Killzone: Shadow Fall"
http://de.slideshare.net/guerrillagames/lighting-of-killzone-shadow-fall
[Toth09] “Real-time Volumetric Lighting in Participating Media”, Eurographics 2009
http://sirkan.iit.bme.hu/~szirmay/lightshaft.pdf

Weitere ähnliche Inhalte

Kürzlich hochgeladen

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Kürzlich hochgeladen (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Empfohlen

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Empfohlen (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

The Rendering Technology of Lords of the Fallen

  • 1. The Rendering Technology of Lords of the Fallen Philip Hammer
  • 2. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Intro ● Deck13 Interactive is one of the leading game developers in Germany ○ In-house multiplatform technology FLEDGE (PS4, XB1, PC, PS3, XB360, iOS) ○ Previously: Venetica, Jack Keane, Blood Knights, Tiger&Chicken, etc.
  • 3. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Intro ● Currently working on “Lords of the Fallen” ○ 3rd-person challenging Action-RPG ○ Platforms PS4, XB1, PC ○ Development together with CI Games ○ Release End of 2014
  • 4. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Development ● LotF started as a PS3/XB360 title ● Gradually shifted to (back then) “Next-Gen” ○ Lot of changes in content ● Tech challenges ○ Switch from Light-Prepass to Deferred Rendering ○ Drop of DX9-support unlocked a lot of freedom ○ Feature a lot more multithreading
  • 5. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Overview ● Our Deferred Rendering Approach ● Deferred Material Parameter Buffer ● Deferred Particle Lighting ● Short Teaser ○ Transparent Shadows ○ Volumetric Lighting ○ GPU Particles
  • 6. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Our Deferred Rendering Approach ● Switch from Light-Prepass Rendering to more traditional Deferred Rendering ○ Getting rid of the second geometry-pass ○ Overhead for Geometry and API was horrible on consoles ○ Memory amount and bandwidth is good nowadays ■ can afford a lot more rendertarget memory ○ Had to move a lot effects from object-shaders to deferred stages (reflections, fog, etc.)
  • 7. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Our Deferred Rendering Approach ● Want have more freedom in lighting ○ IBL / localized cubemaps for ambient specular ○ Translucency should *not* be a hacky corner case anymore ○ Transparent objects should receive lighting and cast transparent shadows ○ Dynamic Global Illumination ■ We use dynamic directional irradiance lightmaps generated by Geomerics Enlighten© Middleware
  • 8. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Our Deferred Rendering Approach ● Render minimal G-Buffer ○ 2x RGBA8_UNORM + R11G11B10_FLOAT + D24S8 = 128 bpp ● Render L-Buffer ○ 2x R11G11B10_FLOAT ○ separate diffuse + specular lighting ● Render deferred reflections ○ Several Environment-Probes Cubemaps + Screenspace Reflections ● Render combine pass ○ Composite Albedo, Spec-Color, Lighting, Reflections ● Render transparent objects ● Render deferred fog ● Render postprocessing
  • 9. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ G-Buffer Layout ● Should be still as small as possible ● Parameter encoding ○ 2-channel normals ○ Compact YCoCg for albedo + specular-color [Mavridis12] ■ Interleave chroma component ○ Parameter packing ■ Pack single bits and use lower precision for some attributes ○ Share channels for mutual exclusive parameters ● Material-ID/-Index for referencing per-material parameters ○ more on this later ● 128 bpp (31,64 MB @ 1080p) even fits into XB1 ESRAM
  • 10. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ G-Buffer Layout RED GREEN BLUE ALPHA MRT0 RGBA8_UNORM Encoded Normal Material- ID / Index Specular Exponent MRT1 RGBA8_UNORM Albedo Luma Albedo Chroma Spec. Luma Spec. Chroma / Translucency L-Buffer (Diffuse) R11G11B10_F Irradiance Lightmap - Depth/Stencil D24S8 Depth Stencil ● Colored Specular and Translucency are mutual exclusive! ○ Determined by Material-ID
  • 11. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ G-Buffer Layout RED GREEN BLUE ALPHA MRT0 RGBA8_UNORM Encoded Normal Material- ID / Index Specular Exponent MRT1 RGBA8_UNORM Albedo Luma Albedo Chroma Spec. Luma Spec. Chroma / Translucency L-Buffer (Diffuse) R11G11B10_F Irradiance Lightmap - Depth/Stencil D24S8 Depth Stencil ● 1 Bit Material-ID determines whether MRT1.a contains Translucency or Spec. Chroma. ● 7 Bit Material-Index used to reference Material Parameter Buffers
  • 12. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ G-Buffer Layout RED GREEN BLUE ALPHA MRT0 RGBA8_UNORM Encoded Normal Material- ID / Index Specular Exponent MRT1 RGBA8_UNORM Albedo Luma Albedo Chroma Spec. Luma Spec. Chroma / Translucency L-Buffer (Diffuse) R11G11B10_F Irradiance Lightmap - Depth/Stencil D24S8 Depth Stencil ● 1 Bit Material-ID determines whether MRT1.a contains Translucency or Spec. Chroma. ● 7 Bit Material-Index used to reference Material Parameter Buffers // extract material-id from g-buffer float unpackMaterialID ( float packedIndexID ) { return floor( ( packedIndexID * 255.0 ) / 128.0 ) ; } // extract material-index from g-buffer uint unpackMaterialIndex ( float packedIndexID ) { const uint bufferElements = 4 ; uint index = uint( packedIndexID * 255.0 ) & 0x7f ; return index * bufferElements ; }
  • 13. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ G-Buffer Layout RED GREEN BLUE ALPHA MRT0 RGBA8_UNORM Encoded Normal Material- ID / Index Specular Exponent MRT1 RGBA8_UNORM Albedo Luma Albedo Chroma Spec. Luma Spec. Chroma / Translucency L-Buffer (Diffuse) R11G11B10_F Irradiance Lightmap - Depth/Stencil D24S8 Depth Stencil ● Stencil used for masking ○ 3 Bits for Decals, Reflections, Skin/SSSSS ● 2 Bits Light-Volume Stenciling
  • 14. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ G-Buffer Layout ● Other Attributes affecting only a few objects will be rendered in a separate pass ○ Tangents for smooth alpha-test ○ Per-object rimlights, emissive/glow & other FX ○ Motion-Vectors of moving objects for motionblur ■ vectors for static geometry are computed by reprojecting the depthbuffer (“camera-motionblur”) ○ Distortion-Vectors for Post-Distort
  • 15. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Material Parameter Buffer (MP-Buffers) ● What to do with additional material parameters when G-Buffer is full? ○ Increasing G-Buffer size not always an option ○ Information is sometimes only needed per-material, not necessarily per- pixel frequency ● Examples ○ Reflection-Parameters (Strength, Fresnel) ○ Subsurface-Scattering Parameters (Distortion, Tint) ○ etc.
  • 16. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Material Parameter Buffer (MP-Buffers) ● Our solution: Material Parameter Buffers ● Generate buffer every frame on CPU and bind to lighting-/reflection- shader ○ Lookup Table for material parameters ■ DX9: multiple 1D RGBA8 textures ■ DX11: structured buffer ○ Stores parameters from material ○ Indexed by Material-Index (G-Buffer) ■ can index up to 128 different materials per frame ● 7 Bit, because 1 Bit reserved for Material-ID ■ determine for each drawcall a set of parameters ● Smart value quantization and interleaving ● Allows a lot more material variety for deferred rendering
  • 17. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ MP-Buffers Example ● Subsurface-scattering / backscattering inspired by [Brisebois12] ● Some problems in deferred rendering ○ Too many per-surface parameters ○ Parametrization per light can work, but inflexible (e.g. white light filters through differently colored objects) ● We store a single scalar translucency value per-pixel ● Other parameters (e.g. fresnel parameters and tint) are stored in MP- Buffers and can therefore only vary per material
  • 18. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ ● Subsurface-scattering / backscattering inspired by [Brisebois12] MP-Buffers Example G-Buffer MRT0.a = Material-ID/-Index Translates to LUT / structured buffer Material- Index sssDistortion sssPower sssMaterialColor … 0 4.5 2.4 0.43, 0.39, 0.84 … 1 8.0 3.5 0.22, 0.51, 0.52 … 2 5.6 4.1 0.41, 0.43, 0.11 … ... ... ... ... ...
  • 19. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ ● Subsurface-scattering / backscattering inspired by [Brisebois12] MP-Buffers Example // deferred light-volume fragment shader Buffer<float4> parameterBuffer ; uint materialIndex = unpackMaterialIndex(gbuffer0Value . a); float4 matParamBuffer0 = parameterBuffer[materialIndex]; float4 matParamBuffer1 = parameterBuffer[materialIndex + 1]; float sssDistortion = matParamBuffer0 . x ; // backscattering according to [Brisebois12] float3 sssLightVector = L + N * sssDistortion ; float sssDot = exp2 ( saturate ( dot ( V, -sssLightVector ) ) * sssPower - sssPower ) * sssScale ; float3 sssColor = ( sssDot * sssMaterialColor * sssLightColor ) * backscattering_mask ; Parameters per Light (cbuffer) Parameters per Material (mp-buffer) Parameters per Pixel (g-bufer) Material- Index sssDistortion sssPower sssMaterialColor … 0 4.5 2.4 0.43, 0.39, 0.84 … 1 8.0 3.5 0.22, 0.51, 0.52 … 2 5.6 4.1 0.41, 0.43, 0.11 … ... ... ... ... ...
  • 20. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Lighting ● 4 different light-types: directional, point, spot, box (local directional) ○ currently around dynamic 500 lights per level ○ most of them featuring animated gobo-textures & shadow-casting ● Classic light-volume accumulation into L-Buffer ○ With optional double-sided stencil masking for large lights ○ Tiled Deferred is currently under development
  • 21. Digital Dragons 2014 Lighting ● Diffuse L-Buffer ○ Indirect lighting ○ Filled in G-Buffer stage ○ Directional irradiance lightmaps for static geometry ○ SH lightprobes for dynamic objects ○ We use Geomerics Enlighten
  • 22. Digital Dragons 2014 Lighting ● Diffuse L-Buffer ○ Accumulate direct diffuse + translucent light
  • 23. Digital Dragons 2014 Lighting ● Specular L-Buffer ○ Accumulate specular light
  • 24. Digital Dragons 2014 Lighting ● Reflection Buffer ○ Shared with specular L-Buffer ○ Static reflections (indirect specular lighting) ○ IBL with localized, parallax corrected cubemaps [Largarde12]
  • 25. Digital Dragons 2014 Lighting ● Reflection Buffer ○ Shared with specular L-Buffer ○ Static reflections (indirect specular lighting) ○ IBL with localized, parallax corrected cubemaps [Largarde12] ● Environment-Probes ○ Create 6 “screenshots” (raw RGBA16_F) with 90° Fov and 1:1 aspect. Skip postprocessing, gui etc. ○ Make cubemap out of 6 screenshots (256x256x256 / BC6) ○ Use ATI CubemapGen API to filter mipmap-chain + Edge-Fixup ○ Doesn’t match BRDF, but looks good with some artist tweaks ● All reflections done in a single fullscreen pass [Drobot12] ○ Gather 8 most influential env-probes and check if inside one or more env-probe AABB
  • 26. Digital Dragons 2014 Lighting ● Final Frame ○ Composite ○ Volumetric Light Scattering ○ Transparent Objects ○ Postprocessing
  • 27. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Deferred Particle Lighting ● We wanted to have lit particles ○ Better integration into scene ○ Reuse particle effects under different lighting conditions or in shadow
  • 28. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Deferred Particle Lighting ● Common type of particles: atmospheric, smoke, dust & fog effects ○ Usually transparent, dense ... and cause a lot of overdraw ○ Cost explosion when lighting every fragment ○ Non-directional, low-frequency information ○ Perfect for vertex-lighting ● Deferred vertex-lighting ○ No compromise in number of affecting lights and shadows ○ Fits perfectly into deferred pipeline
  • 29. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Deferred Particle Lighting: G-Buffer ● Step 1: render a non-screenspace particle “G-Buffer” ○ Basically a sequential list ○ Render particle vertex-buffer as point-list (D3D11_PRIMITIVE_TOPOLOGY_POINTLIST) ○ Rasterize viewspace-positions of particles subsequently into a buffer ■ Currently a 1024x512 RGBA16F texture for all visible lit particles ○ G-Buffer currently contains only vertex-positions ■ Could be extended with more surface attributes like translucency or normals (which doesn’t make too much sense with billboard-particles)
  • 30. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Deferred Particle Lighting: G-Buffer ● Step 1: render a non-screenspace particle “G-Buffer” ○ Compute the next list index in vertex shader and rasterize ■ Based on current SV_VertexID and the previously rendered particles count as shader constant vertexCountPerInstance ■ When using instanced particles, also factor in SV_InstanceID // vertex-shader // pos = SV_Position float4 pos = 1.0 ; // vertexId = SV_VertexID, instanceId = SV_InstanceID // param_vertexcount = shader constant holding the currently rendered number of vertices float vertexIndex = vertexId + ( instanceId * vertexCountPerInstance) + param_vertexcount ; float rasterPosY = trunc ( vertexIndex / textureWidth ) ; float rasterPosX = trunc ( vertexIndex - rasterPosY * textureWidth ) ; pos . x = ( ( rasterPosX * 2.0 ) - textureWidth ) / textureWidth ; pos . y = ( ( rasterPosY * 2.0 ) - textureHeight ) / textureHeight ; pos . zw = 1.0 ;
  • 31. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Deferred Particle Lighting: Lighting ● Step 2: Apply lighting similar to normal deferred lighting ○ Use fullscreen-quads instead of light-volumes, because the fragments have no spatial relationship (Non-Screenspace Fragment-List) ○ Different light-types, shadows, projected textures, etc. “just works” ○ Very simple “lighting model” ○ Shadowing: PCF with large kernel width reduces flickering in shadow/light transitions ○ Optimization: Stencil-Mask each fragment in Per-Vertex G-Buffer // pixel shader // trivial implementation (different for each light type): // - sample g-buffer containing the viewspace positions of particle vertices // - compute light attenuation base on position and light parameters (...) float3 positionVS = SAMPLE ( perVertexGBufferSampler, screenUV . xy ) . rgb ; col0 . rgb = light_color . rgb * getLightAttenuation ( positionVS ) * getShadowing ( positionVS ) ;
  • 32. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Deferred Particle Lighting: Material ● Step 3: Render particles with lighting applied ○ Take care of exact rendering order (same as G-Buffer stage) ○ Sample particle L-Buffer in vertexshader ○ Interpolate lighting to fragment shader and modulate with particle texture // vertex-shader // vertexId = SV_VertexID, instanceId = SV_InstanceID // param_vertexcount = shader constant holding the currently rendered number of vertices float vertexIndex = vertexId + ( instanceId * vertexCountPerInstance ) + param_vertexcount ; float3 perVertexLightBufferUV = 0; perVertexLightBufferUV . y =trunc ( vertexIndex / textureWidth ) ; perVertexLightBufferUV . x =trunc ( vertexIndex - perVertexLightBufferUV . y * textureWidth ) ; perVertexLightBufferUV . y = ( textureHeight - 1.0 ) - perVertexLightBufferUV . y ; float4 lbufferValue = perVertexLightBufferTexture .Load ( (int3)perVertexLightBufferUV . xyz ) ; // pixel-shader col0 . rgb = particleTextureColor . rgb * f_in . lbufferValue . rgb ;
  • 33. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Deferred Particle Lighting - Conclusion ● Great for many types of particles ○ Cheap and effective ● Inherits problems of all per-vertex techniques ○ Low spatial resolution ● Works best with small particles ● Very small and bright lights can lead to flickering if only one corner of particle gets suddenly lit ● Be wary of buffer overflow with many lit particles
  • 34. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Transparent Shadows ● Shadowmask for PSSM ○ Accumulate cascades in screenspace ○ Depth-preserving gauss-blur ○ Can accumulate up to 4 different monochromatic shadow-sources ● Each light can also cast colored transparent shadows ○ Simple approach: ■ Render certain objects alpha-blended into shadowmap-sized RGBA8 buffer ■ Use shadowmap as depth buffer ■ Sample RGBA8 buffer with shadowmap uv and multiply with lighting ■ Works seamless with volumetric lights and particle lighting ○ Problems: ■ Shadowmask reduced to 1 shadow-source ■ Self-shadowing not correct, but normally not an issue
  • 35. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ ● All lights can cast depth-tested transparent shadows Transparent Shadows
  • 36. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Transparent Shadows ● Works also with volumetric lights, transparent particles, etc.
  • 37. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Volumetric Lighting ● For details, see Benjamin Glatzels talk yesterday ● Raymarching in light’s view space while evaluating the shadowmap ○ Also evaluate projector-texture, transparent shadows, IES light-profiles, noise volume-texture, etc ● Based on the technique presented by [Toth09]
  • 38. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Volumetric Lighting
  • 39. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ GPU Particles ● Yeah, we have GPU particles as well ● Compute Shader-based simulations of large amounts of particles ○ Screenspace collisions (test against depthbuffer) ○ Lots of different emitter types ○ Driven by prebaked 3D vector fields and other force-field types ○ Topic would fill another 45 minutes, so just a teaser
  • 40. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ GPU Particles
  • 41. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ Things for the future ● Physical Based Rendering ○ We already have a PBR renderpath, but a lot of content was already done, so it didn’t make it into LotF ● Re-introduce a pure z-prepass ○ Z-Layout done before G-Buffer ○ Reduces Overdraw and can use implicit alpha-test per depth-test=equal ○ Helps with decals ● Tools, tools tools ○ Optimized workflows, better tools and therefore faster iteration times are more important than more funky graphics effects
  • 42. Digital Dragons 2014 @philiphammer0 phammer@deck13.com http://www.deck13.com Thanks for listening! ...and special thanks to the amazing Deck13 tech-team
  • 43. Philip Hammer, The Rendering Technology of ‘Lords of the Fallen’ References [Mavridis12] "The Compact YCoCg Frame Buffer", Journal of Computer Graphics Techniques, Vol. 1, No. 1, 2012 [Lagarde12] “Local Image-based Lighting With Parallax-corrected Cubemap”, Siggraph, 2012 [Brisebois12] “Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look”, GDC 2011 http://dice.se/wp-content/uploads/Colin_BarreBrisebois_Programming_ApproximatingTranslucency.pdf [Drobot12] "Lighting of Killzone: Shadow Fall" http://de.slideshare.net/guerrillagames/lighting-of-killzone-shadow-fall [Toth09] “Real-time Volumetric Lighting in Participating Media”, Eurographics 2009 http://sirkan.iit.bme.hu/~szirmay/lightshaft.pdf