1 / 86

3D 游戏引擎介绍

3D 游戏引擎介绍. Engine. 游戏引擎:用于控制所有游戏功能的主程序,从计算碰撞、物理系统和物体的相对位置,到接受玩家的输入,以及按照正确的音量输出声音等等. History of 3D Game Engine. 引擎的诞生( 1992 年 ~1993 年) – 1992 年, 3D Realms 公司 /Apogee 公司 Wolfenstein 3D 《 德军司令部 》 – 1992 年, Origin 公司 Ultima Underworld 《 创世纪:地下世界 》

farica
Télécharger la présentation

3D 游戏引擎介绍

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. 3D游戏引擎介绍

  2. Engine • 游戏引擎:用于控制所有游戏功能的主程序,从计算碰撞、物理系统和物体的相对位置,到接受玩家的输入,以及按照正确的音量输出声音等等

  3. History of 3D Game Engine • 引擎的诞生(1992年~1993年) – 1992年,3D Realms公司/Apogee公司 Wolfenstein 3D 《德军司令部》 – 1992年,Origin公司 Ultima Underworld 《创世纪:地下世界》 – id Software公司Doom 《毁灭战士》 (Doom引擎是第一个被用于授权的引擎) • 引擎的转变(1994年~1997年) – 1994年为3D Realms公司《毁灭公爵》(Duke Nukem 3D) – 1994年id Software公司的《雷神之锤》(Quake) (Quake引擎是当时第一款完全支持多边形模型、动画和粒子特效的真正意义上的3D引擎) – 1995年,id Software公司推出《雷神之锤2》(Quake2) – Epic Megagames公司(即现在的Epic游戏公司)的《虚幻》(Unreal) (Unreal引擎的应用范围不限于游戏制作,还涵盖了教育、建筑等其它领域。Digital Design公司曾与联合国教科文组织的世界文化遗产分部合作采用Unreal引擎制作过巴黎圣母院的内部虚拟演示,Zen Tao公司采用Unreal引擎为空手道选手制作过武术训练软件 )

  4. History of 3D Game Engine • 引擎的革命(1998年~2000年) – 1998年, Valve公司的《半条命》(Half-Life) 《半条命》采用的是 Quake 和 Quake II引擎的混合体 – LookingGlass工作室《神偷:暗黑计划》(Thief:The Dark Project)在 人工智能方面真正取得突破的游戏是Looking Glass工作室的《神偷:暗黑计划》 – 2000年,3D引擎朝着两个不同的方向分化。一是如《半条命》、《神 偷》和《杀出重围》那样通过融入更多的叙事成分和角色扮演成分以 及加强游戏的人工智能来提高游戏的可玩性,二是朝着纯粹的网络模 式发展 id Software 《雷神之锤3竞技场》(Quake III Arena),它与 Epic公司稍后推出的《虚幻竞技场》(Unreal Tournament)

  5. History of 3D Game Engine – Monolith公司的LithTech引擎,这款引擎最初是用在机甲射击游戏《升 刚》(Shogo) • 引擎的今天(2001年~) – 由于受到技术方面的限制,把第一人称射击游戏放入大型网络环境中 的构想至少在目前还很难实现。因此,id Software公司重新把目光放 在了单人模式上,《雷神之锤4》和《毁灭战士3》将重新建构一个以 单人游戏为主的引擎 ,同时Epic游戏公司也在紧锣密鼓地开发新一代 Unreal引擎和《虚幻竞技场2》的引擎

  6. 3D Game Engine The Render • The Render • CharacterSkeletal Animation • Natural Physics Simulation • 我国的3D网络游戏的现状

  7. The Renderer How models and worlds are stored is a part of the function of the render, more than it is part of the application / game. The game logic doesn't need to know how objects are represented in memory, or how the render is going to go about displaying them. The game simply needs to know that the renderer is going to represent objects using the correct view, and displaying the correct models in their correct frames of animation.

  8. The Render • 3D world • 3D space partition – BSP-tree(Binary Space Partitioning) • Hidden surface remove – Portal – PVS(Potentially Visible Set)

  9. 3D world • 3D objects are stored as points in the 3D world (called vertices) • Lines of these points form many triangles • These triangles create the while 3D world

  10. Creating the 3D world

  11. 3D space partition • What a BSP-tree is? – A Binary Space Partitioning-tree is a structure that, as the name suggests, subdivides the space into smaller sets. • Why to use BSP-trees in the 3D engine? –Optimize a wide variety of areas, such as radiosity calculations, drawing of the world,portal.

  12. BSP-tree

  13. BSP-tree BSP-tree algorithm: The original idea for the creation of a BSP-tree is that you take a set of polygons that is part of a scene and divide them into smaller sets, where each subset is a convex set of polygons.

  14. BSP-tree • Convex(cell): each polygon in this subset is in front of every other polygon in the same set.

  15. BSP-tree • A problem: (unbalance) – You can choose an arbitrary plane in space and divide the polygons by putting the one son the positive side of the plane in the right sub tree and the polygons on the negative side in the left sub tree. The problem with this approach is that it is very difficult to find a plane that divides the polygons into two approximately equally sized sets. (approximately balance)

  16. BSP-tree • A unbalance tree

  17. BSP-tree • The solution: splitting such a polygon into two polygons.

  18. BSP-tree • A example: how a BSP-tree is generated

  19. BSP-tree • Choose polygon 16 as the divider. |negative|= 15 and |positive| = 13 approximate balance

  20. BSP-tree • Choose polygon 4 as the divider. |negative|= 7 and |positive| = 8 approximate balance • Choose polygon 21 as the divider. |negative|= 6 and |positive| = 8. approximate balance

  21. BSP-tree

  22. Hidden surface remove • Is it necessary that each hidden polygon is drawn ? • Answer: unnecessary.

  23. Hidden surface remove • Portal • PVS(Potentially Visibility Set)

  24. Portal rending • The common technique: – Portal rendering • The basic idea: – When you render a scene from a viewer’s position with a viewing frustum and encounter a portal polygon, the portal clips the viewing frustum. Then the adjacent sector is rendered from the same viewer’s position but with the new viewing frustum.

  25. Portal rending

  26. Portal rending • How to know if an object is in the viewing frustum? If it is on the completely negative side of any one of those planes the object is not visible

  27. Placing the portals • How to place the portals is one of the big problems in a portal engine. • A solution need to use BSP-tree.

  28. Placing the portal • The general idea: 1.each portal in the tree must be coinciding with a plane defined by a dividing polygon in the tree. Out of each of these planes a portal polygon is created. 2.each portal polygon is pushed down the sub trees of the node it is in. 3.If a polygon is clipped, the two resulting parts are sent down from the top of the tree. When a portal polygon is not in need of any clipping, it is sent down to the sub trees of the node currently visiting. This means that if it is on the positive side of the plane it will be sent down the right sub tree, and if it is on the negative side it will be sent down the left sub tree.

  29. Placing the portal • An example of the algorithm s2 s4 s3

  30. Placing the portal • 1. Portal polygon 1 (s1) enters node n1. In n1 the splitting polygon will be clipped to fit and one part will be removed since it coincides with one of the polygons in the pillar. p1 and p2 replace s1.

  31. Placing the portal • 2. p1 and p2 enters node s2 In node s2 p1 since it is on the positive side of s2 together with splitting polygon s2 will be sent to node n2. p2 together with s2 will be sent further down to s3, none of them will be clipped since they do not cross splitting polygon s2.

  32. Placing the portal • 3. p1 and s2 enters node n2 In n2 p1 is accepted as a portal, so it is not changed in node n1 either,Polygon s2 that was sent down to s3 in the previous step is now called p3.

  33. Placing the portal • 4. p3 and s3 enters node n3. Since neither of p2 or p3 is clipped they are pushed downwards together with s3. P3 and s3 goes down to node n3 and p2 and s3 is pushed down to node s4.

  34. Placing the portal • 5. p3 and s3 enters node n3 • 6. p2 and p4 enters node s4

  35. Placing the portal • 7. p2, p4 and s4 enters node n4 Neither of p2 or p4 need clipping, except for that to fit the node. But s4 is completely coinciding with a polygon in the pillar so it is removed.

  36. Placing the portal • 8. Nothing enters node n5. • 9. The result Portal p1 is in both n1 and n2. Portal p2 is in both n1 and n4. Portal p3 is in both n2 and n3. Portal p4 is in both n3 and n4.

  37. PVS(Potential Visibility Set) • This PVS is the set of convexes that is visible from the first convex; it is not only of use during the drawing phase. • The PVS is calculated during the pre- rendering of the map.

  38. PVS(Potential Visibility Set) TRACE-VISIBILITY Input: Tree – The BSP-tree to trace visibility in. Output: None Effect: – For each leaf in the tree it traces visibility to that leaf’s connected nodes. Every node that is found visible is added to the PVS of that node.When a visible leaf is found we have to trace for visibility to the visible nodes connected nodes.

  39. PVS(Potential Visibility Set)

  40. PVS(Potential Visibility Set) • TRACE-VISIBILITY (Tree) • 1 for (each leaf L in Tree) • 2 for (each leaf C that is connected to L) • 3 Add C to L’s PVS • 4 for (each leaf L1 in Tree) • 5 while (there exist a leaf L2 in L’s PVS which’s connected nodes • hasn’t been checked for visibility yet) • 5 for (each leaf C that is connected to L2) • 6 if (C isn’t in L1’s PVS already and CHECK- • VISIBILITY (L1, C)) • 7 Add C to L1’s PVS • 7 Add L1 to C’s PVS

  41. 3D Game Engine • The Render • Character Skeletal Animation • Natural Physics Simulation • 我国的3D网络游戏的现状 Character Skeletal Animation

  42. Character Animation Techniques • Layered Model • Deformation Techniques • Animation

  43. Layered Model 1.Two layers skeletal and skin 2.Three layers skeletal,muscle and skin 3.Four layers skeletal,muscle,skin and clothes

  44. Layered Model • Three layers 1. Skeletal 2. Muscle/fatty 3. Skin

  45. Layered Model • Skeletal – A method to animate articulated objects by determining the position of the different elements by the influence of a series of bones and joints. • How to store skeletal? 1. Positional information of joints 2. Relationship between those joints 3. Bones do not have to be saved in the file

  46. Layered Model • Muscle/fatty is applied by attaching geometric primitives to the underlying skeleton. • Skin Mesh (vertices) or skin is attached to the muscle/fatty

  47. Layered Model • Advantage: 1. The smooth transitions while changing from one animation to the other. 2.A number of animations can be added whereas the mesh remains constant. 3.Use a relative small memory footprint.

  48. Deformation Techniques • By using the layered approach for character animation, the animator can rely on the skeletal layer to control the motion of the character. • In order to achieve perceptually realistic movement, the higher layers must deform in accordance with the surrounding layers.

  49. Deformation Techniques • Joint Dependant Local Deformations • Non-linear Global Deformation • Implicit Surfaces • Free Form Deformations

  50. Joint Dependant Local Deformations • Joint Dependant Local Deformations This animation technique, which uses a polygonal mesh skin digitized from a sculpture, maps each vertex point to a particular point on the skeleton using JLD operators. Depend on the nature of the joints, and control the evolution of the surface.

More Related