I’m generating a map of blocks that is 23 x 23 x 20 at startup. Each mesh is set to:
receiveShadows = true
castShadows = true
castShadowsLightMap = true
lightMapped = true
isStatic = true
I’ve tried all combinations of true/false with the above flags.
I’m trying to use a directional light. It doesn’t matter what I set the light to with regard to the lightmapping flags (I’ve tried all combinations). After the map has been generated, I’m calling:
The blocks are only lit if “Affect Dynamic” is switched on and Shadow Update Mode is set to “Realtime”, which appears to me to be indicative of the attempted baking not doing anything, nor of the lighting calculation working during the updateShadow() call.
Make sure your meshes have UV1 coordinates generated.
Also look at browser console - this would contain warnings if you’re trying to bake meshes without UV1.
And yes, updateShadow should not be called at all.
The shadow update is there in an attempt to just to have the lighting calculated once instead of every frame because baking doesn’t work.
Also, looking at your other thread about batching - note that batching is not compatible with real-time lightmapping at this stage.
After the lightmap has been baked, doesn’t the batching just work as if there’s no difference? I’m just curious as to what would stop it from being compatible.
Make sure your meshes have UV1 coordinates generated. Also look at browser console - this would contain warnings if you’re trying to bake meshes without UV1.
All of the meshes I’m using apart from one are built-in primitive boxes and planes. I don’t get any warnings.