#Rendering a Label in a WireFrame Viewport?

10 messages · Page 1 of 1 (latest)

tough zephyr
#

Here's an unusual one I'm hoping someone brighter than I can figure out! So, I'm working on a 3D project which is intentionally rendered entirely in wireframe, using viewport.debug_draw = viewport.DEBUG_DRAW_WIREFRAME, which is working fine. However, my issue is that I'd still like to render Labels attached to 3D nodes in my scenes. That doesn't work because the main viewport renders everything (including the Labels) in wireframe (just like I asked it to, derp). I've tried a bunch of things around using SubViewports, but nothing works because the main viewport is ... again ... wireframe.

cobalt swift
#

I've tried a bunch of things around using SubViewports, but nothing works because the main viewport is ... again ... wireframe.

couldn't you set only the subviewport to be wireframe mode? So you'd have a subviewport for all your 3D stuff, and the main viewport would NOT be in wireframe and it can have UI & labels?

tough zephyr
#

Basically I want the wireframe of screenshot 2, but the Label of screenshot 1.

cobalt swift
#

So in this scene, on which node do you set DEBUG_DRAW_WIREFRAME ?

tough zephyr
#

Currently viewport.debug_draw = viewport.DEBUG_DRAW_WIREFRAME is set on my root node in the scene.

#

(not this scene sorry, the main scene which this scene in loaded into as a Node)

cobalt swift
#

Ok, so then I think what you want is to essentially flip this scene structure:

  • Put MeshInstance3D (and everything in your world really) under SubViewport
  • Put labels and anything else that should NOT be wireframed outside SubViewport
  • Set debug_draw on SubViewport, not on the main viewport
tough zephyr
#

I understand that, but once I've done that, how would the Labels (which would be in the main Viewport) be rendered on top of the SubViewport? Would the SubViewport have some kind of transparency?

cobalt swift
#

oh yes. It should by default unless you change the clear color. That way you can compose objects in 3D that are rendered in separate viewports on top of each other, as if they were all rendered in the same viewport