25
inferred lighting : Handling Transparency in Deferred Render system OZ http://ozlael.egloos.com

Inferred lighting

Embed Size (px)

DESCRIPTION

Inferred lighting

Citation preview

Page 1: Inferred lighting

inferred lighting :Handling Transparency

in Deferred Render system

OZhttp://ozlael.egloos.com

Page 2: Inferred lighting

Deferred Render System

normal depthresult

Page 3: Inferred lighting

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

Deferred Rendering Transparencyin ShaderX7

alpha

G-buffer :Transparent only every odd horizontal line is rendered.

Page 5: Inferred lighting

Deferred Rendering Transparencyin ShaderX7

C0 = CsA + Cd(1-A) orC0 = Cd + (Cs-Cd)A

Page 6: Inferred lighting

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

Inferred lighting

Geometry Pass: 800x450

Light Pass: 800x450Material Pass: 1280x720, 8x MSAA

N D DSF

Page 8: Inferred lighting

Discontinuity Sensitive Filtering(DSF)

Bilinear

DSF

Page 9: Inferred lighting

DSF Buffer

In 16bit -> Object/Instance ID & Normal Group ID

Page 10: Inferred lighting

DSF Buffer

Object/Instance ID

Page 11: Inferred lighting

DSF Buffer

Normal Group ID

Page 12: Inferred lighting

Up-Sample

Low Res.

High Res.

Page 13: Inferred lighting

Up-Sample

Low Res.

High Res.

Page 14: Inferred lighting

Up-Sample

Low Res.

High Res.X

a,b,c :same DSF ID

d : other DSF ID

Page 15: Inferred lighting

Handling Alpha Objects in Geometry Pass

G-Buffer into 2×2 quads

1 transparent3 opaques

transparencytransparency

opaque

Page 16: Inferred lighting

Handling Alpha Objects in Geometry Pass

G-Buffer into 2×2 quads

3 transparents1 opaque

Page 17: Inferred lighting

Handling Alpha Objects in Geometry Pass

Write stipple pattern

Page 18: Inferred lighting

Handling Alpha Objects in Geometry Pass

Alpha samples are lit same as opaque samples

Page 19: Inferred lighting

Handling Alpha Objects in Geometry Pass

DSF on opaque objects automatically ignores alpha samples: different DSF ID

Page 20: Inferred lighting

Handling Alpha Objects in Geometry Pass

Alpha object shader knows stipple pattern :Looks up proper sample locations in L-buffer

Page 21: Inferred lighting

Inferred lighting is the perfect one?

● Never!!!

Page 22: Inferred lighting

Dark side

● Transparents being lit at 1/4 resolution

Forward Render Inferred Render

Page 23: Inferred lighting

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

Dark side

● Assign the appropriate normal ID

Different normal ID each faces

Same normal ID each faces

Page 25: Inferred lighting

Question?