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
1
Question by poolts · Oct 10, 2015 at 12:39 AM · unity 5shaderrenderingshadersblack

U5 shader coming out solid black on newer iOS devices (iPad 2 Air / iPhone 6)

After upgrading to Unity 5, the mesh the following shader is applied to is coming out solid black on iPhone 6 and iPad 2 Air. It's working correctly on older iOS devices (i.e. iPad 2 / iPhone 4S) and Android devices, just not on newer iOS devices. I'm wondering if ES3.0 or Metal could be causing the problem.

Error codes are:

WARNING: Shader Unsupported: 'Standard' - Pass 'FORWARD' has no vertex shader WARNING: Shader Unsupported: 'Standard' - Pass 'FORWARD_DELTA' has no vertex shader WARNING: Shader Unsupported: 'Standard' - Pass 'SHADOWCASTER' has no vertex shader WARNING: Shader Unsupported: 'Standard' - All passes removed

Which has also been posted about here: http://forum.unity3d.com/threads/unsupported-shader-errors-in-chrome-and-firefox.351915/

Here's the shader code:

 Shader "Custom/UberKitFE_GR" {
     Properties {
         _MainTex ("MainTex", 2D) = "white" {}
         _NumberC ("NumberC", Color) = (0.5,0.5,0.5,1)
         _Number ("Number", 2D) = "white" {}
         _BumpMap ("BumpMap", 2D) = "bump" {}
         _Wrap ("Wrap", 2D) = "gray" {}
         _WrapIntensity ("Wrap Intensity", Range(0, 1)) = 0.5
         _FresnelColor ("Fresnel Color", Color) = (0.5,0.5,0.5,1)
         _FresnelIntensity ("Fresnel Intensity", Range(0, 100)) = 1
         _FresnelExponent ("Fresnel Exponent", Range(0, 3)) = 2.5
         _SpecularIntensity ("Specular Intensity", Range(0, 0.25)) = 0.13
         _Shininess ("Shininess", Range(0, 50)) = 25
         _GlossMap ("Gloss Map", 2D) = "white" {}
         _Diffuse ("Diffuse", 2D) = "white" {}
         _U5tint ("U5 darken", Range(1, 4)) = 3.6
     }
     SubShader {
         Tags {
             "RenderType"="Opaque"
         }
         Pass {
             Name "ForwardBase"
             Tags {
                 "LightMode"="ForwardBase"
             }
             
             
             CGPROGRAM
             #pragma vertex vert
             #pragma fragment frag
             #define UNITY_PASS_FORWARDBASE
             #include "UnityCG.cginc"
             #include "AutoLight.cginc"
             #include "Lighting.cginc"
             #pragma multi_compile_fwdbase_fullshadows
             #pragma exclude_renderers d3d11 xbox360 ps3 flash d3d11_9x 
             #pragma target 3.0
             uniform sampler2D _MainTex; uniform fixed4 _MainTex_ST;
             uniform sampler2D _BumpMap; uniform fixed4 _BumpMap_ST;
             uniform sampler2D _Wrap; uniform fixed4 _Wrap_ST;
             uniform fixed _WrapIntensity;
             uniform fixed _FresnelExponent;
             uniform sampler2D _Number; uniform fixed4 _Number_ST;
             uniform fixed4 _NumberC;
             uniform fixed _SpecularIntensity;
             uniform fixed _Shininess;
             uniform fixed _FresnelIntensity;
             uniform sampler2D _GlossMap; uniform fixed4 _GlossMap_ST;
             uniform fixed4 _FresnelColor;
             uniform fixed _U5tint;
             uniform sampler2D _Diffuse; uniform fixed4 _Diffuse_ST;
             struct VertexInput {
                 fixed4 vertex : POSITION;
                 fixed3 normal : NORMAL;
                 fixed4 tangent : TANGENT;
                 fixed2 texcoord0 : TEXCOORD0;
                 fixed2 texcoord1 : TEXCOORD1;
             };
             struct VertexOutput {
                 fixed4 pos : SV_POSITION;
                 fixed2 uv0 : TEXCOORD0;
                 fixed2 uv1 : TEXCOORD1;
                 fixed4 posWorld : TEXCOORD2;
                 fixed3 normalDir : TEXCOORD3;
                 fixed3 tangentDir : TEXCOORD4;
                 fixed3 binormalDir : TEXCOORD5;
                 LIGHTING_COORDS(6,7)
             };
             VertexOutput vert (VertexInput v) {
                 VertexOutput o = (VertexOutput)0;
                 o.uv0 = v.texcoord0;
                 o.uv1 = v.texcoord1;
                 o.normalDir = mul(_Object2World, fixed4(v.normal,0)).xyz;
                 o.tangentDir = normalize( mul( _Object2World, fixed4( v.tangent.xyz, 0.0 ) ).xyz );
                 o.binormalDir = normalize(cross(o.normalDir, o.tangentDir) * v.tangent.w);
                 o.posWorld = mul(_Object2World, v.vertex);
                 fixed3 lightColor = _LightColor0.rgb;
                 o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
                 TRANSFER_VERTEX_TO_FRAGMENT(o)
                 return o;
             }
             fixed4 frag(VertexOutput i) : COLOR {
                 i.normalDir = normalize(i.normalDir);
                 fixed3x3 tangentTransform = fixed3x3( i.tangentDir, i.binormalDir, i.normalDir);
 /////// Vectors:
                 fixed3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
                 fixed3 _BumpMap_var = UnpackNormal(tex2D(_BumpMap,TRANSFORM_TEX(i.uv0, _BumpMap)));
                 fixed3 normalLocal = _BumpMap_var.rgb;
                 fixed3 normalDirection = normalize(mul( normalLocal, tangentTransform )); // Perturbed normals
                 fixed3 lightDirection = normalize(_WorldSpaceLightPos0.xyz);
                 fixed3 lightColor = _LightColor0.rgb;
                 fixed3 halfDirection = normalize(viewDirection+lightDirection);
 ////// Lighting:
                 fixed attenuation = LIGHT_ATTENUATION(i)*2;
 ////// Emissive:
                 fixed4 _GlossMap_var = tex2D(_GlossMap,TRANSFORM_TEX(i.uv0, _GlossMap));
                 fixed3 emissive = ((_FresnelIntensity*(pow(1.0-max(0,dot(normalDirection, viewDirection)),_FresnelExponent)*i.posWorld.g*i.posWorld.g)*_FresnelColor.rgb)+(pow(max(0,dot(normalDirection,halfDirection)),(_Shininess*_GlossMap_var.r))*_SpecularIntensity));
                 fixed2 node_44 = fixed2(0.5*dot(normalDirection,lightDirection)+0.5,0.0);
                 fixed4 _Wrap_var = tex2D(_Wrap,TRANSFORM_TEX(node_44, _Wrap));
                 fixed4 _Number_var = tex2D(_Number,TRANSFORM_TEX(i.uv1, _Number));
                 fixed node_3845 = (1.0 - _Number_var.a);
                 fixed4 _MainTex_var = tex2D(_MainTex,TRANSFORM_TEX(i.uv0, _MainTex));
                 fixed3 node_4347 = ((_NumberC.rgb*_Number_var.a)+((node_3845*node_3845)*_MainTex_var.rgb));
                 fixed4 _Diffuse_var = tex2D(_Diffuse,TRANSFORM_TEX(i.uv0, _Diffuse));
                 fixed3 finalColor = emissive + (((((_Wrap_var.rgb*_WrapIntensity)*node_4347)+(UNITY_LIGHTMODEL_AMBIENT.rgb*node_4347))+(node_4347*max(0,dot(lightDirection,normalDirection))))*(_LightColor0.rgb*attenuation)*_Diffuse_var.rgb);
                 fixed3 finalColorU5 = finalColor / _U5tint;
                 return fixed4(finalColorU5,1);
             }
             ENDCG
         }
     }
     FallBack "playrKit/playrKit_FE"
 }
 
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 fafase · Nov 09, 2015 at 10:49 AM 0
Share

You could try to discard $$anonymous$$etal in Player Settings. Add GLES3 and GLES2 so that if one does not work the next is used but never $$anonymous$$etal.

avatar image ableRex_358 · Nov 09, 2015 at 01:07 PM 0
Share

I get the same problem but sort of in reverse in Unity 5.2.2f1. The problem is seen in an old iPad2($$anonymous$$E400LL/A iOS 9.1). However everything works nicely on iPhone6 (iOS 9.1), also i saw no problems on iPad Air 2 (don't know iOS ver.) and heard there were no problems on an iPhone 5 (don't know iOS ver). Same problem whether using cloud build or Xcode locally (as comparing between the iPhone6 and the old iPad 2).

The menu screen load ok in both cases, however when trying to load the game screen with skybox and terrain (set to default unity shader) the game screen music is heard but the menu screen graphics remains visible(though no longer responsive). This happens only on the iPad 2. On the newer devices gameplay was very smooth and everything worked. The shader warning log after pressing the start-game button looks familiar to this thread: old iPad2 debug log

iPhone6 debug log with same build (just switched the device Xcode open (For some reason I got filetype complain on trying to add this second text file here, so I zipped it. )

iphone6-txt.zip (21.7 kB)
old-ipad.txt (7.3 kB)
avatar image ableRex_358 ableRex_358 · Nov 09, 2015 at 10:41 AM 0
Share

The strange thing is that it used to work just fine also on the iPad 2. Not sure where something happened, I guess I need to try some older cloud builds to see how far it works. I did recently upgrade to Unity 5.2.2f1.

avatar image skok · Dec 14, 2015 at 04:11 PM 0
Share

Similar problem. See http://forum.unity3d.com/threads/u5-shader-co$$anonymous$$g-out-solid-black-on-newer-ios-devices-ipad-2-air-iphone-6-metal-es3-0-issue.360615/#post-2422602 .

0 Replies

· Add your reply
  • Sort: 

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

38 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

Related Questions

How to make a 2d shader with edge waves 0 Answers

Single tone shadows in forward rendering 0 Answers

Fake Volumetrics via custom bloom 0 Answers

URP Blit Render Feature not rendering in Single Pass Instanced VR 0 Answers

Converting c# function 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