Hi, I have created a webgl project which works as expected in unity, but once it’s built and on unity play, it renders different for different browsers. I followed the warning to remove webgl 1 but on safari it shows as black and white pixels to the point it’s unrecognisable and on chrome, the lighting follows the user which is also incorrect and pixellates some of the meshes like a glitch.
Generally speaking, WebGL is a severely limited target platform. Even if it runs on your desktop with many cores and fast GPU, it just does not support many of the modern features. It’s easy to break WebGL builds by using postprocessing effects such as bloom or using complex shaders and generally shadows. Also the choice of render pipeline is critical, URP is highly recommended over built-in.
You will have to strip down your build to a bare minimum set of rendering features and then turn them back on one by one to see if WebGL can manage.
It seems to be the third person starter asset scene that is where it is happening. I started a new URP project for webGL, added the asset and used the playground scene provided, converted it to URP (maybe I missed something there) and it was this exact issue, but not sure what needs fixing there
This is the one I know as “Third Person Starter Asset”, it’s a template when starting a new project from the Hub. But that doesn’t seem to be the asset you used.
What Unity version? For WebGL projects I would recommend the latest tech stream, 2022.2 that is.
Since you mention Safari I assume this is running on a Mac. What model?
Since these glitches happen across browsers I would normally suggest checking video driver updates on a Windows system.
Update: when I remove one of the objects’ cinemachine components it looks a bit better but still not right, although I need these to move the camera and character
Do other WebGL games on that Unity publishing site work or do they also render with glitches? There are also general WebGL compatibility tests and benchmarks you could try.
The M1 series CPU may have some video issues with WebGL is my suspicion, or it may be faulty to begin with but I wouldn‘t go that far if other 3d apps work fine.
Seemed to have found the issue! The Player settings quality for webgl was set as some automatic option by unity that was using one of their render pipeline assets. I created a new unedited pipeline asset and made sure webgl used that one instead of unity’s ones. Thanks for the help!
Other games on unity play look fine so I am hoping it was just this causing it but I would like to learn about those general webGL compatibility tests and benchmarks