I was excited to try procgen and wanted to do a street of buildings generated from a set of sprites and illuminate them with point lights.
It goes well until this happens: Some (but not all) my sprites receive the wrong normal maps.
Footnote: My sprite set is for tryout. It’s highly irregular and not even all opaque but the principle should still work. Likewise, most of the normals are still placeholders and look pretty crappy. I’m not looking for pretty yet, first it needs to work.
I uploaded my project here: GitHub - RanarhEadha/normals_atlas_issues: test repo for help with the atlases being imporperly matched for sprites + normal maps · GitHub
I am using the material “sprite_normal_copy.material” from the 2D lights example ( Normal Maps 2D 1.0 ), adapted to the light components. They work well enough.
Then I have one atlas for the sprites, and a second one for the normals. The sprites and their normals map have the same name. Obviously they are not packed at the same spots in their atlases. I don’t know if that is the problem -I don’t think it should be. But the currently active generation lines should create a solid wall of normalmapped sprites. That only happens with about half the sprites from the table buildings_solid_walls. Then it breaks and normals show up that are not even part of the table (only gets worse when I run the other parts of the buildings like roofs etc). I do believe it might be some sort of issue at the init/update point since I had to do something there to assure everything’s loaded properly (it’s been a few days and I no longer know for sure what I do there).
I have barely used custom materials before, so it’s entirely possible this is a very foolish issue that is easily solved.
Any help is appreciated.
Image below: the big black areas are where the sprite don’t get their proper normals.
