I am working on a 2.5D dungeon crawler and decided to build the first person environment using sprite renderers rotated in 3D space in front of the camera. This obviously breaks 2D lighting, so after proving out the unlit scene for low-end mobile, I jumped over to the 3D renderer and Point Lights for higher end devices.
For the most part this has worked well. I briefly tried using quads instead of sprite renderers, but I found no perceptible benefits, more issues with Z-sorting, and there'd be a big conversion process to undertake for that anyways.
I am using my own Lit shadergraph (first image) that fades objects out in the distance. That works well lit or unlit. But normal maps generated from Sprite Illuminator just don't work correctly. After much effort I discovered the "Normal from Texture Node" works as expected, but I cannot tell why. I've captured both paths for the Normal in the second image (using the fixed one here).
Basically, point lights are illuminating one face of the quad more than the other. They are not illuminating as a circle. This results in some really odd effects at a distance and up close. The second image is an exaggerated representation of this.
- The base textures are 320x320 as Sprite 2D into the editor. No atlases.
- The normal maps are 320x320 as Normal Map, 2D into the editor. No mip maps are used. No convert from greyscale (though that did change the distortion somewhat).
- No compression is used anywhere. No filtering.
- The shadergraph has its _NormalMap node configured as a Normal Map.
So the "fix" (image 3) was to use the Normal from Texture Node. Though this doesn't look as good due to the lack of smoothing... it doesn't distort, cutoff or otherwise smear the lighting. One thing that does jump out at me, is the normal is a darker blue in the generated preview. Works fine for 2D though? Anyone have ideas for what is going wrong here? Or what the performance hit of Normal from Texture is? Thanks!