Sign in to follow this  

2D in D3D - Alpha Layering Without Complete Redraw

Recommended Posts

I am working on a 2D/3D graphics engine which displays scientific data on multiple tracks using DirectX 9. During normal operation, the data is read from the disk and rendered to the screen one pixel at a time. Unfortunately, the data can not be rendered as triangles, lines, or any other type of primative to cut down on the number to be rendered. When rendering my data in 2D (As Primatives through D3D9), DirectX is plenty fast to render about 10 wide pixels at a time without appearing choppy or taking too much time. This involves about 20,000 point primatives to draw. I would like to add a ~50% transparent overlay to the scene that follows the mouse cursor. Here's the catch, a data window may be made up of 1,000,000 point primatives. There is not enough time to recreate the entire scene each time the user moves the mouse. I am looking for advice on how to structure my display elements to make this work. Currently, my device uses a swap effect of D3DSWAPEFFECT_DISCARD, and drawing my primatives to the device, presenting after 10 horizontal points (~20,000 overall) worth of data have been rendered. Is there a way to make another device that is completely transparent that I can display on top of the data device? Should I render both the data and overlay to different surfaces and copy them to the device each frame? Is DirectX unable to help me and I should go back to GDI? (I hate the flicker) Any advice would be helpful -Thanks

Share this post

Link to post
Share on other sites

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