Sokpop Skybox

This a simple gradient skybbox based on the sokpop shader for Unity as seen in: https://www.youtube.com/watch?v=XatLA5SGgAs

Shader code
shader_type sky;

uniform vec3 color_top : source_color = vec3(0.91, 0.14, 1);
uniform vec3 color_horizon : source_color = vec3(1, 0.4, 0.42);
uniform vec3 color_bottom : source_color = vec3(1, 0.74, 0.39);

uniform float exponent_factor_top : hint_range(0, 100) = 1.0;
uniform float exponent_factor_bottom : hint_range(0, 100) = 1.0;
uniform float intensity_amp : hint_range(0, 1) = 1.0;

void sky() {
	float p = EYEDIR.y;
	float p1 = 1.0f - pow(min(1.0f, 1.0f - p), exponent_factor_top);
	float p3 = 1.0f - pow(min(1.0f, 1.0f + p), exponent_factor_bottom);
	float p2 = 1.0f - p1 - p3;
	
	COLOR = (
		color_top * p1 +
		color_horizon * p2 +
		color_bottom * p3
	) * intensity_amp;
}
Tags
godot4, sokpop, stilized
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.

More from afk

Circle progress mirror

Tilemap cell UV

Joepli wobble

Related shaders

wobly 2D – Sokpop based

Skybox from 6 textures

Subscribe
Notify of
guest

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
itsMe
itsMe
2 years ago

how do i use it