Does anyone have any tips for fixing lag when using the SDF texture? I couldn’t use the Godot Light2D because I need to support lots of lights in close proximity, and would hit the Vulkan limit.
You could disable V-Sync and cap the framerate to a multiple of the monitor refresh rate to hide (but not fix) the issue, but this will increase power consumption and isn’t guaranteed to work (on slower hardware or if V-Sync is enforced by the system).
I couldn’t use the Godot Light2D because I need to support lots of lights in close proximity, and would hit the Vulkan limit.
How many lights at once do you need to draw on a single sprite? The limit of lights in Godot is per-sprite, and IIRC, it’s pretty high for 2D (128 lights or so). It is lower in 3D if using the Mobile rendering method, but when using Forward+ in 3D, it’s 512 clustered elements by default (a clustered element being an omni/spot light, a decal or reflection probe).
If you’re actually hitting the limit, you can split large sprites (such as the background) into smaller ones. This can also improve performance as lights won’t need to make as many sprites redraw, reducing the fillrate requirements at the cost of more draw calls.