Implementing a 2D minimap using D3D8

Started by
1 comment, last by d000hg 18 years, 9 months ago
While implementing a minimap for a RTS game should be pretty simple, doing it through D3D adds a little more complexity. I can see a few ways to do it, but I'm not sure if any of these would incur a serious performance hit or cause problems for my minimum spec (Geforce1 or the equivalent Radeon card). We have a static texture representing the terrain, on which data representing each sides' units & buildings should be overlayed, as well as possible map objects belonging to no player. One way to do it is to have our static texture, and a dynamic texture which is updated to show unit distribution. We can then use render-to-texture to a 3rd render-target texture and do it that way. But render-targets seem a bit OTT for such a simple thing. Or we could have our same static and dynamic textures, and then just render a quad using both textures in the first two texture stages - any card provides dual texturing these days. The 2D way of doing it would be to render the original terrain map, then manually draw coloured dots for the units. We can duplicate this by drawing small quads instead of dots, but the small scale might cause problems. I'm preferring the 2nd option but I wondered if there is something even better? As far as the dynamic texture goes, would people generally manipulate the pixels directly?
Advertisement
Usually an RTS involves fairly dense areas, so drawing anything bigger than colored dots on the minimap probably won't do much for you. You can use the point size attribute to make the dots bigger, without actually having to draw a tiny quad.

As far as efficiency goes, first draw the minimap itself, then fill all of the dot positions into a dynamic vertex buffer and render it. There's no particular reason to affect the actual texture.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Oh yeah, that seems a good way of doing it!

This topic is closed to new replies.

Advertisement