Quantcast
Channel: Adobe Community : Popular Discussions - AIR Development
Viewing all articles
Browse latest Browse all 24121

Stage3D partial render to bitmap

$
0
0

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,


Viewing all articles
Browse latest Browse all 24121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>