Jump to content
  • Advertisement
Sign in to follow this  
Qatal

printscreen doesnt actually grab everything?

This topic is 4353 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'm having intermittent problems with the printscreen function in windows capturing partially rendered frames. I initialize fullscreen Direct3D (9c+MDX1.1) in the usual way... and typically render with vsync disabled, (so I can see how much 'excess' perf i have left to take up with cool stuff). When I take a screen capture, I sometimes only get some batches actually impacting the scene. Its always the last few batches rendered that dont get in the image. Other games (other than mine) dont seem to suffer from this. If I'm doing something dumb, can you point me in the right direction to solve this? Thanks Chris

Share this post


Link to post
Share on other sites
Advertisement
To perform a screen capture, you can just render off-screen. Then push that to the screen (so you don't skip a frame) and save it to a file.

Share this post


Link to post
Share on other sites
Thanks, but that doesnt solve my problem.

I'm well aware of being able to implement my own screenshot functionality using offscreen tricks.

What I want, is to be able to use the windows printscreen functionality, and not have it screw up.

I thought the problem could be that my app was drawing directly to the front buffer (which would have been really dumb, and probably not even possible anymore ;P)... because that's the effect I get. However, I have a normal swap chain, automagically created by D3D. The problem is just as apparent when using an *extra* back-buffer (for decoupling the present rate from the monitor refresh without tearing).

It seems to be worse when the framerate is very high (700-900 fps is possible in particularly boring scenes in my engine, and I frequently have bits of the image missing in these cases)

If vsync is on, then it doesnt happen *nearly as much*, but then my app is sitting around blocking on IDirect3DDevice9::Present() for a good chunk of the time :)

Does anyone actually know anything about how printscreen interacts with fullscreen D3D, and *why* it might be doing this.

Regards,
Chris

Share this post


Link to post
Share on other sites
Sounds like regular tearing to me. That's what VSync is for -- to eliminate tearing.

Is there some reason why you can't use VSync?

Share this post


Link to post
Share on other sites
Quote:
Original post by sirob
Sounds like regular tearing to me. That's what VSync is for -- to eliminate tearing.

Tearing is only a visual artifact due to the way the screen refreshes. In memory there is only ever one active frontbuffer, which (should) be copied when you press printscreen. It is impossible to 'capture' tearing via a screengrab/printscreen.

Share this post


Link to post
Share on other sites
Hi, and thanks for your suggestion, although I assert that you are wrong.

It's not the same as tearing. Tearing only affects the perceived result on a monitor, and is caused by updating the image in the front buffer, while the raster is partway through updating it.

Let me reiterate what's going on:

1. I am running my engine in fullscreen. Everything is rendering correctly.
2. I press 'print screen', and then quit the game.
3. I paste the clipboard image into my favorite image editor (photoshop if its open, otherwise paint)
4. WHOLE OBJECTS ARE MISSING FROM THE SCENE. Sometimes, things that are drawn last, like the GUI, are completely missing.

Does anyone have any real suggestion as to why this is happening, and how to fix it?

Regards,
Chris

Share this post


Link to post
Share on other sites
As you say, if you've got a backbuffer then this shouldn't happen. I can only guess (just a guess though) that you have some kind of external app which is capturing the print screen key and doing a custom (and broken) implementation of print screen.

Possibly not a very helpful suggestion: but does the same problem occur with the referance renderer?

Share this post


Link to post
Share on other sites
Hi OrangyTang;

I considered that...

So, clean system:

Windows XP SP2
Visual Studio 2005
DirectX SDK June 2006
nVIDIA 91-series drivers for 6800GT

Still does it.
I thought it might have something to do with the nview desktop management, but it makes no difference whether its on or off - sometimes, things are missing.

I have observed it doing the same thing on a number of machines, so I assume its some caveat in the device initialization.

Changing SwapEffect doesnt appear to affect it, nor does changing the backbuffer count.

Any other ideas?

(It also used to happen with my old radeon, so its not just these new nvidia cards/their drivers)

Regards,
Chris

Share this post


Link to post
Share on other sites
Is this only occurring if your framerate is exceedingly high? Does the problem still occur if vsync is enabled?

This is pure speculation, but I'd guess it may be possible for the "copy to clipboard" operation to grab corrupted data if the front buffer becomes the back buffer and gets cleared by your code before the copy operation completes.

Apologies for the first suggestion, but reading "other games" I assumed you were wondering how other games implement screen captures.

Share this post


Link to post
Share on other sites
By 'other games', i mean, that when you hit printscreen, it just does the Right Thing, and puts the current screen image on the clipboard.

Games having custom screenshot functions seems like a hack around this.

Is it something you've encountered?

Yes, exceedingly high framerates seem to make it worse.

Its not like I'm getting corruption of the image. It's like im getting the backbuffer instead, with whatever batches have already been committed, and the others missing.

-Chris

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!