Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Issues with customized standard shader on Android

Discussion in 'Shaders' started by Charles-Hollemeersch, Apr 27, 2017.

  1. Charles-Hollemeersch

    Charles-Hollemeersch

    Joined:
    Nov 21, 2013
    Posts:
    3
    We are having difficulties with our modified standard shader when running it on Android (OpenGL ES 3). The shader is working fine on other platforms (currently tested and running on D3D9/D3D11/PS4/XboxOne). Our shader code itself is working fine in other GLES 3 based rendering engines as well when using other Unity shaders (for example modified unlit, legacy or custom surface shaders). Inspecting the rendering with a Graphics debugger (Nvidia Tegra) indicates that all inputs (textures, CBs...) are correct. We are inclined to believe the problem is either situated at runtime or during cross compiling to GLSL.

    One remarkable point of attention I have found is that changing the standard shader quality (Graphics settings) affects the artifacts. On our shield tablet, both the ‘low’ and ‘high’ setting seems to work just fine while ‘medium’ is wrong. On a Google Pixel phone, changing the quality does not matter (always broken).

    Our main questions for you are:

    - Are there besides the BRDF (UNITY_BRDF_PBS) other properties affected by the standard shader quality setting?

    - Is there documentation on how to debug possible shader cross compiling issues? I recognize our shader code inside the generated GLSL but it seems that a whole lot of additional code is generated (of example an int->float conversion seems to add code that looks like detecting/correcting overflow). Is there a way to disable this? Or see the intermediate steps?
     
  2. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    1,154
    What version of unity are you using?
    I am on 5.5 and I spend yesterday wondering why I have no shadows on an iPad build. Did not figure it out yet. I discovered that the same build
    - Has shadows on iPad 2 (really old one)
    - has no shadows on iPad 3 (also old )

    There seems to be something strange going on. I am also using a custom shader.
     
  3. Charles-Hollemeersch

    Charles-Hollemeersch

    Joined:
    Nov 21, 2013
    Posts:
    3
    We are currently on 5.6.0f3 but we also seen similar issues on previous builds.