Sprite2D weird texture ingame, fine in editor

Godot Version

4.4.1

Question

I have a sprite that gets completely butchered ingame.
Here the original sprite 16x5 as it looks in the godot editor:


And here how it looks in the game:
image

I have a minimal project recreation of the issue.
The only thing that is changed is the Filter (in the inspector > canvas item > texture ) is set to Nearest on the sprite - I want to keep the sprite as is taking exactly 16x5 pixels of the screen.

Here a download link to the minimal project: https://0x0.st/KmlQ.zip
It is just the sprite put in with those settings, here the sprite itself, if someone wants to recreate the project by hand:
https://0x0.st/Kml_.png

Using your png file seems to work perfectly fine for me, however, your project is completely corrupted in some way, I can’t even open it. I recommend creating a new project.

Recreated the project, but still the same issue: https://0x0.st/KmU1.zip
Just > newproject > put in the sprite on the screen > enable nearest filtering

Can you post how it looks on your screen?

image

1 Like

Weird, maybe there is a difference in the rendering engine being used?

Those are all the project settings

; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
;   [section] ; section goes between []
;   param=value ; assign values to parameters

config_version=5

[application]

config/name="new-sprite-project"
run/main_scene="uid://gwh007gmlhr5"
config/features=PackedStringArray("4.4", "GL Compatibility")
config/icon="res://icon.svg"

[rendering]

renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"

You did not mention in your post that you’re using the Compatibility renderer. However, for me it looks just the same if I use compatibility.

What happens if you start moving said Sprite2D around? And does it still happen if it’s not a Sprite2D but a TextureRect for example?

TextureRect works perfectly fine! I don’t know why it doesn’t work with the Sprite2D.
Also moving it around somehow fixes this?!

extends Sprite2D

func _process(delta: float) -> void:
	position.x += delta
	position.y += delta

I set this code and it looks normal in motion?!

I would assume this is some weirdness with perhaps older graphics drivers or something, most likely nothing you can actually fix yourself, as it is probably not an issue on everyone’s PC.

It is also fixed if I move the texture to a position that is in the Y cordinates: XXX.01

Ahh, try to change the following project setting:

Make sure they’re ticked on and see if the issue still happens.

1 Like

Yes this seems to fix this!!! I will try it in my main project as well now.

1 Like

Yes everything is good now - thanks a lot!!!

1 Like

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