xeokit / xeokit-sdk

Open source JavaScript SDK for viewing high-detail, full-precision 3D BIM and AEC models in the Web browser.
https://xeokit.io
Other
737 stars 291 forks source link

Backfaces on GLTF loader makes no difference #1411

Closed hamza-hajji closed 7 months ago

hamza-hajji commented 8 months ago

Describe the bug Setting backfaces=false/true in GLTFLoaderPlugin#load makes no difference whether the backfaces are shown or not

To Reproduce Steps to reproduce the behavior:

  1. Load this example locally https://xeokit.github.io/xeokit-sdk/examples/buildings/#glTF_Duplex_transform
  2. Set the backfaces to false on the loader, (it is false by default, but setting it to true made no difference)
  3. Zoom into the upper room
  4. You can see the backfaces of the room (see screenast)

Expected behavior Loading it into a GLTF viewer and zooming into the upper room, you can see the backfaces are transparent (see screenshot)

I'm not sure if this is the param to do this, because that's how it's described in the docs:

When true, allows visible backfaces, wherever specified in the glTF. When false, ignores backfaces

Screencasts

zoomintoroof

image

xeolabs commented 7 months ago

Fixed by modifying the behaviour of the backfaces option:

tgranie commented 5 months ago

@xeolabs Hello, I used the backfaces option set to false on a glb. In glt-viewer (https://gltf-viewer.donmccurdy.com/), it works : image

On xeokit using the gltfloader with backfaces to false :

image

Seems like backfaces was true.

Thanks for your help

xeolabs commented 5 months ago

Hi could you please provide the glb model so we can debug?

Seems like backfaces was true.

Could you please clarify here - do you mean in the code or in the model?

thanks

tgranie commented 5 months ago

Please find an example here (glb zipped) : 02_07_2024.zip

Basically we would like the backfaces to be transparent :

image

tgranie commented 4 months ago

@xeolabs Does it clarify the issue ?