Space Background

Space Shader for outer space

might look laggy from close

Shader code
shader_type canvas_item;

//made by xhaya 

uniform sampler2D starNoise: repeat_enable;
uniform sampler2D tintNoise: repeat_enable;
uniform float brightness = 2.0;
uniform float amount = 0.75;
/** so glitchy idk*/
uniform float randomness = 5.785; 
uniform float background_amount: hint_range(0, 1.0 ,0.01) = 0.0; 
/** increasing this so high maxes scrolling effect */
uniform float flashing = 0.001;


void fragment() {
	float noiseTexture = texture(starNoise, VERTEX * randomness + TIME * flashing).r * amount;
	vec4 tintTexture = texture(tintNoise, VERTEX * randomness);
	if (noiseTexture > (background_amount + -noiseTexture)){
		COLOR.rgb = vec3(tintTexture.rgb * pow(noiseTexture, 4)) * brightness;
	} else {
		COLOR.rgb = vec3(0);
	}
	
}
Tags
2d, infinite, space
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 xhaya

Color shift Color Reducer post-processing

Glowing shield/beam/buble/magic/frost Fresnel

Related shaders

Space Background Parallax

Screen Space Lens Flare with rainbow colored effect

Moving planets in space for Skyboxes

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments