Babylon Viewer (v2)

Since you mention CanvasViewerOptions, I assume your code is using the lower layers (not HTML3DElement). If that is the case, and you are calling loadModel yourself, then one option that works today is to pass in an option to disable the MSFT_audio_emitter glTF extension:

viewer.loadModel(source, {
  pluginOptions: {
    gltf: {
      extensionOptions: {
        MSFT_audio_emitter: {
          enabled: false,
        },
      },
    },
  },
});

This is very new and somewhat still in flux, but you can inherit from ViewerElement and specify a different class that inherits from Viewer if you want to subclass it as well. You can also override ViewerElement._createViewer to customize the viewer creation process. From there, Viewer and ViewerElement both expose a number of protected properties and functions that let you heavily customize many aspects of the viewer. For example, there is a protected function to load a model, which allows you to load many models at the same time if this is what makes sense for your scenario. You also of course have full access to the scene and can directly manipulate it in whatever way makes sense (for example, adding primitive shapes like cubes or spheres, etc.). This part of the Viewer is a new, advanced use case, and is not fully fleshed out, so it’s not documented yet, but a lot is possible (and in fact others are already building on it in this way!).

3 Likes

:star: WebGPU by default

Heads up, as of version 7.50.0, WebGPU (with “fast snapshot rendering,” e.g. GPURenderBundles) will be used by default in Chromium browsers when supported. Depending on the model being rendered, this can result in a sizable performance boost. As WebGPU matures in other browsers, we will default to WebGPU in those browsers as well.

If you see any issues, let us know!

7 Likes

:star: Better quality on high dpi devices

As of 7.51.1, the Viewer will now try to render at full native resolution, and dynamically reduce rendering resolution as needed to try to achieve the target frame rate (currently hardcoded at 60fps). This improves rendering quality on high dpi devices (mobile, etc.).

When the Viewer suspends the render loop (e.g. when nothing is visually changing frame to frame), it will render the final frame at full native resolution so the “frozen frame” is max quality.

4 Likes

:star: Viewer Configurator

The first version of the Viewer Configurator is now available! Check it out here: https://viewerconfig.babylonjs.com

The button in the upper right of the configurator will bring you to some docs with additional explanation.

As always, feedback is welcome!

6 Likes