I am trying to set up an HDRI image for lighting that can be rotated at runtime, but is not visible. I have tried the following:
Skylight with cubemap: This has the visual effect I want, where the objects in scene are illuminated by the HDRI but the HDRI itself is not visible. But, the “Source Cubemap Angle” parameter on the skylight for some reason is not settable using blueprints, so it can’t be rotated at runtime?
Skysphere + skylight capture: I put a large skysphere mesh with a two-sided unlit material into the scene, where the material has the cubemap as the emissive and the cubemap can be rotated about the Z-axis with a parameter. Then put a skylight into the scene, and create a BP function to rotate the HDRI texture and recapture the skylight afterwards. This works, but I can’t figure out if it’s possible to have the skysphere be invisible in game while still being captured by the skylight?
In short, #1 hides the background but can’t be rotated at runtime, #2 can be rotated at runtime but the background isn’t hidden. Is there some way to achieve both? Maybe some third way I haven’t tried yet?
[Edit] I’ve also tried using a Custom Depth Stencil to hide the background (replacing the stencil with scene color), but this was problematic in a couple of ways.