Forum

How to work with portals


#1

hi all,

how does this work?

[https://media.giphy.com/media/1eExH5lNIClZPq9fY8/giphy.gif]

is the geometry of all “rooms” together in the middle, and the cube’s sides are materials that render just a certain part of the geo inside? or do you render 6 different cameras with their own geo, and the sides work like masks? or something like depth stencil? or a shader with multiple geo input and a pixel shader that renders different geo based on UV?
@microdee

please elaborate

the cake is a lie


#2

as a hint: there’s a projection transformation node which projects a frustum to an arbitrary rectangle from an arbitrary point in 3D. Oldest trick in the book. It’s PerspectiveLookAtRect (Transform ViewProjection) in vvvv. So in there it’s just 6 rendertargets with that projection and a shader to merge the depths of the inner scenes and the outer scene to have objects going in/out of the cube and pick up screen space effects (like SSAO)