Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unity 5 for Android Essentials

You're reading from   Unity 5 for Android Essentials A fast-paced guide to building impressive games and applications for Android devices with Unity 5

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher
ISBN-13 9781784399191
Length 200 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Valera Cogut Valera Cogut
Author Profile Icon Valera Cogut
Valera Cogut
Arrow right icon
View More author details
Toc

Real-practice techniques


There are two different performance optimization techniques that are used by many professional developers from all over the world.

The high-speed, off-screen particles technique in Unity

The next technique is to optimize the particle system, which was introduced by NVIDIA, GPU Gems 3. The first step in order to achieve the goal is to render particles into RenderTexture or, in other words, into another render target with smaller size than screen. The second step in this idea is to blend the particles back into screen. First, we need depth buffer. When we render into another render target, we need depth buffer for its z-testing. In the following line of code, you can register in the Awake or Start callbacks just as examples:

this.camera.depthTextureMode = DepthTextureMode.depth;

Let's consider following code for high-speed, off-screen particles:

// create the off-screen particles textureRenderTexture yourParticlesRenderTexture = RenderTexture.GetTemporary(
  Screen.width...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image