godot-shaders icon indicating copy to clipboard operation
godot-shaders copied to clipboard

Port project to Godot 4

Open JAWS81 opened this issue 1 year ago • 5 comments

JAWS81 avatar May 25 '23 03:05 JAWS81

Duplicate #47.

IceflowRE avatar May 26 '23 21:05 IceflowRE

Please update

Zifai avatar Nov 09 '23 22:11 Zifai

I am using an old version of the outline shader and it stopped working with godot 4, i stumbled on a solution that should work with many of the shaders from this repo (mostly regarding fragment functions):

https://github.com/godotengine/godot/issues/49781

TL;DR: Many of the shaders can be fixed when setting color by using a "COLOR *=" instead of "COLOR =", because it seems the values are different now.

Maybe leaving this one up so people could stumble upon this could be helpful.

Reneator avatar Dec 25 '23 21:12 Reneator

The tip above is mostly meant to fix the "modulate set on a canvasItem gets ignored when shader is applied" and to then also be able to draw outside the texture you might need something along the lines of:

if (color.a <= 0.0) {
  COLOR = mix(color, line_color, outline - color.a);
}
else {
  COLOR *= mix(color, line_color, outline - color.a);
}

Reneator avatar Dec 25 '23 22:12 Reneator