Jump to content
  • Advertisement
Sign in to follow this  
hserver

Sceen capture is slow using GetFrontBuffer

This topic is 3076 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 I want to capture my Directx8 screen and do some "Image Processing" on it . i'm using pDev->GetFrontBuffer(surf) to access screen pixels but this is quite slow , any idea to make it faster?

Share this post


Link to post
Share on other sites
Advertisement
Have you considered making the image processing in a pixel shader? Of course, not everything can be done that way, but if it could, it would probably be super-fast.

Share this post


Link to post
Share on other sites
tom I want to know how many (for example White) pixels exist in my screen
So Simple !
Do You Think It could be done using dx8 shaders?
What about capture my window using GDI?

Share this post


Link to post
Share on other sites
Hm I don't think you can count the number of specific pixels using a pixel shader.

Anyway, sorry but I don't know anything about DX8, I started with DX9.


And - what do you mean by "quite slow"?

Share this post


Link to post
Share on other sites
You would need to use a pixel shader. Iterating over the entire image in the CPU is going take take way to long. If this is somehting thats got to run at 30 FPS it would be impossible on the CPU.

Share this post


Link to post
Share on other sites
You would need to use a pixel shader. Iterating over the entire image in the CPU is going take take way to long. If this is somehting thats got to run at 30 FPS it would be impossible on the CPU.

Share this post


Link to post
Share on other sites
But can you count the number of lets say white pixels using a pixel shader? I cannot imagine(*) how this could be done in a pixel shader.


(*) Doesn't mean it cannot be done, nobody knows everything :D

Share this post


Link to post
Share on other sites
How about using an occlusion query? That'll tell you how many pixels are drawn, and you could use a pixel shader to clip() all non-white pixels.

Share this post


Link to post
Share on other sites
Who is MR occlusion query !? :-)
i'm using directx8 and such this things are not invented yet!

i can get pixels of HMapTex like this :
Dim HMapTex As Direct3DTexture8
Dim lrData As D3DLOCKED_RECT
HMapTex.LockRect 0, lrData, ByVal 0, 0
DXCopyMemory pxArr2(0), ByVal lrData2.pBits, 262144
HMapTex.UnlockRect 0
I found the answer by myself
i have to get backBuffer instead of front buffer
and don't forget to set present flag to D3DPRESENTFLAG_LOCKABLE_BACKBUFFER
anyway Thanks my friends

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!