Billboard shader without distortion
Posted
by
Nick Wiggill
on Game Development
See other posts from Game Development
or by Nick Wiggill
Published on 2012-04-12T21:46:17Z
Indexed on
2012/04/12
23:46 UTC
Read the original article
Hit count: 537
I use the standard approach to billboarding within Unity that is OK, but not ideal: transform.LookAt(camera).
The problem is that this introduces distortion toward the edges of the viewport, especially as the field of view angle grows larger. This is unlike the perfect billboarding you'd see in eg. Doom when seeing an enemy from any angle and irrespective of where they are located in screen space.
Obviously, there are ways to blit an image directly to the viewport, centred around a single vertex, but I'm not hot on shaders.
Does anyone have any samples of this approach (GLSL if possible), or any suggestions as to why it isn't typically done this way (vs. the aforementioned quad transformation method)?
EDIT: I was confused, thanks Nathan for the heads up. Of course, Causing the quads to look at the camera does not cause them to be parallel to the view plane -- which is what I need.
© Game Development or respective owner