Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlxScreenGrab doesn't match PrintScreen results #82

Open
larsiusprime opened this issue Jun 6, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@larsiusprime
Copy link
Member

commented Jun 6, 2014

In a customized version of crashdumper, I dump a screenshot on crash, using FlxScreenGrab.

Here's FlxScreenGrab's output:
screenshot

Here's the system's native PrintScreen:
screenshot_printscreen

The FlxScreenGrab image's tileset has little artifacts in it -- perhaps because I'm using the "tileset smear trick" where you add borders to each tile to avoid cross-tile bleed. Also note that the flixel-ui elements are arbitrarily offset from the native screenshot.

FlxScreenGrab just looks like it does a naked draw dump from the stage, so how is this discrepancy even happening? It should be using the same draw logic as everything else, right?

@larsiusprime larsiusprime added the Bug label Jun 6, 2014

@Gama11

This comment has been minimized.

Copy link
Member

commented Jun 6, 2014

I think OpenFL might be to blame for these inaccuracies. I've noticed the same with draw()ing the content of a FlxCamera into a BitmapData.

@larsiusprime

This comment has been minimized.

Copy link
Member Author

commented Jun 6, 2014

Ah, so the problem is that draw() is basically saying "render the stage's components" or something? It's not a straight pixel-dump?

Is there any way to just grab the last set of pixels blitted to the screen?

@Gama11

This comment has been minimized.

Copy link
Member

commented Jun 6, 2014

I talked to Joshua in the OpenFL slack:

  • draw() uses software instead of hardware rendering, so that's where the discrepancies might be coming from
  • in this particular case, there seem to floating point rounding errors (if you compare the two images, everything seems to be always one pixel or so off)
  • it might be possible to make a screenshot via OpenGL at low-level as a workaround (openfl.gl.GL.readPixels() / related forum thread)
@larsiusprime

This comment has been minimized.

Copy link
Member Author

commented Jun 6, 2014

GL.readPixels() causes all sorts of crashing. I'm not sure how to use that :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.