Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity 5 - "Standard" Shader Not Working on iOS Device?

Discussion in 'iOS and tvOS' started by kromenak, Apr 12, 2015.

  1. kromenak

    kromenak

    Joined:
    Feb 9, 2011
    Posts:
    266
    I recently upgraded to Unity 5.0.1 and noticed that when I run my game on device, any mesh using the "Default Material (Instance)", which uses the "Standard" shader, displays as magenta - the usual sign of some shader error or another. There is also no error in the log. Is anyone else experiencing anything like this?

    My exact scenario is extremely simple; I'm using GameObject.CreatePrimitive() and adjusting the color of the resulting object:
    Code (CSharp):
    1. GameObject hitGO = GameObject.CreatePrimitive(PrimitiveType.Cube);
    2. hitGO.GetComponent<Renderer>().material.color = Color.red;
    In Unity 4, I think that the system would use the "Diffuse" shader in this scenario. Is there some reason that the "Standard" shader wouldn't work in Unity 5, on iOS in particular?
     
  2. kromenak

    kromenak

    Joined:
    Feb 9, 2011
    Posts:
    266
    I modified the code to use the "Legacy Shaders/Diffuse" shader, which fixes the issue, but it seems like a pretty big deal if the Standard shader is used by default and it doesn't work on some platforms!
     
    zyzyx likes this.
  3. gsantos

    gsantos

    Joined:
    Sep 30, 2012
    Posts:
    7
    I'm facing the same kind of issue :(

    I've created a scene and applied the Standard shaders to all of my mesh objects. Now I want to export for Web, Desktop and mobile platforms but everything it's messed up when I switch to iOS platform on the Build Settings!

    The scene is rather simple and should be suitable for mobile!
    What is the best practice if I want to export the same application for multiple platforms? Should I use the "Mobile" shaders instead?
     
  4. subatomic

    subatomic

    Joined:
    Nov 13, 2014
    Posts:
    24
    same issue here, iphone 6, standard shader, and unity 5.1.2...
    object showing white when standard is chosen, and object looks correct when mobile/DiffuseBump is chosen.
    directional lights (point lights dont seem to work either, with mobile/DiffuseBump... making the object white)
     
  5. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    226
    For some reason the standard shader doesn't get much attention when it comes to mobile. The best chance to get someone to look at your problem is to submit a bug report (and post the # here).
     
  6. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    I can confirm these problems... :-(
     
  7. Sickwitit

    Sickwitit

    Joined:
    Dec 22, 2014
    Posts:
    123
    Has anyone submitted a bug report for this? I'm experiencing the same issue too on iOS only.

    Using Unity 5.1.2p1
    iPhone 4S (still testing on others)
     
  8. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    628
    The 'some reason' is that if you want good performance on mobile (real world game, mid-range devices), you want to be using simpler shaders, and probably baking most of yuor lighting.