printscreen doesnt actually grab everything?

Started by
13 comments, last by iMalc 17 years, 8 months ago
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
die or be died...i think
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.
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
die or be died...i think
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?
Sirob Yes.» - status: Work-O-Rama.
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.

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
die or be died...i think
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?
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
die or be died...i think
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.
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
die or be died...i think

This topic is closed to new replies.

Advertisement