maplibre-gl-js icon indicating copy to clipboard operation
maplibre-gl-js copied to clipboard

3d model and extrusion draw order incorrect in babylonjs example

Open MikkoSteerpath opened this issue 1 year ago • 4 comments

maplibre-gl-js version: Replicated with maplibre 3.0.1 and 3.1.0, BabylonJS 6.7.0 and 5.42.2.

browser: Chrome 114

Steps to Trigger Behavior

Create a custom 3d layer implementing the BabylonJS example, and add some 3d rendered stuff into it.

Link to Demonstration

https://jsfiddle.net/Lg8r5jck/

Expected Behavior

This is using the ThreeJS example which seems to work correctly:

Screenshot 2023-06-14 at 22 42 04

https://jsfiddle.net/dot0bLnr/2/

Actual Behavior

Screenshot 2023-06-14 at 22 43 01

https://jsfiddle.net/Lg8r5jck/

MikkoSteerpath avatar Jun 14 '23 19:06 MikkoSteerpath

I have no clue what can cause this, but it's probably related to the difference between how these libraries work. You'll have to dig into it it I guess...

HarelM avatar Jun 14 '23 19:06 HarelM

I'm also having this issue where they don't occlude properly

GuoBinyong avatar Dec 23 '23 09:12 GuoBinyong

Maybe try adding autoClearDepthAndStencil

   scene.autoClear = false;
   scene.autoClearDepthAndStencil = false;

let me know if it worked.

dennemark avatar Mar 07 '24 12:03 dennemark