3D Skybox - Shader

25 seconds rendering day-night cycle.

25 seconds rendering day-night cycle.

Example in editor.

Using normalized global positions to create an up and down gradient.

Using normalized global positions to create an up and down gradient.

Atmospheric rendering, this function is shared with all the other shaders. Same logic as gradient up & down, i use normalized world pos to create height gradient. I also added the the sun and moon impact on the atmospheric rendering.

Atmospheric rendering, this function is shared with all the other shaders. Same logic as gradient up & down, i use normalized world pos to create height gradient. I also added the the sun and moon impact on the atmospheric rendering.

To render the clouds, I used a 2D raymarching technique that involves layering the same 2D texture at different height levels while applying a bell-shaped gradient (0->1->0). To light the clouds, we sample the same texture, but with an offset.

To render the clouds, I used a 2D raymarching technique that involves layering the same 2D texture at different height levels while applying a bell-shaped gradient (0->1->0). To light the clouds, we sample the same texture, but with an offset.

For the moon and sun masks, I use world positions that are aligned with the sun rotation and then transformed into spherical coordinates to sample a 2D texture.

For the moon and sun masks, I use world positions that are aligned with the sun rotation and then transformed into spherical coordinates to sample a 2D texture.

For the stars, I sample a 3D texture that rotates around an axis. I also sample a 3D noise to create a twinkling star effect.

For the stars, I sample a 3D texture that rotates around an axis. I also sample a 3D noise to create a twinkling star effect.

All shader graph.

All shader graph.

3D Skybox - Shader

Hey,

In this post, i showcases a custom skybox shader
I explain the different steps I did to achieve a convincing sky result.
This shader was created for rendering this scene : https://www.artstation.com/artwork/QKlvx3

I tried my best to maintain the highest video quality, but once it’s uploaded, the compression algorithm degrades the quality.

Reference projects that helped me create the clouds:
https://www.shadertoy.com/view/3sVXRR
https://www.shadertoy.com/view/Wd2XD1

More artwork