Clearing shadow maps from VRAM


Is there a way to unload the current shadow maps from VRAM?

I noticed in the profiler that the VRAM for shadowmaps gets added all the time, even though I destroy lights that cast shadows.

Cleaning up assets/textures by using the unload method works fine, but couldn’t find anything similar for the shadow maps. I assumed they get cleared as soon as the corresponding light gets removed, but seems it isn’t so.

Except if it’s just a profiler issue!

It’s a proifler issue. :wink:

Can you post an issue on the engine project and we’ll get this fixed for you.

1 Like

Well, OK, I guess it may simply be a bug in the engine. But creating a blank project and deleting and undoing the Light entity over and over shows that VRAM is not reclaimed. I wonder if this is because the render target for the light’s ‘shadow camera’ is being destroyed, but not the color buffer texture assigned to it. The all-knowing, all-seeing @Mr_F will know for sure. :slight_smile: