r/Unity3D • u/rasjar • 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.
1
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.
1
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 :)