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

[HTML5] Context3D.drawToBitmapData produces transparent BitmapData #2007

Closed
mayakwd opened this issue Sep 13, 2018 · 8 comments
Closed

[HTML5] Context3D.drawToBitmapData produces transparent BitmapData #2007

mayakwd opened this issue Sep 13, 2018 · 8 comments

Comments

@mayakwd
Copy link
Contributor

mayakwd commented Sep 13, 2018

During developing Starling app I've faced with the problem of drawing starling sprites to BitmapData. DisplayObject.drawToBitmapData produces transparent BitmapData. By the help of @peteshand we've discovered that context3D.drawToBitmapData producing same result on HTML5 target.

@peteshand created sample to reproduce this issue: drawToBitmapdata.zip

Issue in starling project: openfl/starling#110

@peteshand
Copy link

ok, down grading to Lime 6.4.0 and OpenFL 8.3.0 resolves the issue, so it must be a regression in the latest versions.

@peteshand
Copy link

One difference I've noticed within the drawToBitmapData function is the following line:

OpenFL 8.3.0
var image = window.renderer.readPixels ();

OpenFL 8.4.1
var image = #if (lime >= "7.0.0") window.readPixels () #else window.renderer.readPixels () #end;

@peteshand
Copy link

This issue has been resolved via this PR:
openfl/lime#1240

@mayakwd
Copy link
Contributor Author

mayakwd commented Sep 21, 2018

Thank you, Pete! I'll try to compile with develop branch to check if it's resolved :-)

@mayakwd
Copy link
Contributor Author

mayakwd commented Sep 25, 2018

I done testing with latest develop + current starling version. I got total mess with masks and canvas rendering:

  1. Quad masks that are not added to displaylist stopped working, their positions attached to stage instead of local position of target, most content with masks is not displaying at all.
  2. Rendering of canvas blinks like it's being erased every second frame.

Drawing into bitmapData still produces transparent pixels.
Totally unusable version.

@jgranick
Copy link
Member

I just built your sample, it appears to look the same on Flash, Neko and HTML5, using current latest dev of Lime, OpenFL and Starling.

It's tan and white and first, and then clicking any of the other buttons makes it tan instead, and it stays tan over a black background no matter what

@peteshand
Copy link

@mayakwd I'm guessing the Masking / Canvas problems you're seeing are a different issue to the drawToBitmapdata issue right? if so it might make sense to create a separate issue.

@mayakwd
Copy link
Contributor Author

mayakwd commented Sep 26, 2018

@peteshand, yup, I just need more time, to extract some samples, to illustrate new issues. Closing this.

@mayakwd mayakwd closed this as completed Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants