• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by madchuckle · Feb 24, 2011 at 11:46 PM · shaderalphafadetransparentopaque

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?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Alec-Slayden · Feb 25, 2011 at 12:03 AM

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.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image madchuckle · Feb 25, 2011 at 04:48 PM 0
Share

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.

avatar image madchuckle · Feb 25, 2011 at 05:13 PM 0
Share

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

Your answer

Hint: You can notify a user about this post by typing @username

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

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

transparent mode does not work at alpha=255 1 Answer

please how can i add cutout or fade to this shader 0 Answers

Dirt / Dust Shader, Light Interaction 0 Answers

Shader alpha value consistent with all transparent objects 0 Answers

shader for tree leaves + lightmap 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges