- Home /
i want to do fade in fade out in c#
i have 3d model and i want to do fade in fade out on 3d model. For example When i have choose model 2. From model 1 to model 2 it will be fade in or fade out. Can anyone help me about this problem ?
Thank You
Find a shader that supports transparency and has a color. Transparent/Diffuse is one such shader. With these shaders, changing the alpha channel of the color controls the transparency. Then google "Unity3d and fade" for a boatload of hits and code for fading textures. There is one script here.
I already answered your question... If there was something wrong with my answer, you could've commented. -_- Please don't re-post questions.
Answer by Wolfram · Feb 04, 2013 at 08:48 PM
For the fading itself I'd suggest using iTween.
However, you'll have to make sure all your shaders in your model are using the equivalent from the "Transparent/..." section, otherwise the alpha value is not evaluated. The drawback with this approach is that you might/will get overlapping artifacts for non-convex objects even at 100% alpha (=0% transparency). The rather complex solution is to use shader replacement to replace the normal shaders on-the-fly with their transparent counterparts, and change them back once the fade is complete.
Your answer
Follow this Question
Related Questions
Help, with character animation and terrain decoration. 1 Answer
Fade in Fade out in unity 1 Answer
Simple script problem? 1 Answer
Rotating/Spinning 0 Answers
how to create a popping out object ? 2 Answers