inferred lighting :
  Handling Transparency
in Deferred Render system


                  OZ
       http://ozlael.egloos.com
Deferred Render System

result   normal    depth
Deferred Render System
●   Transparency is usually solved by splittin
    g the Rendering pipeline in two parts
     - Render opaque
     - Render transparent objects
●   Lighting inconsistency problem
●   Split pipelines
●   Need same pipeline between opaque an
    d transparence
Deferred Rendering Transparency
          in ShaderX7


                  alpha


                 G-buffer :
                 Transparent only every odd
                 horizontal line is rendered.
Deferred Rendering Transparency
          in ShaderX7




   C0 = CsA + Cd(1-A) or
   C0 = Cd + (Cs-Cd)A
Inferred lighting
●   Extension of Light Pre-pass
●
    Mixed resolution rendering :
    G-Buffers and Lighting are done at a lower resolut
    ion that the final output pass.
●   Use DSF filter
●
    Same lit approach
Inferred lighting

N                   D                  DSF



Geometry Pass: 800x450




    Light Pass: 800x450
                          Material Pass: 1280x720, 8x MSAA
Discontinuity Sensitive Filtering
             (DSF)
Bilinear




DSF
DSF Buffer
In 16bit -> Object/Instance ID & Normal Group ID
DSF Buffer
Object/Instance ID
DSF Buffer
Normal Group ID
Up-Sample




            High Res.

            Low Res.
Up-Sample




            High Res.

            Low Res.
Up-Sample


a,b,c :
same DSF ID
                  X
d:                         High Res.
other DSF ID
                           Low Res.
Handling Alpha Objects
      in Geometry Pass
G-Buffer into
2×2 quads              transparency

1 transparent          opaque
3 opaques
Handling Alpha Objects
      in Geometry Pass
G-Buffer into
2×2 quads

3 transparents
1 opaque
Handling Alpha Objects
       in Geometry Pass
Write stipple pattern
Handling Alpha Objects
       in Geometry Pass
Alpha samples are lit same as opaque samples
Handling Alpha Objects
       in Geometry Pass
DSF on opaque objects automatically ignores alpha samples
: different DSF ID
Handling Alpha Objects
       in Geometry Pass
Alpha object shader knows stipple pattern :
Looks up proper sample locations in L-buffer
Inferred lighting
          is the perfect one?
●   Never!!!
Dark side
●   Transparents being lit at 1/4 resolution




       Forward Render          Inferred Render
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 di
    ffer)
Dark side
●   Assign the appropriate normal ID




    Different normal ID   Same normal ID
    each faces            each faces
Question?

Inferred lighting