Download - Inferred lighting
![Page 1: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/1.jpg)
inferred lighting :Handling Transparency
in Deferred Render system
OZhttp://ozlael.egloos.com
![Page 2: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/2.jpg)
Deferred Render System
normal depthresult
![Page 3: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/3.jpg)
Deferred Render System
● Transparency is usually solved by splitting the Rendering pipeline in two parts - Render opaque - Render transparent objects
● Lighting inconsistency problem● Split pipelines● Need same pipeline between opaque an
d transparence
![Page 4: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/4.jpg)
Deferred Rendering Transparencyin ShaderX7
alpha
G-buffer :Transparent only every odd horizontal line is rendered.
![Page 5: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/5.jpg)
Deferred Rendering Transparencyin ShaderX7
C0 = CsA + Cd(1-A) orC0 = Cd + (Cs-Cd)A
![Page 6: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/6.jpg)
Inferred lighting
● Extension of Light Pre-pass● Mixed resolution rendering :
G-Buffers and Lighting are done at a lower resolution that the final output pass.
● Use DSF filter● Same lit approach
![Page 7: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/7.jpg)
Inferred lighting
Geometry Pass: 800x450
Light Pass: 800x450Material Pass: 1280x720, 8x MSAA
N D DSF
![Page 8: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/8.jpg)
Discontinuity Sensitive Filtering(DSF)
Bilinear
DSF
![Page 9: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/9.jpg)
DSF Buffer
In 16bit -> Object/Instance ID & Normal Group ID
![Page 10: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/10.jpg)
DSF Buffer
Object/Instance ID
![Page 11: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/11.jpg)
DSF Buffer
Normal Group ID
![Page 12: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/12.jpg)
Up-Sample
Low Res.
High Res.
![Page 13: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/13.jpg)
Up-Sample
Low Res.
High Res.
![Page 14: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/14.jpg)
Up-Sample
Low Res.
High Res.X
a,b,c :same DSF ID
d : other DSF ID
![Page 15: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/15.jpg)
Handling Alpha Objects in Geometry Pass
G-Buffer into 2×2 quads
1 transparent3 opaques
transparencytransparency
opaque
![Page 16: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/16.jpg)
Handling Alpha Objects in Geometry Pass
G-Buffer into 2×2 quads
3 transparents1 opaque
![Page 17: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/17.jpg)
Handling Alpha Objects in Geometry Pass
Write stipple pattern
![Page 18: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/18.jpg)
Handling Alpha Objects in Geometry Pass
Alpha samples are lit same as opaque samples
![Page 19: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/19.jpg)
Handling Alpha Objects in Geometry Pass
DSF on opaque objects automatically ignores alpha samples: different DSF ID
![Page 20: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/20.jpg)
Handling Alpha Objects in Geometry Pass
Alpha object shader knows stipple pattern :Looks up proper sample locations in L-buffer
![Page 21: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/21.jpg)
Inferred lighting is the perfect one?
● Never!!!
![Page 22: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/22.jpg)
Dark side
● Transparents being lit at 1/4 resolution
Forward Render Inferred Render
![Page 23: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/23.jpg)
Dark side
● DSF filtering is not cheap● Incur higher base cost● Assign stipple patterns for 3 alpha lightin
g layers● Complex G-buffer reading at Post image
process● In the H/W early-Z between G-pass and
M-pass is impossible (back buffer size differ)
![Page 24: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/24.jpg)
Dark side
● Assign the appropriate normal ID
Different normal ID each faces
Same normal ID each faces
![Page 25: Inferred lighting](https://reader033.vdocument.in/reader033/viewer/2022052211/5561b0dfd8b42ae9708b55af/html5/thumbnails/25.jpg)
Question?