Shadows disappear in web build

Hello. I noticed that all the shadows in my game are not present in my webGL build.
This is terrible since you need your shadow to judge the distance in certain levels.
My second scene in particular has a Landing Pad that moves back and forth in Z, and you are supposed to use your shadow to tell if you will fall on it.
Anyone knows how to fix this?

The game in the editor:

The game in FireFox:


Couple of things, but I’m not sure whether they will resolve the issue for you;

  • check the Quality Settings, File / Edit / Quality

    image

    See what you have set as default and then check the specific settings for that level;

  • WebGL 2.0 Support

    If you check the Unity manual regarding WebGL you’ll note that there is mention (at the bottom of the page) as to the support of WebGL 2.0. In order to use it you need to uncheck Automatic Graphics API which can be found under WebGL Player Settings / Other Settings.

    WebGL 2.0 support GLSL ES 3.00, where-as WebGL1.0 supports GLSL ES 2.00.

    Next, does your browser support WebGL 2.0, probably, but you can check;

Hope some of the above leads you in the right direction and gets you the results you want. From what I have read, it’s possible to get some low quality shadow effects using WebGL 1.0 with a lot of tweaking, but having seen the results in other articles on line, they look a bit poor.

Thank you!
I put the shadow textures and quality settings to ultra.
Now there are shadows.
But I think my FPS suffered a little. Im going to need to play around with these settings.

1 Like

No problem, happy to help.

Experiment a little but perhaps take some screenshots of what the settings were before you changed them, so if something doesn’t work you can easily change it back.

Maybe instead of having all the settings at Ultra, just tweak the shadow settings on the default quality setting so that they match the Ultra level.

Did you try the WebGL 2.0 changes?

I don’t know what the changes are, but I have the latest version of everything (as of today)
I didnt chage much, though. Its slow in firefox but pretty smooth in itch.io.

When you say “its slow in Firefox but pretty smooth in itch.io, do you mean when you are running the game locally in a browser it’s slow?

Yes. The game seems to drop Frames Per Second and the controls feel slightly unresponsive.

Multiple graphics adaptors in your setup? e.g. onboard and separate GPU?

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms