add multi-color directory, for experimentation
This commit is contained in:
@@ -11,6 +11,7 @@ config_version=5
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="simple starfield"
|
config/name="simple starfield"
|
||||||
|
config/tags=PackedStringArray("experiment", "git_managed", "project_elysium")
|
||||||
config/features=PackedStringArray("4.5", "Forward Plus")
|
config/features=PackedStringArray("4.5", "Forward Plus")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=9 format=3 uid="uid://bcvjq6tdfp34q"]
|
[gd_scene load_steps=9 format=3 uid="uid://bcvjq6tdfp34q"]
|
||||||
|
|
||||||
[ext_resource type="Shader" uid="uid://bm2uwshby7iak" path="res://src/starfield_texture.gdshader" id="1_40a2p"]
|
[ext_resource type="Shader" uid="uid://bm2uwshby7iak" path="res://src/mono-color-starfield/starfield_texture.gdshader" id="1_40a2p"]
|
||||||
|
|
||||||
[sub_resource type="Shader" id="Shader_40a2p"]
|
[sub_resource type="Shader" id="Shader_40a2p"]
|
||||||
code = "shader_type canvas_item;
|
code = "shader_type canvas_item;
|
||||||
5
src/multi-color-starfield/mc_fast_noise.tres
Normal file
5
src/multi-color-starfield/mc_fast_noise.tres
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[gd_resource type="FastNoiseLite" format=3 uid="uid://w4lmtnx0twag"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
seed = 250
|
||||||
|
frequency = 0.4687
|
||||||
30
src/multi-color-starfield/mc_starfield.gdshader
Normal file
30
src/multi-color-starfield/mc_starfield.gdshader
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
shader_type canvas_item;
|
||||||
|
|
||||||
|
uniform vec2 resolution = vec2(1270, 720);
|
||||||
|
uniform sampler2D noise_texture: filter_nearest, repeat_enable;
|
||||||
|
uniform float density: hint_range(1.0, 100.0, 0.1) = 20.0;
|
||||||
|
uniform float speed_x: hint_range(-100.0, 100, 0.1) = 0.005;
|
||||||
|
uniform float speed_y: hint_range(-100.0, 100, 0.1) = 0.0;
|
||||||
|
uniform float layers: hint_range(1, 10, 1) = 5;
|
||||||
|
uniform vec4 color_1: source_color;
|
||||||
|
uniform vec4 color_2: source_color;
|
||||||
|
uniform vec4 color_3: source_color;
|
||||||
|
uniform vec4 color_4: source_color;
|
||||||
|
|
||||||
|
float rand(vec2 uv) {
|
||||||
|
return fract(sin(dot(uv.xy, vec2(12.9898,78.233))) * 43758.5453123);
|
||||||
|
}
|
||||||
|
|
||||||
|
void fragment() {
|
||||||
|
vec2 uv = UV;
|
||||||
|
uv.x *= resolution.x / resolution.y;
|
||||||
|
vec2 speed = TIME * vec2(speed_x, speed_y);
|
||||||
|
float stars = 0.0;
|
||||||
|
for(float i = 0.0; i < layers; i++){
|
||||||
|
float shift = i * 0.3;
|
||||||
|
float brightness = 1.0 - i * 0.2;
|
||||||
|
stars += step(0.2, pow(texture(noise_texture, uv + shift + speed * (1.0 - i * 0.1)).r, density)) * brightness;
|
||||||
|
}
|
||||||
|
|
||||||
|
COLOR = vec4(vec3(stars), 1.0);
|
||||||
|
}
|
||||||
1
src/multi-color-starfield/mc_starfield.gdshader.uid
Normal file
1
src/multi-color-starfield/mc_starfield.gdshader.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://co0aqe5andoug
|
||||||
6
src/multi-color-starfield/mc_starfield_material.tres
Normal file
6
src/multi-color-starfield/mc_starfield_material.tres
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://bgb22q7b2j1st"]
|
||||||
|
|
||||||
|
[ext_resource type="Shader" uid="uid://co0aqe5andoug" path="res://src/multi-color-starfield/mc_starfield.gdshader" id="1_4pffc"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
shader = ExtResource("1_4pffc")
|
||||||
17
src/multi-color-starfield/multi_color_starfield.tscn
Normal file
17
src/multi-color-starfield/multi_color_starfield.tscn
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://c6f75hdvqpfaf"]
|
||||||
|
|
||||||
|
[ext_resource type="Material" uid="uid://bgb22q7b2j1st" path="res://src/multi-color-starfield/mc_starfield_material.tres" id="1_yileu"]
|
||||||
|
|
||||||
|
[node name="MultiColorStarfield" type="Control"]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="ColorRect" type="ColorRect" parent="."]
|
||||||
|
material = ExtResource("1_yileu")
|
||||||
|
layout_mode = 0
|
||||||
|
offset_right = 1270.0
|
||||||
|
offset_bottom = 720.0
|
||||||
6
src/multi-color-starfield/new_noise_texture_2d.tres
Normal file
6
src/multi-color-starfield/new_noise_texture_2d.tres
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[gd_resource type="NoiseTexture2D" load_steps=2 format=3 uid="uid://dgorxcmpu6tma"]
|
||||||
|
|
||||||
|
[ext_resource type="FastNoiseLite" uid="uid://w4lmtnx0twag" path="res://src/multi-color-starfield/mc_fast_noise.tres" id="1_vlauu"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
noise = ExtResource("1_vlauu")
|
||||||
Reference in New Issue
Block a user