Try to implement VolumetricLightmaps into Babylon

Hi, all! I am trying to implement VolumetricLightmaps into Babylon.
Currently, I have finished export data we need from UE4, which is called FPrecomputedVolumetricLightmapData. It contains volumetric lightmap bricks’ position and size, also light information (Ambient, spherical harmonic coefficients, shadow factor and Bent Normal, they are all 3D Texture).
I have two questions:

  1. Does WebGL support 3D Texture Array? This is good for bind spherical harmonic coefficients to uniform buffer.
  2. Where do I add and manage these codes? Maybe I can regard it as part of scene (kind of like environment map, scene.VolumetricLightmaps). For management, my thought is to create a file VolumetricLightmap.ts and put them into folder Materials/ rather than Materials/Textures. Since volumetric lightmaps is a combination of several textures rather than a single texture.

Hello! That is very cool idea :smiley:

  1. Since I’m not too sure of this one (my guess would be yes, at least in WebGL 2), I’ll tag @RaananW and @sebavan to check
  2. I think the lightmap could be part of Materials/Textures, since the Cubemap is part of the Textures directory and is also a combination of textures.
1 Like

This would be rad !!! :slight_smile:

3d texture are supported but I do not think 3d textures arrays are.

1 Like

OK, let’s put VolumetricLightmap into Material/Textures. :grinning:

2 Likes