50
Chapter Six - Systems Design One Thread, Multiple Threads One Thread, Multiple Threads 147 147 With One Thread . . . With One Thread . . . 147 147 With Multiple With Multiple Threads . . . 152 Threads . . . 152 Important Subsystems 156 Important Subsystems 156 Real-Time Rendering: Real-Time Rendering: Polygon Culling and Polygon Culling and Level-of-Detail Level-of-Detail Processing 157 Processing 157 Real-Time Collision Real-Time Collision Detection and Response Detection and Response 165 165 Computational Resource Computational Resource Management 174 Management 174

Chapter Six - Systems Design One Thread, Multiple Threads 147 With One Thread... 147With One Thread... 147 With Multiple Threads... 152With Multiple Threads

Embed Size (px)

Citation preview

Chapter Six - Systems DesignOne Thread, Multiple One Thread, Multiple Threads 147Threads 147

• With One Thread . . . 147With One Thread . . . 147

• With Multiple Threads . . . With Multiple Threads . . . 152152

One Thread, Multiple One Thread, Multiple Threads 147Threads 147

• With One Thread . . . 147With One Thread . . . 147

• With Multiple Threads . . . With Multiple Threads . . . 152152

Important Subsystems 156Important Subsystems 156

• Real-Time Rendering: Real-Time Rendering: Polygon Culling and Level-Polygon Culling and Level-of-Detail Processing 157of-Detail Processing 157

• Real-Time Collision Real-Time Collision Detection and Response Detection and Response 165165

• Computational Resource Computational Resource Management 174Management 174

Important Subsystems 156Important Subsystems 156

• Real-Time Rendering: Real-Time Rendering: Polygon Culling and Level-Polygon Culling and Level-of-Detail Processing 157of-Detail Processing 157

• Real-Time Collision Real-Time Collision Detection and Response Detection and Response 165165

• Computational Resource Computational Resource Management 174Management 174

Chapter Six - Systems DesignConclusion 175Conclusion 175

References and Further References and Further Reading 176Reading 176

Conclusion 175Conclusion 175

References and Further References and Further Reading 176Reading 176

The reading collection at The reading collection at the back of this chapter is the back of this chapter is key to really being able to key to really being able to build a net-VE system.build a net-VE system.

The reading collection at The reading collection at the back of this chapter is the back of this chapter is key to really being able to key to really being able to build a net-VE system.build a net-VE system.

What does VR software look like?

One Thread, Multiple ThreadsOne Thread, Multiple Threads

Important SubsystemsImportant Subsystems

• Real-Time Rendering - Polygon Culling & Level of Real-Time Rendering - Polygon Culling & Level of Detail ProcessingDetail Processing

• Real-Time Collision Detection and ResponseReal-Time Collision Detection and Response

• Computational Resource ManagementComputational Resource Management

• Interaction ManagementInteraction Management

One Thread, Multiple ThreadsOne Thread, Multiple Threads

Important SubsystemsImportant Subsystems

• Real-Time Rendering - Polygon Culling & Level of Real-Time Rendering - Polygon Culling & Level of Detail ProcessingDetail Processing

• Real-Time Collision Detection and ResponseReal-Time Collision Detection and Response

• Computational Resource ManagementComputational Resource Management

• Interaction ManagementInteraction Management

Single ThreadNet-VE

Initializations

Read Input Devices

Compute State Changes from Inputs

Compute State Changes from Net Reads

Read Network

Computational Modeling

Post State Changes to the Network

Generate New Picture

Figure 6-1 A single thread networked virtual environment.

Input Device Connections to the Workstation

Sources for Lag - Input Devices

Generatenew picture

Post statechanges tonet

ComputationalModeling

Compute statechanges fromnet reads

Read network

Compute statechanges frominputs

Read inputdevices

SharedMemory

Figure 6-4 Multiple subsystems, multiple threads for the virtual world.

Input Subsystem

Net Read Subsystem

Modeling Subsystem

DisplaySubsystem

Net WriteSubsystem

Real-Time Rendering - Polygon Culling & LODs

The “Generate New Picture” box on the The “Generate New Picture” box on the previous slide is somewhat misleading.previous slide is somewhat misleading.

• It is not that simple unless we have unlimited graphics It is not that simple unless we have unlimited graphics power. We usually don’t.power. We usually don’t.

• Most of the time we are trying to solve the Polygon Culling Most of the time we are trying to solve the Polygon Culling Problem. Problem.

– We try to use available CPU cycles to throw away most of We try to use available CPU cycles to throw away most of our 3D model before we send it through the graphics our 3D model before we send it through the graphics pipeline ...pipeline ...

The “Generate New Picture” box on the The “Generate New Picture” box on the previous slide is somewhat misleading.previous slide is somewhat misleading.

• It is not that simple unless we have unlimited graphics It is not that simple unless we have unlimited graphics power. We usually don’t.power. We usually don’t.

• Most of the time we are trying to solve the Polygon Culling Most of the time we are trying to solve the Polygon Culling Problem. Problem.

– We try to use available CPU cycles to throw away most of We try to use available CPU cycles to throw away most of our 3D model before we send it through the graphics our 3D model before we send it through the graphics pipeline ...pipeline ...

Real-Time Rendering: Polygon Culling and Level-of-Detail Processing

But we are about to get graphics engines that But we are about to get graphics engines that run over 100M polygons per second, some run over 100M polygons per second, some planning beyond 300M+ polygons per second planning beyond 300M+ polygons per second so maybe this becomes less of a problem ...so maybe this becomes less of a problem ...

But we are about to get graphics engines that But we are about to get graphics engines that run over 100M polygons per second, some run over 100M polygons per second, some planning beyond 300M+ polygons per second planning beyond 300M+ polygons per second so maybe this becomes less of a problem ...so maybe this becomes less of a problem ...

Hierarchical Data Structures for Polygon Culling• The classic reference for this is the 1976 paper by The classic reference for this is the 1976 paper by

James Clark “Hierarchical Geometric Models for James Clark “Hierarchical Geometric Models for Visible Surface Algorithms”.Visible Surface Algorithms”.

• The idea in the Clark paper is to build a The idea in the Clark paper is to build a hierarchical data structure for the displayable hierarchical data structure for the displayable world ...world ...

• The classic reference for this is the 1976 paper by The classic reference for this is the 1976 paper by James Clark “Hierarchical Geometric Models for James Clark “Hierarchical Geometric Models for Visible Surface Algorithms”.Visible Surface Algorithms”.

• The idea in the Clark paper is to build a The idea in the Clark paper is to build a hierarchical data structure for the displayable hierarchical data structure for the displayable world ...world ...

Hierarchical Data Structure for the Displayable World

World (complete building model):View volume definitionView point, reference pointBounding Volume (BV)

Floor 1:BV

Floor 2:BV

Floor n:BV

Rm1,1 Rm1,2 Rm 1,3 Rm2,1 Rm2,2 Rm2,3Rmn,1 Rmn,2 Rmn,3

. . .

Minimal set of polygons

Medium set of polygons

Complete set of polygons

BV BV BV BV BV BVBV BV BV

Part 1 of the Clark Paper• We build a data structure that allows us to rapidly We build a data structure that allows us to rapidly

throw away most of the data for the world.throw away most of the data for the world.

• We test the hierarchical bounding volumes to see We test the hierarchical bounding volumes to see if they are contained or partially contained in the if they are contained or partially contained in the current orientation of the view volume.current orientation of the view volume.

• If they are and are leaves in the tree, we draw If they are and are leaves in the tree, we draw them or continue our traversal.them or continue our traversal.

• We build a data structure that allows us to rapidly We build a data structure that allows us to rapidly throw away most of the data for the world.throw away most of the data for the world.

• We test the hierarchical bounding volumes to see We test the hierarchical bounding volumes to see if they are contained or partially contained in the if they are contained or partially contained in the current orientation of the view volume.current orientation of the view volume.

• If they are and are leaves in the tree, we draw If they are and are leaves in the tree, we draw them or continue our traversal.them or continue our traversal.

Part 2 of the Clark Paper• We only send the minimal required description of We only send the minimal required description of

our object through the graphics pipeline.our object through the graphics pipeline.

• We use the distance from the viewer to the We use the distance from the viewer to the BV/object to determine which resolution of our BV/object to determine which resolution of our objects to display, basically the pixel coverage of objects to display, basically the pixel coverage of the final drawn object.the final drawn object.

• This presupposes multiple resolution versions of This presupposes multiple resolution versions of each room.each room.

• We only send the minimal required description of We only send the minimal required description of our object through the graphics pipeline.our object through the graphics pipeline.

• We use the distance from the viewer to the We use the distance from the viewer to the BV/object to determine which resolution of our BV/object to determine which resolution of our objects to display, basically the pixel coverage of objects to display, basically the pixel coverage of the final drawn object.the final drawn object.

• This presupposes multiple resolution versions of This presupposes multiple resolution versions of each room.each room.

View Volume• We can decide rather quickly whether our BV is in We can decide rather quickly whether our BV is in

the High, Medium or Low resolution sections.the High, Medium or Low resolution sections.

– Transform the BVs with the far clipping plane moved Transform the BVs with the far clipping plane moved closer.closer.

– Clip into memory and make the decision (or perform this Clip into memory and make the decision (or perform this test in the CPU, if there are spare cycles).test in the CPU, if there are spare cycles).

– We will end up with a list of BVs that should be displayed We will end up with a list of BVs that should be displayed and a resolution at which they should be displayed.and a resolution at which they should be displayed.

• We can decide rather quickly whether our BV is in We can decide rather quickly whether our BV is in the High, Medium or Low resolution sections.the High, Medium or Low resolution sections.

– Transform the BVs with the far clipping plane moved Transform the BVs with the far clipping plane moved closer.closer.

– Clip into memory and make the decision (or perform this Clip into memory and make the decision (or perform this test in the CPU, if there are spare cycles).test in the CPU, if there are spare cycles).

– We will end up with a list of BVs that should be displayed We will end up with a list of BVs that should be displayed and a resolution at which they should be displayed.and a resolution at which they should be displayed.

View VolumeThis the view volume This the view volume cut into three regions cut into three regions or “levels of detail” or “levels of detail” (LOD).(LOD).

This the view volume This the view volume cut into three regions cut into three regions or “levels of detail” or “levels of detail” (LOD).(LOD).

Viewer

Near

Far

HighRes.

MediumResolution

LowResolution

How do we compute different LODs for our models?

This depends on the origins of our models...This depends on the origins of our models...

• By hand - we do this by hand in our modeling tool, By hand - we do this by hand in our modeling tool, throwing away small polygons for the Low throwing away small polygons for the Low resolution versions of our models.resolution versions of our models.

– Some modeling tools will do this semi-Some modeling tools will do this semi-automatically. They give you a cut at it and you automatically. They give you a cut at it and you can add polygons back in.can add polygons back in.

This depends on the origins of our models...This depends on the origins of our models...

• By hand - we do this by hand in our modeling tool, By hand - we do this by hand in our modeling tool, throwing away small polygons for the Low throwing away small polygons for the Low resolution versions of our models.resolution versions of our models.

– Some modeling tools will do this semi-Some modeling tools will do this semi-automatically. They give you a cut at it and you automatically. They give you a cut at it and you can add polygons back in.can add polygons back in.

How do we compute different LODs for our models?• Triangular decimation - a triangular mesh is fitted Triangular decimation - a triangular mesh is fitted

to your model and an appropriate algorithm is to your model and an appropriate algorithm is used to reduce the total number of triangles in used to reduce the total number of triangles in the model.the model.

– There is some very nice work on this by Greg There is some very nice work on this by Greg Turk and Hughe Hoppe and others...Turk and Hughe Hoppe and others...

• Triangular decimation - a triangular mesh is fitted Triangular decimation - a triangular mesh is fitted to your model and an appropriate algorithm is to your model and an appropriate algorithm is used to reduce the total number of triangles in used to reduce the total number of triangles in the model.the model.

– There is some very nice work on this by Greg There is some very nice work on this by Greg Turk and Hughe Hoppe and others...Turk and Hughe Hoppe and others...

Airey, Rohlf & Brooks Paper• Precomputation of Precomputation of

a hierarchical data a hierarchical data structure for a structure for a building.building.

• Precomputation of Precomputation of a hierarchical data a hierarchical data structure for a structure for a building.building.

Airey, Rohlf & Brooks Paper - Study of Architectural DBs• The model is changed much less often than the The model is changed much less often than the

viewpoint.viewpoint.

– Means pre-processing the database (display compiler) is Means pre-processing the database (display compiler) is possible.possible.

– We could possibly make changes to the big data We could possibly make changes to the big data structure as we added new building components.structure as we added new building components.

– Perhaps the real-time data structure is updated in Perhaps the real-time data structure is updated in parallel. During the “think time” of the engineer at the parallel. During the “think time” of the engineer at the workstation.workstation.

• The model is changed much less often than the The model is changed much less often than the viewpoint.viewpoint.

– Means pre-processing the database (display compiler) is Means pre-processing the database (display compiler) is possible.possible.

– We could possibly make changes to the big data We could possibly make changes to the big data structure as we added new building components.structure as we added new building components.

– Perhaps the real-time data structure is updated in Perhaps the real-time data structure is updated in parallel. During the “think time” of the engineer at the parallel. During the “think time” of the engineer at the workstation.workstation.

Airey, Rohlf & Brooks Paper - Study of Architectural DBs• Many buildings have high average depth Many buildings have high average depth

complexity.complexity.

– Any image computed from an interior viewpoint Any image computed from an interior viewpoint will have many surfaces covering each pixel.will have many surfaces covering each pixel.

– Much of the model contributes NOTHING to any Much of the model contributes NOTHING to any given image.given image.

• Many buildings have high average depth Many buildings have high average depth complexity.complexity.

– Any image computed from an interior viewpoint Any image computed from an interior viewpoint will have many surfaces covering each pixel.will have many surfaces covering each pixel.

– Much of the model contributes NOTHING to any Much of the model contributes NOTHING to any given image.given image.

Airey, Rohlf & Brooks Paper - Study of Architectural DBs• Most polygons are axial.Most polygons are axial.

– They are parallel to 2 of the coordinate axes.They are parallel to 2 of the coordinate axes.

– Most polygons are rectangles.Most polygons are rectangles.

• Most polygons are axial.Most polygons are axial.

– They are parallel to 2 of the coordinate axes.They are parallel to 2 of the coordinate axes.

– Most polygons are rectangles.Most polygons are rectangles.

Airey, Rohlf & Brooks Paper - Study of Architectural DBs• The set of polygons that appears in each view The set of polygons that appears in each view

changes slowly as the viewpoint moves.changes slowly as the viewpoint moves.

– Except when crossing certain thresholds.Except when crossing certain thresholds.

∆ Doors, windows --> portals.Doors, windows --> portals.

• The set of polygons that appears in each view The set of polygons that appears in each view changes slowly as the viewpoint moves.changes slowly as the viewpoint moves.

– Except when crossing certain thresholds.Except when crossing certain thresholds.

∆ Doors, windows --> portals.Doors, windows --> portals.

Airey, Rohlf & Brooks Paper - Study of Architectural DBs• We can possibly have the notion of a “working We can possibly have the notion of a “working

set” of bounding volumes.set” of bounding volumes.

– Based on a viewpoint.Based on a viewpoint.

– Also see this in the Clark paper.Also see this in the Clark paper.

– We could just incrementally add/subtract We could just incrementally add/subtract branches of our tree based on view point branches of our tree based on view point changes.changes.

• We can possibly have the notion of a “working We can possibly have the notion of a “working set” of bounding volumes.set” of bounding volumes.

– Based on a viewpoint.Based on a viewpoint.

– Also see this in the Clark paper.Also see this in the Clark paper.

– We could just incrementally add/subtract We could just incrementally add/subtract branches of our tree based on view point branches of our tree based on view point changes.changes.

Airey, Rohlf & Brooks Paper - Study of Architectural DBs• This means that when we organize our data, our This means that when we organize our data, our

data inside one bounding volume should be co-data inside one bounding volume should be co-located in CPU memory.located in CPU memory.

– To make best use of the virtual memory To make best use of the virtual memory system.system.

• This means that when we organize our data, our This means that when we organize our data, our data inside one bounding volume should be co-data inside one bounding volume should be co-located in CPU memory.located in CPU memory.

– To make best use of the virtual memory To make best use of the virtual memory system.system.

Portals and Viewpoints ...• We have the We have the

notion of notion of viewpoints at viewpoints at portals being portals being indicators that we indicators that we need to swap in need to swap in major new blocks major new blocks of data.of data.

• We have the We have the notion of notion of viewpoints at viewpoints at portals being portals being indicators that we indicators that we need to swap in need to swap in major new blocks major new blocks of data.of data.

Room 1

Room 2 Room 3

x = 1

y = 1

y = 2

v1

v2

v3Blue wall Red wallA

B

Airey, Rohlf & Brooks Paper - Study of Architectural DBs• Large planar surfaces are often structured into Large planar surfaces are often structured into

multiple, co-planar levels for modeling purposes, multiple, co-planar levels for modeling purposes, shading purposes and realism purposes.shading purposes and realism purposes.

– Large walls that cross several rooms might be stored as Large walls that cross several rooms might be stored as multiple polygons of different color.multiple polygons of different color.

– Perhaps BV-wise, we could use the larger wall better Perhaps BV-wise, we could use the larger wall better than the smaller components.than the smaller components.

– Notion of somehow taking advantage of such dividing Notion of somehow taking advantage of such dividing planes in building our tree structure.planes in building our tree structure.

• Large planar surfaces are often structured into Large planar surfaces are often structured into multiple, co-planar levels for modeling purposes, multiple, co-planar levels for modeling purposes, shading purposes and realism purposes.shading purposes and realism purposes.

– Large walls that cross several rooms might be stored as Large walls that cross several rooms might be stored as multiple polygons of different color.multiple polygons of different color.

– Perhaps BV-wise, we could use the larger wall better Perhaps BV-wise, we could use the larger wall better than the smaller components.than the smaller components.

– Notion of somehow taking advantage of such dividing Notion of somehow taking advantage of such dividing planes in building our tree structure.planes in building our tree structure.

Airey, Rohlf & Brooks Paper - Study of Architectural DBs• For viewpoints inside the building, the role of For viewpoints inside the building, the role of

surface interreflections in shading calculations is surface interreflections in shading calculations is very important for spatial comprehension.very important for spatial comprehension.

– In the Airey system, there is an adaptive radiosity display In the Airey system, there is an adaptive radiosity display algorithm.algorithm.

– When the viewpoint is not changing, the better radiosity When the viewpoint is not changing, the better radiosity view id displayed.view id displayed.

∆ An adaptive system. Put up more detail when the An adaptive system. Put up more detail when the system is not moving.system is not moving.

• For viewpoints inside the building, the role of For viewpoints inside the building, the role of surface interreflections in shading calculations is surface interreflections in shading calculations is very important for spatial comprehension.very important for spatial comprehension.

– In the Airey system, there is an adaptive radiosity display In the Airey system, there is an adaptive radiosity display algorithm.algorithm.

– When the viewpoint is not changing, the better radiosity When the viewpoint is not changing, the better radiosity view id displayed.view id displayed.

∆ An adaptive system. Put up more detail when the An adaptive system. Put up more detail when the system is not moving.system is not moving.

Model Space Subdivision• How UNC builds its data structures for display.How UNC builds its data structures for display.

• The use a Display compiler.The use a Display compiler.

– Automatically subdivide their database into Automatically subdivide their database into cells based on the union of “potentially visible cells based on the union of “potentially visible sets” (PVSs) for any viewpoint in a cell.sets” (PVSs) for any viewpoint in a cell.

– Viewpoint --> which cell to displayViewpoint --> which cell to display

– That cell contains potentially visible That cell contains potentially visible information.information.

• How UNC builds its data structures for display.How UNC builds its data structures for display.

• The use a Display compiler.The use a Display compiler.

– Automatically subdivide their database into Automatically subdivide their database into cells based on the union of “potentially visible cells based on the union of “potentially visible sets” (PVSs) for any viewpoint in a cell.sets” (PVSs) for any viewpoint in a cell.

– Viewpoint --> which cell to displayViewpoint --> which cell to display

– That cell contains potentially visible That cell contains potentially visible information.information.

Model Space Subdivision• A cell is a room plus any potentially visible A cell is a room plus any potentially visible

polygons, polygons visible through portals.polygons, polygons visible through portals.

• Computing PVSs is a hard problem.Computing PVSs is a hard problem.

• For any viewpoint, we must display the polygons For any viewpoint, we must display the polygons for the room plus any possibly visible ones for the room plus any possibly visible ones through any doors/portals.through any doors/portals.

• A cell is a room plus any potentially visible A cell is a room plus any potentially visible polygons, polygons visible through portals.polygons, polygons visible through portals.

• Computing PVSs is a hard problem.Computing PVSs is a hard problem.

• For any viewpoint, we must display the polygons For any viewpoint, we must display the polygons for the room plus any possibly visible ones for the room plus any possibly visible ones through any doors/portals.through any doors/portals.

Binary Space Partitioning• Airey used a BSP-tree as the data structure for his Airey used a BSP-tree as the data structure for his

building models.building models.

• His paper describes how to automatically choose His paper describes how to automatically choose dividing planes.dividing planes.

• Use the biggest polygon, the ones with the most Use the biggest polygon, the ones with the most occlusion potential.occlusion potential.

• Airey used a BSP-tree as the data structure for his Airey used a BSP-tree as the data structure for his building models.building models.

• His paper describes how to automatically choose His paper describes how to automatically choose dividing planes.dividing planes.

• Use the biggest polygon, the ones with the most Use the biggest polygon, the ones with the most occlusion potential.occlusion potential.

Binary Space Partitioning

y = 1

x = 1 Room 1

Room 2 Room 3

ViewpointUse the equation of a planein 3-space to determine whichtree branch to follow.

PVS Description:Polygons of the room +polygons visible through portals.

A

B

Room 1

Room 2 Room 3

x = 1

y = 1

y = 2

v1

v2

v3Blue wall Red wallA

B

Partition Priority for Polygons• One of the key problems in model space One of the key problems in model space

subdivision is determining which are the best subdivision is determining which are the best planes for splitting the geometric database.planes for splitting the geometric database.

• Airey came up with the idea of a “partition Airey came up with the idea of a “partition priority” for any polygon.priority” for any polygon.

• One of the key problems in model space One of the key problems in model space subdivision is determining which are the best subdivision is determining which are the best planes for splitting the geometric database.planes for splitting the geometric database.

• Airey came up with the idea of a “partition Airey came up with the idea of a “partition priority” for any polygon.priority” for any polygon.

partition priorityfor any polygon(used to determinebest plane for splittingthe database.)

= 0.5 * occlusion + 0.3 * balance + 0.2 * split

The biggest knownpolygons with bestocclusion potentialare weighted themost.

BSP-treebalance, i.e.1/2 polygonsare on eachside of thedividing polygon.

Sometimes mustcut polygons bythe dividing plane(want to minimzethat.)

Summary of Model Subdivision Results

Optimal Number of Polygons Per Cell?• What is the optimal number of polygons per cell?What is the optimal number of polygons per cell?

– 200 to 300 polygons per cell seems good for 200 to 300 polygons per cell seems good for this system.this system.

• What is the optimal number of polygons per cell?What is the optimal number of polygons per cell?

– 200 to 300 polygons per cell seems good for 200 to 300 polygons per cell seems good for this system.this system.

Optimal Number of Polygons Per Cell?• The number of polygons per cell is determined by The number of polygons per cell is determined by

the graphics hardware’s fill capability and by the the graphics hardware’s fill capability and by the CPU capability.CPU capability.

– CPU capability is how long it takes to throw CPU capability is how long it takes to throw things away.things away.

– i.e. how long does it take us to compute which i.e. how long does it take us to compute which cells to display.cells to display.

• The number of polygons per cell is determined by The number of polygons per cell is determined by the graphics hardware’s fill capability and by the the graphics hardware’s fill capability and by the CPU capability.CPU capability.

– CPU capability is how long it takes to throw CPU capability is how long it takes to throw things away.things away.

– i.e. how long does it take us to compute which i.e. how long does it take us to compute which cells to display.cells to display.

Papers Useful for Walkthrough• (1) 1976 CACM Clark, James H. “Hierarchical (1) 1976 CACM Clark, James H. “Hierarchical

Geometric Models for Visible Surface Algorithms”Geometric Models for Visible Surface Algorithms”

• (2) Fuchs “Near-Real-Time Shaded Display of (2) Fuchs “Near-Real-Time Shaded Display of Rigid Objects” - BSP-tree fundamentals. Rigid Objects” - BSP-tree fundamentals. SIGGRAPH ?SIGGRAPH ?

• (3) Brooks - 1986 Workshop on Interactive 3D (3) Brooks - 1986 Workshop on Interactive 3D Graphics - Early thoughts on walkthroughs. Graphics - Early thoughts on walkthroughs. “Walkthrough - A Dynamic Graphics System for “Walkthrough - A Dynamic Graphics System for Simulating Virtual Buildings”Simulating Virtual Buildings”

• (1) 1976 CACM Clark, James H. “Hierarchical (1) 1976 CACM Clark, James H. “Hierarchical Geometric Models for Visible Surface Algorithms”Geometric Models for Visible Surface Algorithms”

• (2) Fuchs “Near-Real-Time Shaded Display of (2) Fuchs “Near-Real-Time Shaded Display of Rigid Objects” - BSP-tree fundamentals. Rigid Objects” - BSP-tree fundamentals. SIGGRAPH ?SIGGRAPH ?

• (3) Brooks - 1986 Workshop on Interactive 3D (3) Brooks - 1986 Workshop on Interactive 3D Graphics - Early thoughts on walkthroughs. Graphics - Early thoughts on walkthroughs. “Walkthrough - A Dynamic Graphics System for “Walkthrough - A Dynamic Graphics System for Simulating Virtual Buildings”Simulating Virtual Buildings”

Papers Useful for Walkthrough• (4) Notes on the origin of BSP trees.(4) Notes on the origin of BSP trees.

• (5) Airey, Rohlf & Brooks 1990 Symposium on (5) Airey, Rohlf & Brooks 1990 Symposium on Interactive 3D Graphics paper. “Towards Image Interactive 3D Graphics paper. “Towards Image Realism with Interactive Update Rates in Complex Realism with Interactive Update Rates in Complex Virtual Building Environments”Virtual Building Environments”

• (6) Papers by Funkhouser(6) Papers by Funkhouser

• (7) Paper by Teller & Sequin(7) Paper by Teller & Sequin

• (4) Notes on the origin of BSP trees.(4) Notes on the origin of BSP trees.

• (5) Airey, Rohlf & Brooks 1990 Symposium on (5) Airey, Rohlf & Brooks 1990 Symposium on Interactive 3D Graphics paper. “Towards Image Interactive 3D Graphics paper. “Towards Image Realism with Interactive Update Rates in Complex Realism with Interactive Update Rates in Complex Virtual Building Environments”Virtual Building Environments”

• (6) Papers by Funkhouser(6) Papers by Funkhouser

• (7) Paper by Teller & Sequin(7) Paper by Teller & Sequin

Real-Time Collision Detection and Response

Movement through our net-VEs requires that we have some Movement through our net-VEs requires that we have some way to determine if we have collided with the surfaces in our way to determine if we have collided with the surfaces in our world so that we can stop our movement or react to the world so that we can stop our movement or react to the collision.collision.

Interactivity in our net-VEs requires that we have some way of Interactivity in our net-VEs requires that we have some way of reaching out and touching an object in our VE, being able to reaching out and touching an object in our VE, being able to determine what we touched and then being able to react.determine what we touched and then being able to react.

• Both Movement & Interactivity require real-time collision detection Both Movement & Interactivity require real-time collision detection & response.& response.

– And that is a fine way to consume processor cycles ...And that is a fine way to consume processor cycles ...

Movement through our net-VEs requires that we have some Movement through our net-VEs requires that we have some way to determine if we have collided with the surfaces in our way to determine if we have collided with the surfaces in our world so that we can stop our movement or react to the world so that we can stop our movement or react to the collision.collision.

Interactivity in our net-VEs requires that we have some way of Interactivity in our net-VEs requires that we have some way of reaching out and touching an object in our VE, being able to reaching out and touching an object in our VE, being able to determine what we touched and then being able to react.determine what we touched and then being able to react.

• Both Movement & Interactivity require real-time collision detection Both Movement & Interactivity require real-time collision detection & response.& response.

– And that is a fine way to consume processor cycles ...And that is a fine way to consume processor cycles ...

Real-Time Collision Detection & Response

A Short Survey on Collision DetectionA Short Survey on Collision Detection

The problem of collision detection has been The problem of collision detection has been explored in the literature of computer explored in the literature of computer graphics, robotics, computational geometry, graphics, robotics, computational geometry, computer animation, and physically-basedcomputer animation, and physically-based

modeling. modeling.

A Short Survey on Collision DetectionA Short Survey on Collision Detection

The problem of collision detection has been The problem of collision detection has been explored in the literature of computer explored in the literature of computer graphics, robotics, computational geometry, graphics, robotics, computational geometry, computer animation, and physically-basedcomputer animation, and physically-based

modeling. modeling.

Real-Time Collision Detection & Response

Numerous approaches based on geometric Numerous approaches based on geometric reasoning[DK90], bounding volume hierarchy reasoning[DK90], bounding volume hierarchy [Hub96], spatial representation [GASF94, [Hub96], spatial representation [GASF94, NAT90], numerical methods[Cam97, GJK88], NAT90], numerical methods[Cam97, GJK88], and analytical methods[LM95, Sea93] have and analytical methods[LM95, Sea93] have been proposed. been proposed.

Numerous approaches based on geometric Numerous approaches based on geometric reasoning[DK90], bounding volume hierarchy reasoning[DK90], bounding volume hierarchy [Hub96], spatial representation [GASF94, [Hub96], spatial representation [GASF94, NAT90], numerical methods[Cam97, GJK88], NAT90], numerical methods[Cam97, GJK88], and analytical methods[LM95, Sea93] have and analytical methods[LM95, Sea93] have been proposed. been proposed.

Real-Time Collision Detection & Response

However, many of these algorithms do not However, many of these algorithms do not satisfy the demanding requirements of satisfy the demanding requirements of general-purpose collision detection for general-purpose collision detection for networked virtual environments.networked virtual environments.

However, many of these algorithms do not However, many of these algorithms do not satisfy the demanding requirements of satisfy the demanding requirements of general-purpose collision detection for general-purpose collision detection for networked virtual environments.networked virtual environments.

Real-Time Collision Detection & Response

By unifying several techniques from previous By unifying several techniques from previous work [Lin93], exploiting temporal and spatial work [Lin93], exploiting temporal and spatial coherence, and utilizing locality and coherence, and utilizing locality and hierarchical data structures, the research team hierarchical data structures, the research team at UNC has developed several collision at UNC has developed several collision detection algorithms and systems targeted detection algorithms and systems targeted toward large-scale, interactive simulation toward large-scale, interactive simulation environments, including I-COLLIDE[CLMP95], environments, including I-COLLIDE[CLMP95], RAPID[GLM96], and V-COLLIDE[HLC + 97]. RAPID[GLM96], and V-COLLIDE[HLC + 97].

By unifying several techniques from previous By unifying several techniques from previous work [Lin93], exploiting temporal and spatial work [Lin93], exploiting temporal and spatial coherence, and utilizing locality and coherence, and utilizing locality and hierarchical data structures, the research team hierarchical data structures, the research team at UNC has developed several collision at UNC has developed several collision detection algorithms and systems targeted detection algorithms and systems targeted toward large-scale, interactive simulation toward large-scale, interactive simulation environments, including I-COLLIDE[CLMP95], environments, including I-COLLIDE[CLMP95], RAPID[GLM96], and V-COLLIDE[HLC + 97]. RAPID[GLM96], and V-COLLIDE[HLC + 97].

Real-Time Collision Detection & Response

Public domain code is available for ftp at Public domain code is available for ftp at www.cs.unc.edu/ geom. www.cs.unc.edu/ geom.

Another recent effort is undertaken by a Another recent effort is undertaken by a Netherland research team in developing Netherland research team in developing another collision detection system called another collision detection system called SOLID. The code is available at SOLID. The code is available at www.win.tue.nl/cs/tt/gino/solid/.www.win.tue.nl/cs/tt/gino/solid/.

Public domain code is available for ftp at Public domain code is available for ftp at www.cs.unc.edu/ geom. www.cs.unc.edu/ geom.

Another recent effort is undertaken by a Another recent effort is undertaken by a Netherland research team in developing Netherland research team in developing another collision detection system called another collision detection system called SOLID. The code is available at SOLID. The code is available at www.win.tue.nl/cs/tt/gino/solid/.www.win.tue.nl/cs/tt/gino/solid/.

Real-Time Collision Detection & Response

ReferencesReferences

[Cam97] S. Cameron. Enhancing gjk: Computing [Cam97] S. Cameron. Enhancing gjk: Computing minimum and penetration distance between convex minimum and penetration distance between convex polyhedra. Proceedings of International Conference on polyhedra. Proceedings of International Conference on Robotics and Automation, 1997.Robotics and Automation, 1997.

[CLMP95] J. Cohen, M. Lin, D. Manocha, and M. Ponamgi. [CLMP95] J. Cohen, M. Lin, D. Manocha, and M. Ponamgi. I-collide: An interactive and exact collision detection I-collide: An interactive and exact collision detection system for large-scale environments. In Proc. of ACM system for large-scale environments. In Proc. of ACM Interactive 3D Graphics Conference, pages 189{196, Interactive 3D Graphics Conference, pages 189{196, 1995.1995.

ReferencesReferences

[Cam97] S. Cameron. Enhancing gjk: Computing [Cam97] S. Cameron. Enhancing gjk: Computing minimum and penetration distance between convex minimum and penetration distance between convex polyhedra. Proceedings of International Conference on polyhedra. Proceedings of International Conference on Robotics and Automation, 1997.Robotics and Automation, 1997.

[CLMP95] J. Cohen, M. Lin, D. Manocha, and M. Ponamgi. [CLMP95] J. Cohen, M. Lin, D. Manocha, and M. Ponamgi. I-collide: An interactive and exact collision detection I-collide: An interactive and exact collision detection system for large-scale environments. In Proc. of ACM system for large-scale environments. In Proc. of ACM Interactive 3D Graphics Conference, pages 189{196, Interactive 3D Graphics Conference, pages 189{196, 1995.1995.

Real-Time Collision Detection & Response

[DK90] D. P. Dobkin and D. G. Kirkpatrick. Determining [DK90] D. P. Dobkin and D. G. Kirkpatrick. Determining the separation of pre-processed polyhedra { A uni ed the separation of pre-processed polyhedra { A uni ed approach. In Proc. 17th Internat. Colloq. Automata Lang. approach. In Proc. 17th Internat. Colloq. Automata Lang. Program., volume 443 of Lecture Notes Comput. Sci., Program., volume 443 of Lecture Notes Comput. Sci., pages 400{413. Springer-Verlag, 1990.pages 400{413. Springer-Verlag, 1990.

[GASF94] A. Garcia-Alonso, N. Serrano, and J. Flaquer. [GASF94] A. Garcia-Alonso, N. Serrano, and J. Flaquer. Solving the collision detection problem. IEEE Comput. Solving the collision detection problem. IEEE Comput. Graph. Appl., 14:36{43, May 1994.Graph. Appl., 14:36{43, May 1994.

[DK90] D. P. Dobkin and D. G. Kirkpatrick. Determining [DK90] D. P. Dobkin and D. G. Kirkpatrick. Determining the separation of pre-processed polyhedra { A uni ed the separation of pre-processed polyhedra { A uni ed approach. In Proc. 17th Internat. Colloq. Automata Lang. approach. In Proc. 17th Internat. Colloq. Automata Lang. Program., volume 443 of Lecture Notes Comput. Sci., Program., volume 443 of Lecture Notes Comput. Sci., pages 400{413. Springer-Verlag, 1990.pages 400{413. Springer-Verlag, 1990.

[GASF94] A. Garcia-Alonso, N. Serrano, and J. Flaquer. [GASF94] A. Garcia-Alonso, N. Serrano, and J. Flaquer. Solving the collision detection problem. IEEE Comput. Solving the collision detection problem. IEEE Comput. Graph. Appl., 14:36{43, May 1994.Graph. Appl., 14:36{43, May 1994.

Real-Time Collision Detection & Response

[GJK88] E. G. Gilbert, D. W. Johnson, and S. S. Keerthi. A [GJK88] E. G. Gilbert, D. W. Johnson, and S. S. Keerthi. A fast procedure for computing the distance between fast procedure for computing the distance between objects in three-dimensional space. IEEE J. Robotics and objects in three-dimensional space. IEEE J. Robotics and Automation, vol RA-4:193{203, 1988.Automation, vol RA-4:193{203, 1988.

[GLM96] S. Gottschalk, M. Lin, and D. Manocha. Obb-[GLM96] S. Gottschalk, M. Lin, and D. Manocha. Obb-tree: A hierarchical structure for rapid interference tree: A hierarchical structure for rapid interference detection. In Proc. of ACM Siggraph'96, pages 171{180, detection. In Proc. of ACM Siggraph'96, pages 171{180, 1996.1996.

[GJK88] E. G. Gilbert, D. W. Johnson, and S. S. Keerthi. A [GJK88] E. G. Gilbert, D. W. Johnson, and S. S. Keerthi. A fast procedure for computing the distance between fast procedure for computing the distance between objects in three-dimensional space. IEEE J. Robotics and objects in three-dimensional space. IEEE J. Robotics and Automation, vol RA-4:193{203, 1988.Automation, vol RA-4:193{203, 1988.

[GLM96] S. Gottschalk, M. Lin, and D. Manocha. Obb-[GLM96] S. Gottschalk, M. Lin, and D. Manocha. Obb-tree: A hierarchical structure for rapid interference tree: A hierarchical structure for rapid interference detection. In Proc. of ACM Siggraph'96, pages 171{180, detection. In Proc. of ACM Siggraph'96, pages 171{180, 1996.1996.

Real-Time Collision Detection & Response

[HLC+97] T. Hudson, M. Lin, J. Cohen, S. Gottschalk, and D. [HLC+97] T. Hudson, M. Lin, J. Cohen, S. Gottschalk, and D. Manocha. V-collide: Accelerated collision detection for vrml. In Manocha. V-collide: Accelerated collision detection for vrml. In Proc. of VRML Conference, pages 119{125, 1997.Proc. of VRML Conference, pages 119{125, 1997.

[Hub96] P. M. Hubbard. Approximating polyhedra with spheres [Hub96] P. M. Hubbard. Approximating polyhedra with spheres for time-critical collision detection. ACM Trans. Graph., for time-critical collision detection. ACM Trans. Graph., 15(3):179{210, July 1996.15(3):179{210, July 1996.

[HLC+97] T. Hudson, M. Lin, J. Cohen, S. Gottschalk, and D. [HLC+97] T. Hudson, M. Lin, J. Cohen, S. Gottschalk, and D. Manocha. V-collide: Accelerated collision detection for vrml. In Manocha. V-collide: Accelerated collision detection for vrml. In Proc. of VRML Conference, pages 119{125, 1997.Proc. of VRML Conference, pages 119{125, 1997.

[Hub96] P. M. Hubbard. Approximating polyhedra with spheres [Hub96] P. M. Hubbard. Approximating polyhedra with spheres for time-critical collision detection. ACM Trans. Graph., for time-critical collision detection. ACM Trans. Graph., 15(3):179{210, July 1996.15(3):179{210, July 1996.

Computational Resource Management

In our multi-threaded net-VE system, there is In our multi-threaded net-VE system, there is one fundamental question above all:one fundamental question above all:

• How do we make sure the threads of our net-VE How do we make sure the threads of our net-VE don’t hog the processors? don’t hog the processors?

In our multi-threaded net-VE system, there is In our multi-threaded net-VE system, there is one fundamental question above all:one fundamental question above all:

• How do we make sure the threads of our net-VE How do we make sure the threads of our net-VE don’t hog the processors? don’t hog the processors?

Generatenew picture

Post statechanges tonet

ComputationalModeling

Compute statechanges fromnet reads

Read network

Compute statechanges frominputs

Read inputdevices

SharedMemory

Figure 6-4 Multiple subsystems, multiple threads for the virtual world.

Input Subsystem

Net Read Subsystem

Modeling Subsystem

DisplaySubsystem

Net WriteSubsystem

Interaction ManagementWhat does our sensor to action pathway look What does our sensor to action pathway look like?like?

• Issues with sensor to abstraction to resolution…Issues with sensor to abstraction to resolution…

What does our sensor to action pathway look What does our sensor to action pathway look like?like?

• Issues with sensor to abstraction to resolution…Issues with sensor to abstraction to resolution…