0 votes

So I have a general shader for my armour, but for the boots the glowing effect is like this: goldboots
if you go to the image, you can see that the bottom of the glow for the boots shows at the top of the sprite. I would like to know an alternative shader which could help this please.

gold boots

shader_type canvas_item;
render_mode blend_premul_alpha;

uniform float radius = 1.0;
uniform float amount = 0.5;

void fragment() {
    float r = radius;
    vec2 ps = TEXTURE_PIXEL_SIZE;
    vec4 col = texture(TEXTURE, UV);
    vec4 glow = col;

    glow += texture(TEXTURE, UV + vec2(-r, -r) * ps);
    glow += texture(TEXTURE, UV + vec2(-r, 0.0) * ps);
    glow += texture(TEXTURE, UV + vec2(-r, r) * ps);
    glow += texture(TEXTURE, UV + vec2(0.0, -r) * ps);
    glow += texture(TEXTURE, UV + vec2(0.0, r) * ps);
    glow += texture(TEXTURE, UV + vec2(r, -r) * ps);
    glow += texture(TEXTURE, UV + vec2(r, 0.0) * ps);
    glow += texture(TEXTURE, UV + vec2(r, r) * ps);

    r *= 2.0;
    glow += texture(TEXTURE, UV + vec2(-r, -r) * ps);
    glow += texture(TEXTURE, UV + vec2(-r, 0.0) * ps);
    glow += texture(TEXTURE, UV + vec2(-r, r) * ps);
    glow += texture(TEXTURE, UV + vec2(0.0, -r) * ps);
    glow += texture(TEXTURE, UV + vec2(0.0, r) * ps);
    glow += texture(TEXTURE, UV + vec2(r, -r) * ps);
    glow += texture(TEXTURE, UV + vec2(r, 0.0) * ps);
    glow += texture(TEXTURE, UV + vec2(r, r) * ps);

    glow /= 21.0;
    glow *= amount;
    col.rgb *= col.a;

    COLOR = glow + col;
}
Godot version 3.3.3
in Engine by (298 points)
edited by

What exactly do you need help with?

if you go to the image, you can see that the bottom of the glow for the boots shows at the top of the sprite. I would like to know an alternative shader which could help this please.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.