Download - Deferred rendering in Dying Light
![Page 1: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/1.jpg)
Deferred Rendering in Dying Light
![Page 2: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/2.jpg)
Agenda
Deferred shading - why?
G-Buffer
Questions?
![Page 3: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/3.jpg)
Deferred shading - why?
![Page 4: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/4.jpg)
Deferred shading - why?
>250K objects
![Page 5: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/5.jpg)
Deferred shading - why?
>250K objects
Multiple materials
![Page 6: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/6.jpg)
Deferred shading - why?
>250K objects
Multiple materials
Thousands of lights
![Page 7: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/7.jpg)
Deferred shading - why?
>250K objects
Multiple materials
Thousands of lights
Day-night cycle
![Page 8: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/8.jpg)
Deferred shading - why?
>250K objects
Multiple materials
Thousands of lights
Day-night cycle
Changing weather
![Page 9: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/9.jpg)
Deferred shading - why?
Deferred Shading vs Forward Rendering
● Separated scene and lighting rendering
SCENE
![Page 10: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/10.jpg)
Deferred shading - why?
Deferred Shading vs Forward Rendering
● Separated scene and lighting rendering○ G-Buffer
SCENE
![Page 11: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/11.jpg)
Deferred Shading vs Forward Rendering
● Separated scene and lighting rendering○ G-Buffer
● Improved lighting rendering performance○ Scene complexity independency
Deferred shading - why?
![Page 12: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/12.jpg)
Deferred Shading vs Forward Rendering
● Separated scene and lighting rendering○ G-Buffer
● Improved lighting rendering performance○ Scene complexity independency
○ Object material & geometry complexity independency
Deferred shading - why?
![Page 13: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/13.jpg)
Deferred shading - why?
Deferred Shading vs Forward Rendering
● Separated scene and lighting rendering○ G-Buffer
● Improved lighting rendering performance○ Scene complexity independency
○ Object material & geometry complexity independency
● Simpler rendering pipeline○ Easy light handling
![Page 14: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/14.jpg)
Deferred shading - why?
Deferred Shading vs Forward Rendering
● Separated scene and lighting rendering○ G-Buffer
● Improved lighting rendering performance○ Scene complexity independency
○ Object material & geometry complexity independency
● Simpler rendering pipeline○ Easy light handling
○ No material-light litght shader combinations
![Page 15: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/15.jpg)
Deferred shading - why?
Not only lights
● Complex materials
● Scene overdraw
● Consistency
● Lighting model independency
● Deferred Linear Space
![Page 16: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/16.jpg)
Deferred shading - why?
Not only lights
● Complex materials
● Scene overdraw
● Consistency
● Lighting model independency
● Deferred Linear Space
![Page 17: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/17.jpg)
Deferred shading - why?
Not only lights
● Complex materials
● Scene overdraw
● Consistency
● Lighting model independency
● Deferred Linear Space
![Page 18: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/18.jpg)
Deferred shading - why?
Not only lights
● Complex materials
● Scene overdraw
● Consistency
● Lighting model independency
● Deferred Linear Space
![Page 19: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/19.jpg)
Deferred shading - why?
Not only lights
● Complex materials
● Scene overdraw
● Consistency
● Lighting model independency
● Deferred Linear Space
![Page 20: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/20.jpg)
G-Buffer
![Page 21: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/21.jpg)
G-Buffer
LimitationsX Y Z W
R G B A
Z-Buffer
![Page 22: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/22.jpg)
G-Buffer
LimitationsX Y Z W
R G B A
![Page 23: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/23.jpg)
G-Buffer
Limitations
Needs (PBR)
X Y Z W
R G B A
Normal (XYZ)
Specular (RGB)
Diffuse (RGB)
Roughness
Human Skin Translucency Leaves
![Page 24: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/24.jpg)
G-Buffer
How?X Y Z W
R G B A
Normal (XYZ)
Specular (RGB)
Diffuse (RGB)
Roughness
Human Skin Translucency Leaves
?
![Page 25: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/25.jpg)
G-Buffer
How?
Solutions
● Lower resolution
X Y Z W
R G B A
Normal (XYZ)
Specular (RGB)
Diffuse (RGB)
Roughness
Human Skin Translucency Leaves
?
![Page 26: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/26.jpg)
G-Buffer
How?
Solutions
● Lower resolution
● Spherical Normals
X Y Z W
R G B A
Normal (XYZ)
Specular (RGB)
Diffuse (RGB)
Roughness
Human Skin Translucency Leaves
?
![Page 27: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/27.jpg)
G-Buffer
How?
Solutions
● Lower resolution
● Spherical Normals
● YUV
X Y Z W
R G B A
Normal (XYZ)
Specular (RGB)
Diffuse (RGB)
Roughness
Human Skin Translucency Leaves
?
![Page 28: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/28.jpg)
G-Buffer
How?
Solutions
● Lower resolution
● Spherical Normals
● YUV
● ?
X Y Z W
R G B A
Normal (XYZ)
Specular (RGB)
Diffuse (RGB)
Roughness
Human Skin Translucency Leaves
?
![Page 29: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/29.jpg)
G-Buffer
● Specular & Diffuse
![Page 30: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/30.jpg)
G-Buffer
● Specular & Diffuse
● PBR Materials○ Metals
○ Dielectrics
Specular Diffuse
Metals brightcolorful black
Dielectrics darkmonochromatic
full rangecolorful
![Page 31: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/31.jpg)
G-Buffer
● Specular & Diffuse
● PBR Materials○ Metals
○ Dielectrics
● Conclusions○ Metals needs only RGB
○ Dielectrics needs only RGB + Gray
○ Non-overlaping ranges
Specular Diffuse
Metals brightcolorful black
Dielectrics darkmonochromatic
full rangecolorful
![Page 32: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/32.jpg)
G-Buffer
● Specular & Diffuse
● PBR Materials○ Metals
○ Dielectrics
● Conclusions○ Metals needs only RGB
○ Dielectrics needs only RGB + Gray
○ Non-overlaping ranges
● PBR needs (real)
Specular Diffuse
Metals brightcolorful black
Dielectrics darkmonochromatic
full rangecolorful
RGB Alpha
Metal specular color 0 (black)
Dielectric diffuse color Dielectric specular
![Page 33: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/33.jpg)
G-Buffer
● Specular & Diffuse
● PBR Materials○ Metals
○ Dielectrics
● Conclusions○ Metals needs only RGB
○ Dielectrics needs only RGB + Gray
○ Non-overlaping ranges
● PBR needs (real)○ Lossless
Specular Diffuse
Metals brightcolorful black
Dielectrics darkmonochromatic
full rangecolorful
RGB Alpha
Metal specular color 0 (black)
Dielectric diffuse color Dielectric specular
![Page 34: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/34.jpg)
G-Buffer
● Encoding
rgb = dielectric ? diffuse.rgb : specular.rgb
alpha = dielectric ? specular.g : 0.0
![Page 35: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/35.jpg)
G-Buffer
● Encoding
rgb = dielectric ? diffuse.rgb : specular.rgb
alpha = dielectric ? specular.g : 0.0
● Decoding
Specular = (alpha > 0.0) ? alpha : rgb;
Diffuse = (alpha > 0.0) ? rgb : 0.0;
![Page 36: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/36.jpg)
G-Buffer
Specular & Diffuse
Normal (XYZ)
Specular (RGB)
Diffuse (RGB)
Roughness
Human Skin Translucency Leaves
![Page 37: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/37.jpg)
G-Buffer
Specular & Diffuse
Normal (XYZ)
Specular/Diffuse (RGB) Specular (SD)
Roughness
Human Skin Translucency Leaves
![Page 38: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/38.jpg)
G-Buffer
Specular & Diffuse
RoughnessNormal (XYZ)
Specular/Diffuse (RGB) Specular (SD)
Roughness
Human Skin Translucency Leaves
![Page 39: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/39.jpg)
G-Buffer
Specular & Diffuse
Roughness
Masks
● subsurface scattering
● dielectrics only
● binary values
● exclusive
Normal (XYZ) Roughness
Specular/Diffuse (RGB) Specular (SD)
Human Skin Translucency Leaves
![Page 40: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/40.jpg)
G-Buffer
Diffuse/Specular alpha channel - human skinNormal (XYZ) Roughness
Specular/Diffuse (RGB) Specular (SD)
Human Skin Translucency Leaves
![Page 41: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/41.jpg)
G-Buffer
Diffuse/Specular alpha channel - human skin
M Dielectric Specular
0 1 255
![Page 42: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/42.jpg)
G-Buffer
Diffuse/Specular alpha channel - human skin
M Dielectric Specular H
0 1 254 255
![Page 43: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/43.jpg)
G-Buffer
Diffuse/Specular alpha channel - translucency
● simple subsurface scattering
M Dielectric Specular H
0 1 254 255
![Page 44: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/44.jpg)
G-Buffer
Diffuse/Specular alpha channel - translucency
● simple subsurface scattering● varying specular
M Dielectric Specular H
0 1 254 255
![Page 45: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/45.jpg)
G-Buffer
Diffuse/Specular alpha channel - translucency
● simple subsurface scattering● varying specular● signed format?
M Dielectric Specular H
0 1 254 255
![Page 46: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/46.jpg)
G-Buffer
Diffuse/Specular alpha channel - translucency
● simple subsurface scattering● varying specular● signed format?● encoding/decoding - single mad instruction (alpha * 2.0 - 1.0)
H Translucent Dielectric Specular M M Dielectric Specular H
0 1 126 127 128 129 254 255
-1.0 0.0 1.0
![Page 47: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/47.jpg)
G-Buffer
Diffuse/Specular alpha channel - translucency
● simple subsurface scattering● varying specular● signed format?● encoding/decoding - single mad instruction (alpha * 2.0 - 1.0)● encoded specular inversion - abs()
H Translucent Dielectric Specular M M Dielectric Specular H
0 1 max min 126 127 128 129 min max 254 255
-1.0 0.0 1.0
![Page 48: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/48.jpg)
G-Buffer
Diffuse/Specular alpha channel - leaves
● simplified lighting for tree crowns
H Translucent Dielectric Specular M M Dielectric Specular H
0 1 max min 126 127 128 129 min max 254 255
-1.0 0.0 1.0
![Page 49: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/49.jpg)
G-Buffer
Diffuse/Specular alpha channel - leaves
● simplified lighting for tree crowns● no specular
H Translucent Dielectric Specular M M Dielectric Specular H
0 1 max min 126 127 128 129 min max 254 255
-1.0 0.0 1.0
![Page 50: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/50.jpg)
G-Buffer
Diffuse/Specular alpha channel - leaves
L Translucent Dielectric Specular M M Dielectric Specular H
0 1 max min 126 127 128 129 min max 254 255
-1.0 0.0 1.0
![Page 51: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/51.jpg)
Final layout (almost)Normal (XYZ) Roughness
Specular/Diffuse (RGB) M/SD/H/T/L
G-Buffer
![Page 52: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/52.jpg)
G-Buffer
Final layoutNormal (XYZ) M/SD/H/T/L
Specular/Diffuse (RGB) Roughness
![Page 53: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/53.jpg)
G-Buffer
Final layout - summary
● simple (en)coding Normal (XYZ) M/SD/H/T/L
Specular/Diffuse (RGB) Roughness
![Page 54: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/54.jpg)
G-Buffer
Final layout - summary
● simple (en)coding
● slim
Normal (XYZ) M/SD/H/T/L
Specular/Diffuse (RGB) Roughness
![Page 55: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/55.jpg)
G-Buffer
Final layout - summary
● simple (en)coding
● slim
● lossless
Normal (XYZ) M/SD/H/T/L
Specular/Diffuse (RGB) Roughness
![Page 56: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/56.jpg)
G-Buffer
Final layout - summary
● simple (en)coding
● slim
● lossless
● PBR correct
Normal (XYZ) M/SD/H/T/L
Specular/Diffuse (RGB) Roughness
![Page 57: Deferred rendering in Dying Light](https://reader034.vdocuments.site/reader034/viewer/2022042504/58f0d43a1a28abd9478b45cb/html5/thumbnails/57.jpg)
Questions?