How do I use a Dynamic SkyLight under VR performance constraints?

I’m trying to create a day/night cycle using a SkyLight for ambient fill. This is a VR project, and as such I’m under the constraint that I can’t really have a bad frame, ever. I need to be under 11 ms every frame.

To avoid an expensive scene recapture, I’m using cubemaps for my Skylight with SLS Specified Cubemap light source type. I then Set Cubemap Blend to smoothly transition from time of day cubemaps, which for the most part seems to work fine. However, when a new Source or Destination cubemap is supplied (i.e. transitioning to a new cubemap pair), there is a large frame hit. When I profilegpu during a new blend, I see two expensive entries, namely:

  • 8 instances of FilterCubeMap, each
    shorter than the last, totally just
    under 5 ms
  • ComputeDiffuseIrradiance at just
    under 6 ms

Those two together blow my 11 ms budget on their own. I have a few questions that maybe someone can help with.

  1. What specifically is the gpu doing during the FilterCubeMap and ComputeDiffuseIrradiance?

  2. What is “FRAME Leaf Events”. The ComputeDiffuseIrradiance happens under this category in profilegpu, but since it’s not under Scene, I don’t see any evidence of it using RenderDoc.

  3. Can I somehow precompute those so the gpu doesn’t need to? I know the state of the sun and the weather, so I should be able to tell the Skylight everything it needs with “offline” computations. Why does it need to do expensive calculations on a new cubemap?

  4. If these calculations need to be done, is there any way to spread the compuations across frames so that there isn’t a single frame hit?

  5. I’m also using a plane with transparency for ocean water off to the horizon. However, it looks like transparency doesn’t use the Cubemap Blend, so my water specular visually pops with each new cubemap update. The only solution I see is to use many cubemaps so that the visual pop is minimal. Is there an issue with that approach or is there a better approach?

  6. Is there some other reasonable lighting approach that doesn’t use Skylights at all, but can still make a sunrise or sunset look semi-natural.

Thank you so much for any help you can give. I’m really stalled here.

An alternative to skylight could be the Ambient Cubemap post-process effect but it won’t affect translucent materials.

  • place two post-process volumes and set a different cubemap in each volume
  • I can’t remember exactly how (and I won’t have access to UE4 for a couple of days) but you can seamlessly transition between post-process volumes and it won’t have a huge performance hit.