Skip to content

Commit

Permalink
Update add-3d-model-babylon.html with comments on occlusion and inter…
Browse files Browse the repository at this point in the history
…activity (maplibre#3829)

* Update add-3d-model-babylon.html

Adding optional code for interactivity and occlusion.

* add links to comments and fix lint issues
  • Loading branch information
dennemark authored Mar 14, 2024
1 parent 0d8a9e3 commit 2f3a407
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/examples/add-3d-model-babylon.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,22 @@
true
);
this.scene = new BABYLON.Scene(this.engine);
/**
* optionally add
* this.scene.autoClearDepthAndStencil = false
* and for renderingGroupIds set this individually via
* this.scene.setRenderingAutoClearDepthStencil(1,false)
* to allow blending with maplibre scene
* as documented in https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#reducing-calls-to-glclear
*/
this.scene.autoClear = false;
/**
* use detachControl if you only want to interact with maplibre-gl and do not need pointer events of babylonjs.
* alternatively exchange this.scene.detachControl() with the following two lines, they will allow bubbling up events to maplibre-gl.
* this.scene.preventDefaultOnPointerDown = false
* this.scene.preventDefaultOnPointerUp = false
* https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#preventDefaultOnPointerDown
*/
this.scene.detachControl();

this.scene.beforeRender = () => {
Expand Down Expand Up @@ -143,4 +158,4 @@
});
</script>
</body>
</html>
</html>

0 comments on commit 2f3a407

Please sign in to comment.