first commit
This commit is contained in:
46
web-app/node_modules/three/src/nodes/accessors/MaterialReferenceNode.js
generated
vendored
Normal file
46
web-app/node_modules/three/src/nodes/accessors/MaterialReferenceNode.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
import ReferenceNode from './ReferenceNode.js';
|
||||
//import { renderGroup } from '../core/UniformGroupNode.js';
|
||||
//import { NodeUpdateType } from '../core/constants.js';
|
||||
import { nodeObject } from '../tsl/TSLBase.js';
|
||||
|
||||
class MaterialReferenceNode extends ReferenceNode {
|
||||
|
||||
static get type() {
|
||||
|
||||
return 'MaterialReferenceNode';
|
||||
|
||||
}
|
||||
|
||||
constructor( property, inputType, material = null ) {
|
||||
|
||||
super( property, inputType, material );
|
||||
|
||||
this.material = material;
|
||||
|
||||
//this.updateType = NodeUpdateType.RENDER;
|
||||
|
||||
this.isMaterialReferenceNode = true;
|
||||
|
||||
}
|
||||
|
||||
/*setNodeType( node ) {
|
||||
|
||||
super.setNodeType( node );
|
||||
|
||||
this.node.groupNode = renderGroup;
|
||||
|
||||
}*/
|
||||
|
||||
updateReference( state ) {
|
||||
|
||||
this.reference = this.material !== null ? this.material : state.material;
|
||||
|
||||
return this.reference;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default MaterialReferenceNode;
|
||||
|
||||
export const materialReference = ( name, type, material ) => nodeObject( new MaterialReferenceNode( name, type, material ) );
|
||||
Reference in New Issue
Block a user