x


fading alpha renderer.a vs shader performance

Hey guys,

Just a quick performance question i was interested in. Whenever i've had to fade objects in and out i've always done a modification of the renderer property by assigning a new Color to it over time in a while loop (coroutine). What i was wondering is if it has a big performance hit if done to several objects on screen? I've done some testing on iPad 2/3 and some Android devices and it seems fine.

Would it be better if i had a shader handle the alpha value for me? And just pass in a new value to the shader over time?

more ▼

asked Mar 27 '12 at 10:55 PM

Default117 gravatar image

Default117
331 26 29 33

The shader is handing the alpha value. That's what you're doing when you change renderer.material.color.

Mar 28 '12 at 12:14 AM Eric5h5

Oh ok, thanks for the clarification!

Mar 28 '12 at 12:17 AM Default117
(comments are locked)
10|3000 characters needed characters left

1 answer: sort newest

It's possible that you could make those operations faster, but I don't anticipate this would be considered a "low-hanging fruit" when it comes to optimizing performance. There are probably other issues you can improve more easily.

more ▼

answered Mar 27 '12 at 11:07 PM

rutter gravatar image

rutter
5.2k 2 11

Gotcha, thanks. Would it still be a negligible optimisation for mobile devices?

Mar 27 '12 at 11:17 PM Default117

Mobile in general does have less juice to go around, but in my experience setting color params is still pretty quick. If you're more or less familiar with shaders, it might be worth checking out, but otherwise I probably spend some time testing whether it's a problem (say, remove the color calls and check how your performance changes).

Mar 28 '12 at 02:38 AM rutter
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1667
x329
x276
x1

asked: Mar 27 '12 at 10:55 PM

Seen: 562 times

Last Updated: Mar 28 '12 at 02:38 AM