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,21 +1,33 @@
|
||||
shader_type spatial;
|
||||
render_mode unshaded, blend_add, cull_disabled, depth_draw_never;
|
||||
render_mode unshaded, blend_add, depth_draw_never, cull_disabled;
|
||||
|
||||
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);
|
||||
uniform vec3 caustic_color : source_color = vec3(0.5, 0.8, 1.0);
|
||||
uniform float intensity : hint_range(0, 3) = 1.5;
|
||||
uniform float scale = 8.0;
|
||||
uniform float speed = 0.5;
|
||||
|
||||
float caustic_pattern(vec2 uv) {
|
||||
float t = TIME * speed;
|
||||
vec2 p = uv * scale;
|
||||
float c = 0.0;
|
||||
c += sin(p.x + t) * 0.5;
|
||||
c += cos(p.y + t * 0.7) * 0.5;
|
||||
c += sin(p.x * 0.7 + p.y * 0.5 + t * 1.3) * 0.3;
|
||||
c = abs(c);
|
||||
c = smoothstep(0.2, 0.0, c);
|
||||
return c;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec2 uv = UV * scale;
|
||||
vec2 uv = UV * 2.0 - 1.0;
|
||||
float c1 = caustic_pattern(uv);
|
||||
float c2 = caustic_pattern(uv * 1.3 + vec2(0.5, 0.3));
|
||||
float caustics = (c1 + c2 * 0.5) * intensity;
|
||||
|
||||
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));
|
||||
// Fade avec profondeur
|
||||
float depth_fade = clamp((VERTEX.y + 60.0) / 80.0, 0.0, 1.0);
|
||||
caustics *= depth_fade;
|
||||
|
||||
float caustic = (pattern1 + pattern2 + pattern3) / 3.0;
|
||||
caustic = pow(max(caustic, 0.0), 2.0) * intensity;
|
||||
|
||||
EMISSION = caustic_color * caustic;
|
||||
ALBEDO = vec3(0.0);
|
||||
ALBEDO = caustic_color * caustics;
|
||||
ALPHA = caustics;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user