Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
1
Question by AntLewis · Feb 16, 2012 at 02:18 PM · transparent shader

Fading an object shader question

Hi, I'm trying to make an object fade to fully transparent but I'm running into an issue.

I'm using some code to search through all the components in the hierarchy of an object, then access their materials. If the material the shader is associated with isn't transparent diffuse, I change it to this shader and then add all the materials to a list within Start(). Come run time, I loop through the the material list and lerp their alpha's to 0.

Now this 'works', except (not surprisingly) when I change the shader from diffuse to transparent diffuse, I get some wierd visual artifacts. Beyond this, it all works great. So aside from editting the source assets (I'm assuming this is the only way to sort this), would there be anyway to prevent the artifacts when I switch shaders? The switch in shaders cause the object to be semi transparent in areas (though their alpha value is 1.0f which confuses me slightly). I thought setting the materials alpha to 1 would resolve this issue, but unfortunately not.

Thanks for any help!

Comment
Add comment · Show 5
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 Ashkan_gc · Feb 16, 2012 at 02:27 PM 0
Share

It seems a bug if you are completely sure about what you say. submit it with your project. help>report a bug

avatar image AntLewis · Feb 16, 2012 at 02:41 PM 0
Share

I think the actual problem is that once I switch to transparent diffuse, you have semi transparent objects in front of other semi transparent objects, so you get an odd brightening effect. Don't know how to get around this.

avatar image AntLewis · Feb 16, 2012 at 02:57 PM 0
Share

Apparently I need to change the blend mode of the shader to normal....but I can't see how to do this!

avatar image Ashkan_gc · Feb 16, 2012 at 03:19 PM 0
Share

i don't know if it's possible to modify the shaders of unity or not but i think their source is available in unity's resources section of the website at http://www.unity3d.com/support/resources and you can modify and use them. There is a package in asset store called hard surface shaders which allows to choose the rendering order of transparent and semi transparent objects but i think it's $50. It can generate really good looking effects for metalic, plastic, vax, glass and many other types of materials, if you have the money and it can be helpful. buy and use it.

avatar image Jessy · Feb 16, 2012 at 04:01 PM 0
Share

You need to research why the problems occur. Alpha is not opacity. It's a blending multiplier. It is not a bug. http://www.unifycommunity.com/wiki/index.php?title=AlphaVertexLitZ

0 Replies

· Add your reply
  • Sort: 

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.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Altering Material through Script Causes Transparent Rendering Error - C# 1 Answer

WebGl Transparent Background Issue 0 Answers

Why my 2d character would not be displayed correctly at the very beginning? 0 Answers

Multiple intersecting meshes with per-pixel-alpha-sorting transparancy shader 0 Answers

How to cut or make transparent part of a mesh 0 Answers


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