Edit: Upgrading project to version 2020.1b10 solves the problem
I’m making a game that needs a day/night cycle and i created a script that just slowly turns the directional light by 0.5 degrees every couple of frames. I noticed that after a few minutes the game freezes for a few seconds or just crashes. Looking at the memory profiler I noticed that GfxDriver was constantly taking more and more memory and only stopped when i paused the game or disabled the rotation of the directional light. Below that, it says that every time the light moves, a new texture is created. Are those shadowmasks or something? Is there anyhing that can delete those old textures to free up memory? Resources.UnloadUnusedAssets();
doesn’t help and neither does System.GC.Collect();
(found those two in the anwers from simmilar questions)
Info about the project(idk what here is useful, im still learning stuff):
Unity version 2019.3.5f1
HDRP 7.1.8
All lighting is set to realtime
8GB DDR4 RAM