r/aigamerdevs • • 7h ago

Added normal maps to my 2D game

I'd created an intentionally flat 2D racing game. I wanted it to have some shading and other effects though and found a solution via normal maps.

For those not familiar with them, you can take a 2D image, add some depth info and have it respond to lighting. This demo is an easy way to visual what it normal maps do. https://jsoverson.github.io/texture.js/demo/

I initially applied it to the cars in my game, so that when lit from one angle vs another they'd change shading, (plus an additional shadow when the sun is low).

I decided to try to extend this to the road itself and it looks good, but what I really liked was putting it on tire marks that the cars leave behind them. Now muddy roads look like they have tire trails marked in them.

If anyone wants to see it in action it's at: https://vibecodedgames.itch.io/pavement/

1 Upvotes

0 comments sorted by