0 votes

Used code from the following Tutorial:
https://www.youtube.com/watch?v=32jdNLTJ3zY

Result:
https://youtu.be/O_bwNK9zq3k

Code on Sprite:

tool
extends Sprite

func _ready():
pass

func process(delta):
zoom
changed()

func zoomchanged():
#material.set
shaderparam("yzoom", getviewport().globalcanvastransform.y.y)
material.set
shaderparam("yzoom", getviewporttransform().get_scale().y)

func onShaderbaseitemrectchanged():
material.set
shader_param("scale", scale)

Code on Shader:

shadertype canvasitem;

uniform vec2 scale;
uniform float yzoom;

void fragment() {
float uvheight = SCREENPIXELSIZE.y / TEXTUREPIXELSIZE.y;
vec2 reflected
screenuv = vec2(SCREENUV.x, SCREENUV.y + uvheight *yzoom *scale.y * UV.y *2.0); //
//vec2 reflected_screen_uv = vec2(SCREEN_UV.x, SCREEN_UV.y + uv_height *scale.y * UV.y *2.0);
COLOR = texture(SCREEN_TEXTURE, reflected_screen_uv);
}

Signal connected:

itemrectchanged / Connects with itself

Godot version 3.4.2 Stable version
in Engine by (21 points)

It seems only passing uniform is causing problems. What happens if You comment out whole zoomchanged() in process ?

I deleted that part but nothing changed...

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.