MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Shader error when building Android for URP

Open thePostFuturist opened this issue 4 years ago • 35 comments

Upon using URP, the MRTK Standard shader will prevent the app from compiling. This error is thrown:

Shader error in 'Mixed Reality Toolkit/Standard': Non system-generated input signature parameter () cannot appear after a system generated value. at line 775 (on vulkan)

When using the update tools, the app will compile, but the error is still there. This will prevent you choosing the shader from the material dropdown. However, after app restart, the shader error will prevent the app from compiling again.

  • Unity Version [v2020.3.26f1]

  • MRTK Version [v2.7.3.0]

  • OpenXR

  • Oculus Utilities

thePostFuturist avatar Feb 04 '22 18:02 thePostFuturist

Thank you for submitting this shader error @thePostFuturist! I will investigate this issue and report back shortly.

elbuhofantasma avatar Feb 04 '22 18:02 elbuhofantasma

Update: I have removed Vulkan and am building solely using OpenGLES3.

A similar error, Non system-generated input signature parameter () cannot appear after a system generated value. GLES3X

is thrown, although now builds are no longer failing. Can also now select the shader from the material dropdown.

thePostFuturist avatar Feb 08 '22 01:02 thePostFuturist

Any update on this issue ? Thx !

ptc-rgrasset avatar Mar 16 '22 17:03 ptc-rgrasset

yep... stuck on this issue too!

derekdominoes avatar Apr 12 '22 22:04 derekdominoes

Same here!

ezar avatar Apr 23 '22 17:04 ezar

Non system-generated input signature parameter () cannot appear after a system generated value. at line 775 (on vulkan)

Just to clarify, does this prevent a successful build? This sounds like #5844, #10532, similar to #6359. In my investigations of those, the error only seemed to log on first build but didn't actually prevent the build from succeeding. Are you able to confirm that your logs say the build failed?

keveleigh avatar Apr 25 '22 19:04 keveleigh

Log says building player has failed has failed.

Shader error in 'Mixed Reality Toolkit/Standard': Non system-generated input signature parameter () cannot appear after a system generated value. at line 775 (on gles3)

Compiling Subshader: 0, Pass: Main, Vertex program with INSTANCING_ON STEREO_MULTIVIEW_ON Platform defines: SHADER_API_GLES30 SHADER_API_MOBILE UNITY_ASTC_NORMALMAP_ENCODING UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_LIGHTMAP_RGBM_ENCODING UNITY_NO_CUBEMAP_ARRAY UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_RGBM UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3 Disabled keywords: LIGHTMAP_ON UNITY_COLORSPACE_GAMMA UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_UI_CLIP_RECT UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING _ALPHABLEND_ON _ALPHATEST_ON _BORDER_LIGHT _BORDER_LIGHT_OPAQUE _BORDER_LIGHT_REPLACES_ALBEDO _BORDER_LIGHT_USES_HOVER_COLOR _CHANNEL_MAP _CLIPPING_BORDER _CLIPPING_BOX _CLIPPING_PLANE _CLIPPING_SPHERE _DIRECTIONAL_LIGHT _DISABLE_ALBEDO_MAP _EMISSION _ENVIRONMENT_COLORING _HOVER_COLOR_OVERRIDE _HOVER_LIGHT _HOVER_LIGHT_HIGH _HOVER_LIGHT_MEDIUM _IGNORE_Z_SCALE _INDEPENDENT_CORNERS _INNER_GLOW _IRIDESCENCE _LOCAL_SPACE_TRIPLANAR_MAPPING _METALLIC_TEXTURE_ALBEDO_CHANNEL_A _NEAR_LIGHT_FADE _NEAR_PLANE_FADE _NORMAL_MAP _PROXIMITY_LIGHT _PROXIMITY_LIGHT_COLOR_OVERRIDE _PROXIMITY_LIGHT_SUBTRACTIVE _PROXIMITY_LIGHT_TWO_SIDED _REFLECTIONS _REFRACTION _RIM_LIGHT _ROUND_CORNERS _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECULAR_HIGHLIGHTS _SPHERICAL_HARMONICS _TRIPLANAR_MAPPING _USE_SSAA _VERTEX_COLORS _VERTEX_EXTRUSION _VERTEX_EXTRUSION_SMOOTH_NORMALS

Unity 2021.2.17

LukassaOne avatar Apr 27 '22 14:04 LukassaOne

Just found out: if i hit build -> the build will success but if i hit build and run -> the build will fail

LukassaOne avatar Apr 27 '22 15:04 LukassaOne

But the resulting api wont launch so the problem remains

LukassaOne avatar Apr 27 '22 15:04 LukassaOne

First little fix would be to delete: fixed facing:VFACE in line 775 and *facing in line 956,959

until the real fix is out

LukassaOne avatar Apr 27 '22 15:04 LukassaOne

Thank you for the quick fix.... this worked for me as well running on Unity 2021.3.1, MRTK 2.7.3 on Windows 11.

ndaley7 avatar May 10 '22 17:05 ndaley7

Any news about this bug?

csritter avatar Jun 13 '22 20:06 csritter

Hello, just an FYI since this might not be an ideal solution for many. I believe this issue is fixed in the latest version of the MRTK Standard shader found in the Graphics Tools package.

Graphics Tools is our new graphics focused package that comes automatically with MRTKv3 or can be used independently (or side by side with MRTKv2).

I’ve been building to Android (Quest 2) almost daily and haven’t encountered this error. But if anyone encounters it when using Graphics Tools please report the issue here.

Cameron-Micka avatar Jun 16 '22 23:06 Cameron-Micka

@Cameron-Micka, I might be missing something here. Installing the Graphics Tools with the git URL doesn't seem to have an effect. Should I be doing anything else?

ahmed-shariff avatar Oct 06 '22 07:10 ahmed-shariff

Hey @ahmed-shariff! Could you provide some extra details on what you are seeing? Are you seeing the above error from the 'Graphics Tools/Standard' shader or just the 'Mixed Reality Toolkit/Standard' shader?

The 'Mixed Reality Toolkit/Standard' shader should still emit errors with Graphics Tools installed if any materials being built still reference the 'Mixed Reality Toolkit/Standard' shader.

You will want to replace the shader of any materials using the 'Mixed Reality Toolkit/Standard' shader with the 'Graphics Tools/Standard' shader. This should be easy-ish with materials you have created (but might prove harder if you have readonly materials within any packages).

Cameron-Micka avatar Oct 06 '22 18:10 Cameron-Micka

Ah I see, I think I misunderstood. Appreciate the clarification. I had assumed it replaces the default materials from the packages. The errors I get are from the 'Mixed Reality Toolkit/Standard` shaders:

Shader error in 'Mixed Reality Toolkit/Standard': Non system-generated input signature parameter () cannot appear after a system generated value. at line 775 (on gles3)

Compiling Subshader: 0, Pass: Pass 0, Vertex program with INSTANCING_ON STEREO_MULTIVIEW_ON
Platform defines: SHADER_API_GLES30 SHADER_API_MOBILE UNITY_ASTC_NORMALMAP_ENCODING UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HARDWARE_TIER1 UNITY_LIGHTMAP_RGBM_ENCODING UNITY_NO_CUBEMAP_ARRAY UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_RGBM UNITY_NO_SCREENSPACE_SHADOWS UNITY_PASS_FORWARDBASE UNITY_PBS_USE_BRDF3
Disabled keywords: LIGHTMAP_ON UNITY_COLORSPACE_GAMMA UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_UI_CLIP_RECT UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING _ALPHABLEND_ON _ALPHATEST_ON _BORDER_LIGHT _BORDER_LIGHT_OPAQUE _BORDER_LIGHT_REPLACES_ALBEDO _BORDER_LIGHT_USES_HOVER_COLOR _CHANNEL_MAP _CLIPPING_BORDER _CLIPPING_BOX _CLIPPING_PLANE _CLIPPING_SPHERE _DIRECTIONAL_LIGHT _DISABLE_ALBEDO_MAP _EMISSION _ENVIRONMENT_COLORING _HOVER_COLOR_OVERRIDE _HOVER_LIGHT _HOVER_LIGHT_HIGH _HOVER_LIGHT_MEDIUM _IGNORE_Z_SCALE _INDEPENDENT_CORNERS _INNER_GLOW _IRIDESCENCE _LOCAL_SPACE_TRIPLANAR_MAPPING _METALLIC_TEXTURE_ALBEDO_CHANNEL_A _NEAR_LIGHT_FADE _NEAR_PLANE_FADE _NORMAL_MAP _PROXIMITY_LIGHT _PROXIMITY_LIGHT_COLOR_OVERRIDE _PROXIMITY_LIGHT_SUBTRACTIVE _PROXIMITY_LIGHT_TWO_SIDED _REFLECTIONS _REFRACTION _RIM_LIGHT _ROUND_CORNERS _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECULAR_HIGHLIGHTS _SPHERICAL_HARMONICS _TRIPLANAR_MAPPING _USE_SSAA _VERTEX_COLORS _VERTEX_EXTRUSION _VERTEX_EXTRUSION_SMOOTH_NORMALS

If the issue reported is not directly fixed by the Graphics Tools package, wouldn't it be better to have the issue still remain open until it's address directly?

ahmed-shariff avatar Oct 06 '22 23:10 ahmed-shariff

For now I am using @LukassaOne 's solution.

ahmed-shariff avatar Oct 06 '22 23:10 ahmed-shariff

This seems to have been introduced in #4947

ahmed-shariff avatar Oct 06 '22 23:10 ahmed-shariff

For now I am using @LukassaOne 's solution.

Glad that unblocked by removing the VFACE semantic. Note, if you are lighting any back facing triangles your lighting will look incorrect (but that is not a common use case).

Cameron-Micka avatar Oct 06 '22 23:10 Cameron-Micka

If the issue reported is not directly fixed by the Graphics Tools package, wouldn't it be better to have the issue still remain open until it's address directly?

That's a valid concern. @keveleigh should we leave this issue open or closed if it is fixed in MRTKv3? The root issue is within Unity (last I spoke with them a PR with a fix was coming). Without that fix we would be doing some guess and check to see how we work around the root issue.

Cameron-Micka avatar Oct 06 '22 23:10 Cameron-Micka