how can i put BackBuffer in system memory?

Started by
2 comments, last by emmai 20 years ago
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?
Advertisement
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]

Niko Suni

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?
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

Niko Suni

This topic is closed to new replies.

Advertisement