Defining a plane in a material using camera position and world position

Hello!

I am trying to create a material that creates a frame through which the object appears. I already have made the basic portal work, but i’ve been trying to replace the CylinderIntersection node so that i can define a plane using 4 points in space.

However, i can’t seem to make it so that i can make the opacity mask shows the plane in world space.

For example, I want to draw this quadrilateral shape within this cube (which i will later use as an alpha mask), shape defined by its four corners:

I tried some things, but can’t seem to figure out how to translate this into the correct space.

Here i tried adding the point positions to a position transformed into the plane’s space, but i have issues where the geometry of the mesh interferes with the shape, so it works fine on the top face, but breaks when seen from the side. Spheres make the entire thing break.

Here is a link to a post that shows a result I’m trying to achieve, from an effect in Sushi Ben:

x.com

If anyone knows how to replicate this quadrilateral shape effect, I’d be thankful! I’ll keep trying and digging on my side and let you know if i find how to make it work. I think i have an idea of the logic behind it, but can’t get a grasp on translating it with Unreal spaces.