Sign in to follow this  
thoue

how to do billboarding in HLSL

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this