Goz
07-11-2007, 01:41 AM
I've been set a bit of a task. I have an arbitrary point which is part of a triangle, the camera position and a world transform matrix. I've been asked to create a shader that will billboard this triangle.
Is this possible? I've been trying to figure out how i could do this and so far turned up a blank.
The world matrix's position is the center of the billboard so i can get the forward vector quite easily. I'm then a bit unsure of exactly what to do.
In the past when i've done billboarding in a shader i've always added extra information (such as size and a simple 2D vector that describes how i am "pushing" out the vertex positions from the center point). Alas, on this occasion, i must do it without adding extra info (engine limitations :().
I'm probably just being thick. Can anyone give me any suggestions?
Is this possible? I've been trying to figure out how i could do this and so far turned up a blank.
The world matrix's position is the center of the billboard so i can get the forward vector quite easily. I'm then a bit unsure of exactly what to do.
In the past when i've done billboarding in a shader i've always added extra information (such as size and a simple 2D vector that describes how i am "pushing" out the vertex positions from the center point). Alas, on this occasion, i must do it without adding extra info (engine limitations :().
I'm probably just being thick. Can anyone give me any suggestions?