万本电子书0元读

万本电子书0元读

顶部广告

Unity 5 Game Optimization电子书

售       价:¥

5人正在读 | 0人评论 9.8

作       者:Chris Dickinson

出  版  社:Packt Publishing

出版时间:2015-11-01

字       数:585.4万

所属分类: 进口书 > 外文原版书 > 其他

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Master performance optimization for Unity3D applications with tips and techniques that cover every aspect of the Unity3D EngineAbout This BookOptimize CPU cycles, memory usage, and GPU throughput for any Unity3D applicationMaster optimization techniques across all Unity Engine features including Scripting, Asset Management, Physics, Graphics Features, and ShadersA practical guide to exploring Unity Engine's many performance-enhancing methodsWho This Book Is ForThis book is intended for intermediate and advanced Unity developers who have experience with most of Unity’s feature-set, and who want to maximize the performance of their game. Familiarity with the C# language will be needed.What You Will LearnUse the Unity Profiler to find bottlenecks anywhere in our application, and discover how to resolve themImplement best-practices for C# *ing to avoid common pitfallsDevelop a solid understanding of the rendering pipeline, and maximize its performance through reducing draw calls and avoiding fill rate bottlenecksEnhance shaders in a way that is accessible to most developers, optimizing them through subtle yet effective performance tweaksKeep our scenes as dynamic as possible by making the most of the Physics engineOrganize, filter, and compress our art assets to maximize performance while maintaining high qualityPull back the veil on the Mono Framework and the C# Language to implement low-level enhancements that maximize memory usage and avoid garbage collectionGet to know the best practices for project organization to save time through an improved workflowIn DetailCompetition within the gaming industry has become significantly fiercer in recent years with the adoption of game development frameworks such as Unity3D. Through its massive feature-set and ease-of-use, Unity helps put some of the best processing and rendering technology in the hands of hobbyists and professionals alike. This has led to an enormous explosion of talent, which has made it critical to ensure our games stand out from the crowd through a high level of quality. A good user experience is essential to create a solid product that our users will enjoy for many years to come.Nothing turns gamers away from a game faster than a poor user-experience. Input latency, slow rendering, broken physics, stutters, freezes, and crashes are among a gamer’s worst nightmares and it’s up to us as game developers to ensure this never happens. High performance does not need to be limited to games with the biggest teams and budgets.Initially, you will explore the major features of the Unity3D Engine from top to bottom, investigating a multitude of ways we can improve application performance starting with the detection and analysis of bottlenecks. You’ll then gain an understanding of possible solutions and how to implement them. You will then learn everything you need to know about where performance bottlenecks can be found, why they happen, and how to work around them.This book gathers a massive wealth of knowledge together in one place, saving many hours of research and can be used as a quick reference to solve specific issues that arise during product development.Style and approachThis book is organized based on the major features of Unity engine and should be treated as a reference guide. It is written as a series of investigations into both common and unusual performance pitfalls, each including a study on why the bottleneck is causing us problems, and a list of enhancements or features that can be used to work around them. Differences in effectiveness, behaviors, or feature-sets between Unity 4.x and Unity 5.x will be highlighted.
目录展开

Unity 5 Game Optimization

Table of Contents

Unity 5 Game Optimization

Credits

About the Author

Acknowledgments

About the Reviewers

www.PacktPub.com

Support files, eBooks, discount offers, and more

Why subscribe?

Free access for Packt account holders

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

Errata

Piracy

Questions

1. Detecting Performance Issues

The Unity Profiler

Launching the Profiler

Editor or standalone instances

Editor profiling

The Unity Webplayer connection

Remote connection to an iOS device

Remote connection to an Android device

The Profiler window

Controls

CPU Area

The GPU Area

The Rendering Area

The Memory Area

The Audio Area

The Physics 3D/2D Area

Best approaches to performance analysis

Verifying script presence

Verifying script count

Minimizing ongoing code changes

Minimizing internal distractions

Minimizing external distractions

Targeted profiling of code segments

Profiler script control

Custom CPU Profiling

Saving and loading Profiler data

Saving Profiler data

Loading Profiler data

Final thoughts on Profiling and Analysis

Understanding the Profiler

Reducing noise

Focusing on the issue

Summary

2. Scripting Strategies

Cache Component references

Obtaining Components using the fastest method

Removing empty callback declarations

Avoiding the Find() and SendMessage() methods at runtime

Static classes

Singleton Components

Assigning references to pre-existing objects

A global messaging system

A globally accessible object

Registration

Message processing

Implementing the messaging system

Message queuing and processing

Implementing a custom message

Message registration

Message sending

Message cleanup

Wrapping up the messaging system

Disabling unused scripts and objects

Disabling objects by visibility

Disabling objects by distance

Consider using distance-squared over distance

Avoid retrieving string properties from GameObjects

Update, Coroutines, and InvokeRepeating

Consider caching Transform changes

Faster GameObject null reference checks

Summary

3. The Benefits of Batching

Draw Calls

Materials and Shaders

Dynamic Batching

Vertex attributes

Uniform scaling

Dynamic Batching summary

Static Batching

The Static flag

Memory requirements

Material references

Static Batching caveats

Edit Mode debugging of Static Batching

Avoiding instantiating static meshes at runtime

Visibility and rendering

Static Batching summary

Summary

4. Kickstart Your Art

Audio

Loading audio files

Profiling audio

Additional loading options

Encoding formats and quality levels

Audio performance enhancements

Minimize active Audio Source count

Minimize Audio Clip references

Enable Force to Mono for 3D sounds

Resample to lower frequencies

Consider all encoding formats

Beware of streaming

Apply Filter effects through Mixer groups to reduce duplication

Use "WWW.audioClip" responsibly

Consider Audio Module files for background music

Texture files

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

Mesh and animation files

Reducing polygon count

Tweaking Mesh Compression

Use Read-Write Enabled appropriately

Import/calculate only what's needed

Consider baked animations

Let Unity optimize meshes

Combine meshes

Summary

5. Faster Physics

Physics Engine internals

Physics and time

The Fixed Update loop

Maximum Allowed Timestep

Physics updates and runtime changes

Static and Dynamic Colliders

Collision detection

Collider types

The Collision Matrix

Rigidbody active and sleeping states

Ray and object casting

Physics performance optimizations

Scene setup

Scaling

Positioning

Mass

Use Static Colliders appropriately

Optimize the Collision Matrix

Prefer discrete collision detection

Modify the FixedUpdate frequency

Adjust the Maximum Allowed Timestep

Minimize cast and bounding-volume checks

Avoid complex Mesh Colliders

Use simpler primitives

Use simpler Mesh Colliders

Avoid complex physics components

Let physics objects sleep

Modify Solver Iteration Count

Optimizing ragdolls

Reduce Joints and Colliders

Avoid inter-ragdoll collisions

Disable or remove inactive ragdolls

Know when to use physics

Consider upgrading to Unity 5

Summary

6. Dynamic Graphics

Profiling rendering issues

GPU profiling

The Frame Debugger

Brute force testing

CPU-bound

Multithreaded rendering

GPU Skinning

Front end bottlenecks

Level Of Detail

Disable GPU Skinning

Reduce tessellation

Back end bottlenecks

Fill rate

Overdraw

Occlusion Culling

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

Only expose necessary variables

Reduce mathematical complexity

Reduce texture lookups

Avoid conditional statements

Reduce data dependencies

Surface Shaders

Use Shader-based LOD

Memory bandwidth

Use less texture data

Test different GPU Texture Compression formats

Minimize texture sampling

Organize assets to reduce texture swaps

VRAM limits

Texture preloading

Texture thrashing

Lighting and Shadowing

Forward Rendering

Deferred Shading

Vertex Lit Shading (legacy)

Real-time Shadows

Lighting optimization

Use the appropriate Shading Mode

Use Culling Masks

Use Baked Lightmaps

Optimize Shadows

Optimizing graphics for mobile

Minimize Draw Calls

Minimize the Material count

Minimize texture size and Material count

Make textures square and power of 2

Use the lowest possible precision formats in Shaders

Avoid Alpha Testing

Summary

7. Masterful Memory Management

The Mono platform

The compilation process

Manual JIT compilation

Memory usage optimization

Unity memory domains

Native memory

Managed memory

Garbage collection

Memory fragmentation

Garbage collection at runtime

Threaded garbage collection

Garbage collection tactics

Value types and Reference types

Pass by value and pass by reference

Structs are Value types

Arrays are Reference types

Strings are immutable Reference types

String concatenation

Boxing

The importance of data layout

The Unity API

The foreach loops

Coroutines

Closures

.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

The future of Mono and Unity

Summary

8. Tactical Tips and Tricks

Editor hotkey tips

GameObjects

Scene View

Arrays

Interface

Other

Editor interface tips

General

The Inspector View

The Project View

The Hierarchy View

The Scene and Game Views

Play Mode

Scripting tips

General

Attributes

Variable attributes

Class attributes

Logging

Useful links

Custom editors/menus tips

External tips

Other tips

Summary

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部