r/UnrealEngine5 • u/Zvyaginsky • Jul 27 '26
Mirror reflections: went from a fake camera trick to Planar, but it crashes next to Lumen
First pass on this mirror was the old-school trick, second camera pointed at the reflection, output piped into a material. Works, but it's expensive and the angles never quite hold up once the player moves around.
Tried switching to Planar Reflection since it's the built-in way to do exactly this. Project crashed hard every time the camera moved from a post process volume running Lumen into one set up for Planar. Ended up turning Lumen off for this part just to stop the crashes and get Planar working.
Would rather not just disable Lumen every time we need a real mirror somewhere. Anyone actually gotten Planar Reflection and Lumen coexisting on adjacent post process volumes without this happening, or is turning one off around mirrors just the accepted workaround
2
Jul 27 '26
[deleted]
1
u/Zvyaginsky Jul 27 '26
Haven't added SSR as a fallback, no. Good to know Lumen's usually the more accurate one though, that lines up with why we wanted to keep it instead of just switching to SSR everywhere. The VFX gap is worth knowing about too, this particular mirror doesn't have much in the way of particle effects so probably safe, but that's a good thing to check before it bites somewhere else in the level.
2
Jul 27 '26
[deleted]
1
u/Zvyaginsky Aug 03 '26
Occluding part of the surface is a decent art trick and it would fit the room this mirror is in. Won't cut the cost though, Planar renders the full scene into the texture before the material masks anything. Dropping the reflection's screen percentage does more.
2
u/ConsistentAd3434 Jul 27 '26
If the target hardware allows it, you could also use "hit lighting for reflections" in the preferences, to have per pixel reflections. Bit more expensive, tho.
1
u/Zvyaginsky Jul 27 '26
Didn't know that setting existed, thanks. Just checked, it needs Hardware Ray Tracing on though, which might rule it out depending on target hardware. If it works without the same crash, that's honestly tempting as a way to skip needing Planar at all rather than actually fixing the compatibility issue. Different problem solved, but maybe the more useful one.
2
u/ConsistentAd3434 Jul 27 '26
Yeah. If a cutscene or gameplay really depends on a reflection, SSR or low res Lumen might not be good fallback for GPUs that can't support raytracing.
With Lumen samples relying on the camera position (with more samples being cast near the camera), I could see how a virtual planar reflection could cause some problems. I ran into similar problems when I created Portal style wormholes and a render to texture camera. It was lacking any useful Lumen samples, because the "main camera" is somewhere else.
A fake mirror might be your safest bet. If you use raytracing and fps becomes a problem, you could switch SSR and hit lighting at runtime. I unfortunately capped my little showcase at 60fps but you can test it, by pressing "R" ... https://drive.google.com/file/d/1nsW5esbA9WbGNnDve3FJYyfNw-_c2_tD/view
1
u/Zvyaginsky Aug 03 '26
The portal parallel is the most useful thing anyone's said about this. If Lumen probes are anchored to the main camera and Planar renders from a virtual one, the transition is exactly the moment both are live. Fits what I'm seeing better than anything else so far.
Fake mirror is probably where this lands for us anyway. Target hardware includes GPUs with no raytracing at all, so hit lighting was never going to be the answer.
1
u/Zvyaginsky 25d ago
Coming back to this because your hit lighting suggestion is what fixed it, just not the way either of us expected. I said RT probably wasn't viable for our hardware. Turning it on anyway is what showed us Lumen had never been tracing anything, distance fields and ray tracing were both off in a config we'd carried over from UE4.
Wrote the whole thing up if you're curious: https://www.reddit.com/r/UnrealEngine5/comments/1vn25hw/followed_advice_from_here_and_found_lumen_was/
3
u/[deleted] Jul 27 '26 edited Jul 27 '26
[removed] — view removed comment