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 /
avatar image
0
Question by fschaar · Nov 30, 2015 at 12:23 PM · androidshadercompilergpufragment

fragment evaluation shader compile error

I have a problem with shaders not being loaded/compiled on Android. It seems to occur mainly on devices with PowerVR 540 Series GPUs.

There is one Shader it can not compile - but I'm actually not using this shader or I don't know where it is uses. Is there any way to find out?

Here is the error message from adb.

 #version 100
 D/Unity   (26077): uniform sampler2D _MainTex;
 D/Unity   (26077): uniform lowp float _Cutoff;
 D/Unity   (26077): uniform bvec4 unity_MetaFragmentControl;
 D/Unity   (26077): uniform highp float unity_OneOverOutputBoost;
 D/Unity   (26077): uniform highp float unity_MaxOutputValue;
 D/Unity   (26077): uniform highp float unity_UseLinearSpace;
 D/Unity   (26077): varying highp vec2 xlv_TEXCOORD0;
 D/Unity   (26077): varying lowp vec4 xlv_COLOR0;
 D/Unity   (26077): void main ()
 D/Unity   (26077): {
 D/Unity   (26077):   lowp vec4 tmpvar_1;
 D/Unity   (26077):   mediump vec3 tmpvar_2;
 D/Unity   (26077):   lowp vec3 tmpvar_3;
 D/Unity   (26077):   lowp vec4 tmpvar_4;
 D/Unity   (26077):   tmpvar_4 = (texture2D (_MainTex, xlv_TEXCOORD0) * xlv_COLOR0);
 D/Unity   (26077):   tmpvar_3 = tmpvar_4.xyz;
 D/Unity   (26077):   lowp float x_5;
 D/Unity   (26077):   x_5 = (tmpvar_4.w - _Cutoff);
 D/Unity   (26077):   if ((x_5 < 0.0)) {
 D/Unity   (26077):     discard;
 D/Unity   (26077):   };
 D/Unity   (26077):   tmpvar_2 = tmpvar_3;
 D/Unity   (26077):   mediump vec4 res_6;
 D/Unity   (26077):   res_6 = vec4(0.0, 0.0, 0.0, 0.0);
 D/Unity   (26077):   if (unity_MetaFragmentControl.x) {
 D/Unity   (26077):     mediump vec4 tmpvar_7;
 D/Unity   (26077):     tmpvar_7.w = 1.0;
 D/Unity   (26077):     tmpvar_7.xyz = tmpvar_2;
 D/Unity   (26077):     res_6.w = tmpvar_7.w;
 D/Unity   (26077):     highp vec3 tmpvar_8;
 D/Unity   (26077):     tmpvar_8 = clamp (pow (tmpvar_2, vec3(clamp (unity_OneOverOutputBoost, 0.0, 1.0))), vec3(0.0, 0.0, 0.0), vec3(unity_MaxOutputValue));
 D/Unity   (26077):     res_6.xyz = tmpvar_8;
 D/Unity   (26077):   };
 D/Unity   (26077):   if (unity_MetaFragmentControl.y) {
 D/Unity   (26077):     mediump vec3 emission_9;
 D/Unity   (26077):     if (bool(unity_UseLinearSpace)) {
 D/Unity   (26077):       emission_9 = vec3(0.0, 0.0, 0.0);
 D/Unity   (26077):     } else {
 D/Unity   (26077):       emission_9 = vec3(0.0, 0.0, 0.0);
 D/Unity   (26077):     };
 D/Unity   (26077):     mediump vec4 tmpvar_10;
 D/Unity   (26077):     highp vec4 rgbm_11;
 D/Unity   (26077):     highp vec4 tmpvar_12;
 D/Unity   (26077):     tmpvar_12.w = 1.0;
 D/Unity   (26077):     tmpvar_12.xyz = (emission_9 * 0.01030928);
 D/Unity   (26077):     rgbm_11.xyz = tmpvar_12.xyz;
 D/Unity   (26077):     rgbm_11.w = max (max (tmpvar_12.x, tmpvar_12.y), max (tmpvar_12.z, 0.02));
 D/Unity   (26077):     rgbm_11.w = (ceil((rgbm_11.w * 255.0)) / 255.0);
 D/Unity   (26077):     rgbm_11.w = max (rgbm_11.w, 0.02);
 D/Unity   (26077):     rgbm_11.xyz = (tmpvar_12.xyz / rgbm_11.w);
 D/Unity   (26077):     tmpvar_10 = rgbm_11;
 D/Unity   (26077):     res_6 = tmpvar_10;
 D/Unity   (26077):   };
 D/Unity   (26077):   tmpvar_1 = res_6;
 D/Unity   (26077):   gl_FragData[0] = tmpvar_1;
 D/Unity   (26077): }
 D/Unity   (26077): fragment evaluation shader
 D/Unity   (26077): Compile failed.


Any Help wolud be appreciated

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 zinkins · Feb 18, 2016 at 11:10 AM 0
Share

Hi! Did you manage to find shader or fix it? Cause I'm stuck with the same issue and can't find what shader causes it :(

avatar image tank_kun · May 23, 2016 at 11:52 AM 0
Share

Hi ! @zinkins. I have same problem. Our game will freeze on Samsung S4 (PowerVR SGX 544$$anonymous$$P) with OpenGL ES 2.0. You will get the 'bad' shader which causes this compile error, after building your game as a development build.

Env: Unity version: (5.2.3f1)

Here is the screenshot of 'adb logcat'

alt text

avatar image Bunny83 tank_kun · May 23, 2016 at 02:18 PM 0
Share

This post is:

  • NOT an answer

  • NOT about the "same" problem as this is clearly a different shader.

This should be either a comment to the question or better a seperate question with more details. Especially which Unity version you're using and if you used some old shader sources mixed with new ones?!

avatar image tank_kun Bunny83 · May 24, 2016 at 05:53 AM 0
Share

Oops. I had made a mistake. $$anonymous$$y post should be a comment reply to @zinkins about "..... can't find what shader causes it"。 Thanks for waking me up! @Bunny83

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Feb 18, 2016 at 11:54 AM

I doubt that this is all that got printed to the log. Even when it is the problem is that this shader most likely doesn't have a fallback. The actual problem in the shader is probably the "discard" statement which isn't supported on many mobile GPUs. "discard" is usually used by most cutout shaders.

As you can see in the code in line 19-22 it checks if the alpha value is smaller than the given cutout value. If it is, it simply discards the current fragment so nothing gets written to the frame buffer.

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 meat5000 ♦ · Feb 18, 2016 at 12:13 PM 0
Share

You're Neo, aren't you.

To me that looks a bit like a horde of spiders crawled from my ink-pot.

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

44 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

Related Questions

Alternative Android Shader for Fragment? 0 Answers

When using Graphics.Blit() in Android, getting a black screen 5 Answers

Radial Blur for Android/iOS 0 Answers

Importing a Unity3D scene into Android Fragment 3 Answers

enable multidex for android build 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