Layers in single scene vs muliple scenes vs multiple canvas

Hi all

Refering to very interesting Multiple Scenes vs Layers.

Before coding, I would like to know if someone has a strong idea about CPU performance of the different feasible possibilities below.
The context is to show many “layers” (probably around 32), each one composed of hundred+ 3d object linked in a group. It is a geographical project.

Feasible things would be :

  1. Use a single scene, each group of objects (towns, roads, etc) have its dedicated layer. User decides to see layers he want.
  2. Use multiple scenes with one renderer and canvas.
  3. Use multiple transparent canvas (so, renderers)
    Development effort does not matter for me, only performance. Which strategy would give the best performance, just in cas the user selects a lot of “layers”, and makes the “scene” move

Thanks by advance for your lights

1 Like

I think all of those options have different startup times (f.e. more resources needed to initialize multiple renderers/canvases vs one), but after that, I think the performance of repeatedly rendering is relatively the same: it depends on how many objects you need to render and how many GPU calls you need to make to render those objects (that’s where your bottlenecks will be beyond the initialization time, and possibly a tiny bit more overhead with multiple renderers but probably not your bottleneck).

Also depends on what you want:

  1. Having one renderer but using the layers system works, but harder to work with “layers” which are only bits (harder to arrange layers, add/remove layers, etc).
  2. Having multiple scenes makes it easier to manage layers, and easier to apply postprocessing to each layer
  3. Having multiple renderers also makes it easier to manage multiple scenes and postprocessing per layer, but unlike option 2 you will lose control over how the layers blend with each other (both option 1 and 2 allow blending layers in various ways (with postprocessing) but option 1 is just harder to manage the layers IMO). If you want to apply different CSS effects to the layers, then option 3 is your best bet.

Needs testing/measuring though!

1 Like