Shader problem bug

Godot Version

4.3

Question

`its a simple shader, one line and yet something weird has happened.
this is the picture before the shader:

shader_type canvas_item;

void vertex() {
	UV.x+=TIME*.82;
}

this is after the shading happens:

I changed the type of the node from textureRect to sprite but nothing changes. never have seen this problem before. I used this shader before for clouds but this didnt happen.
`

You have to set canvasitem/texture/repeat to enabled for it to work.

repeat? in code or nodes?

In the inspector. Should work for either texturetect or sprite.

yes but then the platforms and player would have problem being seen because canvas always comes on top of everything. platforms are color rects

I’m afraid I can’t quite follow? Drawing order is dependant on the nodes’ order in the scene tree and their z_index values. Setting the texture to repeat itself is not related to that.

Isn’t your shader supposed to move the image horizontally in a permanent loop?

well i added the canvas layer but same thing happened. no changes
and yes the picture should move but with canvas layer, the image will come on top of everything.

You don’t need a CanvasLayer, I was talking about the TextureRect’s / Sprite2D’s properties. Both of them have a CanvasItem category in the inspector, where you can find Texture → Repeat which you should set to enabled.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.