Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
This question was closed Sep 17, 2018 at 10:44 PM by rpallarino3 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by rpallarino3 · Sep 17, 2018 at 02:32 AM · scripting problemshadersmaterial renderer

Mesh material has little plus signs inside of it when I try to set transparency until I expand shader in editor

I am trying to set the transparency on the material on a dynamically created mesh as follows:

         MeshRenderer mr = waterMesh.gameObject.AddComponent<MeshRenderer>();
         mr.material.mainTexture = texture;
         mr.material.EnableKeyword("_ALPHABLEND_ON");
         mr.material.SetFloat("_Mode", 3.0f);
         mesh.RecalculateBounds();
         mesh.RecalculateNormals();

The mesh material updates slightly but has these little plus signs inside of it: alt text

The mesh material stays in this state until I expand the shader on the material in the editor. After expanding the shader, the material refreshes and appears as expected: alt text

Is there some setting I am forgetting to set or some method I need to call in order for this update to happen when the material is edited in my code?

Any feedback would be appreciated, I have been stuck on this for awhile.

fixedmesh.png (78.3 kB)
brokenmesh.png (96.8 kB)
Comment
Add comment · Show 4
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 Eno-Khaon · Sep 17, 2018 at 04:19 AM 0
Share

At a glance, the images have a slight difference in alignment. $$anonymous$$ore notably, it looks like many pixels are offset between the images, yet not all of them are. Is the view we're seeing in those images the scene view or game view?

avatar image rpallarino3 Eno-Khaon · Sep 17, 2018 at 04:30 AM 0
Share

It is the scene view but the game view looks exactly the same.

avatar image Eno-Khaon rpallarino3 · Sep 17, 2018 at 05:49 AM 1
Share

Hmm... I haven't been able to find anything obvious that would lead to this off hand...

One thought that comes to $$anonymous$$d regardless, however: Based on your sample code, it looks like this is using or is based on the Standard Shader (linked as a reference on the full changes made when switching rendering modes). With that in $$anonymous$$d, you'll need to make sure that your build will support the shader variants for the Standard shader as well.

Unfortunately, I'm really not sure what would lead to the exact appearance you're seeing. Expanding the shader panel means that something's not in quite the right state at first, but I'm not certain which thing that would be.

Show more comments

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

168 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

urp lit offset by script not working 0 Answers

Shader not changing according to scene light in real time. 1 Answer

Best Way To Add 2 Shaders to and Object? 2020 1 Answer

Shader Color 1 Answer

How to pass color of two colliding gameobjects to each other? 2 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