- Home /
2d normal mapping with pixel game issue
I'm having issues understanding how bump mapping works with my 2D pixel art game. I've created a simple sprite, which is an blue square image with 2 smaller squares inside it. I then created a white/black rectangle normal map, and applied that as a material to the sprite and it's giving me this weird pixel effect.
I thought normal mapping, just made pixels in the sprite that are in the normal map images area, lighter or darker according to how bright or dark the pixels are in the corresponding normal map area? But instead it's creating pixel artifacts. I've played around with the settings and these artifacts don't seem to go away.
Both the sprite image and the bump map image are the same size 128x128.
Below are a bunch of images showing the effect and the settings I'm using. Any advice appreciated!
Image with basic material.
Weird pixel effect
Unity uses Normal mapping, not bump mapping. Bump mapping was widely used in the late 90s and early 2000's, but today pretty much every 3D game uses normal mapping ins$$anonymous$$d.
The colors of a normal map define how the shader reads the topography of the texture and thus, how bright a pixel should be depending on income lighting.
A normal map has to be imported as a normal map in Unity.
There is a free normal map filter plugin available for Photoshop.
I suggest reading an introduction to normal maps, even the wikipedia page should be enough.
I guess I'm a bit old school which is why I used the term bump mapping :)
The normal map was imported correctly, and is just a rectangle, divided into a white section on the left and a black section on the right. So it just has 2 colours, which I thought would just give me a very bright section of my image on the left and conversely a darkened area on my image on the right, but as you can see it's not doing that.
What you describe is a bump map, which works like a height map, with colors from black to white. A normal map doesn't use this spectrum because it not only defines height of a pixel, but also direction of the slope (if any) depending on it's neighbors. Ins$$anonymous$$d, a spectrum is used that includes red, yellow, blue and green.
https://upload.wikimedia.org/wikipedia/commons/3/3b/Normal_map_example_-_$$anonymous$$ap.png
Your answer
![](https://koobas.hobune.stream/wayback/20220612063350im_/https://answers.unity.com/themes/thub/images/avi.jpg)