defold
defold copied to clipboard
Culling for draw debug physics
Is your feature request related to a problem? Please describe (REQUIRED):
I have a lot of physics object in game.
Debug physics draw all physics. And i have warning
Out of debug vertex data (100000). Increase graphics.max_debug_vertices to avoid this warning.
You see in screenshot that i have a lot of physics. So i can't increase that value.
Also with debug physics i have 14 fps. Without debug 60fps.
Describe the solution you'd like (REQUIRED): Debug physics draw only visible lines. Or mb first draw lines that near to player.
Describe alternatives you've considered (REQUIRED): No workarounds. Need to make smaller world in my game:(
Additional context (OPTIONAL): Add any other context or screenshots about the feature request here.
The debug draw system isn't built and rendered like the components, and honestly, I feel it shouldn't be.
I think it's easier/more flexible to add a Lua function that allows you to check your AABB with a frustum matrix.
Ok, what about to add ability to disable/enable debug draw for component?
If I can manually enable debug draw near player and hide debug draw for other components, it will fixed my problem.
I can check frustum using scene3d frustum. So I can find visible chunks. But I have no ability to debug draw only visible)