Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Level Optimization Sai-Keung Wong Chiao Tung University, Taiwan, R.O.C. Reference: Mastering Unreal Technology (MUT)

Similar presentations


Presentation on theme: "Introduction to Level Optimization Sai-Keung Wong Chiao Tung University, Taiwan, R.O.C. Reference: Mastering Unreal Technology (MUT)"— Presentation transcript:

1 Introduction to Level Optimization Sai-Keung Wong Chiao Tung University, Taiwan, R.O.C. Reference: Mastering Unreal Technology (MUT)

2 Contents Introduction to level optimization

3 Introduction to Level Optimization You just finish one half of the game after a game level is done. Prepare to finish the second half – Level optimization Why? Some players cannot play your game smoothly on their own computer due to too high “complexity” of your game – Lighting – Texture density – Model complexity – Scene computation, e.g. occlusion The strategy – Remove something that is unnecessary – Reduce the texture density – Reduce the model complexity

4 Optimization: Simple approach Occlusion – If something cannot be seen, remove it If a model cannot hide something, don’t use it as an occluder occluded visible occluder eye

5 System Consumption Total computation time in different items – Program execution e.g. Data management, game control – Rendering e.g. Display objects on screen, lighting computation

6 In-Game Statistics An overview of the system consumption in different aspects Play the game and check the statistics – Press TAB, and enter “View scenerendering Examples – Frame rate – CPU Rendering time – GPU Rendering time

7

8 Commands for statistics STAT FPS ( Frames per second / frame rate ) – Show frames per second STAT SCENERENDERING (統計場景渲染) – Rendering time for lighting, translucent, occlusion STAT MEMORY (統計内存) – Memory usage STAT ENGINE (統計引擎) – Terrain, foliage, HUD, skeletal mesh

9 Commands for statistics STAT STREAMING (統計流) – Statistics about streaming STAT AUDIO (統計音频)

10 SHOW Commands ( 顯示命令 ) Show or hide items SHOW BSP (顯示 BSP ) – Show binary space partition planes SHOW DYNAMICSHADOWS (顯示動態陰影) SHOW UNLITTRANSLUCENCY (顯示未照亮的 半透明物體)

11 SHOW Commands ( 顯示命令 ) SHOW POSTPROCESS (顯示後處理) SHOW PARTICLES (顯示粒子) SHOW FOLIAGE (顯示植被) – for terrain SHOW RIGIDBODY (顯示剛體)

12 VIEWMODE Commands ( 查看模式命令 ) VIEWMODE commands: change the in-game view mode – Show information about rendering VIEWMODE WIREFRAME (綫框查看模式)

13 VIEWMODE Commands ( 查看模式命令 ) VIEWMODE UNLIT (無光照查看模式) – No lighting and shadows VIEWMODE LIT (光照查看模式) – Display with textures, lightings and shadows VIEWMODE LIGHTINGONLY (僅光照查看模式) – No textures

14 VIEWMODE Commands ( 查看模式命令 ) VIEWMODE LIGHTCOMPLEXITY (光照複雜度查看模式) – Display surfaces affected by lighting

15 VIEWMODE Commands ( 查看模式命令 ) VIEWMODE TEXTUREDENSITY (貼圖密度查看模式) High density: red Medium density: green Low density: blue

16 Optimization step one: statistics and lighting complexity Load a game level Play from here Press TAB or ‘`’

17 Optimization step one: statistics and lighting complexity View modelcomplexity

18 Optimization step one: statistics and lighting complexity VIEWMODE TEXTUREDENSITY

19 Optimization step one: statistics and lighting complexity VIEWMODE LIGHTINGONLY

20 Optimization step one: statistics and lighting complexity VIEWMODE UNLIT

21 STAT SCENERENDERING

22 Occlusion If an object is occluded, it is not rendered. How to determine whether an object is occluded or not? Check whether its bounding volume is visible or not.

23 Occlusion If an object is not good to be an occluder, disable it.

24 Optimization step two: lighting and shadows For dynamic shadows, shader is used for manipulating the shadow buffer for softening the edges of shadows. Move the light sources farther away from the objects so as to make the shadows smaller.

25 Light Maps Light maps are pre-computed. Consume memory space only. Almost no rendering penalty Use them extensively For example, if an object is not affected y dynamic lighting, set bForceDirectLightMap = true – Shadow buffer will not be used

26 Lighting environments ( 光源環境 ) Create a single modulated shadow for several light sources. Better performance compared to dynamic lighting.

27 Light functions (光照函數) Any light maps associated with a light source cannot be used if light functions are applied for the light source. Avoid using them.

28 Lighting on MLM_Unlit materials Materials with MLM_Unlit If a material is not affected by lighting, set bAcceptsLights = false

29 Statistics browser for geometry Content browser->Primitive stats

30 Statistics browser for geometry Type – types of the objects Count – numbers Triangles – number of triangles Resource Size – memory size Lights (avg LM) – number of light maps Lights (avg other) – number of non-light maps Lights (Avg total) – Lights (avg LM) + Lights (avg other) Obj/ Light cost – number of times a mesh is drawn per frame

31 Triangle cost – cost of rendering triangles Lightmap – number of light maps Shadowmap – number of shadow maps LM Res – average light map resolution Sections – number of sections Radius (min) – minimum radius of bounding volumes Radius (max) – maximum radius of bounding volumes Radius (avg) – average radius of bounding volumes Radius (min/max/avg) – the radius information of each mesh Statistics browser for geometry

32 Material optimization Use fewer materials

33 Material optimization The most complex materials should not be too complex.

34 Unlit translucent Objects ( 無光照的半透明物體 ) Overdraw problem

35 Optimization step three: light environment for dynamic shadows Use shadow volume Light environment

36 Optimization step three: light environment for dynamic shadows Press F4->DynamicSMActor > Light Environment > LightEnvironmentComponent – bEnabled 。 Make the environment brighter LightShadowMode (光源陰影模式) -> set as LightShadow_Modulate ( 調制陰影 )

37 Level optimization Check fps after optimization


Download ppt "Introduction to Level Optimization Sai-Keung Wong Chiao Tung University, Taiwan, R.O.C. Reference: Mastering Unreal Technology (MUT)"

Similar presentations


Ads by Google