Hover shader on text doesn't work in godot 4?
Asked Answered
O

4

0

I'm getting no errors, but for some reason a hover shader I used in godot 3 doesn't work anymore. Does anyone know why?
This is the code:

shader_type canvas_item;

uniform float height = 5.0;
uniform float speed = 5.0;

void fragment() {
	VERTEX.y += height * sin(speed * TIME);
}

godot v4.0.3.stable

Octant answered 29/6, 2023 at 13:31 Comment(0)
H
0

are you sure you had the ...

void fragment() {
	VERTEX.y += height * sin(speed * TIME);
}

... in the fragment section?

void vertex() {
	VERTEX.y += height * sin(speed * TIME);
}

.. makes it wobble up and down.
Is this what you wanted?

Hoyos answered 29/6, 2023 at 20:31 Comment(0)
H
0

Octant doesn't work

... means what exactly? Can you be more specific?

Hoyos answered 29/6, 2023 at 15:58 Comment(0)
O
0

Hoyos The shader is supposed to make the text move on the y axis, but the text doesn't move.

Octant answered 29/6, 2023 at 17:2 Comment(0)
H
0

are you sure you had the ...

void fragment() {
	VERTEX.y += height * sin(speed * TIME);
}

... in the fragment section?

void vertex() {
	VERTEX.y += height * sin(speed * TIME);
}

.. makes it wobble up and down.
Is this what you wanted?

Hoyos answered 29/6, 2023 at 20:31 Comment(0)
O
0

Hoyos Yes! Thanks!

Octant answered 30/6, 2023 at 6:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.