添加关照、全局等高线、修改图层问题
This commit is contained in:
52
static/sdk/three/jsm/nodes/accessors/SceneNode.js
Normal file
52
static/sdk/three/jsm/nodes/accessors/SceneNode.js
Normal file
@ -0,0 +1,52 @@
|
||||
import Node from '../core/Node.js';
|
||||
import { addNodeClass } from '../core/Node.js';
|
||||
import { nodeImmutable } from '../shadernode/ShaderNode.js';
|
||||
import { reference } from './ReferenceNode.js';
|
||||
|
||||
class SceneNode extends Node {
|
||||
|
||||
constructor( scope = SceneNode.BACKGROUND_BLURRINESS, scene = null ) {
|
||||
|
||||
super();
|
||||
|
||||
this.scope = scope;
|
||||
this.scene = scene;
|
||||
|
||||
}
|
||||
|
||||
setup( builder ) {
|
||||
|
||||
const scope = this.scope;
|
||||
const scene = this.scene !== null ? this.scene : builder.scene;
|
||||
|
||||
let output;
|
||||
|
||||
if ( scope === SceneNode.BACKGROUND_BLURRINESS ) {
|
||||
|
||||
output = reference( 'backgroundBlurriness', 'float', scene );
|
||||
|
||||
} else if ( scope === SceneNode.BACKGROUND_INTENSITY ) {
|
||||
|
||||
output = reference( 'backgroundIntensity', 'float', scene );
|
||||
|
||||
} else {
|
||||
|
||||
console.error( 'THREE.SceneNode: Unknown scope:', scope );
|
||||
|
||||
}
|
||||
|
||||
return output;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SceneNode.BACKGROUND_BLURRINESS = 'backgroundBlurriness';
|
||||
SceneNode.BACKGROUND_INTENSITY = 'backgroundIntensity';
|
||||
|
||||
export default SceneNode;
|
||||
|
||||
export const backgroundBlurriness = nodeImmutable( SceneNode, SceneNode.BACKGROUND_BLURRINESS );
|
||||
export const backgroundIntensity = nodeImmutable( SceneNode, SceneNode.BACKGROUND_INTENSITY );
|
||||
|
||||
addNodeClass( 'SceneNode', SceneNode );
|
Reference in New Issue
Block a user