Need help parsing planar data & AbsoluteWorldPosition in Material Editor

In my project, I’m trying to design a material that will only display when viewed through a particular window frame (almost like a portal effect). To do this, I am dynamically calculating a custom view frustum based off of the player’s camera position and empty actors placed at the corners of the window frame to define the edges. I want to use opacity masking to set the material up so that, at each pixel, if it is within the bounds I have set (on the correct side of each of the four planes), then it will draw; if not, it will be masked.

Please note that, due to technical limitations in the project, I cannot use Render Textures or any Post Processing effect (like Custom Render Depth) to achieve similar results.

I am calculating the planes in the level blueprint like so:

Then, I am passing that information to the material using a global Material Parameter Collection, and setting up the opacity mask like this:

However, the material is not behaving correctly, and is giving me anomalous results that I can’t quite understand. I’ve tried splitting up the planes individually to observe their behavior, and each seems to be failing in a different, inconsistent manner. Using various debugging tests, I can confirm that the planes are calculating correctly for exactly what I want, so I know that my math checks out (the result of the dot product should be positive if it’s on the side of the plane that I want, and negative if it’s on the other side). I’m starting to suspect that the data somehow isn’t getting parsed properly when it gets passed to the material, but I’m frankly not familiar enough with the Material Editor to understand what’s happening.

Can anyone help me understand how to make this work properly, or spot anything I’m missing? Any help you can provide would be greatly appreciated. Thanks!

Anyone have any ideas? I’m still looking for help on this.

Does the answer here (Reddit - Dive into anything) have any bearing on the problem I’m seeing? What would that fix look like in my material? What he’s suggesting is just a little over my head when it comes to the Material Editor, so I’m not certain if it’s applicable, or how to enact it if it is.

Minor success - setting up the planes this way (image) at least displays the planes properly, but now I seem unable to determine which side of the plane the rendered point is on (that is, it hides all of the pixels which lie exactly on the plane, but draws all pixels that are both above and below it). Both sides are giving the same dot product result of 1. Thoughts?

I finally found the answer. In case anyone else needs this in the future, here is the solution: