25 lines
735 B
Plaintext
25 lines
735 B
Plaintext
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.
|
|
//}
|