Hello,

On godot 4,
I try to have shadows working on a html5 3d project but at now, I do not know how to do it.
My meshes have uv2, and my meshes materials cast shadows and my directional light enable has shadow enabled
In gl_compability, shadow enabled on lights seems not yet supported.

  • I have tried also with lightmapgi node but is not compatible with gl_compability mode.
  • and when i configure "rendering/renderer/rendering_method.web" to "mobile" shadows work on my godot editor device but not when i test it on the web.

I test it with also the beta chrome version which support webgpu.

For information, In godot 3, indirect light and shadows was working on html5 export.

If you have an idea it would be great.
Perhaps I have to wait that lightmapgi to be supported with gl_compability ? (I haven't found that it wil be in the earlier versions).

Thanks for your help.

equeste changed the title to shadows for html5 not yet possible in Godot 4 ? .

So shadows are not currently supported on the OpenGL renderer (which is used for HTML5 and compatibility modes). You didn't do anything wrong.

HTML5 and OpenGL (or WebGL) was not even supposed to make it into Godot 4.0 (they were going to wait for 4.1) but they added it in at the last minute.

Which is nice that we can start testing, but sadly it is missing a ton of features, shadows being the most important, but also stuff like full screen post-processing and other things.

    cybereality thanks a lot for your explanation👍 : I will do without for the moment.
    I have a lot of others things to improve and to add in this project 🤔 This game engine is so great to use...

    4 months later

    cybereality
    Hello, Cybereality.

    There is still no WebGL shadows support in godot 4.1. 🤔
    What version should we wait? godot 4.2?

    Luking.

      4 months later
      a month later

      Johannski You can custom build an export template dropping some modules you don't need to bring the size down.

        Megalomaniak
        I tried that for 4.1.2 and was a bit disappointed to "only" thin the build size by two MB, even though the list of modules was quite long. You can find all builds here.

        Haven't tried it for 4.2, would you expect bigger gains there?

        Not really, the additional measure would likely have to be some form of packaging/compression.