I have two meshes in my “Skydome”:
- A moon mesh
- Outer sphere that serves as a “shell” which encompasses everything in the level including the moon
They’re both separate actors. Both are using unlit, opaque materials with “IsSky” set to true.
The problem is that the moon displays inconsistently. Sometimes it works, sometimes it doesn’t. Sometimes it works only in editor then fails when I play the game. Sometimes it works until I save the material again and then it suddenly stops working.
A glimpse of the fun I’m having:
I tested both 4.26/4.27 and the issue is present in both.
Does anyone have any idea how I can mitigate this issue?
Tried combining them into a single actor… no dice…
Same issue in UE5.
Getting extremely frustrated with this.
The documentation makes it sound like you can only use a single mesh:
The sky material is rendered as the last opaque mesh during the base pass
However it’s not obvious to me why this would be the case, after all you can use masked materials on sky meshes, why would that make sense if you couldn’t put an opaque mesh behind it? Plus why does it work correctly sometimes?
Indeed, so far a single mesh was supported because reflections rendering was done without depth buffer so the rendering order was dependent on the submission order. It is limited and we should have made this clear in the documentation sorry.
Multiple meshes should be supported now since 4.27 if you use r.SkyLight.RealTimeReflectionCapture.DepthBuffer 1. I believe that should fix your ordering issue. It is not enabled by default because it adds some cost (extra memory and the depth render target needs to be cleared). The documentation should be updated soon.
Thank you for the clarification (and suggestion) Sebastien, sadly I’m still getting inconsistent ordering in 4.27 even with r.SkyLight.RealTimeReflectionCapture.DepthBuffer set to 1.
Same result in game, sometimes it works sometimes it doesn’t.
Ah weird. And in fact this is not even in reflection but in the main view (I thought it was about reflections, so that cvar will not indeed not help, it can only help for the skylight real time reflection capture).
I’ll add it to my long list of todos.
Thanks a lot for taking the time to report.
No problem, thank you for taking the time to respond. I greatly appreciate it
Ugh… turns out I’m just an idiot
Doing this is easy, just make an unlit non-sky material and fill in the shadow with the sky view luminance. I was already doing this but trying to make it work with a sky material… that’s not necessary…