feat(particles): bubble trail behind dolphin + block break burst
- BubbleTrail.gd: GPUParticles3D, auto-configured in _ready, set_intensity() API - BlockBreakParticles.gd: one_shot burst, emit_burst(pos, color) API - DolphinController.gd: bubble_trail onready + speed_factor hook in _update_movement - Dolphin.tscn: BubbleEmitterPoint (0,0,1.2) > BubbleTrail child added Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,20 +1,25 @@
|
||||
shader_type canvas_item;
|
||||
render_mode blend_add;
|
||||
shader_type spatial;
|
||||
render_mode unshaded, blend_add, depth_draw_never, cull_disabled;
|
||||
|
||||
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);
|
||||
uniform vec3 ray_color : source_color = vec3(0.7, 0.9, 1.0);
|
||||
uniform float intensity : hint_range(0, 2) = 0.6;
|
||||
uniform float fade_bottom : hint_range(-100, 0) = -30.0;
|
||||
|
||||
void fragment() {
|
||||
vec2 uv = UV;
|
||||
float rays = 0.0;
|
||||
// Multiple ray stripes
|
||||
for (float i = 0.0; i < 5.0; i++) {
|
||||
float offset = i * 0.2 + TIME * 0.03;
|
||||
float r = smoothstep(0.02, 0.0, abs(fract(uv.x * 8.0 + offset) - 0.5));
|
||||
rays += r * (1.0 - i / 5.0);
|
||||
}
|
||||
// Fade vertical
|
||||
float vertical_fade = smoothstep(0.0, 0.4, 1.0 - uv.y);
|
||||
// Fade avec profondeur joueur
|
||||
float depth_fade = clamp((VERTEX.y - fade_bottom) / (60.0 - fade_bottom), 0.0, 1.0);
|
||||
|
||||
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);
|
||||
float final_alpha = rays * vertical_fade * depth_fade * intensity;
|
||||
ALBEDO = ray_color;
|
||||
ALPHA = final_alpha;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user