Make ReflectionVector ignore camera distance

Ahh, well then I think I see where things are going wrong then and what you’re really trying to acheive.

While it’s true that it’ll never be perfect for the reasons I mentioned - it can be improved dramatically from where you’re at. What would help the most is grounding the cubemap in world space. This also has issues but I think they’ll be visually less jarring. They will fix the issue of it feeling like the cubemap is floating off in infinity and look much better.

One really simple way to do this is to add the “Interior Cubemap” node. This will project the cubemap to the interior of a fake cube. But sometimes the box shape can be a bit too obvious.

There are other ways to achieve a similar effect but they all have their flaws. You could project to the inside of a fake sphere instead.

SphereProject

There isn’t a native sphere interior mapping function to my knowledge * but we can hijack the “RayTracedSphere” to achieve a close end result. Here’s an example of that in action. As you can see there’s a bit of distortion but it kind of looks like I’m looking into a 3D space.


The offset allows you to shift the sphere relative to the portal object. Radius determines how large the sphere is. It needs to be at least as large as your object for a convincing result. If you make it too big, the skybox effect will return. The reflection vector is what tricks the sphere trace into looking inside out. Lastly that UVW is fed into our cubemap. Throw in some special effects to hide the flaws, and you’ll be looking pretty good.

*I take it back, I remembered there is one called “DistanceLimitedReflections”. Much like my example it raycasts a sphere. Results look the same to me and mine seems to cost a few less instructions… Anyway, hope this helps.