How to render a mesh effect passing through a vertical plane / portal?

Hi All,

I’m developing a game with magical portals.
I’m looking for a visual effect where a monster passing through the portal is rendered only partially, as it is coming out from another dimension.
So, from a user’s perspective s/he wouldn’t see the monster if s/he is looking behind the portal but s/he would see it if looking in front of the portal.

Is there a solution for that?

Thanks for your time,
Rod

anyone?

I’d suggest looking into Stencil Buffer shaders.

The official documentation is a good place to start, although it can lack examples.

Here’s some more info on the subject:

These two videos are from the channel “Making stuff look good in videogames”:
Stencil buffer:

More advanced stencil buffer:

I hope you’ll find what you need :slight_smile:

1 Like