File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments