godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.87k stars 3.16k forks source link

"Using Viewports" tutorial incorrect when SubViewport shares parent World3D #8532

Open paulmiller opened 10 months ago

paulmiller commented 10 months ago

https://docs.godotengine.org/en/4.1/tutorials/rendering/viewports.html reads:

  • Node3D
    • CameraA
    • MeshA
    • SubViewport
    • MeshB
    • CameraB

CameraA will display on the Root Viewport and it will draw MeshA. CameraB will be captured by the SubViewport along with MeshB. Even though MeshB is in the scene hierarchy, it will still not be drawn to the Root Viewport. Similarly, MeshA will not be visible from the SubViewport because SubViewports only capture nodes below them in the hierarchy.

This is only true if the SubViewport uses a separate World3D, which is not the default, as explained further down the page.

MichaelMacha commented 8 months ago

I just came here to report this and see if it was an actual issue; I attempted to recreate that scene in Godot 4.2 and had both meshes displaying as the root, contrary to the documentation.

I'm still not entirely sure what a World3D literally is, but I'll offer to see about writing up a correction after I've gotten this working right.

MichaelMacha commented 8 months ago

I've proposed a change at https://github.com/godotengine/godot-docs/pull/8741 ; do let me know if you see any issues with it now?

paulmiller commented 8 months ago

That looks good.