I need help with a shader. I have a mesh that is a plane. it is composed of 10x10 grid of squares. I have a picture that is 10x10 pixels of varying colors. I want each square to have the color of each pixel, but there is a lot of distortion, how do I get rid of the distortion as this very small texture is applied to my mesh?
let me explain:
Basically, I cannot seem to get the right color using texture();
for instance, I tried using ALBEDO = texture( MY_TEXTURE, vec(0,0) );
this should set the entire mesh to the color at pixel 0,0 (top left) of the image. that pixel is red, but I am getting a pink color applied all across the mesh instead. On my texture image, the pixel next to top right is white and I think it is affecting the color.
why isn't texture( MY_TEXTURE, vec(0,0) ); giving me the red I want? how can I get the exact pixel, at 0,0 of my image applied across my texture?
the code bellow is the whole shader I am using.
`shader_type spatial;
uniform sampler2D t_albedo : source_color;
void fragment() {
vec4 albedo_tex = texture(t_albedo, vec2(0,0 );
ALBEDO = albedo_tex.rgb;
}
`