billboards: sprites vs. vertex buffers

Started by
2 comments, last by musikit 22 years, 1 month ago
I''m pretty new to DirectX and i''ve been seeing two types of examples for doing billboarding. one is use a textured vextex buffer, and the other is to use the D3DXSprite class. what are the differences and trade offs and which one is the preferred way of doing billboards? thxs
Advertisement
AFAIK the D3DXSprite class exists to provide a little more convienent way for porting DDraw code to DirectX 8 due to the lack of the aforementioned DDraw functionality.

I''m using a dynamic vertex buffer for billboards and "stream" my billboards into the buffer every frame.

It is important to create the vertex buffer using D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY and D3DPOOL_DEFAULT and to lock it using D3DLOCK_DISCARD to get the best performance since those semantics seem to invoke the "fast path" on most drivers.

You could use point sprites as well but my own tests have shown that (at least on the GF3) point sprites are not worth the hassle speedwise and comments by several other people on the directxdev list suggested that point sprite support in most drivers is still somewhat immature.

quote:Original post by musikit
I''m pretty new to DirectX and i''ve been seeing two types of examples for doing billboarding. one is use a textured vextex buffer, and the other is to use the D3DXSprite class. what are the differences and trade offs and which one is the preferred way of doing billboards?

thxs


Just a guess, but I think PointSprites are the fastest. Pointsprites take up less bandwidth because there only needs to be a position and size passed to the card, not 4 positions. Mind you, thats just what I think.

Moe''s Site
ok,

after looking at several more examples. From what i can tell. I would use a Sprite to create like a 2D image that is on top of the 3D game. kinda like a menu box or the UI components. but if i want a 2D object in a 3D world i would use a billboard that is a Vertex buffer with a texture map over it.

Am i correct on this one?

thxs.

This topic is closed to new replies.

Advertisement