Skip to content

Commit c52fef3

Browse files
authored
parse opacity of material
some model is transparent, so it should parse MAT_TRANSPARENCY, and convert MAT_TRANSPARENCY to material.oapcity
1 parent 345e504 commit c52fef3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

examples/js/loaders/TDSLoader.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,12 @@ THREE.TDSLoader.prototype = Object.assign( Object.create( THREE.Loader.prototype
272272
material.shininess = shininess;
273273
this.debugMessage( ' Shininess : ' + shininess );
274274

275+
} else if ( next === MAT_TRANSPARENCY ) {
276+
277+
var opacity = this.readWord( data );
278+
material.opacity = opacity*0.01;
279+
this.debugMessage( ' Opacity : ' + opacity );
280+
material.transparent = opacity<100 ? true : false;
275281
} else if ( next === MAT_TEXMAP ) {
276282

277283
this.debugMessage( ' ColorMap' );

0 commit comments

Comments
 (0)