1 / 42

Game Technology

Game Technology. Overview. Game Engines Rendering Culling Setup Drawing Phong Lighting Physics Collision Detection Forces Integration Scripting Production. Simplified Game Architecture. Game Scripts. Game Engine. Sound. Scene Manager. Renderer. Graphics Card. AI. Physics.

howe
Télécharger la présentation

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. Game Technology

  2. Overview • Game Engines • Rendering • Culling • Setup • Drawing • Phong Lighting • Physics • Collision Detection • Forces • Integration • Scripting • Production

  3. Simplified Game Architecture Game Scripts Game Engine Sound Scene Manager Renderer Graphics Card AI Physics

  4. Game “Engines” • “Engine” is independent of one particular game • Scripts define individual game behavior and game play

  5. Engine Overview Game Engine Sound Scene Manager Renderer AI Physics

  6. Need for Scene Structures • Different parts of engine all need to access the “world” • Linear search of all objects is slow for large worlds • Create sub-linear structure • O(1) or O(log(n)) • Hash structures • Tree structure Quad Tree

  7. Examples of Scene Structures Wolfenstein 3D: Regular 2D Grid Tomb Raider: Regular 3D Grid Quake: 3D BSP, Arbitrary world geometry GTA: Complex trees, streaming, LOD

  8. Engine Overview Game Engine Sound Scene Manager Renderer AI Physics

  9. Renderer Overview Renderer Culling Setup • Draw • OpenGL • DirectX Graphics Card

  10. View Culling • The scene is presented to the renderer to draw it. • Contains all objects in the game world • Sending everything to the graphics card is slow • Send only limited set of objects visible by camera To be culled

  11. Optimizing Culling • Use fast operations provided by the scene manager • Example: 2D Quad Tree Level1 Level2 Level3 Level…

  12. Renderer Overview Renderer Culling Setup • Draw • OpenGL • DirectX Graphics Card

  13. Setup • Prepare data for efficient rendering • Sort objects per material • Create batches • Calculate per object shader parameters • Send to Graphics Card for rendering

  14. Renderer Overview Renderer Culling Setup • Draw • OpenGL • DirectX Graphics Card

  15. Rendering • Recapitulation Z Vertex V X Triangle Y U Texture Coordinate

  16. Cosine Law • Light intensity is dependent on surface normal Same amount light reaches both surfaces. • Light distributed over small area. • Surface will appear bright. • Light distributed over larger area. • Surface will appear dark

  17. Simplified Light-Surface interactions Diffuse Specular Light reflected in one particular direction. • Light scattered in all directions equally. Many real-life materials can be modeled by a combination of specular and diffuse models.

  18. Phong Lighting • Based on these observations create simple ad-hoc model to calculate lighting. Diffuse Term Specular Term max(0, L.n) Cd Cl + max(0, R.n)e Cs Cl Calculate area hit by light rays Take color of light source Take color of surface Take color of surface Check if camera looking in reflected direction Take color of light source Make the reflected beam narrow

  19. Additional lights and shadows More than one light Shadows Mask out contribution of Phong equation if in shadow. • Independent of each other. • Add output of Phongequations for all lights

  20. Attenuation & Light Culling • Attenuation • Further from source light gets dimmer • Theoretically infinite radius • Light Culling • At certain point assume light level zero • Use techniques similar to view culling

  21. Full equation • We evaluate this equation to determine the lighting at a certain point. Shadow contribution Add all lights in scene Phong for ith light

  22. Where to evaluate equation?

  23. Where to store equation parameters • Per object • Per pixel (in texture)

  24. Normal/Bump mapping • Normals are geometric property of surface • Low poly surface: Renders fast but low lighting detail • Normalmapping: Store approximate normals in texture

  25. Using the GPU to evaluate model: Shaders

  26. Shadow Mapping • Texture: Stores length of blue arrows • Check green length to blue to determine shadows Depth as seen from light source

  27. Shadow Techniques - Comparison Stencil SM PCF 5x5 Bil.PCF 5x5 VSM

  28. Engine Overview Game Engine Sound Scene Manager Renderer AI Physics

  29. Physics Overview Collision Detection Forces Integration

  30. Physics Overview Collision Detection Forces Integration

  31. Collision Detection • Broad phase • Use the scene manager to determine nearby objects • Narrow phase • Object – Object interactions • To simplify calculations, use simple shapes: • Spheres, boxes, …

  32. Collision detection – Rag Dolls • Example of simplification

  33. Physics Overview Collision Detection Forces Integration

  34. Forces • Forces acting on the objects are accumulated • “Traditional” forces: • Gravity • Collisions • … • “Simulation” forces • Collision detection • Constraints • “Game” forces • Explosions, magic, • Not simulated correctly what looks fun

  35. Physics Overview Collision Detection Forces Integration

  36. Integration • Good old Newton • Object’s state vector is integrated using numerical integration methods • Euler • RungeKutta …

  37. Physics on the GPU • Use computational power of the GPU • Parallelize algorithms • For example: • PhysX engine by NVIDIA • Uses CUDA to drive the GPU

  38. Engine Overview Game Scripts Game Engine Sound Scene Manager Renderer AI Physics

  39. Scripting • Script programmers & technical artists • AI & Behavior • Physical properties • Animation behavior

  40. Production • “Making the game” • Use engine to create an unique game • Mainly artists, designers and script writers

  41. Production – Asset Pipeline Text

  42. Questions? • Contact: • charlesfrederik.hollemeersch@ugent.be

More Related