Jump to content
  • Advertisement

Archived

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

Jower

Squares

This topic is 5278 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

Is there some way to draw 2D-squares without using a sprite ? Seems really stupid to have a sprite with just a one-colored square, especially if it''s just a square frame in which case most of the sprite will be empty.

Share this post


Link to post
Share on other sites
Advertisement
I would just use a sprite. You could use an untextured quad and do the billboarding math yourself, but it seems like more trouble than it''s worth. Also, check if sprites require textures. What is the problem with using a sprite? It has to be done somehow.

Share this post


Link to post
Share on other sites
vertex buffers,

xyzrhw, and other settings are texturecoord1, diffuse..icant remember the actual names that work, but search the help file

Share this post


Link to post
Share on other sites
Do you want it for a HUD or something? If not, then I would recommend point sprites.

If it''s a HUD, then you could just do the math for it and render the HUD at a set coord in from of the camera. Then you can do cool effects like the HUD shaking and "catching up" with the camera and stuff.

How you do it is simply a matter of what you want to do, but if you''re interested in preformance, I would suspect that the point sprites would be faster. The only way to know for sure, though, is to benchmark it yourself!


Yes... VB6 is here to steal your minds fps. Very slowly.
Call .optimize(you.sig)

Share this post


Link to post
Share on other sites
It''s kind of a HUD
I just feel using a sprite when I only need a onecolored square is a bit overkill
Should be able to do in some easier (faster) way

Share this post


Link to post
Share on other sites
I''m no DirectX programmer, but I believe you can simply use pre-transformed, pre-lit vertices (which is what I think johnnyBravo is suggesting). In FVF, I guess that would be D3DFVF_XYZRHW | D3DFVF_DIFFUSE. You specify your vertices in screen coordinates, add in some fancy alpha blending and you''re all set.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!