Archived

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

emmai

how can i put BackBuffer in system memory?

Recommended Posts

emmai    100
I found read display memory is very slow~so I''d like to put BackBuffer in system memory so I can read backbuffer effeciently. how can I do this in DX9?

Share this post


Link to post
Share on other sites
Nik02    4348
That is not a good approach either - most cards can't rasterize to system memory at all, and it would be even more slow to return the rendered data on per-draw op basis. Furthermore, I don't think one can create a system-memory render target in DX9 altogether.

Maybe you can achieve the effect you're looking for in pixel shaders (or texture stages)?

-Nik

[edited by - Nik02 on March 28, 2004 3:31:19 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I''m now working with a 2d game,and I''d like to add some 3d effects to it.
the game is previously render to HDC,and I''d turn the output to
backbuffer(lock then write data directly to and then unlock) and
finally present to front buffer.
I''d like to mix the 2d & 3d to render to backbuffer,say,sometime
I write data directly to backbuffer,and another time,I may using
vertexbuffer to render texture to backbuffer~~~how can I
implement this?

Share this post


Link to post
Share on other sites
Nik02    4348
DX has sprite interfaces "out-of-the-box" nowadays, they make 2d development very easy using Direct3D.
Basically, the bitmap data is uploaded to the graphics accelerator as textures, after which they are rendered using screen-space quads consisting of two triangles (which can be thought as "destination rectangles").

The benefit of this method is that you don''t have to actually lock the frame buffer yourself - this is very important for high performance when using 3d cards.

If per-pixel access is desired, you can create so-called dynamic textures, which are optimized for fast write access and are supported on most fairly recent hardware (at least radeon, fx, >gf3).

However, I recommend using pixel shaders if at all possible, because if the effect is achievable using them, they eliminate the burden of video memory locking very efficiently.

Please ask for more info if needed.

Kind rgds,
-Nik

Share this post


Link to post
Share on other sites