feat(ambience): underwater shaders + audio manager + main menu + CC0 assets
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
21
shaders/caustics.gdshader
Normal file
21
shaders/caustics.gdshader
Normal file
@@ -0,0 +1,21 @@
|
||||
shader_type spatial;
|
||||
render_mode unshaded, blend_add, cull_disabled, depth_draw_never;
|
||||
|
||||
uniform float speed : hint_range(0.1, 3.0) = 0.8;
|
||||
uniform float scale : hint_range(1.0, 20.0) = 8.0;
|
||||
uniform float intensity : hint_range(0.0, 2.0) = 0.6;
|
||||
uniform vec3 caustic_color : source_color = vec3(0.7, 0.9, 1.0);
|
||||
|
||||
void fragment() {
|
||||
vec2 uv = UV * scale;
|
||||
|
||||
float pattern1 = sin(TIME * speed + uv.x * 10.0 + sin(uv.y * 10.0 + TIME * speed));
|
||||
float pattern2 = sin(TIME * speed * 0.7 + uv.y * 12.0 + sin(uv.x * 8.0 + TIME * speed * 1.3));
|
||||
float pattern3 = sin(TIME * speed * 1.1 + (uv.x + uv.y) * 7.0 + sin(uv.x * 5.0 - TIME * speed * 0.5));
|
||||
|
||||
float caustic = (pattern1 + pattern2 + pattern3) / 3.0;
|
||||
caustic = pow(max(caustic, 0.0), 2.0) * intensity;
|
||||
|
||||
EMISSION = caustic_color * caustic;
|
||||
ALBEDO = vec3(0.0);
|
||||
}
|
||||
20
shaders/godrays.gdshader
Normal file
20
shaders/godrays.gdshader
Normal file
@@ -0,0 +1,20 @@
|
||||
shader_type canvas_item;
|
||||
render_mode blend_add;
|
||||
|
||||
uniform float ray_count : hint_range(5.0, 40.0) = 20.0;
|
||||
uniform float speed : hint_range(0.1, 2.0) = 0.4;
|
||||
uniform float intensity : hint_range(0.0, 2.0) = 0.5;
|
||||
uniform vec3 ray_color : source_color = vec3(0.5, 0.8, 1.0);
|
||||
|
||||
void fragment() {
|
||||
vec2 uv = UV;
|
||||
|
||||
float vertical_fade = pow(1.0 - uv.y, 2.0);
|
||||
|
||||
float ray_pattern = fract(uv.x * ray_count + sin(TIME * speed + uv.y * 5.0) * 0.3);
|
||||
float ray = smoothstep(0.0, 0.15, ray_pattern) * smoothstep(0.4, 0.15, ray_pattern);
|
||||
|
||||
float brightness = ray * vertical_fade * intensity;
|
||||
|
||||
COLOR = vec4(ray_color * brightness, brightness * 0.6);
|
||||
}
|
||||
21
shaders/underwater_fog.gdshader
Normal file
21
shaders/underwater_fog.gdshader
Normal file
@@ -0,0 +1,21 @@
|
||||
shader_type fog;
|
||||
|
||||
uniform float surface_y : hint_range(-100.0, 100.0) = 0.0;
|
||||
uniform float abyss_depth : hint_range(-200.0, 0.0) = -60.0;
|
||||
|
||||
void fog() {
|
||||
float depth_factor = clamp((WORLD_POSITION.y - abyss_depth) / (surface_y - abyss_depth), 0.0, 1.0);
|
||||
|
||||
vec3 surface_color = vec3(0.15, 0.45, 0.6);
|
||||
vec3 abyss_color = vec3(0.02, 0.08, 0.15);
|
||||
vec3 fog_color = mix(abyss_color, surface_color, depth_factor);
|
||||
|
||||
float current_wave = sin(TIME * 0.3 + WORLD_POSITION.x * 0.05) * 0.02
|
||||
+ sin(TIME * 0.17 + WORLD_POSITION.z * 0.04) * 0.01;
|
||||
|
||||
float base_density = mix(0.3, 0.05, depth_factor) + current_wave;
|
||||
base_density = clamp(base_density, 0.0, 0.4);
|
||||
|
||||
ALBEDO = fog_color;
|
||||
DENSITY = base_density;
|
||||
}
|
||||
Reference in New Issue
Block a user