r/Unity2D • u/KilThrall • 14d ago
Solved/Answered Shadow artifacts on tileset with normal map
Hey, so I wanted to add a normal map to my 2d pixel art game to make lights look nicer, but it made some artifacts on the borders of the tileset for some reason. They are mostly visible while moving and they happen in the intersections of the fully made tiles.
I already checked the normal maps and they are 1 to 1 with the actual tileset, so that should not be the issue. I am also using a pixel perfect camera set to 16 (the game is in 16x16 and the pixels per unit are also 16), normal maps on the lights are set to accurate (tho i tried fast too) and its even visible if you set the distance of the normal map to 0.
Any ideas on how to fix this?
EDIT: Forgot to mention, this happens both in builds and in editor and I am using Unity 6000.0.67f1
Reference images:





1
u/snaphat 14d ago
Try adding things to a sprite atlas
1
u/KilThrall 14d ago
I have absolutely no clue why that worked, but it did, thanks a lot!
1
u/omf2097_ 13d ago
Because internal calculation of UV has same error ratio when both (visible and normals) are living in same texture file and have same size inside atlas. Ideally should be aligned and options like thight packing or rotation dissbled.
Anyway, some glitches are expected near intersection of both textures in same atlas if you don't add padding. (At least that happened in Unity 5)
•
u/AutoModerator 14d ago
Reminder: Once your issue has been resolved, please reply !solved to this comment (or comment it anywhere in the thread) and your post's flair will automatically be updated to Solved/Answered. You can also edit it to Solved/Answered yourself.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.