1 / 11

Engine Basics: Optimizing Geometry CS 446: Real-Time Rendering & Game Technology

Engine Basics: Optimizing Geometry CS 446: Real-Time Rendering & Game Technology. David Luebke University of Virginia. Demo Time. SIGN UP SHEET Today: Fight Night videos. Homework. The pitch: “due” Tuesday, keep pitching The game: due today at midnight. Objects Groups of objects

zubeda
Download Presentation

Engine Basics: Optimizing Geometry CS 446: Real-Time Rendering & Game Technology

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Engine Basics:Optimizing GeometryCS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia

  2. Demo Time • SIGN UP SHEET • Today: Fight Night videos Real-Time Rendering 2 DavidLuebke

  3. Homework • The pitch: “due” Tuesday, keep pitching • The game: due today at midnight Real-Time Rendering 3 DavidLuebke

  4. Objects Groups of objects LOD selectors Animation “effectors” “Flipbook” animation selectors Transform drivers Deformers Skeletal animation players Lights! Cameras! Transforms Useful state Bounding boxes, partitions Graphics state Which textures, shaders bound Material Other state - glEnable(GL_FOO) “Raw” geometry Vertices and triangles Recap: Scene Graph Node Examples Note: often actual geometry only exists at leaves Real-Time Rendering 4 DavidLuebke

  5. Scene Graph Traverals • Classical use of scene graph: • Traverse in depth-first fashion • Apply effects of “action” nodes when reached • LOD selectors, animation effectors • Push/pop matrices when reach/leave xform nodes • Issue geometry as reached • Not very efficient for complex scenes (why?) • Unnecessary pushing/popping • Constantly switching graphics state • No spatial organization • Lots of recalculation for multiple passes Real-Time Rendering 5 DavidLuebke

  6. Scene Graph Traversals • Can optimize traversal logic several ways, e.g.: • Cache per-frame computations: bbox, matrices • Flatten hierarchy for unchanging subgraphs • Call animation effectors first & update bboxes bottom-up • Visibility computations affect traversal • View-frustum culling: top-down, separate visibility grid • Cells & portals: portals can be special arcs • Other: BSP trees, 2.5D from-region, fog-of-war Real-Time Rendering 6 DavidLuebke

  7. Scene Graph Traversals • Common traversals: • Simple depth-first. Optional: • View-frustum culling or other visibility scheme • Different LOD biases • Cache bbox/visibility/matrix info for later passes • Rough front-to-back sort • Sorted by state • Geometry-only Real-Time Rendering 7 DavidLuebke

  8. Efficient Rendering • So leaves of the scene graph represent geometry… • How to efficiently represent that geometry? • Hint: not like this: typedef float Point[3]; typedef Point Triangle[3]; Triangle tris[] = new Triangle[ntris]; ... glBegin(GL_TRIANGLES); for (i=0;i<nverts;i++) { glVertex3fv(tris[i][0]); glVertex3fv(tris[i][1]); glVertex3fv(tris[i][2]); } glEnd(); Real-Time Rendering 8 DavidLuebke

  9. 5 Steps to Efficient Rendering • Step 1: reduce #vertices/triangle • Step 2: reduce overhead of each vertex • Step 3: recognize the existence of the vertex cache • Step 4: display lists (deprecated re: performance) • Step 5: learn about the hardware Real-Time Rendering 9 DavidLuebke

  10. Other things you should know • Most interesting stuff in OpenGL isn’t in red book • Extension registry • http://oss.sgi.com/projects/ogl-sample/registry/ • Extensions you should know: • ARB_multitexture • EXT_framebuffer_object • ARB_occlusion_query • ARB_point_sprite • ARB_texture_rectangle • ARB_draw_buffers • ARB_texture_float (_framebuffer_float, _half_float_pixel, etc) • ARB_depth_texture • ARB_vertex_buffer_object (_pixel_buffer_object) Real-Time Rendering 10 DavidLuebke

  11. Coming Up • Next topic: programmable graphics hardware • We’ll use NVIDIA’s Cg language because I know it • Similar alternatives: • Microsoft’s HLSL for DirectX • OpenGL Shading Language (GLSL, once Glslang) • Different approach: Sh Real-Time Rendering 11 DavidLuebke

More Related