舉報

會員
Unity Game Optimization
Unityenginecomeswithagreatsetoffeaturestohelpyoubuildhigh-performancegames.ThisUnitybookisyourguidetooptimizingvariousaspectsofyourgamedevelopment,fromgamecharactersandscripts,rightthroughtoanimations.You’llexploretechniquesforwritingbettergamescriptsandlearnhowtooptimizeagameusingUnitytechnologiessuchasECSandtheBurstcompiler.Thebookwillalsohelpyoumanagethird-partytoolingusedwiththeUnityecosystem.You’llalsofocusontheproblemsintheperformanceoflargegamesandvirtualreality(VR)projectsinUnity,gaininginsightsintodetectingperformanceissuesandperformingrootcauseanalysis.Asyouprogress,you’lldiscoverbestpracticesforyourUnityC#scriptcodeandgettogripswithusagepatterns.Later,you’llbeabletooptimizeaudioresourcesandtexturefiles,alongwitheffectivelystoringandusingresourcefiles.You’llthendelveintotheRenderingPipelineandlearnhowtoidentifyperformanceproblemsinthepipeline.Inadditiontothis,you’lllearnhowtooptimizethememoryandprocessingunitofUnity.Finally,you’llcovertipsandtricksusedbyUnityprofessionalstoimprovetheprojectworkflow.Bytheendofthisbook,you’llhavedevelopedtheskillsyouneedtobuildinteractivegamesusingUnityanditscomponents.
最新章節
- Leave a review - let other readers know what you think
- Summary
- Other tips
- External tips
- Custom Editor scripts and menu tips
- Useful links
品牌:中圖公司
上架時間:2021-06-24 12:03:47
出版社:Packt Publishing
本書數字版權由中圖公司提供,并由其授權上海閱文信息技術有限公司制作發行
- Leave a review - let other readers know what you think 更新時間:2021-06-24 12:13:56
- Summary
- Other tips
- External tips
- Custom Editor scripts and menu tips
- Useful links
- Logging
- Class attributes
- Variable attributes
- Attributes
- General
- Scripting tips
- Playmode
- The Scene and Game windows
- The Hierarchy window
- The Project window
- The Inspector window
- Editor files
- Script Execution Order
- Editor UI tips
- In-editor documentation
- Interface
- Arrays
- Scene window
- Working with GameObjects
- Editor hotkey tips
- Tactical Tips and Tricks
- Summary
- The burst compiler
- Mixing ECS and jobs
- The new ECS
- A more complex example
- A basic job
- The Unity Job System
- A small example
- The problem of multithreading
- The Data-Oriented Technology Stack
- Summary
- WebGL optimizations
- IL2CPP optimizations
- Prefab pooling summary
- Prefab pooling and scene loading
- Prefab pool testing
- Object despawning
- Instance prespawning
- Object spawning
- Prefab pools
- The Prefab pooling system
- Poolable components
- Prefab pooling
- Object pooling
- Temporary work buffers
- The .NET library functions
- Closures
- Coroutines
- foreach loops
- Using InstanceIDs for dictionary keys
- Arrays from the Unity API
- The importance of data layout
- Boxing
- String formatting
- StringBuilder
- String concatenation
- Strings are immutable reference types
- Arrays are reference types
- Structs are value types
- Pass by value and by reference
- Value types and reference types
- Manual JIT compilation
- Garbage collection tactics
- Memory management performance enhancements
- Profiling memory efficiency
- Profiling memory consumption
- Profiling memory
- IL2CPP
- Code compilation
- Threaded garbage collection
- Garbage collection at runtime
- Memory fragmentation
- Garbage collection
- The heap
- The stack
- Memory domains
- The Mono platform
- Masterful Memory Management
- Summary
- Keeping up to date with the latest developments
- Exercise restraint
- Avoiding Euler angles
- Avoiding camera physics collisions
- Spatialized audio
- Backface culling
- Applying image effects in VR
- Using forward rendering
- Applying antialiasing
- Single Pass versus Multi Pass Stereo rendering
- The kitchen sink
- Performance enhancements in XR
- User comfort
- Developing XR products
- Overview of XR technology
- Optimizations for Virtual and Augmented Reality
- Section 3: Advance Optimizations
- Summary
- Using the lowest possible precision formats in shaders
- Making textures square and the power-of-two
- Minimizing texture size
- Minimizing Material count
- Minimizing draw calls
- Avoiding alpha testing
- Optimizing rendering performance for mobile devices
- Using baked lightmaps
- Using culling masks
- Using real-time shadows responsibly
- Lighting optimization
- Avoid texture thrashing
- Preloading textures with hidden GameObjects
- VRAM limits
- Minimizing texture swapping
- Testing different GPU texture compression formats
- Using less texture data
- Use shader-based LOD
- Surface Shaders
- Reducing data dependencies
- Avoiding conditional statements
- Reducing texture sampling
- Reducing mathematical complexity
- Exposing only necessary variables
- Removing unnecessary input data
- Disabling unnecessary features
- Using GPU-optimized helper functions
- Avoiding changing precision while swizzling
- Using small data types
- Consider using shaders intended for mobile platforms
- Shader optimization
- Checking the documentation
- Checking the Unity UI source code
- Using empty UIText elements for full-screen interaction
- Manually stop ScrollRect motion
- Disable Pixel Perfect for ScrollRects
- Make sure to use a RectMask2D
- Optimizing ScrollRects
- Don't use alpha to hide UI elements
- Explicitly defining the event camera for World Space Canvases
- Avoiding Animator components
- Hiding UI elements by disabling the parent Canvas component
- Disabling Raycast Target for non-interactive elements
- Separating objects between static and dynamic Canvases
- Using more Canvases
- Optimizing Unity UI
- Avoiding recursive Particle System calls
- Making use of Particle System culling
- Optimizing Particle Systems
- Making use of Occlusion Culling
- Culling groups
- Using mesh-based LOD
- Employing GPU instancing
- Reducing tessellation
- Reducing geometric complexity
- Enabling/disabling GPU skinning
- Rendering performance enhancements
- Brute force testing
- Profiling rendering issues
- Detecting performance issues
- Low-level rendering APIs
- Multithreaded Rendering
- Global Illumination
- Vertex-Lit shading (legacy)
- Deferred Shading
- Forward Rendering
- Lighting and shadowing
- Memory bandwidth
- Overdraw
- Fill Rate
- The GPU backend
- The GPU frontend
- Exploring the Rendering Pipeline
- Dynamic Graphics
- Summary
- Knowing when to use physics
- Replacing deactivating or removing inactive ragdolls
- Avoiding inter-ragdoll collisions
- Reducing joints and colliders
- Optimizing ragdolls
- Modifying the solver iteration count
- Letting physics objects sleep
- Avoiding complex physics components
- Using simpler Mesh Colliders
- Using simpler primitives
- Avoiding complex Mesh Colliders
- Minimizing raycasting and bounding-volume checks
- Adjusting the Maximum Allowed Timestep
- Modifying the fixed update frequency
- Preferring discrete collision detection
- Optimizing the Collision Matrix
- Using trigger volumes responsibly
- Using static colliders appropriately
- Mass
- Positioning
- Scaling
- Scene setup
- Physics performance optimizations
- Debugging physics
- Ray and object casting
- Rigidbody active and sleeping states
- The Collision Matrix
- Collider types
- Collision detection
- Static colliders and dynamic colliders
- Physics updates and runtime changes
- Maximum Allowed Timestep
- Physics and time
- Understanding the physics engine
- Faster Physics
- Summary
- Asset bundles and resources
- Combining meshes
- Considering baked animations
- Using Read-Write Enabled appropriately
- Tweaking mesh compression
- Reducing the polygon count
- Mesh and animation files
- Asynchronous texture uploading
- Procedural materials
- Sparse textures
- Adjusting compression rates for nonsquare textures
- Consider atlasing
- Adjusting anisotropic filtering levels
- Managing resolution downscaling externally
- Using mipmaps wisely
- Reducing texture file size
- Texture performance enhancements
- Texture compression formats
- Texture files
- Consider using audio module files for background music
- Using remote content streaming responsibly
- Applying filter effects through mixer groups to reduce duplication
- Being cautious of streaming
- Considering all compression formats
- Resampling to lower frequencies
- Enabling Force to Mono for 3D sounds
- Minimizing active audio source count
- Audio performance enhancements
- Encoding formats and quality levels
- Loading audio files
- Importing audio files
- Audio
- Optimizing Your Art Assets
- Summary
- Static batching summary
- Instantiating static meshes at runtime
- Edit Mode debugging of static batching
- Static batching caveats
- Material references
- Memory requirements
- The Static flag
- Static batching
- Dynamic batching summary
- Mesh scaling
- Vertex attributes
- Dynamic batching
- The Frame Debugger
- Materials and shaders
- Draw calls
- The Benefits of Batching
- Section 2: Graphical Optimizations
- Summary
- Creating a custom Update() layer
- Loading scenes additively and asynchronously
- Moving common data into ScriptableObjects
- Keeping previously loaded serialized objects in memory
- Loading serialized objects asynchronously
- Reducing serialized object size
- Minimizing deserialization behavior
- Using distance-squared over distance
- Disabling objects by distance
- Disabling objects by visibility
- Disabling unused scripts and objects
- Wrapping up the messaging system
- Message cleanup
- Message registration
- Message sending
- Implementing custom messages
- Message queuing and processing
- Implementing the messaging system
- Message processing
- Registration
- A globally accessible object
- A global messaging system
- Singleton components
- Static classes
- Assigning references to pre-existing objects
- Avoiding Find() and SendMessage() at runtime
- Considering caching transform changes
- Avoiding re-parenting transforms at runtime
- Using appropriate data structures
- Avoid retrieving string properties from GameObjects
- Faster GameObject null reference checks
- Update coroutines and InvokeRepeating
- Sharing calculation output
- Caching component references
- Removing empty callback definitions
- Obtaining components using the fastest method
- Scripting Strategies
- Summary
- Focusing on the issue
- Reducing noise
- Understanding the Profiler
- Final thoughts on profiling and analysis
- Custom CPU profiling
- Profiler script control
- Targeted profiling of code segments
- Minimizing external distractions
- Minimizing internal distractions
- Minimizing ongoing code changes
- Verifying the order of events
- Verifying script count
- Verifying script presence
- Best approaches to performance analysis
- The Global Illumination area
- The UI and UI Details areas
- The Video area
- The network messages and network operations areas
- The Physics 3D and Physics 2D areas
- The Audio area
- The Memory area
- The Rendering area
- The GPU Usage area
- The CPU Usage area
- Breakdown View
- Breakdown View Controls
- Timeline View
- Frame Selection
- Save
- Load
- Clear
- Allocation Callstack
- Deep Profile
- Record
- Playmode
- Add Profiler
- Profiler controls
- The Profiler window
- Editor profiling
- Remote connection to an Android device
- Remote connection to an iOS device
- Connecting to a WebGL instance
- Editor or standalone instances
- Launching the Profiler
- Gathering profiling data using the Unity Profiler
- Evaluating Performance Problems
- Section 1: Base Scripting Optimization
- Reviews
- Get in touch
- Conventions used
- Download the color images
- Download the example code files
- To get the most out of this book
- What this book covers
- Who this book is for
- Preface
- Packt is searching for authors like you
- About the reviewer
- About the authors
- Contributors
- Why subscribe?
- About Packt
- Dedication
- Unity Game OptimizationThird Edition
- Copyright and Credits
- Title Page
- coverpage
- coverpage
- Title Page
- Copyright and Credits
- Unity Game OptimizationThird Edition
- Dedication
- About Packt
- Why subscribe?
- Contributors
- About the authors
- About the reviewer
- Packt is searching for authors like you
- Preface
- Who this book is for
- What this book covers
- To get the most out of this book
- Download the example code files
- Download the color images
- Conventions used
- Get in touch
- Reviews
- Section 1: Base Scripting Optimization
- Evaluating Performance Problems
- Gathering profiling data using 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
- Playmode
- Record
- Deep Profile
- Allocation Callstack
- 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
- Obtaining components using the fastest method
- Removing empty callback definitions
- Caching component references
- Sharing calculation output
- Update coroutines and InvokeRepeating
- Faster GameObject null reference checks
- Avoid retrieving string properties from GameObjects
- Using appropriate data structures
- Avoiding re-parenting transforms at runtime
- Considering caching transform changes
- Avoiding 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
- Disabling unused scripts and objects
- Disabling objects by visibility
- Disabling objects by distance
- Using distance-squared over distance
- Minimizing deserialization behavior
- Reducing serialized object size
- Loading serialized objects asynchronously
- Keeping previously loaded serialized objects in memory
- Moving common data into ScriptableObjects
- Loading scenes additively and asynchronously
- Creating a custom Update() layer
- Summary
- Section 2: Graphical Optimizations
- 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
- Optimizing Your Art Assets
- Audio
- Importing audio files
- Loading audio files
- Encoding formats and quality levels
- Audio performance enhancements
- Minimizing active audio source count
- Enabling Force to Mono for 3D sounds
- Resampling to lower frequencies
- Considering all compression formats
- Being cautious of streaming
- Applying filter effects through mixer groups to reduce duplication
- Using remote content streaming responsibly
- Consider using audio module files for background music
- Texture files
- Texture compression formats
- Texture performance enhancements
- Reducing texture file size
- Using mipmaps wisely
- Managing resolution downscaling externally
- Adjusting anisotropic filtering levels
- Consider atlasing
- Adjusting compression rates for nonsquare textures
- Sparse textures
- Procedural materials
- Asynchronous texture uploading
- Mesh and animation files
- Reducing the polygon count
- Tweaking mesh compression
- Using Read-Write Enabled appropriately
- Considering baked animations
- Combining meshes
- Asset bundles and resources
- Summary
- Faster Physics
- Understanding the physics engine
- 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
- Using static colliders appropriately
- Using trigger volumes responsibly
- Optimizing the Collision Matrix
- Preferring discrete collision detection
- Modifying the fixed update frequency
- Adjusting the Maximum Allowed Timestep
- Minimizing raycasting and bounding-volume checks
- Avoiding complex Mesh Colliders
- Using simpler primitives
- Using simpler Mesh Colliders
- Avoiding complex physics components
- Letting physics objects sleep
- Modifying the solver iteration count
- Optimizing ragdolls
- Reducing joints and colliders
- Avoiding inter-ragdoll collisions
- Replacing deactivating or removing inactive ragdolls
- Knowing when to use physics
- Summary
- Dynamic Graphics
- Exploring the Rendering Pipeline
- The GPU frontend
- The GPU backend
- Fill Rate
- Overdraw
- Memory bandwidth
- Lighting and shadowing
- Forward Rendering
- Deferred Shading
- Vertex-Lit shading (legacy)
- Global Illumination
- Multithreaded Rendering
- Low-level rendering APIs
- Detecting performance issues
- Profiling rendering issues
- Brute force testing
- Rendering performance enhancements
- Enabling/disabling GPU skinning
- Reducing geometric complexity
- Reducing tessellation
- Employing GPU instancing
- Using mesh-based LOD
- Culling groups
- Making use of Occlusion Culling
- Optimizing Particle Systems
- Making use of Particle System culling
- Avoiding recursive Particle System calls
- Optimizing Unity UI
- Using more Canvases
- Separating objects between static and dynamic Canvases
- Disabling Raycast Target for non-interactive elements
- Hiding UI elements by disabling the parent Canvas component
- Avoiding Animator components
- Explicitly defining 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
- Using empty UIText elements for full-screen interaction
- Checking the Unity UI source code
- Checking the documentation
- Shader optimization
- Consider using shaders intended for mobile platforms
- Using small data types
- Avoiding changing precision while swizzling
- Using GPU-optimized helper functions
- Disabling unnecessary features
- Removing unnecessary input data
- Exposing only necessary variables
- Reducing mathematical complexity
- Reducing texture sampling
- Avoiding conditional statements
- Reducing data dependencies
- Surface Shaders
- Use shader-based LOD
- Using less texture data
- Testing different GPU texture compression formats
- Minimizing texture swapping
- VRAM limits
- Preloading textures with hidden GameObjects
- Avoid texture thrashing
- Lighting optimization
- Using real-time shadows responsibly
- Using culling masks
- Using baked lightmaps
- Optimizing rendering performance for mobile devices
- Avoiding alpha testing
- Minimizing draw calls
- Minimizing Material count
- Minimizing texture size
- Making textures square and the power-of-two
- Using the lowest possible precision formats in shaders
- Summary
- Section 3: Advance Optimizations
- Optimizations for Virtual and Augmented Reality
- Overview of XR technology
- Developing XR products
- User comfort
- Performance enhancements in XR
- The kitchen sink
- Single Pass versus Multi Pass Stereo rendering
- Applying antialiasing
- Using forward rendering
- Applying image effects in VR
- Backface culling
- Spatialized audio
- Avoiding camera physics collisions
- Avoiding Euler angles
- Exercise restraint
- Keeping up to date with the latest developments
- Summary
- Masterful Memory Management
- The Mono platform
- Memory domains
- The stack
- The heap
- 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
- Summary
- The Data-Oriented Technology Stack
- The problem of multithreading
- A small example
- The Unity Job System
- A basic job
- A more complex example
- The new ECS
- Mixing ECS and jobs
- The burst compiler
- Summary
- Tactical Tips and Tricks
- Editor hotkey tips
- Working with 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
- Playmode
- Scripting tips
- General
- Attributes
- Variable attributes
- Class attributes
- Logging
- Useful links
- Custom Editor scripts and menu tips
- External tips
- Other tips
- Summary
- Leave a review - let other readers know what you think 更新時間:2021-06-24 12:13:56