2

We currently have a screen reaching about 10000 shapes. We are allowing users to pan and zoom to explore. I thought of a couple optimizations to keep using svg in the mid-term:

  1. culling shapes not on screen (only writing objects in our viewport to the DOM)
  2. reducing edges when zoomed out

These 2 tactics go hand in hand; however, I was wondering if shapes not already on screen are already culled and not "drawn" by most browser vendors. If not, is it presumably better maintain a quad tree of objects in the scene and render the current set of trees that intersect with our viewport?

Parris
  • 17,833
  • 17
  • 90
  • 133

1 Answers1

2

Yes, Firefox since version 17 has culled shapes that can't be seen. The code creates what is called a display list of things that it intends to draw. I imagine sure Chrome and IE use some similar mechanism so you'd only make things slower if you try to handle it yourself.

Robert Longson
  • 118,664
  • 26
  • 252
  • 242