MeshLambertNodeMaterial.js 707 B

12345678910111213141516171819202122232425262728293031323334
  1. import NodeMaterial, { addNodeMaterial } from './NodeMaterial.js';
  2. import PhongLightingModel from '../functions/PhongLightingModel.js';
  3. import { MeshLambertMaterial } from 'three';
  4. const defaultValues = new MeshLambertMaterial();
  5. class MeshLambertNodeMaterial extends NodeMaterial {
  6. constructor( parameters ) {
  7. super();
  8. this.isMeshLambertNodeMaterial = true;
  9. this.lights = true;
  10. this.setDefaultValues( defaultValues );
  11. this.setValues( parameters );
  12. }
  13. setupLightingModel( /*builder*/ ) {
  14. return new PhongLightingModel( false ); // ( specular ) -> force lambert
  15. }
  16. }
  17. export default MeshLambertNodeMaterial;
  18. addNodeMaterial( 'MeshLambertNodeMaterial', MeshLambertNodeMaterial );