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 Fixe · Sep 28, 2012 at 01:50 PM · materialalphafadevertexblend

Vertex Alpha value doesn't update?

I'm trying to show a fading splash screen, So I setted up a strecthed cube in front of the camera(as explained in the guide). Now I want to fade out that cube changin vertices alpha values. The code for this(script attached to the cube):

 void Update () {
         
         float alpha = Mathf.Sin (Time.time);
             
         Mesh myMesh = GetComponent<MeshFilter>().mesh;
         if(myMesh){
             Debug.Log("transparency changed!");
         }else{
             Debug.Log("cube not found!");
         }
             
         Color[] meshColor = myMesh.colors;
         int i;
         
         for(i=0;i<meshColor.Length; i++){
             meshColor[i].a = alpha;
         }
     }

seem's that vertex color is not used at all by any of the material ( I tried all materials and no one showed vertex color): That's a big feature lack! fix that! In FREE version of unity there's no need at all for use "COLORS" component in vertices since no material is using vertex colors => memory waste. Alpha value in vertices will allow for a lot of nice effects even on older fixed-pipeline hardware. Seems a big pity Unity "skipped" that important detail in FREE version.

Comment
Add comment · Show 1
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 Lockstep · Sep 28, 2012 at 03:10 PM 0
Share

Why don't you use a transparent material and manipulate its alpha value? Furthermore for a spash screen it might be better to use a GUITexture. Its alpha value can be manipulated quite easy.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Fixe · Sep 29, 2012 at 12:24 PM

I successfully used the material. But what If I needed a per-vertex alpha value for more complex effects?

Comment
Add comment · Show 1 · 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 Lockstep · Sep 29, 2012 at 02:02 PM 0
Share

Something similar is discussed in this thread: http://forum.unity3d.com/threads/39837-Fog-of-war-$$anonymous$$esh.

However this is somewhat difficult to handle. Often you can just go with a transparent texture.

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

10 People are following this question.

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

Related Questions

Way to get a material to alpha-fade along the texture? 0 Answers

Fade out material using alpha channel 1 Answer

Fade in a GameObject Material? 1 Answer

How can I blend between 5 different materials? 2 Answers

Optimize code changing transparency of large number of Objects 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