Is there a fast way to determine if the stage has any unused space aside from the following mechanisms:
- drawing the stage to bitmapdata and looking for alpha values
- calculating the sum of rectangle areas and positions of the stages children
In my situation, I have multiple layered images in a single scene, all which potentially move and have collision logic. In some situations, Certain images cannot be seen by the user, and I would like to loop through the potential images from front to back and draw them(and add them to array of objects for logic looping) until there is no unused space left on the stage. (In other words, I do not want to perform logic or draw the Images that can not be seen at all.)
I was able to do this with the aforementioned techniques, however, 1 was too slow, and 2 presents issues where there are alpha channels in the child Images textures. A combination of the 2 presented some negligible performance benefits, but also created a different set of problems that are too long to go into here. Is there a faster way I could do this with the gpu?
I considered using a binary tree to partition spaces to speed things up, but I was wondering if there was a better way.