Separate Sky Lighting (HDRI or other) from Overlay

Made this to be able to use HDRI lighting, but still have stylised sky overlay. Doesn’t have to be HDRI, it can use any texture input for ‘hdri_background’, including simple gradient. Also includes cloud cover mapped to sky overlay, and their colour with gradient.

Shader code
shader_type sky;

uniform sampler2D hdri_background : filter_linear, source_color, hint_default_black;
uniform sampler2D sky_background : filter_linear, source_color, hint_default_black;
uniform sampler2D clouds : filter_linear, source_color, hint_default_black;
uniform sampler2D cloud_color : source_color;
uniform float exposure : hint_range(0, 128) = 1.0;

void sky() {
	if(AT_CUBEMAP_PASS){
		COLOR = texture(hdri_background, SKY_COORDS).rgb * exposure;
	}
	else{
		COLOR = mix(texture(sky_background, SKY_COORDS).rgb, texture(cloud_color, SKY_COORDS).rgb, texture(clouds, SKY_COORDS).r);
	}
}
Tags
hdri, sky, skybox
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

Related shaders

guest

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Süheyl
Süheyl
4 months ago

Where are the Textures for the Cloud etc

Last edited 4 months ago by Süheyl
PorciniCremini789
PorciniCremini789
4 months ago
Reply to  Süheyl

Make these using Noise Textures, if you make the width really narrow (like shown in the short), it’ll wrap around like in the banner picture