The other shader materials work, but when I apply the aurora borealis shader, nothing happens and it becomes transparent.
Are UVs properly set up on the mesh. What happens when you add the godot logo texture to that standard materialâs albedo? Also, use material_override, not surface_material_override.
Finally, with the old shader, I was able to prevent the edges from appearing.
However, the aurora borealis disappears for a moment and then reappears. How can I make it constant?
shader_type spatial;
render_mode blend_add, unshaded, cull_disabled;
uniform sampler2D noise;
float fade_edges(vec2 uv, float left, float right, float up, float down){
return smoothstep(0.0, up, uv.y) * smoothstep(1.0, 1.0 - down, uv.y) * smoothstep(0.0, left, uv.x) * smoothstep(1.0, 1.0-right, uv.x);;
}
void vertex() {
VERTEX += NORMAL * sin(VERTEX.x * TAU0.3 + TIME0.5) * 0.4;
VERTEX.y += sin(VERTEX.x * (TAU * 0.2) + TIME) * .1 + sin(VERTEX.x * (TAU *0.5) + TIME) * 0.02;
}
void fragment() {
vec2 uv = UV;
uv.y /= 15.0;
uv.x += TIME * 0.02;
uv.x *= 1.5;
vec2 uv2 = vec2(sin(UV.x) * 0.2, cos(UV.y)) * 0.3;
uv2.x *= 4.0;
vec2 uv4 = vec2(UV.x * 14.0, UV.y*0.1 + TIME * 0.1 );
ALBEDO = mix(vec3(0.3, 1.0, 0.01), vec3(0.7, 0.01, 0.4), pow(1.0 - UV.y, 2.0));
ALPHA = texture(noise, uv).r - 0.1 * texture(noise, uv2).r;
ALPHA *= fade_edges(UV, 0.2, 0.2, 1.0, 0.1);
ALPHA *= smoothstep(-0.4, 0.6, texture(noise, UV * vec2(0.2, 0.1) + vec2(TIME*0.05, TIME * 0.001)).r) * 0.4;
ALPHA += smoothstep(0.5, 0.7, texture(noise, uv4).r) * fade_edges(UV, 0.1, 0.1, 0.8, 0.6) * 0.02;
ALPHA = clamp(ALPHA, 0.0, 1.0);
ALPHA *= 1.0 + pow(UV.y, 10.0) * 60.0;
ALPHA *= 0.7;
float fresnel = abs(dot(NORMAL, vec3(0.0, 0.0, 1.0)));
ALPHA = mix(ALPHA, ALPHA * smoothstep(0.5, 2.0, fresnel), pow(UV.y, 1.0));
}

