Gezinmeyi atla
On the main Shopify sphere, we also wanted dynamic clouds that flow naturally, whirling, forming and…
0:00 / 1:16

On the main Shopify sphere, we also wanted dynamic clouds that flow naturally, whirling, forming and…

Xor

@XorDev41 B takipçi

X profili
264 beğeniİndirOrijinal gönderi

25.408 görüntüleme

On the main Shopify sphere, we also wanted dynamic clouds that flow naturally, whirling, forming and dissipating over time. Here's how we achieved that fluidity live

15 Yorum

Yorumlar X (Twitter) üzerindeki orijinal gönderiden alınmıştır

  • Xor profil fotoğrafı

    @XorDev

    The first step is to start with some good noise. We wanted quality, but we had to be mindful of performance to make this run at 8k 60 fps. Some fractal value noise was used as the base. It's cheaper than Simplex and Perlin noise, but still looks good when layered

    7 beğeni

  • Xor profil fotoğrafı

    @XorDev

    For texturing, we need some lighting. This is done by also sampling the cloud density away from the light and comparing the density: exp(cloud_density - shadow_density). This density can also be used for dropshadowing

    7 beğeni

  • Xor profil fotoğrafı

    @XorDev

    For fluid motion, you could use a Navier Stokes fluid solver, but that is expensive and difficult on a sphere at this resolution. What if there was another way to create turbulence procedurally on the fly? I came up with a new 3D version specifically for spherical surfaces

    13 beğeni

  • Xor profil fotoğrafı

    @XorDev

    The standard method works by adding sine waves in different directions, increasing frequency and decreasing amplitudes: When done enough times, you get convincing fluid motion for in real-time for a tiny fraction of the cost (and no bandwidth limits)

    9 beğeni

  • Xor profil fotoğrafı

    @XorDev

    The sphere problem is that we want to limit the waves to the surface. If the waves push the clouds up and down, the noise and motion will no longer make sense. My solution was to project the waves pack to the sphere surface with each iteration

    7 beğeni

  • Xor profil fotoğrafı

    @XorDev

    From here, it was just a matter of finetuning the amount of fluid motion. Too much leads to stretching, but a moderate amount is perfect. All of this is achieved without calculating pressure or velocity vectors!

    7 beğeni

  • Xor profil fotoğrafı

    @XorDev

    For the finishing touches, I made shifted the noise overtime so that clouds form and dissipate and added glowing borders that illuminate the clouds (mipmapping for diffusion)

    27 beğeni

  • Xor profil fotoğrafı

    @XorDev

    There are many other details I could say, but hopefully that's enough to get some ideas rolling. If there's enough interest, I'll write a tutorial specifically on spherical turbulence. It might need a longer write-up to properly explain

    24 beğeni

  • Jan Orszulik profil fotoğrafı

    @JanOrszulik

    @Shopify :)

    3 beğeni

  • Xor profil fotoğrafı

    @XorDev

    @Shopify Jan, we were inspired by your globe and clouds. What method do you use?

    4 beğeni

  • Jan Orszulik profil fotoğrafı

    @JanOrszulik

    @Shopify N/N Flow field values then gets transformed from sphere coords into "world space" and that is fed to volumetric rendering together with density.

    2 beğeni

  • Xor profil fotoğrafı

    @XorDev

    @Shopify I'm curious about performance. I was concerned about using lots of samples or lots of shader passes. What projection do you use for spherical mapping?

    2 beğeni

  • Jan Orszulik profil fotoğrafı

    @JanOrszulik

    @Shopify 1/2 Amount of shader passes itself generally isn't a problem (most will be during fluid sim and you would have to do something insane for that to have significant impact), I will be eventually migrating rendering to octahedral projection most likely.

    2 beğeni

  • Xor profil fotoğrafı

    @XorDev

    @Shopify At 8k with say 25 samples, it would certainly add up. Maybe you're doing like 4 samples? Equirect currently?

    1 beğeni

  • Jan Orszulik profil fotoğrafı

    @JanOrszulik

    @Shopify For volumetric rendering? I do up to 64 samples along the ray and up to 5 towards light source. You don't want to run that full res, ideally temporal sampling with reprojection. Modern tech like DLSS can push that near perfection (check Star Citizen). Sim itself is super low res.

    3 beğeni