transparency
play

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


  1. Transparency CISC 3620 May 15, 2017

  2. Outline

  3. Reading Real-Time Rendering, 5.7

  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

  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.

  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.

  7. Screen-door transparency ◮ Faster ◮ Some visual quality is sacrificed ◮ Limits number of transparent objects that can be layered

  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

  9. Alpha coverage

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

  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: c s , destination color be c d Final blended color: c o = α s c s + (1 − α s ) c d Requires sorting : first opaque objects rendered, then transparent objects blended on top in back to front order

  12. Blending

  13. Blending without sorting vs. depth peeling

  14. Depth peeling Everitt, "Interactive order-independent transparency"

  15. Sorting ◮ Painter’s algorithm ◮ Z-buffer testing without z-depth replacement for transparent objects. ◮ Render transparent objects twice, first backfaces and then frontfaces ◮ A-buffer: combine fragments in sorted order for high-quality transparency

  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.

  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.

Recommend


More recommend