0 votes

I think the problem is this line : vec4(texscreen(zoomed),1.0)
I try to convert with the new docs ...
This is the lens shader :

shader_type canvas_item;
render_mode blend_mix;

uniform vec2 mouse_pos = vec2(0.0,0.0);
uniform float aspect_ratios = 1.0;

vec2 zoom_point(vec2 uv, vec2 point, float zoom) {
    return (uv - point) / zoom * point;
}
void fragment() {

vec2 uv = SCREEN_UV;
float lens_radius = 0.08;
float mouse_dist = distance(uv*vec2(1.0,aspect_ratios),mouse_pos*vec2(1.0,aspect_ratios));
if (mouse_dist < lens_radius + 0.004) {
    COLOR = vec4(0.0,0.0,0.0,1.0);
    }
if (mouse_dist < lens_radius) {
    float zoom = 2.0;
    vec2 zoomed = zoom_point(uv, mouse_pos, zoom);

    COLOR = vec4(texscreen(zoomed),1.0);
    // not working with the next row
    //COLOR = textureLod(SCREEN_TEXTURE, zoomed, 1.0).rgba;
    }
}
in Engine by (41 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 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.