Pixel-perfect 2D normal map shading [now with working images]

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By mneg

Is it possible to have normal map based 2d shading snap to the original pixels? In my case I get smooth shading (bottom image). I would like to maintain the original pixel style (top image).

without shading
with shading

(edit: added permanent image links)

I found a solution in which the graphics is rendered in low resolution and then displayed in a Sprite using a ViewportTexture. However, I wish there was a less complex solution as I have a lot of independent objects on the screen which all would need an own Viewport.

mneg | 2022-02-11 18:55

I found a solution in which the graphics is rendered in low resolution and then displayed in a Sprite using a ViewportTexture.

Not a solution (see here).

mneg | 2022-02-20 12:31

:bust_in_silhouette: Reply From: mneg

Normal map based shading now is pixel perfect: I simply forgot to turn off the texture filtering during import of the normal map (see here).

Getting the original light to align pixel perfectly with the target texture seems to be another matter.