|
560 | 560 |
|
561 | 561 | // NODES |
562 | 562 |
|
563 | | - var mask = new Nodes.SwitchNode( new Nodes.TextureNode( getTexture( "decalDiffuse" ) ), 'w' ); |
564 | | - |
565 | 563 | var normalScale = new Nodes.FloatNode( .3 ); |
566 | 564 |
|
567 | 565 | var radiance = new Nodes.FloatNode( 1 ); |
|
579 | 577 | var envNode = new Nodes.TextureCubeNode( new Nodes.TextureNode( premTexture ) ); |
580 | 578 |
|
581 | 579 | var subSlotNode = new Nodes.SubSlotNode(); |
582 | | - subSlotNode.slots['radiance'] = new Nodes.OperatorNode( radiance, envNode, Nodes.OperatorNode.MUL ); |
583 | | - subSlotNode.slots['irradiance'] = new Nodes.OperatorNode( irradiance, envNode, Nodes.OperatorNode.MUL ); |
| 580 | + subSlotNode.slots[ 'radiance' ] = new Nodes.OperatorNode( radiance, envNode, Nodes.OperatorNode.MUL ); |
| 581 | + subSlotNode.slots[ 'irradiance' ] = new Nodes.OperatorNode( irradiance, envNode, Nodes.OperatorNode.MUL ); |
584 | 582 |
|
585 | 583 | mtl.environment = subSlotNode; |
586 | 584 |
|
|
2496 | 2494 |
|
2497 | 2495 | function biasMode( val ) { |
2498 | 2496 |
|
2499 | | - switch( val ) { |
| 2497 | + switch ( val ) { |
2500 | 2498 |
|
2501 | 2499 | case 'prem': |
2502 | 2500 |
|
|
2595 | 2593 |
|
2596 | 2594 | case 'node-reflect': |
2597 | 2595 |
|
2598 | | - // MATERIAL |
| 2596 | + // MATERIAL |
2599 | 2597 |
|
2600 | | - var node = new Nodes.ReflectNode(); |
| 2598 | + var node = new Nodes.ReflectNode(); |
2601 | 2599 |
|
2602 | | - var nodeMaterial = new Nodes.StandardNodeMaterial(); |
2603 | | - nodeMaterial.environment = new Nodes.CubeTextureNode( cubemap, node ); |
2604 | | - nodeMaterial.roughness.value = .5; |
2605 | | - nodeMaterial.metalness.value = 1; |
| 2600 | + var nodeMaterial = new Nodes.StandardNodeMaterial(); |
| 2601 | + nodeMaterial.environment = new Nodes.CubeTextureNode( cubemap, node ); |
| 2602 | + nodeMaterial.roughness.value = .5; |
| 2603 | + nodeMaterial.metalness.value = 1; |
2606 | 2604 |
|
2607 | | - var standardMaterial = new THREE.MeshStandardMaterial( { |
2608 | | - color: nodeMaterial.color.value, |
2609 | | - side: defaultSide, |
2610 | | - envMap: cubemap, |
2611 | | - roughness: nodeMaterial.roughness.value, |
2612 | | - metalness: 1 |
2613 | | - } ); |
| 2605 | + var standardMaterial = new THREE.MeshStandardMaterial( { |
| 2606 | + color: nodeMaterial.color.value, |
| 2607 | + side: defaultSide, |
| 2608 | + envMap: cubemap, |
| 2609 | + roughness: nodeMaterial.roughness.value, |
| 2610 | + metalness: 1 |
| 2611 | + } ); |
2614 | 2612 |
|
2615 | | - mtl = nodeMaterial; |
| 2613 | + mtl = nodeMaterial; |
2616 | 2614 |
|
2617 | | - // GUI |
| 2615 | + // GUI |
2618 | 2616 |
|
2619 | | - addGui( 'node', true, function ( val ) { |
| 2617 | + addGui( 'node', true, function ( val ) { |
2620 | 2618 |
|
2621 | | - mtl = val ? nodeMaterial : standardMaterial; |
2622 | | - mesh.material = mtl; |
| 2619 | + mtl = val ? nodeMaterial : standardMaterial; |
| 2620 | + mesh.material = mtl; |
2623 | 2621 |
|
2624 | | - } ); |
| 2622 | + } ); |
2625 | 2623 |
|
2626 | | - addGui( 'roughness', nodeMaterial.roughness.value, function ( val ) { |
| 2624 | + addGui( 'roughness', nodeMaterial.roughness.value, function ( val ) { |
2627 | 2625 |
|
2628 | | - nodeMaterial.roughness.value = val; |
2629 | | - standardMaterial.roughness = val; |
| 2626 | + nodeMaterial.roughness.value = val; |
| 2627 | + standardMaterial.roughness = val; |
2630 | 2628 |
|
2631 | | - }, false, 0, 1 ); |
| 2629 | + }, false, 0, 1 ); |
2632 | 2630 |
|
2633 | | - break; |
| 2631 | + break; |
2634 | 2632 |
|
2635 | 2633 |
|
2636 | 2634 | case 'varying': |
|
0 commit comments