1 / 37

성균관대학교 정보통신공학부 한정현 2003 / 11 / 15

3 차원 게임. Part 1. 3D Game and 3D Graphics Part 2. 3D Game Platforms Part 3. 3D Game Engine and Realtime Rendering. 성균관대학교 정보통신공학부 한정현 2003 / 11 / 15. Part 1. 3D Game and 3D Graphics. 3D Game. The first 3D game: Wolfenstein 3D By id Software in 1992 First-person shooter

rio
Download Presentation

성균관대학교 정보통신공학부 한정현 2003 / 11 / 15

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. 3차원 게임 Part 1. 3D Game and 3D Graphics Part 2. 3D Game Platforms Part 3. 3D Game Engine and Realtime Rendering 성균관대학교 정보통신공학부 한정현 2003 / 11 / 15

  2. Part 1. 3D Game and 3D Graphics

  3. 3D Game • The first 3D game: Wolfenstein 3D • By id Software in 1992 • First-person shooter • The items and enemies are sprites (a collection of static images) that are moved around, resized, and even animated. • No jump or stair climbing allowed • Since Wolfenstein 3D, id Software has produced • Doom, which added the ability to walk up stairs. • Doom 1993; Doom 2 1994 • Quake, which added real 3D items and enemies by using polygon models rather than sprites. • Quake 1996; Quake 2 1997; Quake 3 Arena 1999 [idS] Wolfenstein 3D Doom Quake 3

  4. 3D Game (cont’d) • Now, 3D games are everywhere. • A 2001 survey showed that 80% of the games published all over the world were 3D. [Gamemeca] Lineage I Lineage II

  5. 3D Graphics • The core of 3D game is 3D graphics. • 3D graphics = modeling + rendering + animation • A model is a computer representation of an object. • Rendering is the process of creating an image from a model. • Animation is the process of generating repeated renderings of a scene. • The most popular 3D modeling technique is polygon or triangular mesh. • The set of vertices/polygons enters the rendering pipeline. • Application stage (e.g. collision detection) • Geometry stage (for transformation, projection, lighting, etc.) • Rasterization stage geometry rasterization application an example (It really depends on implementations.)

  6. light source n eye r l v object Rendering Pipeline: Geometry Stage • Geometric transformations for perspective projection • Lighting calculation Modeling Transformation Viewing Transformation Local Coordinates World Coordinates Eye Coordinates y Screen Mapping Projection Transformation x z Window Coordinates Normalized Device Coordinates

  7. y x scanline algorithm Rendering Pipeline: Rasterization Stage • Pixel/polygon filling • Shading and texture mapping flat shading smooth shading texture mapping texture

  8. Graphics Accelerator • A lot of the pipeline functions are performed by graphics accelerators. [Card]

  9. OpenGL • We need interfaces to the graphics acceleration hardware, and two best-known interfaces are OpenGL and DirectX. • OpenGL (Open Graphics Library) is the cross-platform standard for 3D rendering and 3D hardware acceleration. • For Windows, MacOS, Linux and Unix systems. • Originally developed by Silicon Graphics Inc. (SGI) • Since 1992, by the OpenGL Architecture Review Board (ARB) • 1992 version 1.0 • 1996 version 1.1 • 1998 version 1.2 • 2001 version 1.3 • 2002 version 1.4 • 2003 version 1.5 • OpenGL is a general-purpose graphics library, but many games, such as id Software’s Quake 3, use OpenGL. • Recently, its mobile version OpenGL ES has been announced. [OpenGL]

  10. DirectX • The de facto standard for multimedia APIs built into Microsoft Windows • By Microsoft, and only for Windows platform • Its APIs give multimedia applications access to 3D graphics acceleration chips and sound cards. • They also control low-level functions, including 2D graphics acceleration; support for input devices such as joysticks, keyboards, and mice; and control of sound mixing and sound output. • First introduced in 1995 and now version 9.0 (2002) • DirectX 9.0 components • DirectX Graphics • DirectInput • DirectPlay • DirectSound • DirectMusic • DirectShow • DirectSetup • DirectX Media Object [DX]

  11. Part 2. 3D Game Platforms

  12. 3D Game Platforms • PC • Console • Xbox, PlayStation 2, etc. • Arcade hardware • Mobile devices • PDA and cell phone • Game Boy Advance (GBA), PlayStation Portable (PSP), etc.

  13. PC: Programmable Pipeline • 3D on PC has been based on OpenGL and DirectX. • Revolution has been going on: from fixed-function pipeline to programmable pipeline. • Fixed-function pipeline • Programmable pipeline [DX] [DX]

  14. Vertex and Pixel Shaders • Pipeline programmability is achieved though shaders. • Vertex shader (for geometry stage) • Pixel shader (for rasterization stage) DirectX vertex shader 1.0 DirectX pixel shader 1.4

  15. Shading Languages • DirectX • Version 8.0: assembly language • Version 9.0: HLSL (High Level Shading Language) • OpenGL 1.5 (2003 July) and the upcoming version 2.0 (will) support ‘OpenGL Shading Language.’ //c0~c3: view_proj_matrix //c4~c6: texture_matrix0 dp4 oPos.x, v0, c0 dp4 oPos.y, v0, c1 dp4 oPos.z, v0, c2 dp4 oPos.w, v0, c3 dp4 oT0.x, v0, c4 dp4 oT0.y, v0, c5 dp4 oT0.z, v0, c6 float4x4 view_proj_matrix; float4x4 texture_matrix0; struct VS_OUTPUT { float4 Pos : POSITION; float3 Pshade : TEXCOORD0; }; VS_OUTPUT main (float4 vPosition : POSITION) { VS_OUTPUT Out = (VS_OUTPUT) 0; Out.Pos = mul (view_proj_matrix, vPosition); Out.Pshade = mul (texture_matrix0, vPosition); return Out; } assembly code example HLSL code example

  16. Shader: Examples • Shaders work fine for skinning animation, procedural deformation, procedural texture mapping, bump mapping, environment mapping, cartoon rendering, etc. Fur rendering with DirectX 9 pixel shader Car painting with DirectX 9 pixel shader [ATi] Natural Light with DirectX 9 (Paul Debevec) “Pipe Dream” with DirectX 9

  17. Xbox • Microsoft Xbox™ technical specifications • Ethernet port • 233MHz custom-designed chip, developed by Microsoft and NVIDIA • Intel 733MHz processor • 64 MB RAM and 8/10 GB Hard Drive • 3D Audio Support in Hardware (64-bit) • XDK (Xbox Development Kit) provided • The core of the Xbox's OS is a version derived from Windows 2000 from which numerous functions are removed that are useless on the console. • A subset of the Win32 APIs is supported. • Graphics • A subset of Direct3D • Compatible with DirectX at the API layer, while providing the thinnest and fastest-possible access to the hardware • Audio • Based on subsets of DirectSound and DirectMusic

  18. Xbox code Code Comparison: Xbox vs. DirectX 8.1

  19. DirectX 8.1 code Code Comparison: Xbox vs. DirectX 8.1 (cont’d)

  20. PlayStation 2 • PS2 system architecture by Sony Computer Entertainment Inc. (SCEI) ▪ SPU2: Sound Processor Unit ▪IOP: I/O Processor ▪EE: Emotion Engine (basically in charge of application and geometry stages) ▪GS: Graphics Synthesizer (basically in charge of rasterization stage)

  21. PlayStation 2: Development Kit • Use IDE such as SN Systems’ ProDG and Metroworks’ CodeWarrior. • Download the executable into DTL-T10000, and execute it. • DTL-T10000 then displays game scenes into the TV screen. The Lord of the Rings (PS2)

  22. Arcade Hardware • SEGA Naomi 2 specifications • CPU: 200 MHz Hitachi SH-4 (SH7091) • Geometry co-processor: VideoLogic custom T&L chip • Sustained Polygonal and Lighting Rate: 10M polygons/sec with 6 light sources • Supported Lights: Ambient, parallel, point and spot • GPU: Two PowerVR2 (CLX2) • Pixel fill-rate: 200M pixels/sec • Graphic Effects: 16-bit and 24-bit color, multiple fog modes, super sampling for full scene anti-aliasing, specular highlighting, texture filtering: bilinear, trilinear, anistropic, MIP mapping, bump mapping, perspective correction, 8-bit alpha blending (256 levels of transparency), ARGB gouraud shading, etc.

  23. Mobile Devices • Cell phone games (far more popular than PDA games in Korea) • Virtual Machine (VM): GVM/GNEX, SK-VM, etc. • Native Binary: BREW, Symbian, etc. • Let’s see an example: Qualcomm Q3Dimension™ Gaming Platform [Q3Dimension]

  24. OpenGL ES • Hardware graphics accelerators for mobile devices are coming to the market, and so we need their APIs. A candidate is OpenGL ES. • OpenGL ES: OpenGL for Embedded Systems • Embedded 3D graphics API • A subset of OpenGL • By Khronos Group (sgi, Sun, ATI, ARM, NOKIA, Symbian, SK Telecom, etc.) • Version 1.0 at July of 2003 Applications High Level Graphics Libraries Low-level Graphics APIs Embedded Hardware [OpenGLES]

  25. Portable Game Console • Nokia N-Gage™ Game Deck • Symbian OS with J2ME support • A plenty of 3D games already available • PSP (PlayStation Portable) • To appear in 2004 [NGage] [PSP]

  26. Part 3. 3D Game Engine and Realtime Rendering

  27. What’s Game Engine? • A game engine consists of • library modules such as graphics/rendering, physics, AI, and sound (sub) engines, and • development tools such as map editor and scene graph editor. • Well-known game engines • Abroad: Quake, Unreal, LithTech, RenderWare, Alchemy, etc. • Domestic: Dream3D, GI3D/G-Blender, etc. • Let’s focus on the graphics/rendering engine, which is in charge of the realtime rendering.

  28. Realtime Rendering • Performance goals in real-time rendering • frame rate: 60-85 frames/sec? • resolution: 1600x1200? • photorealism (if necessary): undistinguishable from real scene! • Unfortunately, there is no real upper limit on the scene complexity. • Jurassic Park's T-REX model : ~175,000 polygons • Boeing-777 model: ~500,000,000 polygons • Therefore, numerous acceleration techniques have been developed. Let’s take one of them, mesh simplification and levels of detail (LOD) technique, that can be done at the application stage of the rendering pipeline.

  29. What do you want for mesh simplification? Geometric accuracy? Visual fidelity? Drastic simplification? Completely automatic? What else? The computer graphics literature is replete with excellent simplification algorithms, each with strengths and weaknesses. A popular approach is edge collapse (ecol), whose inverse operation is vertex split (vsplit). Mesh Simplification

  30. Repeated application of ecol operations Repeated application of vsplit operations Which LOD to use? Discrete or continuous? As discrete LOD leads to popping effect, continuous LOD is preferable. A continuous LOD: The coarsest mesh M0 and the series of vsplit operations constitute the progressive mesh. M0 Mj Mi Mn vsplit0 vsplitj vsplitn-1 Mn Mi Mj M0 ecoln-1 ecoli-1 ecol0 Progressive Mesh

  31. Progressive Mesh:Demo

  32. Criteria for view-dependent LOD View frustum Surface orientation Screen space error etc. distant back facing out of view frustum view–independent LOD view–dependent LOD View-dependent LOD of Progressive Mesh

  33. The Current Status of LOD in Game Development • DirectX has supported progressive mesh since v8.0. • However, it seems that no game is using it at runtime. For example, Homeworld2 (2003 by Relic Entertainment) simply adopts just a few (discrete) LOD models with popping effect. • Think about why? That will answer what 3D researchers have to do … ID3DXMesh *pMesh = NULL; ID3DXPMesh *m_pPMeshFull; D3DXLoadMeshFromX( strMediaPath,…, &pMesh ); D3DXGeneratePMesh( pMesh,…, & m_pPMeshFull); m_pPMeshFull->SetNumVertices( dwNumVertices ); m_pPMeshFull->DrawSubset( i );

  34. Physics Engine • Physics engines provide realistic motions and interactions between real-world objects. • Components of physics engines • Collision: Detection and Response • Fluid • Particle • Rigid Body • Joint • Spring and Damper • etc. • Commercial physics engines • Havok Engine (http://www.havok.com) • RenderWare Physics Engine (http://www.renderware.com)

  35. AI Engine • Virtually all techniques used in academic AI are also useful in game AI, including finite-state machines, learning, path finding, multi-agent cooperation, fuzzy logic, neural network, genetic algorithms, natural language processing, etc. • However, game AI is basically for fun while academic AI pursues extraordinarily difficult problems such as imitating human cognition. • Commercial AI engines • AI.implant (http://www.ai-implant.com) • Spark (http://www.louderthanabomb.com/) • PathEngine (http://www.pathengine.com/) • RenderWare AI Engine (http://www.renderware.com) • Sound engine is also needed, e.g. for 3D sound generation.

  36. Next-generation IT Leaders: What To Do • A lot of research topics are in the areas of realtime rendering, physics, AI, etc. • Publish papers in prestigious societies such as SIGGRAPH. • However, always face the real world. Do NOT research for research. • Work with game developers, and understand what the difficulties and challenges are in the real world. • They are eager to have your support!!!!

  37. References • [ATi] http://www.ati.com/developer/ • [Card] Graphics Cards Articles In Chronological Overview http://www.tomshardware.com/graphic/ • [DX] http://www.microsoft.com/directx • [Gamemeca] http://www.gamemeca.com • [idS] id Software http://www.idsoftware.com • [NGage] http://www.n-gage.com • [OpenGL] http://www.opengl.org • [OpenGLES] Bringing 3D Graphics to Embedded Systems, BOF SIGGRAPH2003 • [PSP] http://www.kgda.or.kr/cgi/technote/read.cgi?board=info&y_number=1345&nnew=1 • [Q3Dimension] Q3Dimension™ gaming platform, http://www.cdmatech.com/solutions/products/q3dimension.jsp

More Related