Skip to content

Commit feb964c

Browse files
committed
fix demos
1 parent eccd61c commit feb964c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

example/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,8 @@ async function updateModel() {
624624

625625
if ( c.material ) {
626626

627+
// set the thickness so we render the material as a volumetric object
628+
c.material.thickness = 1.0;
627629
c.material.side = DoubleSide;
628630

629631
}

example/interior.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,17 @@ async function init() {
116116
.loadAsync( 'https://raw.githubusercontent.com/gkjohnson/3d-demo-data/main/models/pathtracing-bathroom/modernbathroom.glb' )
117117
.then( gltf => {
118118

119+
gltf.scene.traverse( c => {
120+
121+
if ( c.material ) {
122+
123+
// set the thickness so volume rendering is used for transmissive objects.
124+
c.material.thickness = 1.0;
125+
126+
}
127+
128+
} );
129+
119130
const group = new THREE.Group();
120131
group.add( gltf.scene );
121132

0 commit comments

Comments
 (0)