Sign in to follow this  

2D HUD Display

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

Hi guys, I'm rendering my HUD in 2D on top of my 3D scene and everything is fine. I'm making a scanner (minimap) that I'd like to draw programatically, I need to adjust the location, colour and size of the 'blips'. I can access the texture bits and modify those but then I have to also draw the whole background of it first, so I was thinking I can display the blank scanner texture and then access the backbuffer to draw the 'blips'. Is that normally how it's done ? Is it a good idea to modify the backbuffer ? How do I even get access to the backbuffer ? Any other ideas would be appreciated as well. Thanks.

Share this post


Link to post
Share on other sites
[original comment deleted]

Accessing the texture or the backbuffer sounds complicated.

Is there a reason you can't use sprites and just line drawing in the HUD draw itself?

Share this post


Link to post
Share on other sites
You definitely don't want to access the backbuffer. Just making the backbuffer lockable comes with a sizable hit, and actually performing the lock will really slow things down if it's not done right. Just render the blips as either a set of triangles, or a textured quad (you can use ID3DXSprite to make this really easy: simply specify a texture and a location in screen space and it will get drawn there).

Share this post


Link to post
Share on other sites
Point sprites would be another alternative to quads and D3DX sprites.

For performance I'd suggest using a render target and drawing the blips to it once every few frames.

BTW, you can draw them using the CPU, if you want. Write them into a texture, then draw that texture as a quad. Since this won't require locking anything that's already drawn, and assuming you don't do it every frame, it shouldn't end up too costly. I won't recommend it as the best solution, but if it'd be easier to implement, you can start like this.

Share this post


Link to post
Share on other sites

This topic is 3567 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.

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