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
0
Question by Liens · Mar 30, 2011 at 07:36 AM · materialstransparencymultiple

Multiple Transparent Materials Merging

Hi,

I have a cube which I'm putting multiple materials on, using the materials array. However, both the materials are using the Transparent/Cutout/Diffuse shader, which for some reason is making them blend into eachother. It's making the bottom material show through the top material.

I used black for the transparency colour so I find it strange that the 'cutout' would suddenly become partially transparent as well.

It only happens when both materials are transparent, when the bottom material is regular diffuse, the 'cutout' material overlays as it should. I'm not sure how to stop this happening.

Comment
Add comment · Show 2
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 Jessy · Mar 30, 2011 at 12:53 PM 0
Share

Screenshot would help. But it sounds like you're just having sorting issues. I don't know what you mean by "I used black for the transparency colour".

avatar image Liens · Mar 30, 2011 at 10:19 PM 0
Share

http://tinypic.com/r/5uofg0/7 This is what happens, the two materials merge together. http://tinypic.com/r/2nkuf7o/7 This is what happens when I change the material colour to black. That is what I want to happen but not by changing the material colour to black. I've been doing some messing around with material.renderQueue, if I add a material to the materials array and then reverse it so that the newly added material becomes element 0 and vice versa, then set renderQueue to 1(element1) and 2(element0) it works? Unfortunately does not work for more than two materials in the materials array, tho

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Liens · Mar 31, 2011 at 11:27 PM

I fixed the problem by adding the material to the gameObject.renderer.materials array (Using Unshift()), then setting gameObject.renderer.material.renderQueue to 1. For every material I added to the gameOject.renderer.materials array, I set the renderQueue of the added material to array.Length+1

So now they all overlap in order.

Comment
Add comment · 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

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

No one has followed this question yet.

Related Questions

Transparent shader decreases frame rate. Which material i should use for transparent object? 3 Answers

Certain faces appearing transparent, both before and after applying materials 0 Answers

Multiple textures on single object similar to terrain painter? 2 Answers

How do I properly apply a transparent texture to a mesh? 2 Answers

Overlapping transparency Shader fighting. 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