售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Title Page
Second Edition
Copyright
Unity 2017 Game Optimization
Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Why subscribe?
Customer Feedback
Software and Hardware List
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
Pursuing Performance Problems
The Unity Profiler
Launching the Profiler
Editor or standalone instances
Connecting to a WebGL instance
Remote connection to an iOS device
Remote connection to an Android device
Editor profiling
The Profiler window
Profiler controls
Add Profiler
Record
Deep Profile
Profile Editor
Connected Player
Clear
Load
Save
Frame Selection
Timeline View
Breakdown View Controls
Breakdown View
The CPU Usage Area
The GPU Usage Area
The Rendering Area
The Memory Area
The Audio Area
The Physics 3D and Physics 2D Areas
The Network Messages and Network Operations Areas
The Video Area
The UI and UI Details Areas
The Global Illumination Area
Best approaches to performance analysis
Verifying script presence
Verifying script count
Verifying the order of events
Minimizing ongoing code changes
Minimizing internal distractions
Minimizing external distractions
Targeted profiling of code segments
Profiler script control
Custom CPU Profiling
Final thoughts on Profiling and Analysis
Understanding the Profiler
Reducing noise
Focusing on the issue
Summary
Scripting Strategies
Obtain Components using the fastest method
Remove empty callback definitions
Cache Component references
Share calculation output
Update, Coroutines, and InvokeRepeating
Faster GameObject null reference checks
Avoid retrieving string properties from GameObjects
Use appropriate data structures
Avoid re-parenting Transforms at runtime
Consider caching Transform changes
Avoid Find() and SendMessage() at runtime
Assigning references to pre-existing objects
Static Classes
Singleton Components
A global Messaging System
A globally accessible object
Registration
Message processing
Implementing the Messaging System
Message queuing and processing
Implementing custom messages
Message sending
Message registration
Message cleanup
Wrapping up the Messaging System
Disable unused scripts and objects
Disabling objects by visibility
Disabling objects by distance
Consider using distance-squared over distance
Minimize Deserialization behavior
Reduce serialized object size
Load serialized objects asynchronously
Keep previously loaded serialized objects in memory
Move common data into ScriptableObjects
Load scenes additively and asynchronously
Create a custom Update() layer
Summary
The Benefits of Batching
Draw Calls
Materials and Shaders
The Frame Debugger
Dynamic Batching
Vertex attributes
Mesh scaling
Dynamic Batching summary
Static Batching
The Static flag
Memory requirements
Material references
Static Batching caveats
Edit Mode debugging of Static Batching
Instantiating static meshes at runtime
Static Batching summary
Summary
Kickstart Your Art
Audio
Importing audio files
Loading audio files
Encoding formats and quality levels
Audio performance enhancements
Minimize active Audio Source count
Enable Force to Mono for 3D sounds
Resample to lower frequencies
Consider all compression formats
Beware of streaming
Apply Filter Effects through Mixer Groups to reduce duplication
Use remote content streaming responsibly
Consider Audio Module files for background music
Texture files
Texture compression formats
Texture performance enhancements
Reduce texture file size
Use Mip Maps wisely
Manage resolution downscaling externally
Adjust Anisotropic Filtering levels
Consider Atlasing
Adjust compression rates for non-square textures
Sparse Textures
Procedural Materials
Asynchronous Texture Uploading
Mesh and animation files
Reduce polygon count
Tweak Mesh Compression
Use Read-Write Enabled appropriately
Consider baked animations
Combine meshes
Asset Bundles and Resources
Summary
Faster Physics
Physics Engine internals
Physics and time
Maximum Allowed Timestep
Physics updates and runtime changes
Static Colliders and Dynamic Colliders
Collision detection
Collider types
The Collision Matrix
Rigidbody active and sleeping states
Ray and object casting
Debugging Physics
Physics performance optimizations
Scene setup
Scaling
Positioning
Mass
Use Static Colliders appropriately
Use Trigger Volumes responsibly
Optimize the Collision Matrix
Prefer Discrete collision detection
Modify the Fixed Update frequency
Adjust the Maximum Allowed Timestep
Minimize Raycasting and bounding-volume checks
Avoid complex Mesh Colliders
Use simpler primitives
Use simpler Mesh Colliders
Avoid complex physics Components
Let physics objects sleep
Modify the Solver Iteration Count
Optimize Ragdolls
Reduce Joints and Colliders
Avoid inter-Ragdoll collisions
Replace, deactivate or remove inactive Ragdolls
Know when to use physics
Summary
Dynamic Graphics
The Rendering Pipeline
The GPU Front End
The GPU Back End
Fill Rate
Overdraw
Memory Bandwidth
Lighting and Shadowing
Forward Rendering
Deferred Rendering
Vertex Lit Shading (legacy)
Global Illumination
Multithreaded Rendering
Low-level rendering APIs
Detecting performance issues
Profiling rendering issues
Brute-force testing
Rendering performance enhancements
Enable/Disable GPU Skinning
Reduce geometric complexity
Reduce Tessellation
Employ GPU Instancing
Use mesh-based Level Of Detail (LOD)
Culling Groups
Make use of Occlusion Culling
Optimizing Particle Systems
Make use of Particle System Culling
Avoid recursive Particle System calls
Optimizing Unity UI
Use more Canvases
Separate objects between static and dynamic canvases
Disable Raycast Target for noninteractive elements
Hide UI elements by disabling the parent Canvas Component
Avoid Animator Components
Explicitly define the Event Camera for World Space Canvases
Don't use alpha to hide UI elements
Optimizing ScrollRects
Make sure to use a RectMask2D
Disable Pixel Perfect for ScrollRects
Manually stop ScrollRect motion
Use empty UIText elements for full-screen interaction
Check the Unity UI source code
Check the documentation
Shader optimization
Consider using Shaders intended for mobile platforms
Use small data types
Avoid changing precision while swizzling
Use GPU-optimized helper functions
Disable unnecessary features
Remove unnecessary input data
Expose only necessary variables
Reduce mathematical complexity
Reduce texture sampling
Avoid conditional statements
Reduce data dependencies
Surface Shaders
Use Shader-based LOD
Use less texture data
Test different GPU Texture Compression formats
Minimize texture swapping
VRAM limits
Preload textures with hidden GameObjects
Avoid texture thrashing
Lighting optimization
Use real-time Shadows responsibly
Use Culling Masks
Use baked Lightmaps
Optimizing rendering performance for mobile devices
Avoid Alpha Testing
Minimize Draw Calls
Minimize Material count
Minimize texture size
Make textures square and power-of-two
Use the lowest possible precision formats in Shaders
Summary
Virtual Velocity and Augmented Acceleration
XR Development
Emulation
User comfort
Performance enhancements
The kitchen sink
Single-Pass versus Multi-Pass Stereo Rendering
Apply anti-aliasing
Prefer Forward Rendering
Image effects in VR
Backface culling
Spatialized audio
Avoid camera physics collisions
Avoid Euler angles
Exercise restraint
Keep up to date with the latest developments
Summary
Masterful Memory Management
The Mono platform
Memory Domains
Garbage collection
Memory Fragmentation
Garbage collection at runtime
Threaded garbage collection
Code compilation
IL2CPP
Profiling memory
Profiling memory consumption
Profiling memory efficiency
Memory management performance enhancements
Garbage collection tactics
Manual JIT compilation
Value types and Reference types
Pass by value and by reference
Structs are Value types
Arrays are Reference types
Strings are immutable Reference types
String concatenation
StringBuilder
String formatting
Boxing
The importance of data layout
Arrays from the Unity API
Using InstanceIDs for dictionary keys
foreach loops
Coroutines
Closures
The .NET library functions
Temporary work buffers
Object Pooling
Prefab Pooling
Poolable Components
The Prefab Pooling System
Prefab pools
Object spawning
Instance prespawning
Object despawning
Prefab pool testing
Prefab Pooling and Scene loading
Prefab Pooling summary
IL2CPP optimizations
WebGL optimizations
The future of Unity, Mono, and IL2CPP
The upcoming C# Job System
Summary
Tactical Tips and Tricks
Editor hotkey tips
GameObjects
Scene window
Arrays
Interface
In-editor documentation
Editor UI tips
Script Execution Order
Editor files
The Inspector window
The Project window
The Hierarchy window
The Scene and Game windows
Play Mode
Scripting tips
General
Attributes
Variable attributes
Class attributes
Logging
Useful links
Custom Editor scripts and menu tips
External tips
Other tips
Summary
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜