0 votes

I'm using this shader for a Shockwave effect

shader_type canvas_item;

uniform float tile_factor = 1.0;
uniform float aspect_ratio = 1.0;
uniform sampler2D uv_offset_texture : hint_black;
uniform vec2 uv_offset_size = vec2(1.0, 1.0);
uniform float size = 0.02;

void fragment() {
    vec2 waves_size = vec2(size, size);
    vec2 offset_texture_uvs = UV * uv_offset_size;
    vec2 texture_based_offset = texture(uv_offset_texture, offset_texture_uvs).rg;
    texture_based_offset = texture_based_offset * 2.0 - 1.0;
    vec2 adjusted_uv = UV * tile_factor;
    adjusted_uv.y *= aspect_ratio;
    vec2 cPos = -1.0 + 2.0 * UV / (1.0 / TEXTURE_PIXEL_SIZE);
    float cLength = length(cPos);
    vec2 uv = FRAGCOORD.xy / (1.0 / SCREEN_PIXEL_SIZE).xy + 0.0;
    COLOR = texture(SCREEN_TEXTURE, uv + texture_based_offset * waves_size);
}

HighRes
With high resolution doesn't look that bad
LowRes
But with my wanted pixel-art resolution gives this ugly blurry artifacts.

I'm not sure if it's a rendering-configuration problem or if I may need some adjustments to the shader.

Any help is welcomed!

Godot version 3.5
in Engine by (12 points)

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 Frequently asked questions and 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 [email protected] with your username.