Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Arcibald Wearlot

Billboarding in a vertex shader

This topic is 5139 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m trying to do implement billboarding in a vertex shader for my particle system, but something isn''t working. Every frame I create a vertex buffer with 6 vertices per particle (in model space) and set it. I pass the world, view, projection matrices and the transposed view matrix, then in the vertex shader I do something like this: m4x4 r0,v0,WORLD m3x3 r0,r0,TRANS_VIEW m4x4 r0,r0,VIEW m4x4 r0,r0,PROJECTION I think this should be correct: I multiply the world space vertex with the transposed view matrix, using m3x3 to ignore anything beside rotation, to make it face the camera, then transform with view and projection matrices. But it isn''t working: the particles rotate in strange ways and don''t face the camera. What am I doing wrong?

Share this post

Link to post
Share on other sites
One suggestion I just found...
Look a few relies down. I think you must also pass the camera vectors via VS constants.

Of course for a particle system you could always use point-sprites, which are automatically view-aligned, but then you don't get distance scaling, which is really a fundimental feature of 3D graphics.

[edited by - AndyTX on May 25, 2004 3:11:32 PM]

[edited by - AndyTX on May 25, 2004 3:15:13 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!