Open egeres opened 3 weeks ago
Do you have the original texture? This is likely a bug with the fix to reduce border artifacts.
Here it is! But I suspect the issue doesn't come from the texture itself, you just need a 16x16 .png image with distinguishable pixels. And yeah, what you're saying makes sense!
Thanks. We likely need to disable or tone down the uv offset when rendering in pixelated/nearest mode. It works great as long as you don't have scaling.
The uv offset needs to be moved into the geometry shader were we offset by 1.0 / atlas_size
and multiply with some [0.0, 1.0]
bias value based on the current texture interpolation. Possibly we modify the bias to 1.0
if there is no scale.
Started working on a fix here: https://github.com/pythonarcade/arcade/pull/2355
Quick preview:
pip install -I https://github.com/pythonarcade/arcade/archive/refs/heads/uv-fix.zip
Also, thank you again for creating this issue. It was a pretty bad oversight 😅
It's okay! (I'm not sure how I would have tested for this) I tried solving this myself, but I'm not very familiar about how the UV mapping is made and I got lost in the code 😥
Other than that the library is going on a good direction and I'm impressed by the work this team has made, congratulations!!!
While using the latest version: https://github.com/pythonarcade/arcade/releases/tag/3.0.0-dev.33, it seems that rendering pixel-perfect images draws the border pixels in half?
My code is:
I'm struggling to find new information about the usage of Camera2D, I'm not even sure if it's what I should be using for pixel-perfect graphics. Am I missing any parameters?
Edit 0:
This also seems to be happening with a sprite of scale 1 and a camera with zoom:
Edit 1:
Checking out version
3.0.0.dev29
seems to solve the problem, I'm confused about this because for that I'm cloning the repo and runninggit checkout tags/3.0.0-dev.30
, anyways, when I check outgit checkout tags/3.0.0-dev.31
, which would be version3.0.0.dev30
the display breaksI exported the atlas and texture images but they seem to be okay, my best guess is that the issue comes from the UV mapping being displaced 0.5 pixels inside or something