Shadows rendering only once inquiry

Good Day, Babylon Community,

I have a question about the shadows of my asset.
I am implementing the following code into my project:

shadowGenerator.getShadowMap().refreshRate = BABYLON.RenderTargetTexture.REFRESHRATE_RENDER_ONCE;

I anticipate adding this bit of code will make my scene more efficient. I created shadows for my scene, I checked the refreshRate of my asset. I was getting a value of one, after my scene is fully load, I changed the refreshRate to a value of zero. I observe that the refresh rate has indeed changed to zero for my asset shadows.
My expectation is if shadows are refreshing only once, changing the position of my asset in my scene should not update the shadows associated with the asset because my scene is NOT updating shadows every frame. However, when I use the inspector to move my asset from one position to another, the shadows associated with my asset updates with its position. Is my expectation of the asset shadow staying place incorrect? Or is it something else?

Warm Regards,

James Wu

This is pretty weird indeed REFRESHRATE_RENDER_ONCE would force the rendering of the shadow map to happen only once.

Could you share a repro in the playground ?

1 Like

I was only able to observe the behavior in my current branch. I am going to see if I can recreate a playground where this is occurring.

1 Like

Thank you for getting back to me. I missed the “light.autoUpdateExtends = false” block. My apologies for the confusion.

2 Likes