-
Hello! I made a scene with 5 point light sources and configured them to cast shadows. On desktop with a Vulkan backend, the shadows are amazing and everything renders well. However, on web, some of the objects have shadows, but most of them don't. I was curious if this is a limitation of the default settings for each rendering backend--and if so, how I could change those--or if the existing WebGL backend's shadow rendering is simply limited in a way that Vulkan isn't. Update: I also tried my program with the Metal backend and it behaves the same way as Vulkan. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
It is a limitation of WebGL2 and the way that we render point light shadows. We use cubemap textures, which contain 6 faces of a cube to provide information about where the light from the point light source can reach in the scene. WebGL2 does not support having arrays of cubemap textures so we can only support one shadow mapped point light (though still many point lights). Using other shadow mapping techniques could enable us to support more. Perhaps using shadow atlases instead for example. |
Beta Was this translation helpful? Give feedback.
-
Got it, thanks @superdump! Is this also a limitation of WebGPU? I read that WebGPU will be supported in Bevy 0.11, so I'm wondering if switching to that, once it's released, will ensure better shadow parity between web and native? (I realize WebGPU is only currently supported by the latest version of Chrome, though!) |
Beta Was this translation helpful? Give feedback.
It is a limitation of WebGL2 and the way that we render point light shadows. We use cubemap textures, which contain 6 faces of a cube to provide information about where the light from the point light source can reach in the scene. WebGL2 does not support having arrays of cubemap textures so we can only support one shadow mapped point light (though still many point lights). Using other shadow mapping techniques could enable us to support more. Perhaps using shadow atlases instead for example.