duizeligheidsimulator
This commit is contained in:
+12
-27
@@ -1,35 +1,20 @@
|
|||||||
shader_type sky;
|
shader_type sky;
|
||||||
|
|
||||||
uniform sampler2D base;
|
uniform float speed : hint_range(0, 0.1) = 0.05;
|
||||||
uniform vec3 base_color : source_color;
|
uniform float brightness : hint_range(0, 1) = 0.1;
|
||||||
uniform float base_speed : hint_range(0,1) = 0.1;
|
uniform sampler2D layers[10];
|
||||||
|
|
||||||
uniform sampler2D layer;
|
const vec2 speeds[10] = { vec2(-0.9, 0.8), vec2(-0.4, -0.1), vec2(3.03, 2.0), vec2(2.1, 0.2), vec2(0, 0), vec2(0.1, 0), vec2(-0.1, 0), vec2(0.03, 0), vec2(-0.01, 0), vec2(0, 0) };
|
||||||
uniform sampler2D layer_two;
|
|
||||||
|
|
||||||
uniform float NOISE : hint_range(0,1) = 0.5;
|
vec3 layer(sampler2D layer, vec2 direction, vec2 sky_coords) {
|
||||||
|
vec2 coords = vec2(sky_coords.x + TIME*speed*direction.x, sky_coords.y + TIME*speed*direction.y);
|
||||||
float random(vec2 coords) {
|
vec4 pixel = texture(layer, coords);
|
||||||
return fract(sin(dot(coords.xy, vec2(12.9898,78.233))) * 43758.5453);
|
return pixel.rgb * pixel.a * pixel.a * brightness;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sky() {
|
void sky() {
|
||||||
float NOISE_GRANULARITY = NOISE / 100.0;
|
COLOR = vec3(0,0,0);
|
||||||
|
for (int i = 0; i < layers.length(); i++) {
|
||||||
vec2 base_coords = vec2(SKY_COORDS.x+TIME*base_speed*0.05, SKY_COORDS.y);
|
COLOR += layer(layers[i], speeds[i], SKY_COORDS);
|
||||||
vec4 base_pix = texture(base, base_coords);
|
}
|
||||||
float noise = mix(-NOISE_GRANULARITY, NOISE_GRANULARITY, random(base_coords));
|
|
||||||
float base_alpha = base_pix.a;
|
|
||||||
//if (base_alpha < 0.01 && base_alpha > 0.0) {
|
|
||||||
//base_alpha += noise;
|
|
||||||
//}
|
|
||||||
|
|
||||||
vec2 star_coords = vec2(SKY_COORDS.x-TIME*base_speed*0.05, SKY_COORDS.y);
|
|
||||||
vec4 star_pix = texture(layer_two, star_coords)*0.5;
|
|
||||||
|
|
||||||
vec2 galaxy_coords = vec2(SKY_COORDS.x-TIME*base_speed*0.01, SKY_COORDS.y);
|
|
||||||
vec4 galaxy_pix = max(vec4(0,0,0,0),texture(layer, galaxy_coords));
|
|
||||||
COLOR = vec3(0,0,0) + star_pix.rgb * star_pix.a + base_pix.rgb * base_alpha + + galaxy_pix.rgb * galaxy_pix.a;
|
|
||||||
// Called for every visible pixel in the sky background, as well as all pixels
|
|
||||||
// in the radiance cubemap.
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
[gd_resource type="ShaderMaterial" load_steps=5 format=3 uid="uid://51srw6jbogv2"]
|
[gd_resource type="ShaderMaterial" load_steps=7 format=3 uid="uid://51srw6jbogv2"]
|
||||||
|
|
||||||
[ext_resource type="Shader" path="res://sky.gdshader" id="1_eneyl"]
|
[ext_resource type="Shader" path="res://sky.gdshader" id="1_eneyl"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cnkcm734q350a" path="res://stars-full.png" id="2_6u6i7"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cgce54urm5fyp" path="res://stars.png" id="2_jwkpn"]
|
||||||
[ext_resource type="Texture2D" uid="uid://yjay8cqle8yi" path="res://aurora.png" id="2_tntr4"]
|
[ext_resource type="Texture2D" uid="uid://yjay8cqle8yi" path="res://aurora.png" id="2_tntr4"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cjr3yq45rbob0" path="res://galaxy.png" id="3_ue5o8"]
|
[ext_resource type="Texture2D" uid="uid://cjr3yq45rbob0" path="res://galaxy.png" id="3_ue5o8"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bbu4k18ek1nk3" path="res://starlayer.png" id="4_qqleb"]
|
[ext_resource type="Texture2D" uid="uid://bbu4k18ek1nk3" path="res://starlayer.png" id="4_qqleb"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
shader = ExtResource("1_eneyl")
|
shader = ExtResource("1_eneyl")
|
||||||
shader_parameter/base_color = Color(0.125402, 0.324219, 0.138971, 1)
|
shader_parameter/speed = 0.008
|
||||||
shader_parameter/base_speed = 0.033
|
shader_parameter/brightness = 0.755
|
||||||
shader_parameter/NOISE = 1.0
|
shader_parameter/layers = Array[Texture2D]([ExtResource("2_6u6i7"), ExtResource("3_ue5o8"), ExtResource("2_tntr4"), ExtResource("2_jwkpn"), ExtResource("4_qqleb")])
|
||||||
shader_parameter/base = ExtResource("2_tntr4")
|
|
||||||
shader_parameter/layer = ExtResource("3_ue5o8")
|
|
||||||
shader_parameter/layer_two = ExtResource("4_qqleb")
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 720 KiB |
@@ -0,0 +1,35 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cnkcm734q350a"
|
||||||
|
path.s3tc="res://.godot/imported/stars-full.png-2a600889f49780cf9794aded59aefb25.s3tc.ctex"
|
||||||
|
metadata={
|
||||||
|
"imported_formats": ["s3tc_bptc"],
|
||||||
|
"vram_texture": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://stars-full.png"
|
||||||
|
dest_files=["res://.godot/imported/stars-full.png-2a600889f49780cf9794aded59aefb25.s3tc.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=2
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=true
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=0
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cgce54urm5fyp"
|
||||||
|
path.s3tc="res://.godot/imported/stars.png-256a232ab4d0d756c204342db2d8c8ef.s3tc.ctex"
|
||||||
|
metadata={
|
||||||
|
"imported_formats": ["s3tc_bptc"],
|
||||||
|
"vram_texture": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://stars.png"
|
||||||
|
dest_files=["res://.godot/imported/stars.png-256a232ab4d0d756c204342db2d8c8ef.s3tc.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=2
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=true
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=0
|
||||||
Reference in New Issue
Block a user