defold icon indicating copy to clipboard operation
defold copied to clipboard

Culling for draw debug physics

Open d954mas opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe (REQUIRED): I have a lot of physics object in game. 2023-05-25_18-35-19

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.

d954mas avatar May 25 '23 15:05 d954mas

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.

JCash avatar May 29 '23 06:05 JCash

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.

d954mas avatar May 29 '23 08:05 d954mas

I can check frustum using scene3d frustum. So I can find visible chunks. But I have no ability to debug draw only visible)

d954mas avatar May 29 '23 08:05 d954mas