Work on vfx and sfx for traps.
This commit is contained in:
24
visuals/shaders/explosive_streaks.gdshader
Normal file
24
visuals/shaders/explosive_streaks.gdshader
Normal file
@@ -0,0 +1,24 @@
|
||||
shader_type spatial;
|
||||
render_mode cull_disabled;
|
||||
|
||||
uniform sampler2D streaks_texture;
|
||||
uniform sampler2D explosion_texture;
|
||||
uniform vec4 streak_color : source_color;
|
||||
|
||||
void vertex() {
|
||||
// Called for every vertex the material is visible on.
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
// Called for every pixel the material is visible on.
|
||||
vec2 streak_uv = vec2(UV.x * .25 + floor(COLOR.r * 4.0) * .25, UV.y);
|
||||
float n_val = texture(explosion_texture, UV).r;
|
||||
float alpha = texture(streaks_texture, streak_uv).r * smoothstep(COLOR.a, 1, n_val);
|
||||
ALBEDO = streak_color.rgb;
|
||||
ALPHA = alpha;
|
||||
}
|
||||
|
||||
//void light() {
|
||||
// // Called for every pixel for every light affecting the material.
|
||||
// // Uncomment to replace the default light processing function with this one.
|
||||
//}
|
||||
Reference in New Issue
Block a user