DOC PREVIEW
UCSD CSE 167 - Scene Management

This preview shows page 1-2-3-4-29-30-31-32-33-60-61-62-63 out of 63 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 63 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 63 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 63 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 63 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 63 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 63 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 63 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 63 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 63 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 63 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 63 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 63 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 63 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 63 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Scene ManagementCSE 167, UCSD, Fall 2005Steve RotenbergScene ManagementThe scene management system is responsible for efficiently rendering complex scenesWe will mainly focus on real time scene management, but many of these techniques are also useful for offline renderingThe system maintains a world full of objects and determines what gets drawn and in what orderSome of the primary components include:Scene graphCullingLevel of detail (LOD)Draw orderInstancingPagingLayersThe scene management layer deals primarily with objectsThe rendering layer deals primarily with triangles and graphics state.Scene GraphComputer graphics often makes use of a scene graph of some sortAt a minimum, graphics scene graphs would probably have a tree structure where each node in the tree stored some geometry and a transformation (matrix or some other form)The hand from project 2, for example, can be represented as a scene graph. Each node in the tree would have a box model and a transform that does one or two rotationsHand Scene GraphPalmDigit00Digit01Digit02Digit10Digit11Digit12Digit20Digit21Digit22Digit30Digit31Digit32Real Time Scene GraphCombining the transformation and geometry into a single node makes sense, but for more complex scenes, it is more common to separate the two into different nodesAs always, there are different ways to do this, but today, we will consider a scene graph with a base node class and various derived nodes that perform specific functionsOur base Node will not really do anything, but will have a generic ‘Draw()’ function that can be overridden by higher level nodesclass Node {public:virtual void Draw();};Transform NodeThe Transform node is just a local transformation in the scene graph (exactly like the local joint rotations we did in project 2)class Transform:public Node {Matrix44 Mtx;Node *Child;public:void Draw() {if(Child==0) return;glPushMatrix();glMultMatrix(&Mtx); // need to convert Mtx* to float[]…Child->Draw();glPopMatrix();}};Instance NodeThe ‘Instance’ node is an instance of some piece of geometryIt stores a pointer to a Model class, so that multiple instances could potentially share the same model dataNotice that Instance doesn’t have any ‘child’ nodes, and can therefore only be a leaf node in the scene treeclass Instance:public Node {Model *Mod;public:void Draw() {if(Mod) Model->Draw();}};Group NodeWe define a ‘Group’ node which stores an array of child nodes, but doesn’t perform any real computationGroups are used when one needs to parent several nodes to a single node (like the fingers on the hand)class Group:public Node {int NumChildren;Node *Child;public:void Draw() {for(int i=0;i<NumChildren;i++)Child[i]->Draw();}};Hand Scene Graph (version 2)GroupInstance (palm)TransformGroupInstance (digit00)TransformGroupInstance (digit01)TransformInstance (digit02)etc…etc…TransformGroupInstance (digit10)TransformGroupInstance (digit11)TransformInstance (digit12)Scene GraphThe second version of the scene graph might look a bit more complicated, but the extra flexibility offered by the technique usually justifies itSub-Tree InstancingWe can also have nodes parented to more than one node, as long as we avoid any cyclic loops in our tree graphHaving nodes parented to more than one parent changes the tree graph into a directed acyclic graph or DAGFor example, if we wanted several copies of the hand at different locations:Groupetc…GroupTransform Transform Transform(hand from previous slide)Bounding Volume CullingCullingThe term cull means to remove from a groupIn graphics, it means to determine which objects in the scene are not visibleWe looked at culling of individual triangles. Today, we will consider culling of objectsThere are many approaches to object culling (and they can usually be combined easily)Bounding volumes (spheres, boxes…)Cull-planes, face clusteringOcclusion surfacesPortalsPotentially Visible Sets (PVS)Camera View VolumeThe main data that defines a real-time perspective camera includes:World space camera matrixField of view (FOV)Aspect ratioNear & far clipping plane distancesxzFOVNear clipFar clipBackface CullingBackface culling refers to the removal of individual triangles that face away from the cameraThis is usually built into the lower level renderer (OpenGL / Direct3D…) and is not really a part of scene managementBounding VolumesObjects are contained within simple bounding volumes (sphere, cylinder, box…)Before drawing an object, its bounding volume is tested against the camera’s viewing volume. There are 3 possible outcomes:Totally visibleTotally invisiblePartially visible (may require clipping)xzBounding Volume TypesSphereCylinderHot dog / capsule / lozengeAABB: axis-aligned bounding boxOBB: oriented bounding boxConvex polyhedronGenerating Bounding SpheresMethod 1: Average vertex positionsStep 1: Compute average of all vertex positions and place the center of the bounding sphere there.Step 2: Find the vertex farthest from the center and set the radius to that distanceWill rarely, if ever, generate optimal resultsOptimal Enclosing SphereSphere ComputeSphere(int N,Point P[]) {randomly mix up points P[0]…P[N-1];Sphere sphere(P[0],0);i=1;while (i<N) {if(P[i] not in support) {if(P[i] not in sphere) {add P[i] to support and remove any unnecessary points;compute sphere from current support;i=0; // start over when support changescontinue;}}i++;}return sphere;}Testing Bounding SpheresTransform bounding sphere to view spaceCompare against all 6 view volume facesObject is totally invisible if it is completely outside any one planeObject is totally visible if it is completely inside all planesOtherwise, the object may intersect the view volume and may require clippingxzTransforming to Camera SpaceObject’s world matrix: WCamera’s world matrix: CSphere position in object space: sSphere position in view space: s´=C-1•W•sTesting Near & Far Planesxzs'Far clipNear clipif(s.z-radius > -NearClip) then outsideelse if(s.z+radius<-FarClip) then outsideelse if(s.z+radius>-NearClip) then intersectelse if(s.z-radius<-FarClip) then intersectelse insideTesting Right, Left, Top, & Bottomdist = n · s'if(dist>radius) then outsideif(dist<-radius) then insideelse intersectRight plane:n=[cos(FOV/2), 0, sin(FOV/2)]Top plane:n=~[0,


View Full Document

UCSD CSE 167 - Scene Management

Documents in this Course
Lighting

Lighting

38 pages

Review

Review

59 pages

Surfaces

Surfaces

22 pages

Review

Review

110 pages

Midterm

Midterm

4 pages

Lighting

Lighting

38 pages

Lighting

Lighting

71 pages

Review

Review

110 pages

Lighting

Lighting

71 pages

Load more
Download Scene Management
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Scene Management and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Scene Management 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?