Imagine first release
This commit is contained in:
BIN
content/banner.png
Normal file
BIN
content/banner.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 MiB |
40
content/banner.png.import
Normal file
40
content/banner.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cl3c8beeyvsuv"
|
||||
path="res://.godot/imported/banner.png-07aed7dc6f5515a14db0651ba6e535f0.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://content/banner.png"
|
||||
dest_files=["res://.godot/imported/banner.png-07aed7dc6f5515a14db0651ba6e535f0.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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=1
|
||||
@@ -1,22 +1,52 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D ripples: repeat_enable;
|
||||
uniform sampler2D texture1: filter_linear, source_color;
|
||||
uniform sampler2D texture2: filter_linear, source_color;
|
||||
uniform sampler3D ripples: repeat_enable, filter_linear;
|
||||
uniform float transition = 0;
|
||||
uniform float time = 0;
|
||||
uniform float warp;
|
||||
uniform float time_scale = 0.1f;
|
||||
uniform float ridge_sharpness;
|
||||
uniform float ridge_shine = 0;
|
||||
uniform float vignette_start;
|
||||
uniform float vignette_fade;
|
||||
uniform float vignette_distort = 0;
|
||||
uniform float vignette_gradient = 1;
|
||||
|
||||
vec3 hmap_normal(sampler2D hmap, vec2 uv) {
|
||||
float eps = 0.01f;
|
||||
vec3 hmap_normal(sampler3D hmap, vec3 uv) {
|
||||
float eps = 0.03;
|
||||
float z = texture(hmap, uv).z;
|
||||
return normalize(vec3(
|
||||
(texture(hmap, uv + vec2(eps, 0)).z - z) / eps,
|
||||
(texture(hmap, uv + vec2(0, eps)).z - z) / eps,
|
||||
(texture(hmap, uv + vec3(eps, 0, 0)).z - z) / eps,
|
||||
(texture(hmap, uv + vec3(0, eps, 0)).z - z) / eps,
|
||||
-1
|
||||
));
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
float tr = transition;
|
||||
|
||||
//vec3 normal = texture(ripples, UV + vec2(TIME * time_scale, 0)).xyz;
|
||||
vec3 normal = hmap_normal(ripples, UV + vec2(TIME * time_scale, 0));
|
||||
vec4 col = texture(TEXTURE, UV + normal.xy * warp).rgba;
|
||||
vec3 time_uv = vec3(UV.x, UV.y, time);
|
||||
vec3 center = hmap_normal(ripples, time_uv);
|
||||
vec3 right = hmap_normal(ripples, time_uv + vec3(ridge_sharpness, 0, 0));
|
||||
vec3 up = hmap_normal(ripples, time_uv + vec3(0, ridge_sharpness, 0));
|
||||
vec3 left = hmap_normal(ripples, time_uv + vec3(-ridge_sharpness, 0, 0));
|
||||
vec3 down = hmap_normal(ripples, time_uv + vec3(0, -ridge_sharpness, 0));
|
||||
|
||||
vec3 normal = (center + left + right + up + down) / 5.0f;
|
||||
vec3 edge_normal = (center + left - right + up - down) / 5.0f;
|
||||
|
||||
float ridge_shine_factor = pow(length(edge_normal.xy), 3) * 0.7f;
|
||||
vec2 warp_uv = UV + normal.xy * (warp + 0.05f * tr);
|
||||
float vig = pow(max(length(warp_uv - vec2(0.5f)) - vignette_start, 0) / (1.0f - vignette_start), vignette_gradient);
|
||||
|
||||
vec2 vig_uv = warp_uv - (vignette_distort + 1.0f * tr) * vig * normalize(warp_uv - vec2(0.5f));
|
||||
vec4 col1 = texture(texture1, vig_uv).rgba;
|
||||
vec4 col2 = texture(texture2, vig_uv).rgba;
|
||||
vec4 col = mix(col1, (col1 + col2) / 2.0f, tr);
|
||||
|
||||
col.rgb += vec3((ridge_shine + 5.0f * tr) * ridge_shine_factor);
|
||||
col.rgb = mix(col.rgb, vec3(1.0f), (vignette_fade + 2.0f * tr) * (vig + 0.02f * tr));
|
||||
COLOR.rgb = col.rgb;
|
||||
}
|
||||
|
||||
12
content/imagine_params.gd
Normal file
12
content/imagine_params.gd
Normal file
@@ -0,0 +1,12 @@
|
||||
class_name ImagineParams extends Resource
|
||||
|
||||
@export var time_scale: float
|
||||
@export var frequency: float
|
||||
@export var warp: float
|
||||
@export var ridge_sharpness: float
|
||||
@export var ridge_shine: float
|
||||
@export var vignette_start: float
|
||||
@export var vignette_fade: float
|
||||
@export var vignette_distort: float
|
||||
@export var vignette_gradient: float
|
||||
@export var transition_dur: float
|
||||
1
content/imagine_params.gd.uid
Normal file
1
content/imagine_params.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c5hr1d3ko8et3
|
||||
@@ -1,27 +1,36 @@
|
||||
[gd_resource type="ShaderMaterial" load_steps=4 format=3 uid="uid://wr6g6bhw2fyj"]
|
||||
[gd_resource type="ShaderMaterial" load_steps=5 format=3 uid="uid://wr6g6bhw2fyj"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://cutdjeuxu188p" path="res://content/imagine.gdshader" id="1_74fhu"]
|
||||
[ext_resource type="Texture2D" uid="uid://cl3c8beeyvsuv" path="res://content/banner.png" id="2_g1ag2"]
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_74fhu"]
|
||||
noise_type = 0
|
||||
frequency = 0.0018
|
||||
cellular_distance_function = 1
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_g1ag2"]
|
||||
noise_type = 3
|
||||
seed = 7
|
||||
frequency = 0.04
|
||||
fractal_type = 2
|
||||
fractal_octaves = 1
|
||||
domain_warp_type = 2
|
||||
domain_warp_amplitude = 3.36
|
||||
domain_warp_fractal_type = 2
|
||||
domain_warp_amplitude = 7.11
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_74fhu"]
|
||||
width = 1280
|
||||
height = 720
|
||||
noise = SubResource("FastNoiseLite_74fhu")
|
||||
[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_kf2mi"]
|
||||
width = 128
|
||||
depth = 256
|
||||
noise = SubResource("FastNoiseLite_g1ag2")
|
||||
seamless = true
|
||||
invert = true
|
||||
in_3d_space = true
|
||||
normalize = false
|
||||
bump_strength = 32.0
|
||||
seamless_blend_skirt = 0.294
|
||||
|
||||
[resource]
|
||||
shader = ExtResource("1_74fhu")
|
||||
shader_parameter/ripples = SubResource("NoiseTexture2D_74fhu")
|
||||
shader_parameter/warp = 0.005
|
||||
shader_parameter/time_scale = 0.035
|
||||
shader_parameter/texture1 = ExtResource("2_g1ag2")
|
||||
shader_parameter/texture2 = ExtResource("2_g1ag2")
|
||||
shader_parameter/ripples = SubResource("NoiseTexture3D_kf2mi")
|
||||
shader_parameter/transition = 0.0
|
||||
shader_parameter/time = 0.0
|
||||
shader_parameter/warp = 0.02
|
||||
shader_parameter/ridge_sharpness = 0.01
|
||||
shader_parameter/ridge_shine = 1.0
|
||||
shader_parameter/vignette_start = 0.225
|
||||
shader_parameter/vignette_fade = 1.0
|
||||
shader_parameter/vignette_distort = 0.7
|
||||
shader_parameter/vignette_gradient = 2.0
|
||||
|
||||
17
content/value_slider.gd
Normal file
17
content/value_slider.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
@tool
|
||||
extends HSlider
|
||||
|
||||
@onready var default_value = value
|
||||
|
||||
func _ready() -> void:
|
||||
update_label(value)
|
||||
value_changed.connect(update_label)
|
||||
|
||||
func update_label(x):
|
||||
var p = (x - min_value) / (max_value - min_value)
|
||||
$Label.text = "%.0f %%" % [ p * 100 ]
|
||||
$Label.modulate = Color.BLUE.lerp(Color.RED, p)
|
||||
|
||||
func reset():
|
||||
value = default_value
|
||||
value_changed.emit(value)
|
||||
1
content/value_slider.gd.uid
Normal file
1
content/value_slider.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b30buugsxbwhs
|
||||
29
content/value_slider.tscn
Normal file
29
content/value_slider.tscn
Normal file
@@ -0,0 +1,29 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://b3hvp2t36d4eo"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b30buugsxbwhs" path="res://content/value_slider.gd" id="1_vyn1w"]
|
||||
|
||||
[node name="ValueSlider" type="HSlider"]
|
||||
offset_right = 104.0
|
||||
offset_bottom = 25.0
|
||||
tick_count = 3
|
||||
ticks_position = 3
|
||||
script = ExtResource("1_vyn1w")
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
modulate = Color(0, 0, 1, 1)
|
||||
layout_mode = 1
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -21.0
|
||||
offset_top = -17.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 5
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "0 %"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 2
|
||||
Reference in New Issue
Block a user