I'm creating a 2d game (engine written in JavaScript) with layers system. I would like to have some post process to optimize the images and the layers.
If there is too many images in one layer it completely covers some of the images at the lower layers. So I would like to remove them form the final build, but not worry about them at creating time so to not slow down development.
I have tried with the bounding box and combining neighbours but this doesn’t t account for alpha transparency.
Can you please share some techniques how to handle this problem?
javascript
is not a engine, You can further inform the technical framework you are using to know if it has out-of-the-box functionality. In particular, how do you render the graph. \$\endgroup\$occlusion culling
, This is included in some rendering APIs(such as openGL), but it only happens with opaque render queues. So we need to know more about the technical framework you are using in order to find a more accurate solution. BTW ,I think using bounding box check for 2d pictures is fine. \$\endgroup\$