#Weird behaviour of a pixel art UV mapping shader
1 messages · Page 1 of 1 (latest)
at least make sure compression is disabled for the UV texture
here is the Blender shader result
all textures involved have compression off and no interploration
also tried converting color spaces between RGB and linear, didn't do anything helpful either
That would have been my second guess. Does your shader in blender use linear color space too (and not sRGB)?
Try to disable mip maps on the color texture.
they're not enabled
🤔
sometimes the color sampling still does some gamma correction, you could try to put a color space conversion node between the sample output and uv input, and try linear -> sRGB or sRGB -> linear setting.
well that generally results in nonsense, but I'll try an offset
linear > rgb is not better I guess ?
I was also going to suggest a half pixel offset after this 😅
the offset was honestly my firstest solution long ago (this is an old bug, I just left it for later)
Hum, the white bleeding seems to come from where different body parts overlap.
IDK how you are making the UV texture, but if you are rendering it from blender, maybe it's anti-aliasing the 3D objects (kind of expected) and blends the arm and body UV for example.
Disabling any form of AA in the rendering might fix it.
it's hand drawn pixel art
the UV maps are made by hand-placing pixels that match UV coordinates in the lookup texture
there's no AA involved as far as I'm aware unless Unity is hiding it from me
What does the shader nodes look like in blender ? nothing particular I guess ?
I'm a bit cluelees about why it would behave differently now :/
I gotta find the most recent file because I lost it 💀
I'm almost there though
👀
The UV texture importer needs to have "Non-Power of 2" disabled
It was messign up the values.
how do I do that
I don't see that being a thing on 6.2
is that a new setting or am I missing a package?
I'm on 6.3, but it's an old setting.
Can you screenshot the texture importer ?
I've also added a half pixel negative offset to the uvs.
as far as I remember, the only thing the blender shader did past the basic mapping was the offset, can't find the most recent file right now
oh
Oh, the texture is imported as 2D and UI, this is why you don't have the Power of Two setting.
it's because it was in Sprite mode
If found a "fix"
I applied a "dilatation" filter to the color texture to avoid the white pixels.
Maybe in blender the texture was on a transparent background and blender was filling the pixels itself 🤷
And here's the graph setup :
Afaik blender indeed does color dilation with alpha transparency automatically
Or the sampling method is otherwise somehow different enough to cause one pixel fringing to appear differently
I didn't get the exact same result as the reference blender screenshot, so I'm not sure this is 100% correct though, but it's the closest I got.
Mipmap sampling is also different, and something you don't really have control over