x


Opaque to Transparent animation effect on a textured object (Lerpz)?

I am learning Unity through the great platform tutorial. I've finished it and now trying to improve on it somehow. Currently I am trying to apply a transparency fade-out fade-in effect to the Lerpz (player). However, I've come into many problems as it uses a Bumped Specular shader and not a transparent one.

I have a class which uses the transform.renderer.material.color to modify the alpha channel progressively for a fade-in fade-out effect.

The effect I'm trying to achieve is that Lerpz will slowly fade-out into full transparency and then slowly fade-in to fully opaque mode repeatedly (kind of like a ping-pong effect). (This will be used for an invisibility cloak power).

I've managed to construct a semi-solution for this by changing the material from the script whenever the effect is on to a transparently shaded one. Then used a Lerp based coroutine in C# for a ping-pong alpha cycle. However it only works if I remove the alpha information from the new material texture, but this time some back-side polygons can be seen through the surface and it is really ugly.

So the question: is there a way to smoothly animate between fully opaque and fully trans for a textured object without having problems at the opaque stage?

more ▼

asked Feb 24 '11 at 11:46 PM

madchuckle gravatar image

madchuckle
1 1 1 5

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

The built in shaders include a bumped diffuse transparency option. By selecting this shader, the texture maps should load in automatically and you should be able to access the alpha. This should just work, but I have seen other questions on here that mentioned strange issues with bump maps and transparency. I can't seem to locate them, however.

more ▼

answered Feb 25 '11 at 12:03 AM

Alec Slayden gravatar image

Alec Slayden
1.2k 1 4 15

Thank you. The problem with transparent shaders is that I cannot make them fully opaque in any way. I think I will just settle with changing the material temporarily.

Feb 25 '11 at 04:48 PM madchuckle

Added information to the original question about my current (unsatisfactory) solution.

Feb 25 '11 at 05:13 PM madchuckle
(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
x189
x178
x10

asked: Feb 24 '11 at 11:46 PM

Seen: 2752 times

Last Updated: Feb 28 '11 at 12:35 PM