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 antonkudin · Mar 04, 2015 at 03:51 AM · shaderunity5alpha

Unity 5 shaders and alpha on sprites broken?

I've used a shader in unity 4.6 which uses alpha channel. In 5 same shader shows strange behavior, ignoring or altering alpha in strange way. I've read about 'keepalpha' tag in the docs, but it does nothing here, it seems.

Another strange thing is when I select 'BumpedSpecular' shader in 'Legacy/Transparent/' folder, they work fine, cutting off alpha where needed. If i use same shader from 'Built-in shaders 4.6' package, it's broken. So, something changed in shaders. There's no ZIP of the built-in ones on their site: http://unity3d.com/get-unity/download/archive so I can't get those as a reference.

Shader source: http://pastebin.com/ensWirZR alt text

screen-shot-2015-03-04-at-012622.png (205.0 kB)
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

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Shins94 · Apr 10, 2015 at 05:27 PM

Just add "alpha:blend" to your #pragma like following

#pragma surface surf alpha:blend

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 keeperkai2 · Mar 14, 2016 at 02:10 AM 0
Share

I tried that, and although it does alpha blending( I recall alpha:blend being an option long before Unity 5, and it did just that, alpha blending but ignoring the Blend option settings), it ignores the Blend SrcAlpha One option for the shader, it uses a default way to blend ins$$anonymous$$d of what you specify, so this is still not the same as in Unity 4. it seems that you cannot have additive blending surface shaders in Unity5. If you read the compiled surface shader code. You'll see that it completely ignores your "Blend" options and just adds SrcAlpha One$$anonymous$$inusSrcAlpha

avatar image
0

Answer by antonkudin · Mar 04, 2015 at 03:23 PM

Found the link to 5's built-in shaders in documentation: http://docs.unity3d.com/Manual/StandardShaderMakeYourOwn.html

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

[Unity5]how to change alpha by using shader. 1 Answer

Unity 5 transparency in custom shader 1 Answer

custom shader error. copy of "Nature/Tree Soft Occlusion Leaves" 0 Answers

Shader:DX11 get texture dimensions inside a shader 1 Answer

Shader that does per Vert alpha with co 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