I am wanting to create Aperture Science style portals, And I’m aware of various compositing techniques to do this, but to make it more flexible I am thinking about using Open Shading Language. I do not know much about OSL, but the principle in mind is to basically have the shader take a ray trace that’s coming at it, and send it out of a different object, translating the first object’s local space into the other’s (possibly with a tiny bit of offset so it doesn’t then collide with the second object, but that may not be necessary if we can take normals into account)
In short, is this or a synonymous implementation possible, and how would it be done? I’ll be looking up resources on OSL in the meantime if I can.
This is what it looks like in Portal 2:
As you can see, one portal is connected directly to the other. For clarity, the small swirly blue-and-orange icon in the center of the screen (showing over the bottom of the orange portal) is a crosshair and is unrelated to the effect at hand. A holographic outline of the orange portal also shows through the testing sphere, and that is also unrelated.