DmitriySalnikov / godot_debug_draw_3d

Draw 3D debug graphics and 2D overlays with this add-on.

Home Page:https://dd3d.dmitriysalnikov.ru/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Can't Draw In Viewports that use thier own worlds

lucidium4 opened this issue · comments

Godot version

v4.2.1.stable.official [b09f793f5]

DebugDraw3D version

1.3.1

On which operating systems the error occurs

Windows

Using which renderers the error occurs

Vulkan mobile

Issue description

Debug Draw 3D Can't be use in Viewport that have thier on worlds.

Steps to reproduce

Run the project with the "Own World 3D" variable on and off on the SubViewport

Minimal reproduction project

SubViewportBug.zip

This is expected, because in order to draw graphics, it needs to be added to some of the worlds. By default, the world of the root of the game is used.

I already have a method that changes the world for all meshes, but only 1 world can be selected. This method only needs to be exposed.

At the moment, a separate mesh is being created for each shape, there are 19 in total. +1 for lines. There is also a division into _process and _physics_process. That is, (19 + 1) * 2 meshes are created for one world.

I think it's not very difficult to add support for other worlds, but it will probably reduce performance a little more. And somehow you need to specify the world in which to draw (scoped configs are most likely).

I have added the ability to change World3D for the entire geometry. You can check how set_world_3d_from_viewport works using binaries from here.

The next goal is to be able to render to multiple Worlds at the same time, but I'm not completely sure how this will be implemented.

godot windows editor dev x86_64 mono_sxaI5oAoGT
more edits are needed, but the main part is already working.