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
1
Question by Paulius-Liekis · Oct 04, 2012 at 09:43 PM · androidshadertransparentclipcutout

Crash: cutout shaders on mobile

I need Cutout shader on Android. When I'm using default Transparent/Cutout/Diffuse shader Unity gives me this warning "Shader is using clip instruction (usually caused by alpha test). It might cause problems on some Qualcomm/Adreno drivers." And it actually crashes when I run the app.

I need a shader which has diffuse and works with and without lightmaps. So I suspect that writing surface shader is the best way to go. But my guess is that it will be always compiled into a shader which uses "clip" instruction.

How can I solve this probem? Can I write surface shader without clip function?

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
1

Answer by GianormousGames · Oct 18, 2012 at 08:03 PM

AlphaTest is what causes the clip instruction - and I think all the cutout shaders are affected.

I traced a crash on HTC Thunderbolt into 1) some of the NGUI shaders and 2) the cutout shaders.

Shaders that neither contain clip instructions nor turn on AlphaTest should be fine.

Comment
Add comment · Show 2 · 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 Paulius-Liekis · Oct 18, 2012 at 08:08 PM 0
Share

Yeah, I figured out same thing - cutout shaders are causing a crash. In my case it happens only when I turn on lightmaps. So my solution is not to turn no the lightmaps. But I would like to see proper solution eventually... I'm rendering a tree, and you can not render a tree without AlphaTest.

avatar image Paulius-Liekis · Oct 10, 2013 at 01:37 PM 0
Share

Can you somehow ifdef that instruction in the shader based "Qualcomm/Adreno" or simply "Android"?

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

12 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

Related Questions

Transparent Cutout Shader? 1 Answer

What is the difference between a cutout shader and using clip? 1 Answer

Transparent shaders render as fullbright 0 Answers

Transparency working in the editor but not when I build 0 Answers

please how can i add cutout or fade to this 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