Godot Version
4.4
Question
I’ve got a PNG that is 1920x1080 and imported into my project. Project settings / Rendering / Default Texture Filter is set to Nearest.
I create a Sprite2D and set its’ texture to my texture and it looks perfect.
Now add a shader material & shader code to that Sprite2D with a texture as a uniform that has my texture loaded into it.
The following shader code results in 2 different images depending on which texture I sample, the core sprite texture or the parameter being passed in:
shader_type canvas_item;
uniform sampler2D pattern: filter_nearest;
void fragment() {
-
// this line looks perfect, crisp and clear*
-
COLOR = texture(TEXTURE, UV);*
-
// this line has a haziness to it and has developed some pixelation*
-
COLOR = texture(pattern, UV);*
}
Any thoughts on what might be causing the texture to be sampled differently if it’s a parameter versus being assigned directly to the sprite?
Thanks!