Presentation is loading. Please wait.

Presentation is loading. Please wait.

Scene Manager Creates and places movable objects like lights and cameras so as to access them efficiently, e.g. for rendering. Loads and assembles world.

Similar presentations


Presentation on theme: "Scene Manager Creates and places movable objects like lights and cameras so as to access them efficiently, e.g. for rendering. Loads and assembles world."— Presentation transcript:

1 Scene Manager Creates and places movable objects like lights and cameras so as to access them efficiently, e.g. for rendering. Loads and assembles world geometry (large sprawling and generally not movable. Permits scene queries. Setup and rendering of shadows Setup backgrounds like sky boxes Passing organized content to render system. Often organized by location or texture.

2 Ogre Scene Manager Scene starts with root node.
A node can contain entities and other nodes This produces a tree. A nodes can be enabled and disabled. (affects subtree.) Nodes can be translated and rotated. Ogre Scene Manager FAQ

3 Scene Graphs The scene graph is a structure that arranges the logical and often (but not necessarily) spatial representation of a graphical scene. Modern cards require ordering by textures as well as location for efficiency. Order of object rendering is often important, so Ogre uses queues of queues.

4 Scene Graphs

5 Octrees

6 Octrees

7 Quadtrees

8 Z buffer Z-Buffer hold pixel's distance from camera

9 Frustrum Culling and Z-buffering insufficient
Given a large enough set of polygons, no matter how fast the graphics card, sending it too many hidden polygons will overwhelm it. Need algorithms for occlusion culling

10 Occlusion Culling Octrees Divides space into a tree of octants
Interior nodes contain a count of object in node Leaves record objects in node BSP trees (KD trees) Uses Planes (hyperplanes) to divide space into two parts and then repeats Interior nodes and leaves as in Octrees

11 Polygonal Ordering Painter's Algorithm: Paint the polygons that may be covered by other polygons first. Establishes a “partial” ordering: A is in front of B if A may cover part of B. Necessary for transparency

12 Using BSP Trees for Polygonal Ordering
Back to front order: G, C, F, A, E, B, D V is the view position.

13 Polygon Aligned BSP Using polygons to determine planes:
Select a polygon. The plane containing the polygon divides space in half. If another polygon is cut by the plane, replace it with two new polygons one on each side of the plane. For each half space repeat the above procedure until there are no more polygons.

14 Sky SkyBoxes - A SkyBox is basically a giant cube that surrounds all of the objects in the scene.

15 Sky SkyDomes - SkyDomes are very similar to SkyBoxes, and you use them by calling setSkyDome. A giant cube is created around the Camera and rendered onto, but the biggest difference is that the texture is "projected" onto the SkyBox in a spherical manner. SkyPlanes - SkyPlanes are very different from SkyBoxes and SkyDomes. Instead of a cube to render the sky texture on, we use just a single plane.

16 Sky Which sky to use depends entirely on your application. If you have to see all around you, even in the negative y direction, then really your only real choice is to use a SkyBox. If you have terrain, or some kind of floor which blocks the view of the negative y direction, then using a SkyDome seems to give more realistic results. For areas where you cannot see to the horizon (such as a valley surrounded by mountains on all sides, or the inner courtyard of a castle), a SkyPlane will give you very good looking results for very little GPU costs.

17 Shadow Maps

18 Shadow Maps Contain the Z – depth of all points visible to a light. Any point with a greater distance from the light is in a shadow cast by that light. Point coordinates must be converted from a light specific frame to a camera frame. Requires a matrix multiply for each point One for each light. In general only movable objects need to be considered.

19 Soft Shadows If light is a point source, hard shadow
Otherwise soft shadow.

20 Shadows Other topics Soft shadows. Shadows on curved surfaces
Shadow Volumes See Real-Time Rendering, Akenine-Moller, Eric Haines

21 Terrains Static meshes and height maps.
Static meshes allow more freedom with terrain as you can have overhangs. You will need to implement collision detection however if you wish to have entities interact correctly with the terrain Record heights as pixel values

22 Height Maps Heightmaps are more limiting in that you cannot have overhangs in the terrain. For further terrain details such as bridges for example - you will need to add these as meshes on top of the height map. If you wish to have a cave you would need to leave a hole in the height map in order place meshes later at the appropriate locations. Heightmaps are better suited for large maps and can be further optimised by using the paging scene manager Scene Managers can provide an optimized getHeight function which allows entities to be easily snapped to the terrain. There would still need to be further collision code implemented for any terrain related meshes on the landscape.

23 Shaders Use texture memory to store data
Vertex Shaders – apply programs to vertices of polygons, before interior of polygon is rendered Fragment Shaders – apply programs to points of polygons (fragments). Can use textures for data and masks.

24 Lighting Equation Can be handled in fragment shader. If point in shadow for a light, skip that light.

25 More Info SceneManger http://www.ogre3d.org/tikiwiki/OgreBullet


Download ppt "Scene Manager Creates and places movable objects like lights and cameras so as to access them efficiently, e.g. for rendering. Loads and assembles world."

Similar presentations


Ads by Google