3D mesh layers? Or use two cameras in one viewport?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DrPlamsa
:warning: Old Version Published before Godot 3 was released.

Hey folks:

Let me describe what I’m trying to do. I want to have several meshes in the foreground, then several meshes in the background… BUT I want to ENFORCE that the foreground meshes will be drawn over the background ones, even if the player is closer to the background ones.

If 3D cameras/viewports had layer IDs like 2D, I could do that. Or if I could set the blank (undrawn) screen area of one camera/viewport to display the contents of another, I could do that. Are either of these possible? Can I enforce that a subset of meshes will be rendered under another subset regardless of distance?

Thanks Godot users!

Maybe you could trick the depth of the background mesh so that it appears the same in “2D” side view, but in 3D it’s just a lot further away. So you would still have a possibility for background to be drawn above, but due to a proper setup that may never happen (because your game works in a particular way that makes you able to assume that).

Or you could render that mesh in an offscreen viewport, but like you said I don’t know if that works in 3D… (like, rendering Sprites/UI BEHIND 3D stuff??)

Zylann | 2017-11-28 12:24