#GameDev#IndieDev#PixelArt#MadeWithUnity
Small addition to yesterday's post for correct pixel-grid lighting π‘
Updated the grid stay consistent even with rotations.
Explanation below π
We need to create our own TRS matrix, by ignoring the 3x3 scale and rotation part. We use that to go into 'Kind of world-space'.
Scale is still going to be weird. Don't think there's an easy way to separate scale from rotation in the TRS inside shader code.
Fragment shaders work on screen pixels, not texture pixels. In pixel-art styles 1 pixel in your art is going to be rendered over a bunch of screen pixels
That means you'll have different data for different parts of a texture pixel-> so you won't get the neat per-art-pixel look
The solution is to snap our data to an art pixel-grid.
We're gonna need to align both vertex positions and fragment positions to our pixel grid.