VIII. Visibility algorithms (II)

Similar documents
Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Page 1. Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms

Computer Graphics. Bing-Yu Chen National Taiwan University

Identifying those parts of a scene that are visible from a chosen viewing position, and only process (scan convert) those parts

Spatial Data Structures

Visible Surface Detection Methods

Spatial Data Structures

Visible-Surface Detection Methods. Chapter? Intro. to Computer Graphics Spring 2008, Y. G. Shin

Spatial Data Structures

Advanced 3D-Data Structures

Spatial Data Structures

Computer Graphics II

Spatial Data Structures

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

9. Visible-Surface Detection Methods

Computer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura

Ray Tracing Acceleration Data Structures

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

Computing Visibility. Backface Culling for General Visibility. One More Trick with Planes. BSP Trees Ray Casting Depth Buffering Quiz

Solid Modeling. Thomas Funkhouser Princeton University C0S 426, Fall Represent solid interiors of objects

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Ray Tracing: Intersection

Werner Purgathofer

Accelerating Ray Tracing

Acceleration Data Structures

Intersection Acceleration

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Hidden surface removal. Computer Graphics

Overview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics

Announcements. Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday

8. Hidden Surface Elimination

Lecture 11: Ray tracing (cont.)

Ray Tracing. Foley & Van Dam, Chapters 15 and 16

Ray Tracing Foley & Van Dam, Chapters 15 and 16

Determination (Penentuan Permukaan Tampak)

CPSC GLOBAL ILLUMINATION

Ray Genealogy. Raytracing: Performance. Bounding Volumes. Bounding Volume. Acceleration Classification. Acceleration Classification

Collision Detection based on Spatial Partitioning

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CEng 477 Introduction to Computer Graphics Fall 2007

Sung-Eui Yoon ( 윤성의 )

CSE328 Fundamentals of Computer Graphics: Concepts, Theory, Algorithms, and Applications

Drawing the Visible Objects

Simulation in Computer Graphics Space Subdivision. Matthias Teschner

Lecture 25 of 41. Spatial Sorting: Binary Space Partitioning Quadtrees & Octrees

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

CHAPTER 1 Graphics Systems and Models 3

More Hidden Surface Removal

Today. CS-184: Computer Graphics. Lecture #10: Clipping and Hidden Surfaces. Clipping. Hidden Surface Removal

CS 563 Advanced Topics in Computer Graphics Culling and Acceleration Techniques Part 1 by Mark Vessella

MODELING AND HIERARCHY

CPSC / Sonny Chan - University of Calgary. Collision Detection II

More Visible Surface Detection. CS116B Chris Pollett Mar. 16, 2005.

The University of Calgary

8. Hidden Surface Elimination

CS488. Visible-Surface Determination. Luc RENAMBOT

Computer Graphics. Rendering. by Brian Wyvill University of Calgary. cpsc/enel P 1

Spatial Data Structures. Steve Rotenberg CSE168: Rendering Algorithms UCSD, Spring 2017

Visibility and Occlusion Culling

The Traditional Graphics Pipeline

Advanced Ray Tracing

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

Spatial Data Structures and Speed-Up Techniques. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

Ray-tracing Acceleration. Acceleration Data Structures for Ray Tracing. Shadows. Shadows & Light Sources. Antialiasing Supersampling.

Algorithms for GIS:! Quadtrees

Direct Rendering of Trimmed NURBS Surfaces

Hidden Surface Removal

Accelerated Raytracing

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

From Vertices To Fragments-1

Recursive Ray Tracing. Ron Goldman Department of Computer Science Rice University

INFOGR Computer Graphics. J. Bikker - April-July Lecture 11: Acceleration. Welcome!

Clipping. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Computer Graphics Ray Casting. Matthias Teschner

Speeding Up Ray Tracing. Optimisations. Ray Tracing Acceleration

Scene Management. Video Game Technologies 11498: MSc in Computer Science and Engineering 11156: MSc in Game Design and Development

Accelerating Ray-Tracing

Ray Tracing. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Implicit Surfaces & Solid Representations COS 426

Real-Time Rendering (Echtzeitgraphik) Dr. Michael Wimmer

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination

Ray Intersection Acceleration

The Traditional Graphics Pipeline

Collision and Proximity Queries

Hidden Surface Elimination: BSP trees

A Model to Evaluate Ray Tracing Hierarchies

The Traditional Graphics Pipeline

Real-Time Shadows. André Offringa Timo Laman

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Computer Graphics: 8-Hidden Surface Removal

MSBVH: An Efficient Acceleration Data Structure for Ray Traced Motion Blur

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination (Total: 100 marks)

Graphics and Interaction Rendering pipeline & object modelling

Today. Acceleration Data Structures for Ray Tracing. Cool results from Assignment 2. Last Week: Questions? Schedule

1999, Denis Zorin. Ray tracing

L1 - Introduction. Contents. Introduction of CAD/CAM system Components of CAD/CAM systems Basic concepts of graphics programming

Solid Modeling. Ron Goldman Department of Computer Science Rice University

Ray Tracing with Spatial Hierarchies. Jeff Mahovsky & Brian Wyvill CSC 305

Transcription:

VIII. Visibility algorithms (II)

Hybrid algorithsms: priority list algorithms Find the object visibility Combine the operations in object space (examples: comparisons and object partitioning) with operations in image space (example: scan conversion) The list of sorted objects is computed with the object precision => correct redrawing to any resolution

Depth sorting algorithm = Pictorial algorithm, Newell-Newell-Sancha alg. Assume a polygonal network representation Stages: 1. Sort the polygons in the increasing order of the minimum value of z of the vertices (sorting in object space) 2. Solve the ambiguities produced by the superimposing of z extensions (eventually polygonal partition; comparisons in image space) 3. Draw the polygons in the increasing order of the minimum values z of the vertices

Depth-sort algorithm 5 levels of testing for the second stage:

Depth-sort alg stage 2 (T4) Q in the same part with the observer relative to plane P => L=(,P,Q, ) otherwise (T5) (T5) The projections of P and Q are not intersection => L=(,P,Q, ) otherwise (T3 ) (T3 ) (T3) with inversed roles for P and Q (T4 ) (T4) with inversed roles for P and Q Otherwise Find the intersections edge by edge Replace the polygons in the list with its components

Example 1 (a) (T3) false, (T4) true; (b) (T3) true

Depth sort example 2 (a) (T3 ) is true (b) tests failed (c) mark a polygon to avoid infinite cycling due to the tests

Polygon positions

Depth sort algorithm

Depth sort algorithm

Alg. using binary tree for spatial patitioning (BSP) Recommended when the observer position is changing Idea: object group that is on the same side with the observer relative to the plane of a polygon can hide, but cannot be hidden by, other groups Partition the scene: tree BSP with internal nodes planes, terminal nodes space regions

BSP

BSP

BSP

Tree crossing Inorder to establish the polygon drawing priority (if the observer is in the frontal plane of the root, in an inversed order otherwise)

Ray-tracing algorithm Draw the visual rays (parametric) from the observer to the scene objects The window is divided: rectangular grid Assume the objects are opaque => each element from the grid is colored with the color of the first object that is intersected by the ray

Ray-tracing

Ray-tracing

Ray-tracing

Ray tracing algorithm select the projection center and the window from the projection plane for each scan line of the image do for each pixel of the scan line do find the ray from the projection center to the pixel for each object from the scene do if the object is intersected and is the closest until now then retain the intersection and object id set the pixel color to that of the closest object

Ray-tracing - problems The quantity of intersections to be checked Example: image 1024 x 1024 and 100 objects => 100 Mb for the intersections Solutions: 1. Optimize the intersection computations 2. Avoid the intersection computations

Optimize the intersection computations Bounding volume = convex polyhedron defined by plane pairs that enclose the object The ray does not intersect the bounded volume => the ray does not intersect the object The bounded volume is built such that the computations of the intersections between the ray and the volume are much easier to be done than the intersection with the object

Bounding volume and hierarchy

Bounding volumes

Avoid intersection computations Using pre-processing techniques for partitioning rays or objects in classes. These techniques are using: 1. Hierarchy 2. Partitioning 3. Modeling objects with CSG

Hierarchy Example: hierarchy of bounding volumes with the scene objects at the terminal nodes and the bounding volumes as internal nodes The ray is not intersecting a certain bounding volume => the ray is not intersecting the volumes of the children Organize the objects from details towards general

Hierarchy

Partitioning The volume that bounds the entire scene is divided in equal subvolumes Organizing from general to details Each partition has a list of contained objects Find the partitions that are passed by the ray Find the intersections of the ray with the objects from the traversed partitions Test the inclusion of the intersection to that partition

Partitioning To avoid the intersection computations with the same object in different partitions it is maintained a list of the intersections depending on the object In the case of non-uniform distribution of the objects it is necessary an adaptive partitioning (example: octrees) Partitioning + hierarchy => hierarchy with lists or 3d grids as the internal nodes

Partitioning

Static or adaptive partitioning

Static or adaptive partitioning

Hierarchical partitioning

Hierarchical partitioning

2d or binary partitioning

2d or binary partitioning

Modeling objects using CSG The intersection of the ray with the objects = dividing [0,1] in subintervals for t for which the ray is in/out of the object The object is obtained using Boolean operations => subintervals t are obtained applying the same operations on the intervals corresponding to the intersections with the primitives

Modeling objects through CSG

Supra-sampling The spatial aliasing appears if the sampling network has an insufficient resolution Solution: supra-sampling = usage of two or more rays that are corresponding to the same pixel the final color of the pixel is a men value Remark: the ray multiplication for 1 pixel with n leads to an increase of computational time x n

Supra-sampling

Supra-sampling variants Supra-sampling with rays that are passing through fixed positions (example: corners or the center of the area that represent the pixel) Stochastic supra-sampling (random arrays) Adaptive supra-sampling: Initial representation using 5 rays If the colors of the rays are close, compute the mean value Otherwise subdivide the aria in smaller regions and repeat the step for the new regions

Adaptive supra-sampling

Supra-sampling

Adaptive supra-sampling

Ray intersection with a sphere

Ray intersection with a sphere

Ray intersection with a sphere

Ray intersection with a sphere

Ray intersection with a sphere

Ray intersection with a sphere

Ray intersection with a plane

Ray intersection with a plane

Ray intersection with a parallelepiped Useful: compute intersections with bounding volumes

Ray intersection with a parallelepiped

Ray intersection with objects

Comparisons between visibility algorithms Criteria Sorting Coherence Efficiency Visualization Algorithm Depth-sort algorithm Scan-line algorithm Warnock s algorithm Z-buffer algorithm Scan-line algorithm Area subdivision algorithm Z-buffer algorithm Depth-sort algorithm Z-buffer algorithm Warnock s algorithm Scan-line algorithm Z-buffer algorithm BSP algorithm Case Zxy algorithm Yxz algorithm (xy)z algorithm (xyz) algorithm Line coherence Area coherence Depth coherence For small number of polygons Relative const.to the polygon no.variation Complex tests and computations Shadow or primitive chnging Interactive visualization system Static scene, mobile observer

Comparisons between algorithms