Initial commit
This commit is contained in:
25
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/BufferNode.js
generated
vendored
Normal file
25
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/BufferNode.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import InputNode from '../core/InputNode.js';
|
||||
|
||||
class BufferNode extends InputNode {
|
||||
|
||||
constructor( value, bufferType, bufferCount = 0 ) {
|
||||
|
||||
super( 'buffer' );
|
||||
|
||||
this.value = value;
|
||||
this.bufferType = bufferType;
|
||||
this.bufferCount = bufferCount;
|
||||
|
||||
}
|
||||
|
||||
getNodeType( /* builder */ ) {
|
||||
|
||||
return this.bufferType;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BufferNode.prototype.isBufferNode = true;
|
||||
|
||||
export default BufferNode;
|
||||
43
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/ColorNode.js
generated
vendored
Normal file
43
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/ColorNode.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
import InputNode from '../core/InputNode.js';
|
||||
import { Color } from 'three';
|
||||
|
||||
class ColorNode extends InputNode {
|
||||
|
||||
constructor( value = new Color() ) {
|
||||
|
||||
super( 'color' );
|
||||
|
||||
this.value = value;
|
||||
|
||||
}
|
||||
|
||||
serialize( data ) {
|
||||
|
||||
super.serialize( data );
|
||||
|
||||
const { r, g, b } = this.value;
|
||||
|
||||
data.r = r;
|
||||
data.g = g;
|
||||
data.b = b;
|
||||
|
||||
}
|
||||
|
||||
deserialize( data ) {
|
||||
|
||||
super.serialize( data );
|
||||
|
||||
const { r, g, b } = data;
|
||||
const value = this.value;
|
||||
|
||||
value.r = r;
|
||||
value.g = g;
|
||||
value.b = b;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ColorNode.prototype.isColorNode = true;
|
||||
|
||||
export default ColorNode;
|
||||
33
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/FloatNode.js
generated
vendored
Normal file
33
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/FloatNode.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import InputNode from '../core/InputNode.js';
|
||||
|
||||
class FloatNode extends InputNode {
|
||||
|
||||
constructor( value = 0 ) {
|
||||
|
||||
super( 'float' );
|
||||
|
||||
this.value = value;
|
||||
|
||||
}
|
||||
|
||||
serialize( data ) {
|
||||
|
||||
super.serialize( data );
|
||||
|
||||
data.value = this.value;
|
||||
|
||||
}
|
||||
|
||||
deserialize( data ) {
|
||||
|
||||
super.serialize( data );
|
||||
|
||||
data.value = this.value;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
FloatNode.prototype.isFloatNode = true;
|
||||
|
||||
export default FloatNode;
|
||||
33
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/IntNode.js
generated
vendored
Normal file
33
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/IntNode.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import InputNode from '../core/InputNode.js';
|
||||
|
||||
class IntNode extends InputNode {
|
||||
|
||||
constructor( value = 0 ) {
|
||||
|
||||
super( 'int' );
|
||||
|
||||
this.value = value;
|
||||
|
||||
}
|
||||
|
||||
serialize( data ) {
|
||||
|
||||
super.serialize( data );
|
||||
|
||||
data.value = this.value;
|
||||
|
||||
}
|
||||
|
||||
deserialize( data ) {
|
||||
|
||||
super.serialize( data );
|
||||
|
||||
this.value = data.value;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
IntNode.prototype.isIntNode = true;
|
||||
|
||||
export default IntNode;
|
||||
18
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/Matrix3Node.js
generated
vendored
Normal file
18
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/Matrix3Node.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import InputNode from '../core/InputNode.js';
|
||||
import { Matrix3 } from 'three';
|
||||
|
||||
class Matrix3Node extends InputNode {
|
||||
|
||||
constructor( value = new Matrix3() ) {
|
||||
|
||||
super( 'mat3' );
|
||||
|
||||
this.value = value;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Matrix3Node.prototype.isMatrix3Node = true;
|
||||
|
||||
export default Matrix3Node;
|
||||
18
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/Matrix4Node.js
generated
vendored
Normal file
18
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/Matrix4Node.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import InputNode from '../core/InputNode.js';
|
||||
import { Matrix4 } from 'three';
|
||||
|
||||
class Matrix4Node extends InputNode {
|
||||
|
||||
constructor( value = new Matrix4() ) {
|
||||
|
||||
super( 'mat4' );
|
||||
|
||||
this.value = value;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Matrix4Node.prototype.isMatrix4Node = true;
|
||||
|
||||
export default Matrix4Node;
|
||||
89
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/TextureNode.js
generated
vendored
Normal file
89
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/TextureNode.js
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
import InputNode from '../core/InputNode.js';
|
||||
import UVNode from '../accessors/UVNode.js';
|
||||
|
||||
class TextureNode extends InputNode {
|
||||
|
||||
constructor( value = null, uvNode = new UVNode(), biasNode = null ) {
|
||||
|
||||
super( 'texture' );
|
||||
|
||||
this.value = value;
|
||||
this.uvNode = uvNode;
|
||||
this.biasNode = biasNode;
|
||||
|
||||
}
|
||||
|
||||
generate( builder, output ) {
|
||||
|
||||
const texture = this.value;
|
||||
|
||||
if ( ! texture || texture.isTexture !== true ) {
|
||||
|
||||
throw new Error( 'TextureNode: Need a three.js texture.' );
|
||||
|
||||
}
|
||||
|
||||
const type = this.getNodeType( builder );
|
||||
|
||||
const textureProperty = super.generate( builder, type );
|
||||
|
||||
if ( output === 'sampler2D' || output === 'texture2D' ) {
|
||||
|
||||
return textureProperty;
|
||||
|
||||
} else if ( output === 'sampler' ) {
|
||||
|
||||
return textureProperty + '_sampler';
|
||||
|
||||
} else {
|
||||
|
||||
const nodeData = builder.getDataFromNode( this );
|
||||
|
||||
let snippet = nodeData.snippet;
|
||||
|
||||
if ( snippet === undefined ) {
|
||||
|
||||
const uvSnippet = this.uvNode.build( builder, 'vec2' );
|
||||
const biasNode = this.biasNode;
|
||||
|
||||
let biasSnippet = null;
|
||||
|
||||
if ( biasNode !== null ) {
|
||||
|
||||
biasSnippet = biasNode.build( builder, 'float' );
|
||||
|
||||
}
|
||||
|
||||
snippet = builder.getTexture( textureProperty, uvSnippet, biasSnippet );
|
||||
|
||||
nodeData.snippet = snippet;
|
||||
|
||||
}
|
||||
|
||||
return builder.format( snippet, 'vec4', output );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
serialize( data ) {
|
||||
|
||||
super.serialize( data );
|
||||
|
||||
data.value = this.value.toJSON( data.meta ).uuid;
|
||||
|
||||
}
|
||||
|
||||
deserialize( data ) {
|
||||
|
||||
super.serialize( data );
|
||||
|
||||
this.value = data.meta.textures[ data.value ];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TextureNode.prototype.isTextureNode = true;
|
||||
|
||||
export default TextureNode;
|
||||
41
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/Vector2Node.js
generated
vendored
Normal file
41
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/Vector2Node.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import InputNode from '../core/InputNode.js';
|
||||
import { Vector2 } from 'three';
|
||||
|
||||
class Vector2Node extends InputNode {
|
||||
|
||||
constructor( value = new Vector2() ) {
|
||||
|
||||
super( 'vec2' );
|
||||
|
||||
this.value = value;
|
||||
|
||||
}
|
||||
|
||||
serialize( data ) {
|
||||
|
||||
super.serialize( data );
|
||||
|
||||
const { x, y } = this.value;
|
||||
|
||||
data.x = x;
|
||||
data.y = y;
|
||||
|
||||
}
|
||||
|
||||
deserialize( data ) {
|
||||
|
||||
super.serialize( data );
|
||||
|
||||
const { x, y } = data;
|
||||
const value = this.value;
|
||||
|
||||
value.x = x;
|
||||
value.y = y;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Vector2Node.prototype.isVector2Node = true;
|
||||
|
||||
export default Vector2Node;
|
||||
43
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/Vector3Node.js
generated
vendored
Normal file
43
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/Vector3Node.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
import InputNode from '../core/InputNode.js';
|
||||
import { Vector3 } from 'three';
|
||||
|
||||
class Vector3Node extends InputNode {
|
||||
|
||||
constructor( value = new Vector3() ) {
|
||||
|
||||
super( 'vec3' );
|
||||
|
||||
this.value = value;
|
||||
|
||||
}
|
||||
|
||||
serialize( data ) {
|
||||
|
||||
super.serialize( data );
|
||||
|
||||
const { x, y, z } = this.value;
|
||||
|
||||
data.x = x;
|
||||
data.y = y;
|
||||
data.z = z;
|
||||
|
||||
}
|
||||
|
||||
deserialize( data ) {
|
||||
|
||||
super.serialize( data );
|
||||
|
||||
const { x, y, z } = data;
|
||||
const value = this.value;
|
||||
|
||||
value.x = x;
|
||||
value.y = y;
|
||||
value.z = z;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Vector3Node.prototype.isVector3Node = true;
|
||||
|
||||
export default Vector3Node;
|
||||
45
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/Vector4Node.js
generated
vendored
Normal file
45
HTML/ThreeJS/node_modules/three/examples/jsm/nodes/inputs/Vector4Node.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import InputNode from '../core/InputNode.js';
|
||||
import { Vector4 } from 'three';
|
||||
|
||||
class Vector4Node extends InputNode {
|
||||
|
||||
constructor( value = new Vector4() ) {
|
||||
|
||||
super( 'vec4' );
|
||||
|
||||
this.value = value;
|
||||
|
||||
}
|
||||
|
||||
serialize( data ) {
|
||||
|
||||
super.serialize( data );
|
||||
|
||||
const { x, y, z, w } = this.value;
|
||||
|
||||
data.x = x;
|
||||
data.y = y;
|
||||
data.z = z;
|
||||
data.w = w;
|
||||
|
||||
}
|
||||
|
||||
deserialize( data ) {
|
||||
|
||||
super.serialize( data );
|
||||
|
||||
const { x, y, z, w } = data;
|
||||
const value = this.value;
|
||||
|
||||
value.x = x;
|
||||
value.y = y;
|
||||
value.z = z;
|
||||
value.w = w;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Vector4Node.prototype.isVector4Node = true;
|
||||
|
||||
export default Vector4Node;
|
||||
Reference in New Issue
Block a user