Special Course on Networked Virtual February 13, 2004 Environments Single Single- -Thread NVE Thread NVE Multiple Subsystems, Multiple Threads Multiple Subsystems, Multiple Threads Input Input Initialization Initialization Subsystem Subsystem Compute State Compute State Display Display Read Input Read Input Changes from Changes from Subsystem Subsystem Generate New Generate New Post State Changes Post State Changes Devices Devices Inputs Inputs Picture Picture to Network to Network Generate Generate Net Read Net Read New Picture New Picture Subsystem Subsystem Shared Shared Compute State Compute State Read Input Read Input Computational Computational Memory Memory Event Loop Event Loop Read Network Read Network Changes from Changes from Net Write Net Write Devices Devices Modelling Modelling Net Reads Net Reads Subsystem Subsystem Modelling Modelling Post State Post State Subsystem Subsystem Compute State Changes Compute State Changes Compute State Changes Compute State Changes Changes Changes Read Network Read Network from Inputs from Inputs from Net Reads from Net Reads Computational Computational Modelling Modelling Real- Real -Time Rendering Time Rendering Polygon Culling Polygon Culling � Reduce the number of processed polygons Reduce the number of processed polygons � � Key problem: limitations in the performance of graphics � Key problem: limitations in the performance of graphics � determine which polygons do not need to be drawn � determine which polygons do not need to be drawn hardware hardware � � A wealth of research and methods exists A wealth of research and methods exists � frames per second � Assumes that the underlying 3D model remains quite static � Assumes that the underlying 3D model remains quite static � frames per second changes in the model ⇒ ⇒ changes in the culling data structures � changes in the model � changes in the culling data structures � polygons per second � polygons per second � Polygon � Polygon culling culling ? ? � Level Level- -of of- -detail detail processing processing � Culling Culling Draw visible polygons Draw visible polygons Draw all polygons Draw all polygons Time Time Culling Tree Potentially Visible Sets (PVSs) Sets (PVSs) of of Polygons Polygons Culling Tree Potentially Visible Binary space partitioning tree Binary space partitioning tree View View y = 2 = 2 y Virtual World Virtual World Volume Volume y = 1 = 1 Bounding Volume (BV) Bounding Volume (BV) y Room 1 Room 1 y = 1 = 1 y Floor 1; BV Floor 1; BV Floor 2; BV Floor 2; BV Floor 3; BV Floor 3; BV Room 2 Room 2 Room 3 Room 3 x = 1 = 1 Room 1 Room 1 x PVS PVS Room 1,2; Room 1,2; Room 1,1; Room 1,1; Room 1,1; Room 1,1; BV BV BV BV BV BV x = 1 = 1 x Room 2 Room 2 Room 3 Room 3 PVS PVS PVS PVS Jouni Smed 1
Special Course on Networked Virtual February 13, 2004 Environments Levels of Detail (LOD) Levels of Detail (LOD) Real- Real -Time Collision Detection and Response Time Collision Detection and Response � Why to draw a large number of � Why to draw a large number of � Interacting � Interacting with with the VE the VE polygons if they cover only few polygons if they cover only few � touching, grasping, standing,… � touching, grasping, standing,… pixels? pixels? � � Level Level- -of of- -detail detail decision: how much decision: how much � Take some action in response to the collision � Take some action in response to the collision to draw to draw � Is there an intersection with the polygons of an object � Is there an intersection with the polygons of an object and the polygons of any other object? and the polygons of any other object? � test bounding boxes � test bounding boxes � utilize hierarchical data structures � utilize hierarchical data structures Complete Set Complete Set Medium Set Medium Set Minimum Set Minimum Set Viewer Viewer of Polygons of Polygons of Polygons of Polygons of Polygons of Polygons � � Where are the precise contact points? Where are the precise contact points? Distance to the object Distance to the object Real Real- -Time Collision Detection Solutions Time Collision Detection Solutions Fast, Approximate Collision Detection Fast, Approximate Collision Detection � � Important to recognize that a collision has occurred Important to recognize that a collision has occurred � Approaches to collision detection � Approaches to collision detection � The precise location of the collision is unimportant � The precise location of the collision is unimportant � geometric reasoning � geometric reasoning � � Example: NPSNET Example: NPSNET � bounding volume hierarchy � bounding volume hierarchy � � moving objects can collide with each other and with fixed, stati moving objects can collide with each other and with fixed, static c objects � analytical methods � analytical methods objects ⇒ the moving object dies upon collision over a certain speed ⇒ � � the moving object dies upon collision over a certain speed � � hybrid hybrid � � no sophisticated physics no sophisticated physics � Fast � Fast, , approximate approximate collision collision detection detection � � Ownship = the local player in the VE Ownship = the local player in the VE Moving object (ownship) against static objects 1. Moving object (ownship) against static objects � � ownship: ownship: static static object object collisions collisions 1. Moving object (ownship) against moving objects (other players) 2. 2. Moving object (ownship) against moving objects (other players) � ownship: � ownship: moving moving object object collisions collisions � � Up to the ownship to report its collisions and its death Up to the ownship to report its collisions and its death � Fast � Fast, , accurate accurate collision collision detection detection Ownship: Static Object Collisions Object Collisions Ownship: Moving Object Collisions Object Collisions Ownship: Static Ownship: Moving � � Occurs when an object has moved Occurs when an object has moved � The � The ownship ownship did not did not collide collide with with and its position is updated and its position is updated any static object any static object � Reduce the set of static objects � Reduce the set of static objects � � Reduce the collision comparison Reduce the collision comparison that must be considered that must be considered space space 1. Check current and 1. Check current and neighbouring neighbouring squares squares 1. 1. Is the Is the ownship ownship below the a below the a 2. Calculate 3D distances to objects Calculate 3D distances to objects 2. threshold elevation? threshold elevation? 2. Calculate 2D distance to all 2. Calculate 2D distance to all 3. Cast a ray from the 3. Cast a ray from the ownship’s ownship’s objects in the grid square objects in the grid square origin to the moving object’s object’s origin to the moving 3. 3. Is the Is the ownship’s ownship’s ground ground origin origin elevation less than the height of elevation less than the height of � The host managing moving � The host managing moving the static object? the static object? object also performs collision object also performs collision � Issue a detonation PDU or an � Issue a detonation PDU or an detection and issues detection and issues PDUs PDUs entity state PDU entity state PDU Jouni Smed 2
Recommend
More recommend