2 Errors when building with Entities.Graphics + URP in a URP-Shader

Hello there!

I just tried to switch some parts of a project of mine to the ecs workflow, but I didn’t even came to changing anything really yet because I tried if everything still works fine by building etc. after importing and activating all the necessary packages.

The project used URP and is built with IL2CPP if that matters.

The first problem that occured I couldn’t activate SRP batching on the URP-Config objects since the advanced-section of the script is not there, also already mentioned that in the docs where it’s described that it needs to be active.
9260286--1295565--upload_2023-8-30_10-31-16.png
The way to solve that was to enable the debug-mode of the inspector where I could toggle it on which fixed the “SRP batching has to be ON” error.
9260286--1295568--upload_2023-8-30_10-31-27.png

So all looked fine, no errors. So I hit the build button in the build settings and the build finishes with success (kind of), but there are two errors in the console.

Shader error in ‘Universal Render Pipeline/Particles/Unlit’: out parameters require l-value arguments at /[ProjectDir]/Library/PackageCache/com.unity.render-pipelines.universal@14.0.8/ShaderLibrary/ParticlesInstancing.hlsl(57) (on d3d11)
Compiling Subshader: 0, Pass: ForwardLit, Vertex program with DOTS_INSTANCING_ON PROCEDURAL_INSTANCING_ON
Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS

Disabled keywords: FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _DISTORTION_ON _FADING_ON _FLIPBOOKBLENDING_ON _NORMALMAP _SOFTPARTICLES_ON

And:

Shader error in ‘Universal Render Pipeline/Particles/Unlit’: undeclared identifier ‘unity_WorldToObject’ at /[ProjectDir]/Library/PackageCache/com.unity.render-pipelines.universal@14.0.8/ShaderLibrary/ParticlesInstancing.hlsl(57) (on d3d11)
Compiling Subshader: 0, Pass: ForwardLit, Vertex program with DOTS_INSTANCING_ON PROCEDURAL_INSTANCING_ON
Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
Disabled keywords: FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _DISTORTION_ON _FADING_ON _FLIPBOOKBLENDING_ON _NORMALMAP _SOFTPARTICLES_ON

̶A̶l̶s̶o̶ ̶w̶h̶e̶n̶ ̶s̶t̶a̶r̶t̶i̶n̶g̶ ̶t̶h̶e̶ ̶b̶u̶i̶l̶d̶ ̶I̶ ̶j̶u̶s̶t̶ ̶g̶e̶t̶ ̶a̶ ̶m̶a̶g̶e̶n̶t̶a̶ ̶s̶c̶r̶e̶e̶n̶ ̶n̶o̶w̶ ̶(̶d̶o̶n̶’̶t̶ ̶k̶n̶o̶w̶ ̶i̶f̶ ̶a̶n̶y̶t̶h̶i̶n̶g̶ ̶e̶l̶s̶e̶ ̶w̶o̶r̶k̶s̶ ̶a̶s̶ ̶e̶x̶p̶e̶c̶t̶e̶d̶,̶ ̶g̶o̶t̶ ̶n̶o̶ ̶s̶o̶u̶n̶d̶s̶ ̶e̶t̶c̶ ̶y̶e̶t̶)̶.̶

That was an issue on my part, the errors above still popup, I don’t use particles with the material yet (pretty early in project no real visuals yet)

1 Like

I’m kind of lost here, since I don’t know how to address this, for further context:

Unity: 2022.3.8f1
Package (and dependencies) versions:
9260292--1295571--upload_2023-8-30_10-36-55.png
9260292--1295574--upload_2023-8-30_10-37-5.png

1 Like

I have the same problem with shader errors and all my custom shaders are purple on build but in editor they works fine. I update Unity version from 2022.3.2 to 2022.3.10. It’s look like i will need rollback

Is there any update on this issue? in Unity 2022.3.9f1, OpenGl android project, I am seeing the exact errors on console during build. Build works fine, but freezes without error report some times. I wonder if those are related.