Unity Issue: "Too many uniforms" with PBR Master Node in URP Shadergraph in WebGL

I am experiencing issues with weird behaviour of shadergraph shaders in URP WebGL, with maps and values not being set. Upon investigation, I suspect “too many uniforms” to be the root cause.

All shaders with the “PBR Master Node” seem to produce a shader error “Too Many Uniforms” and “Note: Creation of the internal variant of Shader … failed” (blue, on the left). Even for the most simple pbr shader without any properties whatsoever. How to Reproduce: crate a new URP project, build target WebGL, create a new PBR shadergraph shader without any properties, assign to a new marterial and that to a simple cube. Build and run with WebGL.


As a comparison: The unlit shader (red, on the right) does not show that behaviour.

Since WebGL seems to have a 16 uniforms limit (unity itself does not warn about that), I tried to create the same error with an unlit shadergraph shader. Even at 32 color properties, the unlit shader worked as expected without any errors :

I am currently on Unity 2020.1.0b11.3880, same behaviour in all browsers on my Mac. Can anyone else reproduce the error? Is there a fix? My business is quite dependent on this feature working.

Old post, but I am having a similar issue. My WebGL project made wit h2021.3.4f1 builds and works fine on PC desktop chrome, but on mac/safari, i get an error:error “Too Many Uniforms” and “Note: Creation of the internal variant of Shader Universal RenderPipeline/Lit failed”, and “Note: Creation of the internal variant of Shader Universal RenderPipeline/SimpleLit failed”.

It is worth noting that the project worked just fine on mac and even IOS until recently. I am trying to revert to the point where it started causing problems but I haven’t figured it out yet.

Does anyone have the same problem ?

Have the same problem, were you able to figure out?

I’m having this problem only on WebGL for mobile devices using the regular Universal Render Pipeline/Lit (no shadergraph), it usually happens with some GL warnings:

build.framework.js:3 WARNING: 0:2: ‘GL_EXT_shader_texture_lod’ : extension is not supported
WARNING: 0:3: ‘GL_EXT_shader_framebuffer_fetch’ : extension is not supported
ERROR: too many uniforms
Note: Creation of internal variant of shader ‘Universal Render Pipeline/Lit’ failed.

I’m using Unity 2022.1.10f1, and this error wasn’t happening before back when I was using Unity 2019.4.14f1. It seems to be an URP issue, as it doesn’t happen when using the built-in render pipeline.

@dnach @Jonas-Mortensen

Unity 2021.3.11f1 WebGL
URP 12.1.7
On Android the Universal Render Pipeline/Lit, Simple Lit and Lit Shader Graph all fail with

WARNING: 0:2: ‘GL_EXT_shader_texture_lod’ : extension is not supported
ERROR: too many uniforms

Desktop and iOS work fine but not Android. I’ve tried with an older device and a newer device
The /Unlit shader works fine. Can anyone help with this issue?

Edit: For runtime, I was able to hack a solution by searching for all meshes that use the URP lit/simplelit shaders and setting their material.shader to “Universal Render Pipeline/Lit” or “/Simple Lit”. For whatever reason, it works. You need to have the shaders not be stripped in your Graphics Settings, and you probably need to have references to the materials that use those shaders in a scene

This is still an issue with Unity 2022.3.30f1 and URP 14.0.11 - on WebGL - This is only an issue (for me at least) on the Meta Quest Browser