Highlighted

Stage3D partial render to bitmap

New Here ,
Apr 03, 2015

Copy link to clipboard

Copied

Hello,

I'm using Context3D.drawToBitmapData(bitmapData), unfortunately this has no offset (x,y).

Consequence, it is quite slow even if I draw a small simple object in a corner because it uses the whole stage3D size. And if I need to crop the bitmapData afterwards (which I dont need all the time fortunately), it's even slower because, again, I start from a much larger bitmapData than what I need.

If I use a smaller bitmapData in parameters it is indeed VERY faster. Problem is it crops the stage from (0,0), and very often I want to draw to bitmap something that is not in the top left corner. I did some test when objects are in top-left, with a smaller bitmapData, HUGE gain!

Of course I can't really move the object/camera because the perspective would be different. If I could set the PoV anywhere I guess I could move the object to top-left, move the PoV to a strange place and get the same thing as if it were bottom-right but I wasn't really able to do that. Also that would be a workaround at best, which might be costfull perf-wise too.

What I need is pretty simple : being able to use an offset when using Context3D.drawToBitmapData(bitmapData) when using a smaller bitmapData than the whole stage size. I'm not sure but I see no reason why it wouldn't be as fast as doing the same from the top left corner with a small bitmapdata.

Or if you know some kind of way to do that or workaround... Using Textures retrieval from GPU didnt help because I need the bitmapData in the end. Also setScissorRectangle doesn't affect drawToBitmapData.

Any help appreciated

Regards,

TOPICS
Development

Views

304

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Stage3D partial render to bitmap

New Here ,
Apr 03, 2015

Copy link to clipboard

Copied

Hello,

I'm using Context3D.drawToBitmapData(bitmapData), unfortunately this has no offset (x,y).

Consequence, it is quite slow even if I draw a small simple object in a corner because it uses the whole stage3D size. And if I need to crop the bitmapData afterwards (which I dont need all the time fortunately), it's even slower because, again, I start from a much larger bitmapData than what I need.

If I use a smaller bitmapData in parameters it is indeed VERY faster. Problem is it crops the stage from (0,0), and very often I want to draw to bitmap something that is not in the top left corner. I did some test when objects are in top-left, with a smaller bitmapData, HUGE gain!

Of course I can't really move the object/camera because the perspective would be different. If I could set the PoV anywhere I guess I could move the object to top-left, move the PoV to a strange place and get the same thing as if it were bottom-right but I wasn't really able to do that. Also that would be a workaround at best, which might be costfull perf-wise too.

What I need is pretty simple : being able to use an offset when using Context3D.drawToBitmapData(bitmapData) when using a smaller bitmapData than the whole stage size. I'm not sure but I see no reason why it wouldn't be as fast as doing the same from the top left corner with a small bitmapdata.

Or if you know some kind of way to do that or workaround... Using Textures retrieval from GPU didnt help because I need the bitmapData in the end. Also setScissorRectangle doesn't affect drawToBitmapData.

Any help appreciated

Regards,

TOPICS
Development

Views

305

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 03, 2015 0
New Here ,
Apr 10, 2015

Copy link to clipboard

Copied

Am I in the right forum section to ask for this by the way? I can't figure out how this is organized.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 10, 2015 0
Adobe Employee ,
Apr 10, 2015

Copy link to clipboard

Copied

I'm going to move this to the AIR dev forum, but could you also open this as a feature request over at https://bugbase.adobe.com?  Once added, please post back with the bug number so that others can comment and vote! 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 10, 2015 0
New Here ,
Apr 14, 2015

Copy link to clipboard

Copied

I created a feature request there :

Feature#3969467 - Stage3D partial render to bitmap

Many fields I didnt know what to write (platforms... well All of them, just put iOS because there is no "all", Hardware configuration : any, etc.)

Dont hesitate to tell me if you think I should change a few things. I kept the first person mostly because I was too lazy to write it all again from scratch

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 14, 2015 0
Engaged ,
Apr 10, 2015

Copy link to clipboard

Copied

It could be nice feature request.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 10, 2015 0