#Weird gaps between pixels on a pixel art sprite

1 messages · Page 1 of 1 (latest)

minor hinge
#

I'm implementing a shader that uses colors of source texture as UV to look up pixels in a color texture, for easy color palette and outfit swaps for characters. weird thing is, there's this constant one pixel wide gap between texture pixels

#

shader node set up

#

any ideas what could be causing the white gaps?

tulip igloo
# minor hinge shader node set up

Mip maps, or more precisely the way mip mapped texture sampling deals with instant changes in UV coordinate space like with pixelation

minor hinge
#

I don't have "generate mipmaps" selected for either

tulip igloo
#

Wait, I'm on autopilot and you're not doing pixelation in the shader
So it's not the same issue

minor hinge
#

I thing I just fixed the gaps by turning mipmaps on, clicking a bunch of random options, then turning it off 💀

tulip igloo
#

Works for me

#

Means it's technically closely related

minor hinge
#

yeah, now the only issue I get is that I need to set a weird offset and still get some blank pixels despite of that

#

but that might be a problem with the sprite itself potentially, though it worked fine in the blender prototype of the shader

tulip igloo
#

Not necessarily exactly half if there's no filtering to worry about

minor hinge
#

i'd think that too, but actual halves of pixels warp pixel placements and I need some nonsense for it to actually map correctly, can't crack why is that

tulip igloo
minor hinge
#

wait, I'm dumb 💀

#

or am I

tulip igloo
#

But anyway if both your coordinate texture and palette texture have no mipmaps and no filtering / point filtering, the offsets shouldn't be that important

minor hinge
#

no, I think I got it right, I was applying the offset to the color look up texture based on that textures resolution

minor hinge
#

if I set offset to (0,0) it's all warped

tulip igloo
#

Well, with totally zero offsets I think you're getting the pixel intersections of the palette texture

#

Which won't work even with pure sharp pixels

minor hinge
#

okay, but funnily enough an offset like 0.001 in each direction also gives warped results, differently warped than 0

#

it's madness

#

for reference, the color lookup texture is 64x64

tulip igloo
minor hinge
#

alright, thanks

#

discord didn't want to allow me to send metas

#

so I couldn't send over my import settings

tulip igloo
minor hinge
#

well, probably key info is that they're compression-less and on point filter

tulip igloo
#

Because it stores coordinates, it should be saved in linear space and import as not "sRGB (color texture)"

#

In gamma space you get effectively the same coordinates, but with far less accuracy in the upper end, and more in the lower