I'm trying to write a shader that does 8-direction sprite billboarding such as in the original Doom. The obvious idea is to try to use a dot-product between the sprite forward-vector and the camera forward-vector, and use this to change the texture coords on my spritesheet. I just cant figure out this math…Even though I've done a lot of searches…
↧