Search Unity

Question Best approach to volumetric clouds for a flight sim on mobile (Quest)?

Discussion in 'General Graphics' started by JoeStrout, Aug 11, 2022.

  1. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I've been looking at various options for making clouds that you can fly around and through, for use on Oculus Quest. Performance on this platform is super important, and the hardware is rather limited. General advice is to avoid (1) screen-space effects and post-processing, and (2) overdraw (as much as possible).

    There are a lot of cloud systems in the Asset Store but it seems like msot of them rely on full-screen (often raymarching) effects. I'm skeptical that we can afford the rendering time for any of them on Quest.

    Microsoft Flight Simulator 2004 used a technique (described here) where they basically had collections of little cloudlet sprites, with some lighting tricks to make them darker towards the bottom and brighter on the side towards the sun. They also used a ring of imposters for far-away clouds, so only the nearby ones needed to use these sprite swarms. But even so, that sounds like an awful lot of overdraw.


    So. Any opinions on the most likely best-performing approach to clouds you can fly around and through on Quest?
     
  2. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    I can think of a few possible approaches.

    1. do similar to MFS 04 and use cloud sprites, but cut them out so only the edges are transparent, with the centers being fully opaque (use two different shaders for each part).

    2. some kind of dithered translucency (similar to UE4), but ofc this requires TAA, which is probably too costly for the Quest, unless everything else is pretty simple.

    3. raymarching might actually be the best option, given that it gives you more concrete control per pixel of performance, whereas with sprites, you can't control if you have a lot of pixel work per pixel if the sprites all just happen to align badly. I can see that maybe you could do some cheap noise that might work well. there are probably varying levels of things you could get away with that might have artifacts or look not as AAA, but still perform well. If you only need to store density, you could try some methods of packing only 4 levels (2 bits) per texel in a 3d texture, then you can sample that with noise and get up to 4 actual texels per stored texel, albeit of course at a lower resolution. The big thing with raymarching is just doing as little texture samples as possible, as mobile memory performance is going to wreck you the fastest.

    4. If you have sparse clouds, you could combine raymarching with bounding volumes, so rather than 1 bounding volume for the sky, you have 1 for each cloud. This could improve performance, but only if you have sparse clouds. Pretty sure this is how voxels are rendered optimally in Teardown.

    5. You could try rendering clouds to a low res buffer (using any of the above techniques), then combine with the final full res buffer by doing a manual compare against the depth buffer. Many screen space techniques are done this way, even in AAA games.

    I am sure there are a ton of other possibly well performing techniques. It's certainly an interesting topic. Would be interested in a follow up with what you end up doing.
     
  3. stefano_s

    stefano_s

    Joined:
    Apr 6, 2018
    Posts:
    1
    look at real flight simulator on mobile version 2.0.5