how to do billboarding in HLSL
Correct my if im wrong, but if i wanna do billboarding in HLSL i just have to pass the inverse in the view matrix then get data in it to apply rotaton to the vertecies.
Now any clues how to do this ? Not the complet code but the logic. I know how to manupulate and set the .FX files.
why would u want to? I find its better to use the ID3DXSprite interface then use ID3DXEffect to apply your shaders on transformed/lit verts.
Also think that would be faster.
If you pass the inverse of the view transform then you pretty much are operating in camera-space, unless Im much mistaken this is NOT what u want. Billboarding is just rotating a quad to face the camera, this can be done by simply keeping track of the angle between the camera and its lookat position (camera yaw) and assigning that value to the yaw of a billboard.
If u use Sprites you wont have to worry about that either I believe.
Also think that would be faster.
If you pass the inverse of the view transform then you pretty much are operating in camera-space, unless Im much mistaken this is NOT what u want. Billboarding is just rotating a quad to face the camera, this can be done by simply keeping track of the angle between the camera and its lookat position (camera yaw) and assigning that value to the yaw of a billboard.
If u use Sprites you wont have to worry about that either I believe.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement