Search Issue Tracker

Fixed in 2018.1.X

Fixed in 2017.2.X, 2017.4.X

Votes

2

Found in

2017.2.0p1

Issue ID

962811

Regression

No

Standard Roughness setup shader is not building correctly for Android builds when using OpenGLES3.0

Mobile Graphics

-

The Standard Shader (Roughness Setup) that was introduced in 2017.2 is not building for Android when using OpenGLES3.0 and the build fails with errors.

To reproduce:
1. Create a new project and set the platform to Android.
2. Create a new material and use the Standard (Roughness setup) shader option
3. Create a cube and assign the material to the cube.
4. Make sure that OpenGLES3.0 is selected as graphics API and build the project.

Actual Result: The build fails with the following errors

Shader error in 'Standard (Roughness setup)': 'RoughnessSetup_Reflectivity' : no matching overloaded function found at /UnityVersions/Unity 2017.2.0p1_PatchRelease/Editor/Data/CGIncludes/UnityStandardCoreForwardSimple.cginc(111) (on gles)

Compiling Vertex program with DIRECTIONAL
Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER SHADER_API_MOBILE UNITY_HARDWARE_TIER1 UNITY_COLORSPACE_GAMMA

Shader error in 'Standard (Roughness setup)': undeclared identifier 'RoughnessSetup_Reflectivity' at /UnityVersions/Unity 2017.2.0p1_PatchRelease/Editor/Data/CGIncludes/UnityStandardCoreForwardSimple.cginc(111) (on gles3)

Compiling Vertex program with DIRECTIONAL
Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER SHADER_API_MOBILE UNITY_HARDWARE_TIER1 UNITY_COLORSPACE_GAMMA

Shader error in 'Standard (Roughness setup)': undeclared identifier 'RoughnessSetup_Reflectivity' at /UnityVersions/Unity 2017.2.0p1_PatchRelease/Editor/Data/CGIncludes/UnityStandardCoreForwardSimple.cginc(111) (on vulkan)

Compiling Vertex program with DIRECTIONAL SHADOWS_SCREEN
Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER SHADER_API_MOBILE UNITY_HARDWARE_TIER1 UNITY_COLORSPACE_GAMMA

Expected Result: There should be no errors and the build shouldn't fail.

Extra notes:
There are no build errors if OpenGLES2.0 or Vulkan is selected as Graphic API

Reproducible: 2017.2.0a4, 2017.2.0b1, 2017.2.0f3, 2017.2.0p1 and 2018.1.0a

Comments (22)

  1. lrb

    Jan 17, 2018 16:32

    The Silvershunt's workaround works perfectly for me on 2017.2.0f3!

    Thank you so much!

  2. silvershunt

    Jan 16, 2018 06:32

    This is not fixed. I got this error on Unity 2017.3.0p1 every time I open a project and build it on Android.

    Here's a workaround: Once you get the error, uncheck the "Auto Graphics API" and remove either OpenGLES2 or Vulkan, whatever you have in there. I usually remove OpenGLES2.
    After removing, scripts compilation dialog box should run. Now, add OpenGLES2 again then build your project. Weird, I know..

    I will be updating to 2017.3.0p2 and hope this fixes the issue.

  3. Fmacgt

    Jan 11, 2018 15:03

    As KARONTE mentioned, this error occurs randomly, and after a few builds switching APIs no longer works.

    The cause seems to be that a definition for RoughnessSetup_Reflectivity() is missing. There are MetallicSetup_Reflectivity() and SpecularSetup_Reflectivity(), though. So I just copied & pasted MetallicSetup_Reflectivity() and rename it into RoughnessSetup_Reflectivity(), then the error disappeared.

    It is a hack and may cause more trouble, but it seems to be more stable than switching graphics APIs, and I'm not using Standard(Roughness) anyway.

  4. lmoro

    Dec 29, 2017 11:53

    The problem persists with 2017.3.0f3

    Switched graphics to OpenGLES3.0 and Vulkan to avoid this error

  5. karonte

    Dec 01, 2017 16:47

    2017.2.0f3
    setting OpenglES2.0 or Vulkan did nothing.
    Cleaning the library did nothing.
    The error comes and goes as he pleases.
    This is getting seriously frustrating and unacceptable

  6. yinono

    Nov 28, 2017 09:17

    Have this problem too. It happen when I use Build&Run. It does not happen on Build only.
    And as build use cache, after a single Build you can return to use Build&Run till you perform another change to such materials.

  7. ZihaoJay

    Nov 22, 2017 07:15

    same here, using 2017.2.0f3. switching to vulkan didn't work

  8. Zahidylin_Marat

    Nov 12, 2017 12:52

    What does it men?
    "voting disabled for resolved issues (fix in review)"

    I have similar problem, but in my case i have not Roughtness shader, but Specular. And deactivated Auto API - selected Vulcan and es3.0.

  9. ben_page

    Nov 05, 2017 23:06

    Reproduced using Unity 2017.2.0f3:

    Switching Graphics API to Vulkan fixed it.
    Switching Graphics API to OpenGLES2.0 did not.

  10. ben_page

    Nov 05, 2017 22:27

    Rebuilding the library isn't working for me. Any other ideas?

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.