Pixel-pefect 3D sprite outlines?
I've been stuck on this for like a day now, even though it seems so simple.
Basically, I'm working on a top-down "2.5D" game, where the world is full 3D with perspective, and all characters and such are simple billboard sprites.
The game runs at a very low resolution, and thanks to our friend the 3rd dimension, sprites get bigger or smaller depending on how far away they are, which can noticeably distort the sprite. I personally find this quite charming. Or, I would if it wasn't for the sprite's outline being distorted too, sometimes disappearing completely, like this:
Now, this could be solved by removing the outline from the sprite itself, and making a shader that always draws an outline that's exactly 1 viewport pixel thick. I just can't figure out how.
I've seen a lot of stuff about using multiple viewports, like rendering the sprite layer onto its own texture, and applying a simple outline shader to that, but my attempts at this were pretty unsuccessful. It also feels super hacky, but I could just be doing it wrong.
So, what's the correct way to do this? Is using viewports really the only way? And if so, how would I set them up properly?