1
play

1 Ray Tracing - Bounding Volumes Ray Tracing - Bounding Volumes - PDF document

Computer Graphics as Virtual Photography real camera photo Photographic Photography: scene (captures processing print light) Ray Tracing: Intersection processing camera Computer 3D synthetic tone model Graphics: models image


  1. Computer Graphics as Virtual Photography real camera photo Photographic Photography: scene (captures processing print light) Ray Tracing: Intersection processing camera Computer 3D synthetic tone model Graphics: models image reproduction (focuses simulated lighting) Ray Tracing: Intersection Ray Tracing - Object - Ray Intersection • We only talked about ray intersection with spheres • For each ray, intersection test needs to be and planes made for each object • What about? – This could costly if you have many objects…consider if object has n polygons, n – Boxes very large! – Cylinders – Solutions – Cones • Adaptive Depth Control – Triangles • Bounding Volume – Spline surfaces • Spatial Subdivision – Irregular shapes Ray Tracing – Adaptive Depth Control Ray Tracing - Bounding Volumes • Place simple objects (i.e., sphere or box) • Indices of diffuse/reflection/refraction get around complex objects multiplied together as the ray tracer recurses – Suitability depends on object being enclosed! • Depending on material properties, this • Do initial intersection tests on bounding attenuation can get very small objects. • Keep running product and stop when below • If ray intersects bounding volume, then test a threshold complex bounded object • Can be nested 1

  2. Ray Tracing - Bounding Volumes Ray Tracing - Bounding Volumes [Watt/Watt,235] [Watt/Watt,236] Ray Tracing - Spatial Subdivision Ray Tracing - Spatial Subdivision • Motivation • Subdivide your scene volume into hierarchical – Without spatial subdivision, for each ray, you regions will need to query all objects/polygons and test – Octrees for intersection – BSP Trees – With spatial subdivision, you know which • Create a tree structure that indicates for each region: objects are in each volume so you only test – if the region is empty objects that are in the volumes where a ray is – the object present at that particular region traveling. • Test ray intersection with region volume Ray Tracing - Octrees Ray Tracing - Octrees • Recursively subdivide volume into equal regions. • If subregion is empty or contains a single object, then stop • Otherwise, further subdivide. • Continue until each subregion is empty or contains a single object. [Foley/Van Dam] 2

  3. Ray Tracing – Oct(quad)trees Ray Tracing - Oct(quad)trees • Subdivisions represented as a tree • Quadtree applet http://njord.umiacs.umd.edu:1601/users/brabec/qu adtree/points/pointquad.html [Watt/Watt,244] Ray Tracing -- Octrees Ray Tracing -- Octrees • Images from http://www.flipcode.com/tutorials/tut_octrees.shtml Ray Tracing -- Octrees Ray Tracing -- Octrees Shows viewing frustum and which “octants” need to be checked. 3

  4. Ray Tracing - BSP Trees Ray Tracing - Spatial Subdivision • Binary Space Partitioning Trees (BSP • Octrees vs BSP Trees Trees) – Like Octrees but divides space into a pair of subregions – Subregions need not be equally spaced – Planes separating regions can be placed at object boundaries. [Watt/Watt,246] Ray Tracing - BSP Trees Ray Tracing - BSP Trees • BSP Trees – Each non-terminal node represents a single • BSPTree applet partitioning plane that divides space in two http://symbolcraft.com/graphics/bsp/index.html [Watt/Watt,247] Ray Tracing - Spatial Subdivision Ray Tracing - Spatial Subdivision • Potential Problems - can double testing or miss small items • Advantages – Efficient means for finding objects within your space – Compact representation • Disadvantages – Preprocessing required – If scene changes, must rebuild your tree – Not foolproof [Watt/Watt,247] 4

  5. Ray Tracing - Spatial Subdivision • Octrees vs BSP trees – BSP Trees are generally more balanced than Octrees – BSP Traversal more efficient – BSP Trees have additional storage overhead as must store subdivision planes 5

Recommend


More recommend