MagicNStuff/game/assets/shaders/rhythm/beating_lightbeam.gdshader
SchimmelSpreu83 94beee112e Some script improvements, clean-up and refactoring
- Refactored VibrationComponent (RumbleComponent)
-- Now supports multiple vibrations and adjustable curves.
-- Inspired by the RumblePak addon.

- Added a new startup scene.
2026-06-22 01:52:04 +02:00

30 lines
900 B
Plaintext

shader_type spatial;
render_mode unshaded, shadows_disabled, cull_disabled;
#include "uid://cy7b01or0ckgk" // Rhythm Helper
uniform vec3 color: source_color = vec3(1.0, 1.0, 1.0);
uniform float alpha_multiplier: hint_range(0.0, 1.0, 0.001) = 0.25;
uniform sampler2D albedo;
uniform float flash_exponent = 3.0;
uniform float edge_fade = 0.5;
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
float phase = get_beat_phase();
vec4 tex = texture(albedo, UV);
float edge = dot(NORMAL, VIEW);
edge = clamp(pow(edge, mix(8.0, 2.0, edge_fade)), 0.0, 1.0);
ALBEDO = mix(tex.rgb, color.rgb, 0.5);
ALPHA = max(tex.a * ease(1.0 - phase, flash_exponent) * alpha_multiplier * edge, 0.0);
}
//void light() {
// // Called for every pixel for every light affecting the material.
// // Uncomment to replace the default light processing function with this one.
//}