SlideShare a Scribd company logo
Kelly Gawne, Games Engineer
September 2016
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
Intel Confidential 2
Agenda
• Intro
• Optimization Thoughts
• Profiling
• Optimizations
• Questions
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
3
Optimization Ideology
• Don’t.
• Don’t yet.
• Profile and identify your largest bottleneck.
• Test, address, test again.
• Repeat as desired.
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
Where is the bottleneck?
4
The Core Optimization Question:
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
5
CPU Limitations
• Draw Call Preparation
• Scripting
• Physics
• Memory
• Etc.
GPU Limitations
• Memory bandwidth
• Resolution
• Shader or Geometric
Complexity
• Lighting
• Etc.
The Core Optimization Question: CPU or GPU?
Unity Optimization Tips, Tricks and Tools
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
7
A Profiling Toolbox
Unity Profiler
Unity Render Stats Overlay Intel GPA System Analyzer
Intel GPA Frame Analyzer
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
8
Unity Render Stats
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
9
Unity Profiler
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
10
Intel GPA System Analyzer
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
11
Intel GPA Frame Analyzer
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
12
Unity:
Watch the profiler
Decrease resolution. If framerate
improves, GPU-bound
GPA:
Use the experiments:
• If turning on NULL HW increases
framerate, GPU-Bound
• If NULL HW doesn’t help but
DISABLE DRAW CALLS does,
driver-bound
• If neither help, CPU-bound
Where’s that bottleneck?
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
13
CPU:
Check the Unity Profiler:
What’s so expensive?
Is it a constant cost?
Are there hitches or
frametime spikes?
GPU:
Is there a killer draw call?
Are lots of little calls eating
up frametime?
Is everything rendered
essential?
Where next?
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
14
Unity Optimization Tips, Tricks and Tools
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
16
Scripting
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
17
Script Frustum Culling Co-routines
Help, I Can’t Stop Update()ing
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
18
Scripting Fades
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
19
Scripting with Memory in Mind
Garbage Collection (GC)
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
20
Object Pooling
Reuse objects in a pool instead of
instantiating and destroying them.
Great for: bullets, explosions
Catch 22:
Heap memory cost, could trigger GC
Slower GC
Long-lasting, large groups aren’t ideal
Garbage Collection Avoidance
• Use structs instead of classes
• Cache references to objects
• Minimize runtime allocations
Scripting with Memory in Mind
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
21
Physics
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
22
Physics
• Use primitive colliders over mesh colliders
• Tweak fixed delta time
• Don’t move static colliders
• If it needs to move, add a rigidbody and
uncheck static
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
23
Model Geometry
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
24
Model Geometry
The number of vertices processed by the GPU is greater than the number
of geometric vertices in the model.
Why? Vertices can be split for multiple normals/UV coordinates/etc
Two Good Modeling Rules:
1. Don’t use more triangles than you need.
2. Reduce UV seams and hard edges when possible
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
25
Model Geometry: LOD
• Switch out mesh based on objects distance from camera
• Customizable camera distances
• Dramatic reduction in memory requirements by frame
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
26
Level of Detail (LOD)
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
27
Model Geometry: Occlusion Culling
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
28
Model Geometry: Occlusion Culling
Be sure to set occlusion areas, Unity defaults to using the whole scene
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
29
Batching
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
30
Batching
The number of vertices processed by the GPU is greater than the number
of geometric vertices in the model.
Why? Vertices can be split for multiple normals/UV coordinates/etc
Two Good Modeling Rules:
1. Don’t use more triangles than you need.
2. Reduce UV seams and hard edges when possible
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
31
Static Batching
Unity automatically performs
Does not affect culling (unlike manual)
No performance gain unless material is
shared  texture atlas
Cons: Memory overhead
Dynamic Batching
For small meshes (<900 vertex
attributes)
Incurs per-vertex CPU overhead, only
a win if the CPU vertex transform work
< extra draw call expense.
Batching
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
32
Textures and Shaders
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
33
Textures
• Compress when possible
• Generate Mipmaps
• UNLESS 2D game, UI element
• 33% more memory per texture
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
34
Texture Atlasing
Combine multiple textures into one
Texture2D.PackTextures.
Why?
•Reduce Material and Texture count
•Reduce engine overhead on Material setup
•Reduce engine overhead on Texture switch
•Allow for more static batching
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
35
Shaders
Built-ins aren’t built for your game
Only compute what you need
• Reduce complex math operations (e.g. pow, exp, log, cos, sin, tan). Consider
a lookup texture if applicable
• Avoid writing your own versions of operations (e.g. normalize, dot, inversesqrt)
as the built-in's ensure the driver can optimize as much as possible.
• Float v. half v. fixed is largely ignored on desktop GPUs (everything is float on
modern GPUs). Worry about it for mobile if you need it
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
36
Lighting and Shadows
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
37
Pros:
Uses per-pixel, per-vertex and SH
Real-time shadows and per-pixel
effects
Cons:
Can lead to many draws to same pixel
Lighting Path Quick Notes: Forward
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
38
Pros:
Lighting complexity unrelated to
scene
Trade heavy lighting computation
for memory
Lighting Path Quick Notes: Deferred
Cons:
Semi-transparent not supported
directly
No anti-aliasing
No Receive Shadows flag support
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
39
Lightmapping
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
40
Lightmapping
Mark all static geometry.
Place light probes to fill all
dynamic object paths
Bake
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
41
HDR
If you’re using HDR effect like
Bloom and Flare using deferred
rendering, check HDR to reduce
draw calls.
Each camera has an HDR
checkbox
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
42
Shadows
Avoid Realtime Shadows
Soft shadows have a greater GPU overhead
Use cascaded shadow maps for directional lights
Tweak your shadow settings:
• Shadow Filtering: hard/soft
• Shadow Resolution: Resolution of shadow map
• Shadow Projection: Stable/Close fit
• Shadow Cascades: 0, 2, 4
• Shadow Distance: Max distance object’s shadow can project
Unity Optimization Tips, Tricks and Tools
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
44
Final Thoughts
• Design with optimization in mind
• Know what you’re optimizing for
• If there’s an issue, profile first.
• Profile, optimize, profile.
• Make fast, fantastic games.
Kelly Gawne
Intel Games Engineer
Kelly.D.Gawne@intel.com
45
software.intel.com/gpa
https://github.com/GameTechDev/
UnityPerformanceSandbox
Unity Optimization Tips, Tricks and Tools
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
Legal Disclaimer & Optimization Notice
INFORMATION IN THIS DOCUMENT IS PROVIDED “AS IS”. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR
OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. INTEL ASSUMES NO
LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO THIS
INFORMATION INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors.
Performance tests, such as SYSmark and MobileMark, are measured using specific computer systems, components, software,
operations and functions. Any change to any of those factors may cause the results to vary. You should consult other information
and performance tests to assist you in fully evaluating your contemplated purchases, including the performance of that product when
combined with other products.
Copyright © 2014, Intel Corporation. All rights reserved. Intel, Pentium, Xeon, Xeon Phi, Core, VTune, Cilk, and the Intel logo are
trademarks of Intel Corporation in the U.S. and other countries.
Optimization Notice
Intel’s compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel
microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the
availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent
optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are
reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the
specific instruction sets covered by this notice.
Notice revision #20110804
47Intel Confidential
48
Copyright © 2015, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Optimization Notice
Intel Confidential 49
Intel® GPA Release Notes
https://software.intel.com/en-us/articles/intel-gpa-release-notes
Unity Optimization Tips, Tricks and Tools
Ad

Recommended

Mobile Performance Tuning: Poor Man's Tips And Tricks
Mobile Performance Tuning: Poor Man's Tips And Tricks
Valentin Simonov
 
Practical guide to optimization in Unity
Practical guide to optimization in Unity
DevGAMM Conference
 
Practical Guide for Optimizing Unity on Mobiles
Practical Guide for Optimizing Unity on Mobiles
Valentin Simonov
 
Unity - Internals: memory and performance
Unity - Internals: memory and performance
Codemotion
 
Optimizing Large Scenes in Unity
Optimizing Large Scenes in Unity
Noam Gat
 
Unite 2013 optimizing unity games for mobile platforms
Unite 2013 optimizing unity games for mobile platforms
ナム-Nam Nguyễn
 
Learn how to do stylized shading with Shader Graph – Unite Copenhagen 2019
Learn how to do stylized shading with Shader Graph – Unite Copenhagen 2019
Unity Technologies
 
Optimizing unity games (Google IO 2014)
Optimizing unity games (Google IO 2014)
Alexander Dolbilov
 
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
David Salz
 
게임프로젝트에 적용하는 GPGPU
게임프로젝트에 적용하는 GPGPU
YEONG-CHEON YOU
 
Optimization in Unity: simple tips for developing with "no surprises" / Anton...
Optimization in Unity: simple tips for developing with "no surprises" / Anton...
DevGAMM Conference
 
Frostbite on Mobile
Frostbite on Mobile
Electronic Arts / DICE
 
Unreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - Gameplay
Nick Pruehs
 
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
repii
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture Overview
Yu-Hsin Hung
 
【Unite Tokyo 2019】【あら簡単】インテルのGPAを使ってあなたのUnityタイトルを高速化
【Unite Tokyo 2019】【あら簡単】インテルのGPAを使ってあなたのUnityタイトルを高速化
UnityTechnologiesJapan002
 
Killzone Shadow Fall: Threading the Entity Update on PS4
Killzone Shadow Fall: Threading the Entity Update on PS4
jrouwe
 
Unity Internals: Memory and Performance
Unity Internals: Memory and Performance
DevGAMM Conference
 
Unreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User Interface
Nick Pruehs
 
Graphics Gems from CryENGINE 3 (Siggraph 2013)
Graphics Gems from CryENGINE 3 (Siggraph 2013)
Tiago Sousa
 
Quest for Progress (GDC Europe 2016)
Quest for Progress (GDC Europe 2016)
Anthony Pecorella
 
Executable Bloat - How it happens and how we can fight it
Executable Bloat - How it happens and how we can fight it
Electronic Arts / DICE
 
Advancements in-tiled-rendering
Advancements in-tiled-rendering
mistercteam
 
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
Guerrilla
 
Parallel Futures of a Game Engine
Parallel Futures of a Game Engine
repii
 
Level design in 11 points
Level design in 11 points
용태 이
 
Unreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal Editor
Nick Pruehs
 
Game Design 2: Lecture 5 - Game UI Wireframes and Paper Prototypes
Game Design 2: Lecture 5 - Game UI Wireframes and Paper Prototypes
David Farrell
 
Intel® Graphics Performance Analyzers
Intel® Graphics Performance Analyzers
Intel® Software
 
Intel Graphics Performance Analyzers (Intel GPA)
Intel Graphics Performance Analyzers (Intel GPA)
Intel® Software
 

More Related Content

What's hot (20)

A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
David Salz
 
게임프로젝트에 적용하는 GPGPU
게임프로젝트에 적용하는 GPGPU
YEONG-CHEON YOU
 
Optimization in Unity: simple tips for developing with "no surprises" / Anton...
Optimization in Unity: simple tips for developing with "no surprises" / Anton...
DevGAMM Conference
 
Frostbite on Mobile
Frostbite on Mobile
Electronic Arts / DICE
 
Unreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - Gameplay
Nick Pruehs
 
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
repii
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture Overview
Yu-Hsin Hung
 
【Unite Tokyo 2019】【あら簡単】インテルのGPAを使ってあなたのUnityタイトルを高速化
【Unite Tokyo 2019】【あら簡単】インテルのGPAを使ってあなたのUnityタイトルを高速化
UnityTechnologiesJapan002
 
Killzone Shadow Fall: Threading the Entity Update on PS4
Killzone Shadow Fall: Threading the Entity Update on PS4
jrouwe
 
Unity Internals: Memory and Performance
Unity Internals: Memory and Performance
DevGAMM Conference
 
Unreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User Interface
Nick Pruehs
 
Graphics Gems from CryENGINE 3 (Siggraph 2013)
Graphics Gems from CryENGINE 3 (Siggraph 2013)
Tiago Sousa
 
Quest for Progress (GDC Europe 2016)
Quest for Progress (GDC Europe 2016)
Anthony Pecorella
 
Executable Bloat - How it happens and how we can fight it
Executable Bloat - How it happens and how we can fight it
Electronic Arts / DICE
 
Advancements in-tiled-rendering
Advancements in-tiled-rendering
mistercteam
 
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
Guerrilla
 
Parallel Futures of a Game Engine
Parallel Futures of a Game Engine
repii
 
Level design in 11 points
Level design in 11 points
용태 이
 
Unreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal Editor
Nick Pruehs
 
Game Design 2: Lecture 5 - Game UI Wireframes and Paper Prototypes
Game Design 2: Lecture 5 - Game UI Wireframes and Paper Prototypes
David Farrell
 
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
David Salz
 
게임프로젝트에 적용하는 GPGPU
게임프로젝트에 적용하는 GPGPU
YEONG-CHEON YOU
 
Optimization in Unity: simple tips for developing with "no surprises" / Anton...
Optimization in Unity: simple tips for developing with "no surprises" / Anton...
DevGAMM Conference
 
Unreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - Gameplay
Nick Pruehs
 
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
repii
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture Overview
Yu-Hsin Hung
 
【Unite Tokyo 2019】【あら簡単】インテルのGPAを使ってあなたのUnityタイトルを高速化
【Unite Tokyo 2019】【あら簡単】インテルのGPAを使ってあなたのUnityタイトルを高速化
UnityTechnologiesJapan002
 
Killzone Shadow Fall: Threading the Entity Update on PS4
Killzone Shadow Fall: Threading the Entity Update on PS4
jrouwe
 
Unity Internals: Memory and Performance
Unity Internals: Memory and Performance
DevGAMM Conference
 
Unreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User Interface
Nick Pruehs
 
Graphics Gems from CryENGINE 3 (Siggraph 2013)
Graphics Gems from CryENGINE 3 (Siggraph 2013)
Tiago Sousa
 
Quest for Progress (GDC Europe 2016)
Quest for Progress (GDC Europe 2016)
Anthony Pecorella
 
Executable Bloat - How it happens and how we can fight it
Executable Bloat - How it happens and how we can fight it
Electronic Arts / DICE
 
Advancements in-tiled-rendering
Advancements in-tiled-rendering
mistercteam
 
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
Guerrilla
 
Parallel Futures of a Game Engine
Parallel Futures of a Game Engine
repii
 
Level design in 11 points
Level design in 11 points
용태 이
 
Unreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal Editor
Nick Pruehs
 
Game Design 2: Lecture 5 - Game UI Wireframes and Paper Prototypes
Game Design 2: Lecture 5 - Game UI Wireframes and Paper Prototypes
David Farrell
 

Similar to Unity Optimization Tips, Tricks and Tools (20)

Intel® Graphics Performance Analyzers
Intel® Graphics Performance Analyzers
Intel® Software
 
Intel Graphics Performance Analyzers (Intel GPA)
Intel Graphics Performance Analyzers (Intel GPA)
Intel® Software
 
Debug, Analyze and Optimize Games with Intel Tools - Matteo Valoriani - Codem...
Debug, Analyze and Optimize Games with Intel Tools - Matteo Valoriani - Codem...
Codemotion
 
Debug, Analyze and Optimize Games with Intel Tools - Matteo Valoriani - Codem...
Debug, Analyze and Optimize Games with Intel Tools - Matteo Valoriani - Codem...
Codemotion
 
Debug, Analyze and Optimize Games with Intel Tools
Debug, Analyze and Optimize Games with Intel Tools
Matteo Valoriani
 
Real-Time Game Optimization with Intel® GPA
Real-Time Game Optimization with Intel® GPA
Intel® Software
 
In The Trenches Optimizing UE4 for Intel
In The Trenches Optimizing UE4 for Intel
Intel® Software
 
It Doesn't Have to Be Hard: How to Fix Your Performance Woes
It Doesn't Have to Be Hard: How to Fix Your Performance Woes
Intel® Software
 
Improve the performance of your Unity project using Graphics Performance Anal...
Improve the performance of your Unity project using Graphics Performance Anal...
Unity Technologies
 
The Architecture of Intel Processor Graphics: Gen 11
The Architecture of Intel Processor Graphics: Gen 11
DESMOND YUEN
 
The Architecture of 11th Generation Intel® Processor Graphics
The Architecture of 11th Generation Intel® Processor Graphics
Intel® Software
 
Forts and Fights Scaling Performance on Unreal Engine*
Forts and Fights Scaling Performance on Unreal Engine*
Intel® Software
 
More explosions, more chaos, and definitely more blowing stuff up
More explosions, more chaos, and definitely more blowing stuff up
Intel® Software
 
Make your unity game faster, faster
Make your unity game faster, faster
Intel® Software
 
Getting Space Pirate Trainer* to Perform on Intel® Graphics
Getting Space Pirate Trainer* to Perform on Intel® Graphics
Intel® Software
 
Optimization Deep Dive: Unreal Engine 4 on Intel
Optimization Deep Dive: Unreal Engine 4 on Intel
Intel® Software
 
OIT to Volumetric Shadow Mapping, 101 Uses for Raster-Ordered Views using Dir...
OIT to Volumetric Shadow Mapping, 101 Uses for Raster-Ordered Views using Dir...
Gael Hofemeier
 
thu-blake-gdc-2014-final
thu-blake-gdc-2014-final
Robert Taylor
 
Accelerate Your Game Development on Android*
Accelerate Your Game Development on Android*
Intel® Software
 
Scalability for All: Unreal Engine* 4 with Intel
Scalability for All: Unreal Engine* 4 with Intel
Intel® Software
 
Intel® Graphics Performance Analyzers
Intel® Graphics Performance Analyzers
Intel® Software
 
Intel Graphics Performance Analyzers (Intel GPA)
Intel Graphics Performance Analyzers (Intel GPA)
Intel® Software
 
Debug, Analyze and Optimize Games with Intel Tools - Matteo Valoriani - Codem...
Debug, Analyze and Optimize Games with Intel Tools - Matteo Valoriani - Codem...
Codemotion
 
Debug, Analyze and Optimize Games with Intel Tools - Matteo Valoriani - Codem...
Debug, Analyze and Optimize Games with Intel Tools - Matteo Valoriani - Codem...
Codemotion
 
Debug, Analyze and Optimize Games with Intel Tools
Debug, Analyze and Optimize Games with Intel Tools
Matteo Valoriani
 
Real-Time Game Optimization with Intel® GPA
Real-Time Game Optimization with Intel® GPA
Intel® Software
 
In The Trenches Optimizing UE4 for Intel
In The Trenches Optimizing UE4 for Intel
Intel® Software
 
It Doesn't Have to Be Hard: How to Fix Your Performance Woes
It Doesn't Have to Be Hard: How to Fix Your Performance Woes
Intel® Software
 
Improve the performance of your Unity project using Graphics Performance Anal...
Improve the performance of your Unity project using Graphics Performance Anal...
Unity Technologies
 
The Architecture of Intel Processor Graphics: Gen 11
The Architecture of Intel Processor Graphics: Gen 11
DESMOND YUEN
 
The Architecture of 11th Generation Intel® Processor Graphics
The Architecture of 11th Generation Intel® Processor Graphics
Intel® Software
 
Forts and Fights Scaling Performance on Unreal Engine*
Forts and Fights Scaling Performance on Unreal Engine*
Intel® Software
 
More explosions, more chaos, and definitely more blowing stuff up
More explosions, more chaos, and definitely more blowing stuff up
Intel® Software
 
Make your unity game faster, faster
Make your unity game faster, faster
Intel® Software
 
Getting Space Pirate Trainer* to Perform on Intel® Graphics
Getting Space Pirate Trainer* to Perform on Intel® Graphics
Intel® Software
 
Optimization Deep Dive: Unreal Engine 4 on Intel
Optimization Deep Dive: Unreal Engine 4 on Intel
Intel® Software
 
OIT to Volumetric Shadow Mapping, 101 Uses for Raster-Ordered Views using Dir...
OIT to Volumetric Shadow Mapping, 101 Uses for Raster-Ordered Views using Dir...
Gael Hofemeier
 
thu-blake-gdc-2014-final
thu-blake-gdc-2014-final
Robert Taylor
 
Accelerate Your Game Development on Android*
Accelerate Your Game Development on Android*
Intel® Software
 
Scalability for All: Unreal Engine* 4 with Intel
Scalability for All: Unreal Engine* 4 with Intel
Intel® Software
 
Ad

More from Intel® Software (20)

AI for All: Biology is eating the world & AI is eating Biology
AI for All: Biology is eating the world & AI is eating Biology
Intel® Software
 
Python Data Science and Machine Learning at Scale with Intel and Anaconda
Python Data Science and Machine Learning at Scale with Intel and Anaconda
Intel® Software
 
Streamline End-to-End AI Pipelines with Intel, Databricks, and OmniSci
Streamline End-to-End AI Pipelines with Intel, Databricks, and OmniSci
Intel® Software
 
AI for good: Scaling AI in science, healthcare, and more.
AI for good: Scaling AI in science, healthcare, and more.
Intel® Software
 
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
Intel® Software
 
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
Intel® Software
 
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
Intel® Software
 
AWS & Intel Webinar Series - Accelerating AI Research
AWS & Intel Webinar Series - Accelerating AI Research
Intel® Software
 
Intel Developer Program
Intel Developer Program
Intel® Software
 
Intel AIDC Houston Summit - Overview Slides
Intel AIDC Houston Summit - Overview Slides
Intel® Software
 
AIDC NY: BODO AI Presentation - 09.19.2019
AIDC NY: BODO AI Presentation - 09.19.2019
Intel® Software
 
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
Intel® Software
 
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
Intel® Software
 
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Intel® Software
 
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
Intel® Software
 
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
Intel® Software
 
AIDC India - AI on IA
AIDC India - AI on IA
Intel® Software
 
AIDC India - Intel Movidius / Open Vino Slides
AIDC India - Intel Movidius / Open Vino Slides
Intel® Software
 
AIDC India - AI Vision Slides
AIDC India - AI Vision Slides
Intel® Software
 
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
Intel® Software
 
AI for All: Biology is eating the world & AI is eating Biology
AI for All: Biology is eating the world & AI is eating Biology
Intel® Software
 
Python Data Science and Machine Learning at Scale with Intel and Anaconda
Python Data Science and Machine Learning at Scale with Intel and Anaconda
Intel® Software
 
Streamline End-to-End AI Pipelines with Intel, Databricks, and OmniSci
Streamline End-to-End AI Pipelines with Intel, Databricks, and OmniSci
Intel® Software
 
AI for good: Scaling AI in science, healthcare, and more.
AI for good: Scaling AI in science, healthcare, and more.
Intel® Software
 
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
Intel® Software
 
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
Intel® Software
 
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
Intel® Software
 
AWS & Intel Webinar Series - Accelerating AI Research
AWS & Intel Webinar Series - Accelerating AI Research
Intel® Software
 
Intel AIDC Houston Summit - Overview Slides
Intel AIDC Houston Summit - Overview Slides
Intel® Software
 
AIDC NY: BODO AI Presentation - 09.19.2019
AIDC NY: BODO AI Presentation - 09.19.2019
Intel® Software
 
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
Intel® Software
 
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
Intel® Software
 
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Intel® Software
 
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
Intel® Software
 
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
Intel® Software
 
AIDC India - Intel Movidius / Open Vino Slides
AIDC India - Intel Movidius / Open Vino Slides
Intel® Software
 
AIDC India - AI Vision Slides
AIDC India - AI Vision Slides
Intel® Software
 
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
Intel® Software
 
Ad

Recently uploaded (20)

Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
The Future of AI Agent Development Trends to Watch.pptx
The Future of AI Agent Development Trends to Watch.pptx
Lisa ward
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
 
2025_06_18 - OpenMetadata Community Meeting.pdf
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
ICT Frame Magazine Pvt. Ltd.
 
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
The Future of AI Agent Development Trends to Watch.pptx
The Future of AI Agent Development Trends to Watch.pptx
Lisa ward
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
 
2025_06_18 - OpenMetadata Community Meeting.pdf
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
ICT Frame Magazine Pvt. Ltd.
 
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 

Unity Optimization Tips, Tricks and Tools

  • 1. Kelly Gawne, Games Engineer September 2016
  • 2. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice Intel Confidential 2 Agenda • Intro • Optimization Thoughts • Profiling • Optimizations • Questions
  • 3. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 3 Optimization Ideology • Don’t. • Don’t yet. • Profile and identify your largest bottleneck. • Test, address, test again. • Repeat as desired.
  • 4. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice Where is the bottleneck? 4 The Core Optimization Question:
  • 5. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 5 CPU Limitations • Draw Call Preparation • Scripting • Physics • Memory • Etc. GPU Limitations • Memory bandwidth • Resolution • Shader or Geometric Complexity • Lighting • Etc. The Core Optimization Question: CPU or GPU?
  • 7. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 7 A Profiling Toolbox Unity Profiler Unity Render Stats Overlay Intel GPA System Analyzer Intel GPA Frame Analyzer
  • 8. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 8 Unity Render Stats
  • 9. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 9 Unity Profiler
  • 10. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 10 Intel GPA System Analyzer
  • 11. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 11 Intel GPA Frame Analyzer
  • 12. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 12 Unity: Watch the profiler Decrease resolution. If framerate improves, GPU-bound GPA: Use the experiments: • If turning on NULL HW increases framerate, GPU-Bound • If NULL HW doesn’t help but DISABLE DRAW CALLS does, driver-bound • If neither help, CPU-bound Where’s that bottleneck?
  • 13. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 13 CPU: Check the Unity Profiler: What’s so expensive? Is it a constant cost? Are there hitches or frametime spikes? GPU: Is there a killer draw call? Are lots of little calls eating up frametime? Is everything rendered essential? Where next?
  • 14. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 14
  • 16. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 16 Scripting
  • 17. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 17 Script Frustum Culling Co-routines Help, I Can’t Stop Update()ing
  • 18. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 18 Scripting Fades
  • 19. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 19 Scripting with Memory in Mind Garbage Collection (GC)
  • 20. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 20 Object Pooling Reuse objects in a pool instead of instantiating and destroying them. Great for: bullets, explosions Catch 22: Heap memory cost, could trigger GC Slower GC Long-lasting, large groups aren’t ideal Garbage Collection Avoidance • Use structs instead of classes • Cache references to objects • Minimize runtime allocations Scripting with Memory in Mind
  • 21. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 21 Physics
  • 22. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 22 Physics • Use primitive colliders over mesh colliders • Tweak fixed delta time • Don’t move static colliders • If it needs to move, add a rigidbody and uncheck static
  • 23. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 23 Model Geometry
  • 24. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 24 Model Geometry The number of vertices processed by the GPU is greater than the number of geometric vertices in the model. Why? Vertices can be split for multiple normals/UV coordinates/etc Two Good Modeling Rules: 1. Don’t use more triangles than you need. 2. Reduce UV seams and hard edges when possible
  • 25. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 25 Model Geometry: LOD • Switch out mesh based on objects distance from camera • Customizable camera distances • Dramatic reduction in memory requirements by frame
  • 26. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 26 Level of Detail (LOD)
  • 27. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 27 Model Geometry: Occlusion Culling
  • 28. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 28 Model Geometry: Occlusion Culling Be sure to set occlusion areas, Unity defaults to using the whole scene
  • 29. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 29 Batching
  • 30. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 30 Batching The number of vertices processed by the GPU is greater than the number of geometric vertices in the model. Why? Vertices can be split for multiple normals/UV coordinates/etc Two Good Modeling Rules: 1. Don’t use more triangles than you need. 2. Reduce UV seams and hard edges when possible
  • 31. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 31 Static Batching Unity automatically performs Does not affect culling (unlike manual) No performance gain unless material is shared  texture atlas Cons: Memory overhead Dynamic Batching For small meshes (<900 vertex attributes) Incurs per-vertex CPU overhead, only a win if the CPU vertex transform work < extra draw call expense. Batching
  • 32. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 32 Textures and Shaders
  • 33. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 33 Textures • Compress when possible • Generate Mipmaps • UNLESS 2D game, UI element • 33% more memory per texture
  • 34. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 34 Texture Atlasing Combine multiple textures into one Texture2D.PackTextures. Why? •Reduce Material and Texture count •Reduce engine overhead on Material setup •Reduce engine overhead on Texture switch •Allow for more static batching
  • 35. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 35 Shaders Built-ins aren’t built for your game Only compute what you need • Reduce complex math operations (e.g. pow, exp, log, cos, sin, tan). Consider a lookup texture if applicable • Avoid writing your own versions of operations (e.g. normalize, dot, inversesqrt) as the built-in's ensure the driver can optimize as much as possible. • Float v. half v. fixed is largely ignored on desktop GPUs (everything is float on modern GPUs). Worry about it for mobile if you need it
  • 36. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 36 Lighting and Shadows
  • 37. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 37 Pros: Uses per-pixel, per-vertex and SH Real-time shadows and per-pixel effects Cons: Can lead to many draws to same pixel Lighting Path Quick Notes: Forward
  • 38. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 38 Pros: Lighting complexity unrelated to scene Trade heavy lighting computation for memory Lighting Path Quick Notes: Deferred Cons: Semi-transparent not supported directly No anti-aliasing No Receive Shadows flag support
  • 39. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 39 Lightmapping
  • 40. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 40 Lightmapping Mark all static geometry. Place light probes to fill all dynamic object paths Bake
  • 41. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 41 HDR If you’re using HDR effect like Bloom and Flare using deferred rendering, check HDR to reduce draw calls. Each camera has an HDR checkbox
  • 42. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 42 Shadows Avoid Realtime Shadows Soft shadows have a greater GPU overhead Use cascaded shadow maps for directional lights Tweak your shadow settings: • Shadow Filtering: hard/soft • Shadow Resolution: Resolution of shadow map • Shadow Projection: Stable/Close fit • Shadow Cascades: 0, 2, 4 • Shadow Distance: Max distance object’s shadow can project
  • 44. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice 44 Final Thoughts • Design with optimization in mind • Know what you’re optimizing for • If there’s an issue, profile first. • Profile, optimize, profile. • Make fast, fantastic games.
  • 45. Kelly Gawne Intel Games Engineer [email protected] 45 software.intel.com/gpa https://github.com/GameTechDev/ UnityPerformanceSandbox
  • 47. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice Legal Disclaimer & Optimization Notice INFORMATION IN THIS DOCUMENT IS PROVIDED “AS IS”. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO THIS INFORMATION INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark and MobileMark, are measured using specific computer systems, components, software, operations and functions. Any change to any of those factors may cause the results to vary. You should consult other information and performance tests to assist you in fully evaluating your contemplated purchases, including the performance of that product when combined with other products. Copyright © 2014, Intel Corporation. All rights reserved. Intel, Pentium, Xeon, Xeon Phi, Core, VTune, Cilk, and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries. Optimization Notice Intel’s compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice. Notice revision #20110804 47Intel Confidential
  • 48. 48
  • 49. Copyright © 2015, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice Intel Confidential 49 Intel® GPA Release Notes https://software.intel.com/en-us/articles/intel-gpa-release-notes

Editor's Notes

  • #9: Contents FPS (Frametime) The amount of time to process and render one frame. Only includes time to update and render game view, not editor scene view, inspector update or other editor only processing Batches Combined rendering of multiple objects into a chunk of memory in order to reduce CPU overhead due to resources switching (Draw calls?) Saved By Batching Number of batches that were combined. For best batching, share materials between as many obj as possible. Tris and Verts The number of triangles and vertices drawn Screen The screen dimensions + anti-aliasing level and memory usage SetPass The number of rendering passes. Each pass requires Unity runtime to bind a new shader (which may introduce CPU overhead) Visible Skinned Meshes Number of skinned meshes rendered Animations Number of animations playing
  • #10: Must be a Development Build Current Data + last several hundred frames Sub Profilers CPU usage, GPU usage, Rendering, Memory, Audio, Physics, and Physics 2D CPU Metrics: Rendering, Scripts, Physics, GarbageCollector, Vsync, and Others sections. Deep Profiling – all script code profiled to the function. Large overhead, lots o memory Manual Deep Profiling with Profiler. BeginSample CPU Render Time: Camera. Render Self – time in function, not subfunctions GC Alloc -- memory allocated in the current frame later collected by the garbage collector. Keep at 0 to avoid framrate hiccups Memory Memory in Unity, heap size, gfxDriver, audio driver, profiler, object count (num obj created. If increases, never destroyed) Detailed not realtime Audio Physics Active/Sleeping rigidbodies, number of contacts, static/dynamic colliders
  • #11: No dev build needed Metrics: CPU, GPU, Memory, Power, Rasterizer, Vertex-Shader, IA, Output-Merger, Device IO, EU’s
  • #12: Contains: All state changes, resources, timing info, and much more Format List of render targets Draw calls/clears/compute shaders – whatever takes time Details Panel Detail Per Draw Frame Overview: timing/stat broken down by GPU pipeline Details: ^ per draw call Texture: list of currently bound textures Shaders: view compiled shaders. Edit and see the effects immediately. Geometry Experiments Null Hardware: Infinitely fast GPU Hardware Disable Draw Calls: Infinitely fast GPU & Driver 2x2 Textures: simple tex Simple Pixel Shader
  • #18: Use: update function on a script is particularly expensive and doesn’t need to be called often Co-routines: functions with the ability to pause and resume execution. Start with Start() and set new update protocol
  • #19: Disable meshrenderer when fully transparent 
  • #28: reduce visible geometry and draw-calls in complex static scenes with lots of occlusion. Design levels with occlusion in mind. Goes through scene with virtual camera Makes hierarchy of potentially visible sets (PVS) or objects Data is composed of sells. View cells for static, target cells for moving The occlusion culling process goes through the scene using a virtual camera to build a hierarchy of potentially visible sets of objects. Each camera uses this data at runtime to determine what's visible. Avoid overdraw: renderqueue ordering
  • #31: Every draw call induces significant graphics API overhead, largely due to state changes between calls (e.g. switching to a different material) which causes expensive validation and translation steps in the gfx driver.
  • #32: Static batching works by transforming the static objects into world space and building a big vertex + index buffer for them. Then for visible objects w/I a batch, a series of "cheap" draw calls--requiring no state changes--is performed. (Does not actually reduce draw calls, just state changes which are the expensive part anyhow) Thus requires additional mem to store the combined geom. Even if geom is identical, a copy is created for each object. Thus: not ideal for a dense forest (^rendering performance but MASSIVE memory footprint) When using lots of pixel lights in the forward rendering path combining may not be ideal: meshes far enough apart to be affected by different pixel lights, if combined, must be rendered once for each pixel light.
  • #34: Use compressed textures, not uncompressed 32-bit RGBA (use 16!)--> smaller memory footprint, faster load times   Enable Generate Mipmaps in 3d scenes (let GPU use lower res for smaller tris) UNLESS texel maps 1:1 with rendered screen pixels (2d games, UI elements) Catch-22: Incurs 33% more memory per texture. Worth it unless memory is a real limiting factor (mobile)   Use pixel shader or texture combiners to mix textures instead of multiple passes Where possible, just use fewer textures
  • #38: FORWARD Pass BreakdownBase pass First per-pixel light reserved for brightest directional light. Next, up to 3 other per-pixel lights that are marked as important are drawn. If no lights are marked as important, the next 3 brightest from the scene are chosen. If there are more lights marked as important that exceed the “per-pixel light count” setting value in Project->Quality, then these are done in additional passes. Next, up to 4 lights are rendered per-vertex. Finally, remaining lights are drawn using spherical harmonic calculations (these values are always calculated, so essentially free on GPU). Per-pixel Lighting Pass An additional pass done for each per-pixel light remaining after the base pass. Semi-transparent Object Pass An additional pass done for semi-transparent objects. DEFERRED
  • #40: Bake all scene light into light map As long as you have mem/sampler headroom Use light probes for dynamic objects
  • #41: Bake all scene light into light map As long as you have mem/sampler headroom Use light probes for dynamic objects Non-Directional Flat Diffuse. Single lightmap storing info about how much light the surface emits assuming it's purely diffuse. Normalmaps and specularity aren't used. One texture, one texture sample, a few extra shader instructions Directional normalmapped diffuse. Adds a secondary lightmap storing the dominant light direction and factor proportional to how much light from the first lightmap is the from light along the dominant direction. Two textures, two texture samples, a few more extra shader instructions Directional with Specular full shading. Uses two lightmaps like directional, but split in halves. Left side stores direct light, right stores indirect. Light is stored as incoming intensity. This allows the shader to run the BRDF usually reserved for realtime lights for a full-featured material appearance. Two textures (twice the size of Directional), four textures samples, high extra shader cost (about equivalent to two un-shadowed lights)  
  • #43: Shadow Filtering – Method used to filter shadows Hard - When sampling from the shadow map, Unity takes the nearest shadow map pixel Soft – Averages several shadow map pixels to create smoother shadows. This options is more expensive, but creates a more natural looking shadow Shadow Resolution – Resolution of the generated shadow map Can significantly affect performance if using many point / spot lights Shadow Projection – Method used to project shadows Stable – Renders lower resolution shadows that do not cause wobbling if the camera moves Close Fit – Renders higher resolution shadow maps that can wobble slightly if the camera moves Shadow Cascades – The number of parallel splits used in cascades shadow maps (cascades closer to the viewer have higher resolution for improved quality) Can significantly impact directional light performance hadow Distance – Max distance from object that shadows can project Can significantly affect fragment shader performance if using directional light Can be changed on the fly via script Performance results will vary as the GPU usage is dependent on the scene and how many objects are casting/receiving shadows. As always, it is important to use the lowest quality settings required to achieve the desired look. It is generally recommended to change the default shadow distance to a lower value.