getShadowMap().resize() does not work

Calling shadowGenerator.getShadowMap().resize(newShadowMapSize) to resize a shadowmap does not work, as demonstrated in the playground below.

In the playground, press the Space key once the scene is loaded to attempt to resize a shadowmap. It does not work - the shadow disappears.

In other cases, where the shadow-casting-mesh may be larger, the shadow is still there, but is however smaller and not the right size for the mesh.


I could reproduce the issue with Chrome and Firefox. No errors or any log in the console. Anyways, I’m taking a look.

1 Like

It works with webgl1 but not with webgl2. pinging @sebavan

Yup looks like a bug as the light UBOs are not flagged as dirty the new size info are not passed through the shader. I should have a fix by tomorrow morning.

1 Like

It is already tomorrow in France :wink: so I pushed the fix here: Fix RTT resize and ShadowGenerator by sebavan · Pull Request #6627 · BabylonJS/Babylon.js · GitHub It will be part of the next nightly tomorrow.

1 Like

Thank you, @sebavan!