[gd_resource type="ShaderMaterial" load_steps=3 format=2]
[ext_resource path="res://assets/shaders/electric/noise.png" type="Texture" id=1]
[sub_resource type="Shader" id=1]
code = "shader_type spatial;
render_mode blend_add,depth_draw_never,cull_disabled,diffuse_burley,specular_schlick_ggx,unshaded;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
uniform float animate: hint_range(0.0, 1.0);
vec3 neon(float val, vec3 color) {
float ramp = clamp(val, 0.0, 1.0);
vec3 outp = vec3(0.0);
ramp = ramp * ramp;
outp += pow(color, vec3(4.0)) * ramp;
ramp = ramp * ramp;
outp += color * ramp;
ramp = ramp * ramp;
outp += vec3(1.0) * ramp;
return outp;
}
void fragment() {
vec2 base_uv = UV;
float illumination = clamp(1.0 - abs(0.0 - UV.y + animate) * 1.0, 0.0, 1.0);
illumination *= (1.0 - UV.y * 2.0);
float lightning = texture(texture_albedo,base_uv).r;
float intensity =0.0;
//intensity += lightning;
intensity = illumination * lightning + illumination;
ALBEDO = neon(intensity, albedo.rgb);
}
"
[resource]
shader = SubResource( 1 )
shader_param/albedo = Color( 0, 0.733333, 0.988235, 1 )
shader_param/animate = 0.0
shader_param/texture_albedo = ExtResource( 1 )