Im building a game for WebGL to be played via Webview on mobile devices, Unity 2022.2.19 and URP 14.0.7
On some devices (POCO X5, Sony Xperia XA2, Xiaomi Redmi Note 11, for example) the game is not rendering some objects with a mesh renderer. At first I thought that it was a problem with the adressables, since only the objects loaded that way had the problem and another couple of objects render correctly that are loaded with the scene, but I made a test scene with 4 cubes, one with the default lit mat, another couple with my custom material with diferent maps, and another with a lit simple mat, and neither of those render, the configuration between both objects with the default lit is the same.
So far we have tested in 50 devices and about 8 present this bug, what might be the problem?
Hi I’d like to share my experience. I have these kinds of issues also. All the devices you listed have Adreno GPUs.
All the devices I have the problem with have Adreno GPUs. I have found that materials using the URP/Lit shader are failing to render. Any that use the URP/Unlit or URP/Complex Lit are rendering.
I hope this helps or at least inspires some constructive discussion around the issue that gets us closer to a solution
Edit: Changing the shader to Complex Lit has so far only worked on one of my scenes
The problem comes from the Adreno GPUs having very limited number of uniform values that it supports (MAX_FRAGMENT_UNIFORM_VECTORS), compared to other GPUs. On many GPUs it’s 1024, and on the Adreno GPUs it’s 256. The Lit shader is running out of uniforms on these devices. We are looking into ways to get around this.
Hi!
Do you get any WebGL or shader compilation errors in the browser console when the objects are not rendered?
What rendering path are you using?
When using WebGL2 graphics API only “Forward” and “Deferred” are supported. WebGPU(still experimental) also supports “Forward+”.
I solved this problem in three different ways. (of “URP/Lit” in WebGL not show on some phone.)
Method 1 : Uncheck “Receive Shadows” in “URP/Lit” materials.
Method 2 : Use “URP/SimpleLit”.
Method 3 : Use “URP/BakedLit”.
These methods seems to have something in common.
And by the way, “Sprites/Default” also can show.
I also encountered the same problem. In the course of testing, I found that when using URP/Lit shader, I could render in mobile webgl by disabling the Environment Reflections attribute in AdvancedOptions. It may be a problem with some related shader properties when calculating reflections
I’m here since I experience the same kind of troubles:
unity 6000.0.32f1
URP
Deferred or forward
Only URP>unlit material objects show in a webgl app on Window, Chrome and 1660.
I’m highly confused and stuck trying to show my client a demo.
Can someone help please ?
thank you
that solved it for me but I noticed that complex did not work for me. Only universal unlit and universal simple lit that I tested and worked for me on chrome-android, firefox-android, and samsung browser
URP assets were generated from the new Unity 6 Project : PC and Mobile quality levels - doesn’t render Lit and Lit-based shaders.
URP assets were generated from Unity 2022.3 and were upgraded with Unity 6: there are 5 quality levels - this one renders in the WebGL build on Android.
Creating New Unity Project with Unity 6000.038.
Deleted Settings folder with all URP stuff.
Closed the Project.
Opened the Project: 2 URP files were created automatically:
3.1 DefaultVolumeProfile
3.2 UniversalRenderPipelineGlobalSettings
Created URP Asset (with Universal Renderer).
Assigned it to Default Render Pipeline in Graphics Settings: I didn’t assign it in Quality Levels.