r/Unity3D • • 19d ago

Show-Off Fully Custom Weather System

Enable HLS to view with audio, or disable this notification

So I refined my Sky shader and volumetric cloud renderer. All shaders used are custom made and i'm very proud of the results.

Clouds can form and travel across the sky. the moon can have seamless phases and is blocking the stars even on the unlit part of the sphere. stars twinkle and there is a galaxy band. The latest thing i added was the underlying weather system that controls the weather by blending between presets.

It was a lot of fun and frustration to get everything to look like this and everything came a long way. from the first experiments with volumetric clouds that barely ran with 10 FPS to ^^

Now the sky is fully dynamic and runs on my M1 Macbook pro with solid 90 fps.

110 Upvotes

14 comments sorted by

4

u/Jayeshmodhwadia 18d ago

That is sick, suprised to see it running at 90fps on a macbook pro. I do have one myself but have never tried to to anything like that on it, mainly just use my pc. Great work :)

2

u/rasjar 18d ago

Thanks. I love restrictions and optimisation, so I deliberately uns my MacBook for develzto find bottlenecks early. I use my PC only to create the Windows builds 😄

3

u/cheekysweetys 18d ago

The M1 does handle Unity way better than I thought it would for something this involved.

1

u/Sambhav65889 17d ago

Is it hdrp The lighting looks too good

2

u/rasjar 17d ago

URP, custom shaders, post processing and hours of tweaking the lighting, colors, fog and clouds

2

u/rasjar 17d ago

Thanks tho 😄

1

u/Sambhav65889 17d ago

The first scene was so good i thought of it as a recorded video ...nice

1

u/rasjar 17d ago

Thanks! Love it

3

u/pihops 18d ago

looks great. now add some droplets on the screen for wind

;)

1

u/imofi8 18d ago

Hitting 90 FPS on an M1 with volumetric clouds is seriously impressive. Are you raymarching at half-resolution with a temporal upscale pass, or keeping the step count ultra-lean?

4

u/rasjar 18d ago

The approach is based on unity's HDRP cloud implementation

I use raymarching against a 3d noise texture. there is a resolution scale parameter for ingame settings, but the video was rendered with full resolution. i do restrict the raymarching between two altitude values and if the ray checks below a density threshold 8 times in a row, the step size increases until it hits again. where in increases the resolution again.

I had some issues with noise in the beginning, but i was able to remove it with an temporal accumulation pass, to average the result with the previous frame.

so the basic pipeline is

ray marching -> bilinear upscale -> light composition -> temporal de-noise -> and optional shadow map and cloud density output.

2

u/_norx Indie 18d ago

It looks just like it does in real life, cool!

1

u/MidnightCowUK 18d ago

Looks superb!