-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Closed
Milestone
Description
With Three.js r132 I can no longer make my models transparent. I export Models in Blender (2.92.0) as .glb file. I then import via GLTFLoader and set the opacity in JavaScript. I am also unable to make the object transparent using the three.js editor (drag and drop .glb in the editor).
Steps to reproduce the behavior:
- Export "Blender cube" as .glb file
- Load the .glb via GLTFLoader
- Set opacity/transparency on the MeshStandardMaterial
(expect that model ist transparent)
Code
new GLTFLoader().load("cube.glb", (gltf) => {
const cube = gltf.scene.getObjectByName("Cube");
if (
cube instanceof THREE.Mesh &&
cube.material instanceof THREE.MeshStandardMaterial
) {
scene.add(cube);
cube.material.opacity = 0.5;
cube.material.color.set("#0000ff");
cube.material.transparent = true;
cube.material.depthWrite = false;
cube.material.side = THREE.FrontSide;
}
});Expected behavior
With r131, the sample project looks like this:
https://codesandbox.io/s/threejs-transparency-r131-rth6g
Screenshots
With r132, the sample project looks like this:
https://codesandbox.io/s/threejs-transparency-r132-1hs0v
Platform:
- Device: Desktop
- OS: MacOS
- Browser: Chrome
- Three.js version: r132.2
TheBrainChain, poirierlouis, brother-dong-new, bmorwood and ranbuch
Metadata
Metadata
Assignees
Labels
No labels

