GLTFLoader: Support KHR_materials_transmission physically-based transparency
See original GitHub issueDescribe the bug
The extension KHR_materials_transmission
does not semi transparent materials from a .glb
.
To Reproduce
Steps to reproduce the behavior:
- Get the reference glb from here https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/TransmissionTest
- Load it with threejs gltf loader.
- The parts of the geometry that are supposed to be semi-transparent are instead 100% opaque. Only 100% transparency is respected. See screenshots below.
Live example
https://jsfiddle.net/jt6ywhs5/12/
Expected behavior
Semi-transparency and transmission works.
Screenshots
Reference: Threejs:
Platform:
- Device: Desktop
- OS: MacOS
- Browser: Chrome 87.0.4280.88 (Official Build) (x86_64)
- Three.js version: latest stable from https://threejs.org/build/three.module.js
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:50 (5 by maintainers)
Top Results From Across the Web
GLTFLoader – three.js docs
GLTFLoader supports the following glTF 2.0 extensions: KHR_draco_mesh_compression; KHR_materials_clearcoat; KHR_materials_ior; KHR_materials_specular ...
Read more >Using threeGLTFLoader load gltf get transparency problem
If you're the author of the model, it's an issue you could fix by disabling transparency on parts of the model that aren't...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The latest version, I just fix the refraction issue for thickness support. Thickness refraction is cool thing I got from gltf viewer. However, I do not see this parameter from GLTF data. ( above demo using magic number 0.01 as thickness)
Let’s keep this open — https://github.com/mrdoob/three.js/issues/16977 is a pretty broad issue so I think it’s good to have something specifically tracking
KHR_materials_transmission
.