0 votes

So i got a simple plane mesh with a simple shader attached to it
In the shader i got 4 textures as uniform.
Im trying to add the 4 textures next to eachother on the plane

shader_type spatial;

uniform sampler2D texture_0;
uniform sampler2D texture_1;
uniform sampler2D texture_2;
uniform sampler2D texture_3;

void fragment(){
    ALBEDO = texture(texture_0,UV*2).rgb;

In that code i just multiplied the UV by 2, that changes the size of the texture and devides everything into 4 pieces,
the problem is that the same texture is showing 4 times now on repeat

I need to add my 4 textures to each tile but the repetitions are in the way,
The question is now, is there a way to stop the textures from repeating when u multiply their UVs to change their size?

Godot version 4.0 beta
in Engine by (20 points)

1 Answer

0 votes

ok i just managed to get a solution by adding the repeat disable hint:

uniform sampler2D texture_0: repeat_disable;

I ran into another problem tho, the texture is getting stretched on the borders, how do i fix this now ;CCC
enter image description here

by (20 points)
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.