添加关照、全局等高线、修改图层问题
This commit is contained in:
@ -0,0 +1,38 @@
|
||||
import NodeMaterial, { addNodeMaterial } from './NodeMaterial.js';
|
||||
import { diffuseColor } from '../core/PropertyNode.js';
|
||||
import { directionToColor } from '../utils/PackingNode.js';
|
||||
import { materialOpacity } from '../accessors/MaterialNode.js';
|
||||
import { transformedNormalView } from '../accessors/NormalNode.js';
|
||||
import { float, vec4 } from '../shadernode/ShaderNode.js';
|
||||
|
||||
import { MeshNormalMaterial } from 'three';
|
||||
|
||||
const defaultValues = new MeshNormalMaterial();
|
||||
|
||||
class MeshNormalNodeMaterial extends NodeMaterial {
|
||||
|
||||
constructor( parameters ) {
|
||||
|
||||
super();
|
||||
|
||||
this.isMeshNormalNodeMaterial = true;
|
||||
|
||||
this.setDefaultValues( defaultValues );
|
||||
|
||||
this.setValues( parameters );
|
||||
|
||||
}
|
||||
|
||||
setupDiffuseColor() {
|
||||
|
||||
const opacityNode = this.opacityNode ? float( this.opacityNode ) : materialOpacity;
|
||||
|
||||
diffuseColor.assign( vec4( directionToColor( transformedNormalView ), opacityNode ) );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default MeshNormalNodeMaterial;
|
||||
|
||||
addNodeMaterial( 'MeshNormalNodeMaterial', MeshNormalNodeMaterial );
|
Reference in New Issue
Block a user