提交 4e547727 编写于 作者: M Mr.doob

Using MeshPhysicalMaterial in webgl_loader_ctm_materials.

上级 be0737f7
......@@ -180,7 +180,7 @@
loaderCTM = new THREE.CTMLoader();
var position = new THREE.Vector3( -105, -78, -40 );
var position = new THREE.Vector3( -105, -78, -30 );
var scale = new THREE.Vector3( 30, 30, 30 );
loaderCTM.loadParts( "models/ctm/camaro/camaro.js", function( geometries, materials ) {
......@@ -214,31 +214,37 @@
if ( m.name.indexOf( "Body" ) !== -1 ) {
var mm = new THREE.MeshPhongMaterial( { map: m.map } );
var mm = new THREE.MeshPhysicalMaterial();
mm.color.setHex( 0x000000 );
mm.lightMap = m.map;
mm.envMap = textureCube;
mm.combine = THREE.MixOperation;
mm.reflectivity = 0.75;
mm.metalness = 0.99;
mm.roughness = 0.2;
materials[ i ] = mm;
} else if ( m.name.indexOf( "mirror" ) !== -1 ) {
var mm = new THREE.MeshPhongMaterial( { map: m.map } );
var mm = new THREE.MeshPhysicalMaterial();
mm.color.setHex( 0x808080 );
mm.lightMap = m.map;
mm.envMap = textureCube;
mm.combine = THREE.MultiplyOperation;
mm.metalness = 1;
mm.roughness = 0;
materials[ i ] = mm;
} else if ( m.name.indexOf( "glass" ) !== -1 ) {
var mm = new THREE.MeshPhongMaterial( { map: m.map } );
var mm = new THREE.MeshPhysicalMaterial();
mm.envMap = textureCube;
mm.color.copy( m.color );
mm.combine = THREE.MixOperation;
mm.reflectivity = 0.25;
// mm.lightMap = m.map;
mm.envMap = textureCube;
mm.metalness = 1;
mm.roughtness = 0;
mm.opacity = m.opacity;
mm.transparent = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册