Transparency CISC 3620 May 15, 2017 Outline Reading Real-Time - - PowerPoint PPT Presentation

transparency
SMART_READER_LITE
LIVE PREVIEW

Transparency CISC 3620 May 15, 2017 Outline Reading Real-Time - - PowerPoint PPT Presentation

Transparency CISC 3620 May 15, 2017 Outline Reading Real-Time Rendering, 5.7 Semitransparent object View-based effects: semitransparent object itself is rendered Light-based effects: object causes light to be weakened or bent, which


slide-1
SLIDE 1

Transparency

CISC 3620 May 15, 2017

slide-2
SLIDE 2

Outline

slide-3
SLIDE 3

Reading

Real-Time Rendering, 5.7

slide-4
SLIDE 4

Semitransparent object

◮ View-based effects: semitransparent object itself is rendered ◮ Light-based effects: object causes light to be weakened or

bent, which causes other objects in the scene to be lit and rendered differently Simplest form: view-based: semitransparent object acts as color filter of the view of the objects behind it

slide-5
SLIDE 5

A-buffer

Depth of closest fragment is stored in Z-buffer Limitation: Only one object stored per pixel A-buffer: has “deep pixels” that store n fragments that are resolved to single pixel color after all objects are rendered Can also work with Z-buffer.

slide-6
SLIDE 6

Screen-door transparency

render semitransparent polygon with checkerboard fill pattern: render every other pixel, so object behind it is partially visible pixels on screen will be close enough together that checkerboard pattern itself is not visible.

slide-7
SLIDE 7

Screen-door transparency

◮ Faster ◮ Some visual quality is sacrificed ◮ Limits number of transparent objects that can be layered

slide-8
SLIDE 8

Alpha coverage

Transparency = how many samples inside pixels are covered Like screen-door transparency but at sub-pixel level Used to antialias edges of cutout textures:

◮ Suppose a fragment covers a pixel but is 25% transparent due

to cutout texture

◮ Render fragment as fully opaque, but covering only three of

the four samples

◮ No sorting necessary ◮ Object silhouette will hide objects behind it in consistent way

along its edges

slide-9
SLIDE 9

Alpha coverage

slide-10
SLIDE 10

Alpha test

Only allows for two levels of transparency: opaque or not (no translucency) Sorting not necessary

slide-11
SLIDE 11

Blending

Alpha value is used to combine color of 2+ fragments. Without blending: each new fragment overwrites existing colors in framebuffer With blending: combine color of old fragment and new fragment Let source RGBA color be: cs, destination color be cd Final blended color: co = αscs + (1 − αs)cd Requires sorting: first opaque objects rendered, then transparent

  • bjects blended on top in back to front order
slide-12
SLIDE 12

Blending

slide-13
SLIDE 13

Blending without sorting vs. depth peeling

slide-14
SLIDE 14

Depth peeling

Everitt, "Interactive order-independent transparency"

slide-15
SLIDE 15

Sorting

◮ Painter’s algorithm ◮ Z-buffer testing without z-depth replacement for transparent

  • bjects.

◮ Render transparent objects twice, first backfaces and then

frontfaces

◮ A-buffer: combine fragments in sorted order for high-quality

transparency

slide-16
SLIDE 16

Depth peeling

First render opaque surfaces, store depths in z-buffer Then render transparent surfaces with depth greater than in z-buffer but less than some threshold Then another pass with closer threshold Etc.

slide-17
SLIDE 17

Anti-aliasing

If opaque fragment covers 30% of screen grid cell, have alpha of 0.3, used to blend object’s edge with the scene.