You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you disable a regular Light Volume in runtime, and then enable - it degrades the performance. Fortunately, seems like this bug has no cumulative effect and only drops the performance only once on the certain amount.
What is even more weird - you can fix the bug in runtime by disabling and enabling a Point Light Volume in the scene.
How to reproduce the bug
Go to the Example.unity scene, provided with the package
Enable the Overdrawing Benchmark game object, in hierarchy which is actually 100 quads with a transparent LV material, to cause a massive overdrawing and profile the performance in play mode.
Add a Point Light Volume to the scene and place it anywhere, it doesn't matter. (There are no Point Light Volumes on the scene by default)
Go to play mode and enable the Profiler in GPU mode.
Now disable and enable pretty much any regular light volume.
You'll see a really noticeable performance drop in profiler. Doing it more times and with other volumes too doesn't drops performance more.
Now you can fix this bug in runtime by enabling and disabling the Point Light Volume in the scene.
Note
Doing this operations fast and chaotically, after some time will make it impossible to fix the performance with the Point Light Volume toggle for some reason.
I tried uploading this world in VRChat with some local toggles for the volumes, and based on the FPS changes, it still exists in VRChat, not only in editor.
Have no idea about the Android builds, didn't check them.
Some research I already did
I simplified the Light Volumes Manager udon script to make it possible to directly change the float _UdonLightVolumeCount and float _UdonPointLightVolumeCount global shader variables. And looks like just changing this values is enough to reproduce this bug.
So, changing _UdonLightVolumeCount value drops the performance and changing _UdonPointLightVolumeCount fixes it back. So, probably it's not the problem related to Udon scripts, might be the problem in Light Volumes shader code itself, which makes it even more weird.
When the issue appeared
I noticed this bug in early LV development stage, so most probably it was always since the first (or almost first) Light Volumes prototypes.
What the bug does
If you disable a regular Light Volume in runtime, and then enable - it degrades the performance. Fortunately, seems like this bug has no cumulative effect and only drops the performance only once on the certain amount.
What is even more weird - you can fix the bug in runtime by disabling and enabling a Point Light Volume in the scene.
How to reproduce the bug
Example.unityscene, provided with the packageOverdrawing Benchmarkgame object, in hierarchy which is actually 100 quads with a transparent LV material, to cause a massive overdrawing and profile the performance in play mode.Note
Doing this operations fast and chaotically, after some time will make it impossible to fix the performance with the Point Light Volume toggle for some reason.
There's also a video I recorded that demonstrates the bug: https://youtu.be/rc_qAe4PRUI
Where it is reproducible
I tried uploading this world in VRChat with some local toggles for the volumes, and based on the FPS changes, it still exists in VRChat, not only in editor.
Have no idea about the Android builds, didn't check them.
Some research I already did
I simplified the Light Volumes Manager udon script to make it possible to directly change the
float _UdonLightVolumeCountandfloat _UdonPointLightVolumeCountglobal shader variables. And looks like just changing this values is enough to reproduce this bug.So, changing
_UdonLightVolumeCountvalue drops the performance and changing_UdonPointLightVolumeCountfixes it back. So, probably it's not the problem related to Udon scripts, might be the problem in Light Volumes shader code itself, which makes it even more weird.When the issue appeared
I noticed this bug in early LV development stage, so most probably it was always since the first (or almost first) Light Volumes prototypes.