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
5
Question by AlwaysSunny · Oct 28, 2014 at 11:55 PM · shadertransparencyalphaimporting textures

What does the "alpha is transparency" setting actually do?

I know this seems very obvious, so please hear me out.

Most transparent shaders read the alpha value of textures to determine cutoff or translucency when drawing to the screen. This data is already a part of the texture, so what does this import setting actually accomplish?

If I import a texture with a proper alpha channel, I have to check this import toggle for my transparent shaders to make use of it. I understand there are cases where having the alpha channel represent other 0...1 data would be useful, but wouldn't that alternate usage take place in the shader logic?

So, what's the intended purpose behind giving us this option at all? And what actually happens to my texture's alpha channel when it's not checked? How does the shader know, one way or the other? I use it 100% of the time, IIRC.

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

1 Reply

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

Answer by LukaKotar · Oct 29, 2014 at 12:17 AM

Release notes for Unity 4.2 state: "Texture importer now has "Alpha is Transparency" setting, which does color dilation to fix edge artifacts on semitransparent textures. It is enabled by default for GUI textures."

It also shows a nice transparent thumbnail in the project view when checked. You should enable it for textures you want to use as transparent. For textures just simply needing the alpha channel, you don't need to check that option. For example, Unity's default specular shaders use the alpha channel to map out the specular (specular map).

Comment
Add comment · Show 3 · 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 AlwaysSunny · Oct 29, 2014 at 03:28 AM 0
Share

"color dilation to fix edge artifacts" -- okay, I'll buy that. $$anonymous$$y apologies for not thinking to check the release notes.

I'm still unclear on what actually happens behind the scenes to a texture's alpha channel when the option is unchecked (it's as if the alpha channel were full white, like the alpha channel is overridden), but this was just a curiosity, after all.

avatar image LukaKotar · Oct 29, 2014 at 05:08 AM 1
Share

I don't know what exactly it does behind the scenes, but it seems to fix the semi-transparent outlines of textures. Doing a bit of testing, there is an (unintentional) outline visible when I don't check that option:

alt text

screenshot 2014-10-29 06.01.27.png (18.2 kB)
avatar image AlwaysSunny · Oct 29, 2014 at 05:43 AM 0
Share

I really appreciate your time and investigation!

I recall that before this option was available, I never had a problem with the artifacts depicted on the left. And in my experience, I've never encountered a need to not enable the option, which left me wondering why it exists to begin with.

I'll just accept "some internal howd'yado" and be content to click it each time I import something. :)

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

27 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

Related Questions

All objects are getting transparent ? 1 Answer

Changing custom shader. Add alpha cutout 1 Answer

Shader help (Animating Alpha values does not work on it!) 1 Answer

How do I add transparency to a cg vertex lit shader 2 Answers

Adding Alpha-Transparency to Shader 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