mirror of
https://github.com/jiawanlong/Cesium-Examples.git
synced 2025-07-06 16:31:03 +00:00
35 lines
684 B
JavaScript
35 lines
684 B
JavaScript
import NodeMaterial, { addNodeMaterial } from './NodeMaterial.js';
|
|
import PhongLightingModel from '../functions/PhongLightingModel.js';
|
|
|
|
import { MeshLambertMaterial } from 'three';
|
|
|
|
const defaultValues = new MeshLambertMaterial();
|
|
|
|
class MeshLambertNodeMaterial extends NodeMaterial {
|
|
|
|
constructor( parameters ) {
|
|
|
|
super();
|
|
|
|
this.isMeshLambertNodeMaterial = true;
|
|
|
|
this.lights = true;
|
|
|
|
this.setDefaultValues( defaultValues );
|
|
|
|
this.setValues( parameters );
|
|
|
|
}
|
|
|
|
constructLightingModel( /*builder*/ ) {
|
|
|
|
return new PhongLightingModel( false ); // ( specular ) -> force lambert
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export default MeshLambertNodeMaterial;
|
|
|
|
addNodeMaterial( MeshLambertNodeMaterial );
|