0% found this document useful (0 votes)
7 views58 pages

Siggraph2016 Idtech6

The document outlines the technical requirements and processes involved in lighting and shading within a clustered structure for rendering. It includes pseudocode for computing lighting, detailing the world, and handling particle lighting, along with optimization strategies for data fetching. Additionally, it discusses dynamic resolution scaling and provides insights into future developments and hiring opportunities.

Uploaded by

obelardos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views58 pages

Siggraph2016 Idtech6

The document outlines the technical requirements and processes involved in lighting and shading within a clustered structure for rendering. It includes pseudocode for computing lighting, detailing the world, and handling particle lighting, along with optimization strategies for data fetching. Additionally, it discusses dynamic resolution scaling and provides insights into future developments and hiring opportunities.

Uploaded by

obelardos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

THE DEVIL IS IN THE DETAILS

Initial Requirements











Anatomy of a Frame
Frame Cost









Data Structure for Lighting & Shading









Preparing Clustered Structure




𝑠𝑙𝑖𝑐𝑒
𝐹𝑎𝑟𝑧
 𝑍𝑆𝑙𝑖𝑐𝑒 = 𝑁𝑒𝑎𝑟𝑧 × ( )𝑛𝑢𝑚 𝑠𝑙𝑖𝑐𝑒𝑠
𝑁𝑒𝑎𝑟𝑧





Preparing Clustered Structure






//Pseudo-code - 1 job per depth slice ( if any item )


for ( y = MinY; y < MaxY; ++y ) {
for ( x = MinX; x < MaxX; ++x ) {
intersects = N planes vs cell AABB
if ( intersects ) {
Register item
}
}
}
Preparing Clustered Structure













Preparing Clustered Structure
Preparing Clustered Structure
Detailing the World









Detailing the World












Detailing the World

 𝑒0 𝑒1

0.5 𝑒 𝑒
𝑠𝑖𝑧𝑒𝑋
0 0 0.5 𝑒0𝑥 𝑒1𝑥 2𝑥 𝑥
0
0.5
0 0.5 𝑒0𝑦 𝑒1𝑦 2𝑦 𝑦 𝑒
𝑠𝑖𝑧𝑒𝑌
0.5 𝑒0𝑧 𝑒1𝑧 2𝑧 𝑧
0 0 0.5
𝑠𝑖𝑧𝑒𝑍 0 0 0 1
0 0 0 1



const float4 albedo = tex2Dgrad( decalsAtlas, uv.xy * scaleBias.xy + scaleBias.zw, uvDDX, uvDDY );
Detailing the World











Detailing the World
Detailing the World
Detailing the World
Detailing the World
Detailing the World
Detailing the World
Lighting











Lighting

//Pseudocode

ComputeLighting( inputs, outputs ) {


Read & Pack base textures

for each decal in cell {


early out fragment check
Read textures
Blend results
}

for each light in cell {


early out fragment check
Compute BRDF / Apply Shadows
Accumulate lighting
}
}
Lighting












Lighting











Lighting



Lighting


 




 



Transparents







Particle Lighting











Decoupled Particle Lighting











Decoupled Particle Lighting

//Pseudocode – Particle shading becomes something like this

Particles( inputs, outputs ) {



const float3 lighting = tex2D( particleAtlas, inputs.texcoord );
result = lighting * inputs.albedo;

}
Decoupled Particle Lighting

 Particle Light Atlas









Decoupled Particle Lighting


Post-Process
Optimizing Data Fetching ( GCN )









Clustered Lighting Access Patterns
Clustered Lighting Access Patterns
Clustered Lighting Access Patterns
Clustered Lighting Access Patterns
Analyzing the Data








Leveraging Access Patterns





 Thread X A B D
Thread Y B C E

Thread Z A C D E




Scalar A B C D E
Special Paths











Dynamic Resolution Scaling










Async Post Processing










GCN Wave Limits Tuning








GCN Register Usage










What’s next ?








Special Thanks



We are Hiring !


Thank you





References














Bonus Slides
Lighting















Deferred Passes








You might also like