super-three 0.168.0 → 0.169.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/three.cjs +384 -700
- package/build/three.module.js +384 -700
- package/build/three.module.min.js +1 -1
- package/build/three.webgpu.js +24644 -22406
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +79941 -0
- package/build/three.webgpu.nodes.min.js +6 -0
- package/examples/jsm/Addons.js +0 -6
- package/examples/jsm/controls/TrackballControls.js +32 -12
- package/examples/jsm/controls/TransformControls.js +97 -62
- package/examples/jsm/exporters/DRACOExporter.js +4 -2
- package/examples/jsm/exporters/EXRExporter.js +19 -11
- package/examples/jsm/exporters/KTX2Exporter.js +21 -13
- package/examples/jsm/exporters/OBJExporter.js +5 -1
- package/examples/jsm/exporters/PLYExporter.js +9 -7
- package/examples/jsm/geometries/DecalGeometry.js +4 -1
- package/examples/jsm/geometries/InstancedPointsGeometry.js +1 -1
- package/examples/jsm/helpers/LightProbeHelper.js +1 -1
- package/examples/jsm/helpers/LightProbeHelperGPU.js +65 -0
- package/examples/jsm/libs/basis/basis_transcoder.js +8 -10
- package/examples/jsm/libs/basis/basis_transcoder.wasm +0 -0
- package/examples/jsm/libs/ktx-parse.module.js +1 -1
- package/examples/jsm/lights/LightProbeGenerator.js +24 -10
- package/examples/jsm/loaders/ColladaLoader.js +9 -6
- package/examples/jsm/loaders/DRACOLoader.js +3 -1
- package/examples/jsm/loaders/FBXLoader.js +30 -20
- package/examples/jsm/loaders/GLTFLoader.js +5 -10
- package/examples/jsm/loaders/KTX2Loader.js +10 -7
- package/examples/jsm/loaders/MTLLoader.js +4 -3
- package/examples/jsm/loaders/MaterialXLoader.js +29 -10
- package/examples/jsm/loaders/OBJLoader.js +5 -3
- package/examples/jsm/loaders/PCDLoader.js +5 -4
- package/examples/jsm/loaders/PDBLoader.js +3 -2
- package/examples/jsm/loaders/PLYLoader.js +8 -5
- package/examples/jsm/loaders/STLLoader.js +3 -2
- package/examples/jsm/loaders/VRMLLoader.js +10 -10
- package/examples/jsm/loaders/VTKLoader.js +4 -3
- package/examples/jsm/loaders/XYZLoader.js +3 -2
- package/examples/jsm/misc/Timer.js +1 -1
- package/examples/jsm/modifiers/CurveModifierGPU.js +233 -0
- package/examples/jsm/objects/LensflareMesh.js +322 -0
- package/examples/jsm/objects/SkyMesh.js +1 -2
- package/examples/jsm/objects/Water2Mesh.js +2 -3
- package/examples/jsm/objects/WaterMesh.js +1 -2
- package/examples/jsm/physics/JoltPhysics.js +1 -1
- package/examples/jsm/physics/RapierPhysics.js +1 -1
- package/examples/jsm/transpiler/GLSLDecoder.js +1 -1
- package/examples/jsm/transpiler/ShaderToyDecoder.js +2 -2
- package/examples/jsm/utils/GeometryCompressionUtils.js +37 -122
- package/examples/jsm/utils/ShadowMapViewer.js +3 -8
- package/examples/jsm/utils/ShadowMapViewerGPU.js +201 -0
- package/examples/jsm/utils/SkeletonUtils.js +84 -66
- package/examples/jsm/utils/TextureUtils.js +1 -0
- package/examples/jsm/utils/TextureUtilsGPU.js +63 -0
- package/examples/jsm/webxr/XRControllerModelFactory.js +1 -1
- package/package.json +2 -2
- package/src/Three.WebGPU.Nodes.js +200 -0
- package/src/Three.WebGPU.js +2 -1
- package/src/audio/Audio.js +2 -2
- package/src/constants.js +1 -1
- package/src/core/BufferAttribute.js +0 -9
- package/src/core/Clock.js +1 -1
- package/src/core/InterleavedBuffer.js +0 -9
- package/src/extras/Controls.js +1 -1
- package/src/geometries/CylinderGeometry.js +11 -4
- package/src/loaders/MaterialLoader.js +7 -1
- package/src/loaders/nodes/NodeLoader.js +24 -4
- package/src/loaders/nodes/NodeMaterialLoader.js +21 -17
- package/src/loaders/nodes/NodeObjectLoader.js +19 -0
- package/src/materials/nodes/InstancedPointsNodeMaterial.js +19 -34
- package/src/materials/nodes/Line2NodeMaterial.js +26 -26
- package/src/materials/nodes/LineBasicNodeMaterial.js +7 -3
- package/src/materials/nodes/LineDashedNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshBasicNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshLambertNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshMatcapNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshNormalNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshPhongNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +6 -3
- package/src/materials/nodes/MeshSSSNodeMaterial.js +6 -3
- package/src/materials/nodes/MeshStandardNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshToonNodeMaterial.js +7 -3
- package/src/materials/nodes/NodeMaterial.js +20 -45
- package/src/materials/nodes/NodeMaterials.js +2 -0
- package/src/materials/nodes/PointsNodeMaterial.js +7 -3
- package/src/materials/nodes/ShadowNodeMaterial.js +7 -3
- package/src/materials/nodes/SpriteNodeMaterial.js +39 -6
- package/src/materials/nodes/VolumeNodeMaterial.js +13 -9
- package/src/materials/nodes/manager/NodeMaterialObserver.js +302 -0
- package/src/math/Triangle.js +24 -0
- package/src/nodes/Nodes.js +3 -3
- package/src/nodes/TSL.js +96 -93
- package/src/nodes/accessors/BatchNode.js +7 -3
- package/src/nodes/accessors/BufferAttributeNode.js +6 -3
- package/src/nodes/accessors/BufferNode.js +6 -3
- package/src/nodes/accessors/Camera.js +10 -16
- package/src/nodes/accessors/ClippingNode.js +7 -3
- package/src/nodes/accessors/CubeTextureNode.js +6 -3
- package/src/nodes/accessors/InstanceNode.js +11 -11
- package/src/nodes/accessors/InstancedPointsMaterialNode.js +6 -3
- package/src/nodes/accessors/Lights.js +51 -0
- package/src/nodes/accessors/MaterialNode.js +8 -4
- package/src/nodes/accessors/MaterialReferenceNode.js +6 -3
- package/src/nodes/accessors/ModelNode.js +42 -7
- package/src/nodes/accessors/ModelViewProjectionNode.js +9 -5
- package/src/nodes/accessors/MorphNode.js +7 -3
- package/src/nodes/accessors/Normal.js +32 -6
- package/src/nodes/accessors/Object3DNode.js +11 -27
- package/src/nodes/accessors/PointUVNode.js +7 -3
- package/src/nodes/accessors/ReferenceBaseNode.js +32 -4
- package/src/nodes/accessors/ReferenceNode.js +40 -3
- package/src/nodes/accessors/RendererReferenceNode.js +9 -3
- package/src/nodes/accessors/SceneNode.js +7 -3
- package/src/nodes/accessors/SkinningNode.js +7 -3
- package/src/nodes/accessors/StorageBufferNode.js +21 -3
- package/src/nodes/accessors/StorageTextureNode.js +7 -4
- package/src/nodes/accessors/Texture3DNode.js +7 -4
- package/src/nodes/accessors/TextureNode.js +19 -8
- package/src/nodes/accessors/TextureSizeNode.js +8 -5
- package/src/nodes/accessors/UniformArrayNode.js +12 -9
- package/src/nodes/accessors/UserDataNode.js +9 -6
- package/src/nodes/accessors/VelocityNode.js +74 -23
- package/src/nodes/accessors/VertexColorNode.js +6 -3
- package/src/nodes/code/CodeNode.js +7 -3
- package/src/nodes/code/ExpressionNode.js +8 -4
- package/src/nodes/code/FunctionCallNode.js +6 -3
- package/src/nodes/code/FunctionNode.js +6 -3
- package/src/nodes/code/ScriptableNode.js +11 -6
- package/src/nodes/code/ScriptableValueNode.js +7 -3
- package/src/nodes/core/AssignNode.js +9 -6
- package/src/nodes/core/AttributeNode.js +7 -3
- package/src/nodes/core/BypassNode.js +8 -4
- package/src/nodes/core/CacheNode.js +8 -4
- package/src/nodes/core/ConstNode.js +6 -3
- package/src/nodes/core/ContextNode.js +7 -3
- package/src/nodes/core/IndexNode.js +25 -3
- package/src/nodes/core/InputNode.js +7 -3
- package/src/nodes/core/MRTNode.js +6 -3
- package/src/nodes/core/Node.js +10 -51
- package/src/nodes/core/NodeBuilder.js +71 -5
- package/src/nodes/core/NodeUtils.js +48 -6
- package/src/nodes/core/OutputStructNode.js +8 -4
- package/src/nodes/core/ParameterNode.js +6 -3
- package/src/nodes/core/PropertyNode.js +7 -3
- package/src/nodes/core/StackNode.js +7 -3
- package/src/nodes/core/StructTypeNode.js +7 -3
- package/src/nodes/core/TempNode.js +8 -4
- package/src/nodes/core/UniformGroupNode.js +10 -6
- package/src/nodes/core/UniformNode.js +6 -3
- package/src/nodes/core/VarNode.js +8 -4
- package/src/nodes/core/VaryingNode.js +7 -3
- package/src/nodes/display/AfterImageNode.js +6 -0
- package/src/nodes/display/AnaglyphPassNode.js +6 -0
- package/src/nodes/display/AnamorphicNode.js +6 -0
- package/src/nodes/display/BloomNode.js +6 -0
- package/src/nodes/display/BumpMapNode.js +6 -0
- package/src/nodes/display/ColorSpaceFunctions.js +4 -4
- package/src/nodes/display/ColorSpaceNode.js +43 -14
- package/src/nodes/display/DenoiseNode.js +6 -3
- package/src/nodes/display/DepthOfFieldNode.js +6 -3
- package/src/nodes/display/DotScreenNode.js +8 -5
- package/src/nodes/display/FXAANode.js +6 -3
- package/src/nodes/display/FilmNode.js +6 -3
- package/src/nodes/display/FrontFacingNode.js +7 -3
- package/src/nodes/display/GTAONode.js +6 -3
- package/src/nodes/display/GaussianBlurNode.js +6 -3
- package/src/nodes/display/Lut3DNode.js +6 -3
- package/src/nodes/display/NormalMapNode.js +8 -6
- package/src/nodes/display/ParallaxBarrierPassNode.js +8 -5
- package/src/nodes/display/PassNode.js +18 -7
- package/src/nodes/display/PixelationPassNode.js +12 -5
- package/src/nodes/display/PosterizeNode.js +6 -3
- package/src/nodes/display/RGBShiftNode.js +6 -3
- package/src/nodes/display/RenderOutputNode.js +12 -8
- package/src/nodes/display/SSAAPassNode.js +6 -3
- package/src/nodes/display/ScreenNode.js +181 -0
- package/src/nodes/display/SobelOperatorNode.js +6 -3
- package/src/nodes/display/StereoCompositePassNode.js +6 -3
- package/src/nodes/display/StereoPassNode.js +6 -3
- package/src/nodes/display/ToneMappingFunctions.js +12 -12
- package/src/nodes/display/ToneMappingNode.js +8 -7
- package/src/nodes/display/ToonOutlinePassNode.js +111 -0
- package/src/nodes/display/TransitionNode.js +6 -3
- package/src/nodes/display/ViewportDepthNode.js +7 -3
- package/src/nodes/display/ViewportDepthTextureNode.js +8 -5
- package/src/nodes/display/ViewportSharedTextureNode.js +8 -5
- package/src/nodes/display/ViewportTextureNode.js +8 -5
- package/src/nodes/fog/FogExp2Node.js +6 -3
- package/src/nodes/fog/FogNode.js +7 -3
- package/src/nodes/fog/FogRangeNode.js +6 -3
- package/src/nodes/functions/PhysicalLightingModel.js +2 -2
- package/src/nodes/functions/material/getShIrradianceAt.js +28 -0
- package/src/nodes/geometry/RangeNode.js +7 -3
- package/src/nodes/gpgpu/AtomicFunctionNode.js +99 -0
- package/src/nodes/gpgpu/BarrierNode.js +40 -0
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +98 -0
- package/src/nodes/gpgpu/ComputeNode.js +8 -4
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +100 -0
- package/src/nodes/lighting/AONode.js +6 -3
- package/src/nodes/lighting/AmbientLightNode.js +6 -3
- package/src/nodes/lighting/AnalyticLightNode.js +198 -30
- package/src/nodes/lighting/BasicEnvironmentNode.js +6 -3
- package/src/nodes/lighting/BasicLightMapNode.js +6 -3
- package/src/nodes/lighting/DirectionalLightNode.js +7 -4
- package/src/nodes/lighting/EnvironmentNode.js +6 -3
- package/src/nodes/lighting/HemisphereLightNode.js +10 -6
- package/src/nodes/lighting/IESSpotLightNode.js +6 -3
- package/src/nodes/lighting/IrradianceNode.js +6 -3
- package/src/nodes/lighting/LightProbeNode.js +8 -31
- package/src/nodes/lighting/LightingContextNode.js +6 -3
- package/src/nodes/lighting/LightingNode.js +7 -3
- package/src/nodes/lighting/LightsNode.js +24 -5
- package/src/nodes/lighting/PointLightNode.js +11 -7
- package/src/nodes/lighting/RectAreaLightNode.js +11 -7
- package/src/nodes/lighting/SpotLightNode.js +13 -10
- package/src/nodes/math/ConditionalNode.js +23 -6
- package/src/nodes/math/MathNode.js +6 -3
- package/src/nodes/math/OperatorNode.js +6 -3
- package/src/nodes/pmrem/PMREMNode.js +6 -3
- package/src/nodes/utils/ArrayElementNode.js +8 -4
- package/src/nodes/utils/ConvertNode.js +7 -3
- package/src/nodes/utils/CubeMapNode.js +6 -3
- package/src/nodes/utils/EquirectUVNode.js +6 -3
- package/src/nodes/utils/FlipNode.js +7 -4
- package/src/nodes/utils/FunctionOverloadingNode.js +7 -3
- package/src/nodes/utils/JoinNode.js +6 -3
- package/src/nodes/utils/LoopNode.js +7 -3
- package/src/nodes/utils/MatcapUVNode.js +6 -3
- package/src/nodes/utils/MaxMipLevelNode.js +6 -3
- package/src/nodes/utils/OscNode.js +7 -3
- package/src/nodes/utils/RTTNode.js +6 -3
- package/src/nodes/utils/ReflectorNode.js +8 -5
- package/src/nodes/utils/RemapNode.js +7 -3
- package/src/nodes/utils/RotateNode.js +6 -3
- package/src/nodes/utils/SetNode.js +7 -4
- package/src/nodes/utils/SplitNode.js +7 -3
- package/src/nodes/utils/SpriteSheetUVNode.js +7 -3
- package/src/nodes/utils/StorageArrayElementNode.js +9 -8
- package/src/nodes/utils/TimerNode.js +6 -3
- package/src/nodes/utils/TriplanarTexturesNode.js +7 -3
- package/src/nodes/utils/ViewportUtils.js +2 -2
- package/src/objects/BatchedMesh.js +76 -10
- package/src/objects/LOD.js +21 -0
- package/src/objects/Line.js +1 -0
- package/src/objects/Mesh.js +7 -23
- package/src/objects/Points.js +2 -0
- package/src/renderers/WebGLRenderer.js +65 -50
- package/src/renderers/common/BundleGroup.js +26 -0
- package/src/renderers/common/ClippingContext.js +4 -3
- package/src/renderers/common/RenderContext.js +4 -5
- package/src/renderers/common/RenderObject.js +116 -5
- package/src/renderers/common/RenderObjects.js +8 -1
- package/src/renderers/common/Renderer.js +57 -49
- package/src/renderers/common/extras/PMREMGenerator.js +7 -9
- package/src/renderers/common/nodes/NodeBuilderState.js +3 -3
- package/src/renderers/common/nodes/Nodes.js +33 -14
- package/src/renderers/shaders/ShaderLib/sprite.glsl.js +2 -4
- package/src/renderers/webgl/WebGLAttributes.js +45 -14
- package/src/renderers/webgl/WebGLCapabilities.js +9 -0
- package/src/renderers/webgl/WebGLProgram.js +2 -0
- package/src/renderers/webgl/WebGLPrograms.js +21 -17
- package/src/renderers/webgl/WebGLState.js +21 -0
- package/src/renderers/webgl/WebGLTextures.js +22 -0
- package/src/renderers/webgl-fallback/WebGLBackend.js +50 -45
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +4 -4
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +6 -0
- package/src/renderers/webgl-fallback/utils/WebGLState.js +1 -4
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +61 -16
- package/src/renderers/webgpu/WebGPUBackend.js +33 -25
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +42 -0
- package/src/renderers/webgpu/WebGPURenderer.js +5 -2
- package/src/renderers/webgpu/nodes/BasicNodeLibrary.js +59 -0
- package/src/renderers/{common → webgpu}/nodes/StandardNodeLibrary.js +11 -11
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +91 -11
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +6 -16
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +1 -1
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +7 -5
- package/src/renderers/webgpu/utils/WebGPUUtils.js +1 -1
- package/src/utils.js +33 -1
- package/examples/jsm/geometries/SDFGeometryGenerator.js +0 -144
- package/examples/jsm/loaders/TiltLoader.js +0 -520
- package/examples/jsm/utils/GPUStatsPanel.js +0 -95
- package/examples/jsm/utils/PackedPhongMaterial.js +0 -178
- package/src/nodes/display/ViewportNode.js +0 -138
- package/src/nodes/lighting/LightNode.js +0 -57
- package/src/renderers/common/StandardRenderer.js +0 -18
- package/src/renderers/webvr/WebVRManager.js +0 -495
- package/src/renderers/webvr/WebVRUtils.js +0 -66
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { addMethodChaining, nodeObject, vec4 } from '../tsl/TSLCore.js';
|
|
4
3
|
|
|
5
4
|
import { LinearSRGBColorSpace, SRGBColorSpace } from '../../constants.js';
|
|
5
|
+
import { ColorManagement } from '../../math/ColorManagement.js';
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const WORKING_COLOR_SPACE = 'WorkingColorSpace';
|
|
8
|
+
const OUTPUT_COLOR_SPACE = 'OutputColorSpace';
|
|
9
|
+
|
|
10
|
+
function getColorSpaceName( colorSpace ) {
|
|
8
11
|
|
|
9
12
|
let method = null;
|
|
10
13
|
|
|
@@ -20,33 +23,55 @@ const getColorSpaceName = ( colorSpace ) => {
|
|
|
20
23
|
|
|
21
24
|
return method;
|
|
22
25
|
|
|
23
|
-
}
|
|
26
|
+
}
|
|
24
27
|
|
|
25
|
-
export
|
|
28
|
+
export function getColorSpaceMethod( source, target ) {
|
|
26
29
|
|
|
27
30
|
return getColorSpaceName( source ) + 'To' + getColorSpaceName( target );
|
|
28
31
|
|
|
29
|
-
}
|
|
32
|
+
}
|
|
30
33
|
|
|
31
34
|
class ColorSpaceNode extends TempNode {
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
static get type() {
|
|
37
|
+
|
|
38
|
+
return 'ColorSpaceNode';
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
constructor( colorNode, source, target ) {
|
|
34
43
|
|
|
35
44
|
super( 'vec4' );
|
|
36
45
|
|
|
37
46
|
this.colorNode = colorNode;
|
|
38
|
-
this.target = target;
|
|
39
47
|
this.source = source;
|
|
48
|
+
this.target = target;
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
getColorSpace( builder, colorSpace ) {
|
|
53
|
+
|
|
54
|
+
if ( colorSpace === WORKING_COLOR_SPACE ) {
|
|
55
|
+
|
|
56
|
+
return ColorManagement.workingColorSpace;
|
|
57
|
+
|
|
58
|
+
} else if ( colorSpace === OUTPUT_COLOR_SPACE ) {
|
|
59
|
+
|
|
60
|
+
return builder.context.outputColorSpace || builder.renderer.outputColorSpace;
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return colorSpace;
|
|
40
65
|
|
|
41
66
|
}
|
|
42
67
|
|
|
43
68
|
setup( builder ) {
|
|
44
69
|
|
|
45
|
-
const { renderer
|
|
70
|
+
const { renderer } = builder;
|
|
71
|
+
const { colorNode } = this;
|
|
46
72
|
|
|
47
|
-
const source = this.
|
|
48
|
-
const target = this.
|
|
49
|
-
const colorNode = this.colorNode;
|
|
73
|
+
const source = this.getColorSpace( builder, this.source );
|
|
74
|
+
const target = this.getColorSpace( builder, this.target );
|
|
50
75
|
|
|
51
76
|
if ( source === target ) return colorNode;
|
|
52
77
|
|
|
@@ -76,10 +101,14 @@ class ColorSpaceNode extends TempNode {
|
|
|
76
101
|
|
|
77
102
|
export default ColorSpaceNode;
|
|
78
103
|
|
|
79
|
-
|
|
104
|
+
export const toOutputColorSpace = ( node ) => nodeObject( new ColorSpaceNode( nodeObject( node ), WORKING_COLOR_SPACE, OUTPUT_COLOR_SPACE ) );
|
|
105
|
+
export const toWorkingColorSpace = ( node ) => nodeObject( new ColorSpaceNode( nodeObject( node ), OUTPUT_COLOR_SPACE, WORKING_COLOR_SPACE ) );
|
|
80
106
|
|
|
81
|
-
export const
|
|
82
|
-
export const
|
|
107
|
+
export const workingToColorSpace = ( node, colorSpace ) => nodeObject( new ColorSpaceNode( nodeObject( node ), WORKING_COLOR_SPACE, colorSpace ) );
|
|
108
|
+
export const colorSpaceToWorking = ( node, colorSpace ) => nodeObject( new ColorSpaceNode( nodeObject( node ), colorSpace, WORKING_COLOR_SPACE ) );
|
|
83
109
|
|
|
84
110
|
addMethodChaining( 'toOutputColorSpace', toOutputColorSpace );
|
|
85
111
|
addMethodChaining( 'toWorkingColorSpace', toWorkingColorSpace );
|
|
112
|
+
|
|
113
|
+
addMethodChaining( 'workingToColorSpace', workingToColorSpace );
|
|
114
|
+
addMethodChaining( 'colorSpaceToWorking', colorSpaceToWorking );
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { uv } from '../accessors/UV.js';
|
|
4
3
|
import { Fn, nodeObject, float, int, vec2, vec3, vec4, mat2, If } from '../tsl/TSLBase.js';
|
|
@@ -16,6 +15,12 @@ import { Vector3 } from '../../math/Vector3.js';
|
|
|
16
15
|
|
|
17
16
|
class DenoiseNode extends TempNode {
|
|
18
17
|
|
|
18
|
+
static get type() {
|
|
19
|
+
|
|
20
|
+
return 'DenoiseNode';
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
constructor( textureNode, depthNode, normalNode, noiseNode, camera ) {
|
|
20
25
|
|
|
21
26
|
super();
|
|
@@ -163,8 +168,6 @@ class DenoiseNode extends TempNode {
|
|
|
163
168
|
|
|
164
169
|
export default DenoiseNode;
|
|
165
170
|
|
|
166
|
-
DenoiseNode.type = /*@__PURE__*/ registerNode( 'Denoise', DenoiseNode );
|
|
167
|
-
|
|
168
171
|
function generatePdSamplePointInitializer( samples, rings, radiusExponent ) {
|
|
169
172
|
|
|
170
173
|
const poissonDisk = generateDenoiseSamples( samples, rings, radiusExponent );
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { uv } from '../accessors/UV.js';
|
|
4
3
|
import { Fn, nodeObject, vec2, vec4 } from '../tsl/TSLBase.js';
|
|
@@ -9,6 +8,12 @@ import { convertToTexture } from '../utils/RTTNode.js';
|
|
|
9
8
|
|
|
10
9
|
class DepthOfFieldNode extends TempNode {
|
|
11
10
|
|
|
11
|
+
static get type() {
|
|
12
|
+
|
|
13
|
+
return 'DepthOfFieldNode';
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
constructor( textureNode, viewZNode, focusNode, apertureNode, maxblurNode ) {
|
|
13
18
|
|
|
14
19
|
super();
|
|
@@ -116,6 +121,4 @@ class DepthOfFieldNode extends TempNode {
|
|
|
116
121
|
|
|
117
122
|
export default DepthOfFieldNode;
|
|
118
123
|
|
|
119
|
-
DepthOfFieldNode.type = /*@__PURE__*/ registerNode( 'DepthOfField', DepthOfFieldNode );
|
|
120
|
-
|
|
121
124
|
export const dof = ( node, viewZNode, focus = 1, aperture = 0.025, maxblur = 1 ) => nodeObject( new DepthOfFieldNode( convertToTexture( node ), nodeObject( viewZNode ), nodeObject( focus ), nodeObject( aperture ), nodeObject( maxblur ) ) );
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { nodeObject, Fn, vec2, vec3, vec4 } from '../tsl/TSLBase.js';
|
|
4
3
|
import { uniform } from '../core/UniformNode.js';
|
|
5
4
|
import { uv } from '../accessors/UV.js';
|
|
6
5
|
import { sin, cos } from '../math/MathNode.js';
|
|
7
6
|
import { add } from '../math/OperatorNode.js';
|
|
8
|
-
import {
|
|
7
|
+
import { screenSize } from './ScreenNode.js';
|
|
9
8
|
|
|
10
9
|
import { Vector2 } from '../../math/Vector2.js';
|
|
11
10
|
|
|
12
11
|
class DotScreenNode extends TempNode {
|
|
13
12
|
|
|
13
|
+
static get type() {
|
|
14
|
+
|
|
15
|
+
return 'DotScreenNode';
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
constructor( inputNode, center = new Vector2( 0.5, 0.5 ), angle = 1.57, scale = 1 ) {
|
|
15
20
|
|
|
16
21
|
super( 'vec4' );
|
|
@@ -31,7 +36,7 @@ class DotScreenNode extends TempNode {
|
|
|
31
36
|
const s = sin( this.angle );
|
|
32
37
|
const c = cos( this.angle );
|
|
33
38
|
|
|
34
|
-
const tex = uv().mul(
|
|
39
|
+
const tex = uv().mul( screenSize ).sub( this.center );
|
|
35
40
|
const point = vec2( c.mul( tex.x ).sub( s.mul( tex.y ) ), s.mul( tex.x ).add( c.mul( tex.y ) ) ).mul( this.scale );
|
|
36
41
|
|
|
37
42
|
return sin( point.x ).mul( sin( point.y ) ).mul( 4 );
|
|
@@ -58,6 +63,4 @@ class DotScreenNode extends TempNode {
|
|
|
58
63
|
|
|
59
64
|
export default DotScreenNode;
|
|
60
65
|
|
|
61
|
-
DotScreenNode.type = /*@__PURE__*/ registerNode( 'DotScreen', DotScreenNode );
|
|
62
|
-
|
|
63
66
|
export const dotScreen = ( node, center, angle, scale ) => nodeObject( new DotScreenNode( nodeObject( node ), center, angle, scale ) );
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { uv } from '../accessors/UV.js';
|
|
4
3
|
import { Fn, nodeObject, float, vec2, vec4, int, If } from '../tsl/TSLBase.js';
|
|
@@ -13,6 +12,12 @@ import { Vector2 } from '../../math/Vector2.js';
|
|
|
13
12
|
|
|
14
13
|
class FXAANode extends TempNode {
|
|
15
14
|
|
|
15
|
+
static get type() {
|
|
16
|
+
|
|
17
|
+
return 'FXAANode';
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
16
21
|
constructor( textureNode ) {
|
|
17
22
|
|
|
18
23
|
super();
|
|
@@ -324,6 +329,4 @@ class FXAANode extends TempNode {
|
|
|
324
329
|
|
|
325
330
|
export default FXAANode;
|
|
326
331
|
|
|
327
|
-
FXAANode.type = /*@__PURE__*/ registerNode( 'FXAA', FXAANode );
|
|
328
|
-
|
|
329
332
|
export const fxaa = ( node ) => nodeObject( new FXAANode( convertToTexture( node ) ) );
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { uv } from '../accessors/UV.js';
|
|
4
3
|
import { Fn, nodeProxy, vec4 } from '../tsl/TSLBase.js';
|
|
@@ -7,6 +6,12 @@ import { timerLocal } from '../utils/TimerNode.js';
|
|
|
7
6
|
|
|
8
7
|
class FilmNode extends TempNode {
|
|
9
8
|
|
|
9
|
+
static get type() {
|
|
10
|
+
|
|
11
|
+
return 'FilmNode';
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
10
15
|
constructor( inputNode, intensityNode = null, uvNode = null ) {
|
|
11
16
|
|
|
12
17
|
super();
|
|
@@ -48,6 +53,4 @@ class FilmNode extends TempNode {
|
|
|
48
53
|
|
|
49
54
|
export default FilmNode;
|
|
50
55
|
|
|
51
|
-
FilmNode.type = /*@__PURE__*/ registerNode( 'Film', FilmNode );
|
|
52
|
-
|
|
53
56
|
export const film = /*@__PURE__*/ nodeProxy( FilmNode );
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import Node
|
|
1
|
+
import Node from '../core/Node.js';
|
|
2
2
|
import { nodeImmutable, float } from '../tsl/TSLBase.js';
|
|
3
3
|
|
|
4
4
|
import { BackSide, WebGLCoordinateSystem } from '../../constants.js';
|
|
5
5
|
|
|
6
6
|
class FrontFacingNode extends Node {
|
|
7
7
|
|
|
8
|
+
static get type() {
|
|
9
|
+
|
|
10
|
+
return 'FrontFacingNode';
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
constructor() {
|
|
9
15
|
|
|
10
16
|
super( 'bool' );
|
|
@@ -35,7 +41,5 @@ class FrontFacingNode extends Node {
|
|
|
35
41
|
|
|
36
42
|
export default FrontFacingNode;
|
|
37
43
|
|
|
38
|
-
FrontFacingNode.type = /*@__PURE__*/ registerNode( 'FrontFacing', FrontFacingNode );
|
|
39
|
-
|
|
40
44
|
export const frontFacing = /*@__PURE__*/ nodeImmutable( FrontFacingNode );
|
|
41
45
|
export const faceDirection = /*@__PURE__*/ float( frontFacing ).mul( 2.0 ).sub( 1.0 );
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { texture } from '../accessors/TextureNode.js';
|
|
4
3
|
import { textureSize } from '../accessors/TextureSizeNode.js';
|
|
@@ -26,6 +25,12 @@ const _size = /*@__PURE__*/ new Vector2();
|
|
|
26
25
|
|
|
27
26
|
class GTAONode extends TempNode {
|
|
28
27
|
|
|
28
|
+
static get type() {
|
|
29
|
+
|
|
30
|
+
return 'GTAONode';
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
29
34
|
constructor( depthNode, normalNode, camera ) {
|
|
30
35
|
|
|
31
36
|
super();
|
|
@@ -239,8 +244,6 @@ class GTAONode extends TempNode {
|
|
|
239
244
|
|
|
240
245
|
export default GTAONode;
|
|
241
246
|
|
|
242
|
-
GTAONode.type = /*@__PURE__*/ registerNode( 'GTAO', GTAONode );
|
|
243
|
-
|
|
244
247
|
function generateMagicSquareNoise( size = 5 ) {
|
|
245
248
|
|
|
246
249
|
const noiseSize = Math.floor( size ) % 2 === 0 ? Math.floor( size ) + 1 : Math.floor( size );
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { nodeObject, Fn, float, vec2, vec4 } from '../tsl/TSLBase.js';
|
|
4
3
|
import { NodeUpdateType } from '../core/constants.js';
|
|
@@ -21,6 +20,12 @@ const _quadMesh2 = /*@__PURE__*/ new QuadMesh();
|
|
|
21
20
|
|
|
22
21
|
class GaussianBlurNode extends TempNode {
|
|
23
22
|
|
|
23
|
+
static get type() {
|
|
24
|
+
|
|
25
|
+
return 'GaussianBlurNode';
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
constructor( textureNode, directionNode = null, sigma = 2 ) {
|
|
25
30
|
|
|
26
31
|
super( 'vec4' );
|
|
@@ -205,6 +210,4 @@ class GaussianBlurNode extends TempNode {
|
|
|
205
210
|
|
|
206
211
|
export default GaussianBlurNode;
|
|
207
212
|
|
|
208
|
-
GaussianBlurNode.type = /*@__PURE__*/ registerNode( 'GaussianBlur', GaussianBlurNode );
|
|
209
|
-
|
|
210
213
|
export const gaussianBlur = ( node, directionNode, sigma ) => nodeObject( new GaussianBlurNode( convertToTexture( node ), directionNode, sigma ) );
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { Fn, nodeObject, vec3, vec4, float } from '../tsl/TSLBase.js';
|
|
4
3
|
import { uniform } from '../core/UniformNode.js';
|
|
@@ -6,6 +5,12 @@ import { mix } from '../math/MathNode.js';
|
|
|
6
5
|
|
|
7
6
|
class Lut3DNode extends TempNode {
|
|
8
7
|
|
|
8
|
+
static get type() {
|
|
9
|
+
|
|
10
|
+
return 'Lut3DNode';
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
constructor( inputNode, lutNode, size, intensityNode ) {
|
|
10
15
|
|
|
11
16
|
super();
|
|
@@ -49,6 +54,4 @@ class Lut3DNode extends TempNode {
|
|
|
49
54
|
|
|
50
55
|
export default Lut3DNode;
|
|
51
56
|
|
|
52
|
-
Lut3DNode.type = /*@__PURE__*/ registerNode( 'Lut3D', Lut3DNode );
|
|
53
|
-
|
|
54
57
|
export const lut3D = ( node, lut, size, intensity ) => nodeObject( new Lut3DNode( nodeObject( node ), nodeObject( lut ), size, nodeObject( intensity ) ) );
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { add } from '../math/OperatorNode.js';
|
|
4
3
|
|
|
5
|
-
import {
|
|
6
|
-
import { normalView } from '../accessors/Normal.js';
|
|
4
|
+
import { normalView, transformNormalToView } from '../accessors/Normal.js';
|
|
7
5
|
import { positionView } from '../accessors/Position.js';
|
|
8
6
|
import { TBNViewMatrix } from '../accessors/AccessorsUtils.js';
|
|
9
7
|
import { uv } from '../accessors/UV.js';
|
|
@@ -41,6 +39,12 @@ const perturbNormal2Arb = /*@__PURE__*/ Fn( ( inputs ) => {
|
|
|
41
39
|
|
|
42
40
|
class NormalMapNode extends TempNode {
|
|
43
41
|
|
|
42
|
+
static get type() {
|
|
43
|
+
|
|
44
|
+
return 'NormalMapNode';
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
44
48
|
constructor( node, scaleNode = null ) {
|
|
45
49
|
|
|
46
50
|
super( 'vec3' );
|
|
@@ -68,7 +72,7 @@ class NormalMapNode extends TempNode {
|
|
|
68
72
|
|
|
69
73
|
if ( normalMapType === ObjectSpaceNormalMap ) {
|
|
70
74
|
|
|
71
|
-
outputNode =
|
|
75
|
+
outputNode = transformNormalToView( normalMap );
|
|
72
76
|
|
|
73
77
|
} else if ( normalMapType === TangentSpaceNormalMap ) {
|
|
74
78
|
|
|
@@ -99,6 +103,4 @@ class NormalMapNode extends TempNode {
|
|
|
99
103
|
|
|
100
104
|
export default NormalMapNode;
|
|
101
105
|
|
|
102
|
-
NormalMapNode.type = /*@__PURE__*/ registerNode( 'NormalMap', NormalMapNode );
|
|
103
|
-
|
|
104
106
|
export const normalMap = /*@__PURE__*/ nodeProxy( NormalMapNode );
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import { Fn, If, nodeObject, vec4 } from '../tsl/TSLBase.js';
|
|
3
2
|
import { uv } from '../accessors/UV.js';
|
|
4
3
|
import { mod } from '../math/MathNode.js';
|
|
5
|
-
import {
|
|
4
|
+
import { screenCoordinate } from './ScreenNode.js';
|
|
6
5
|
import StereoCompositePassNode from './StereoCompositePassNode.js';
|
|
7
6
|
import NodeMaterial from '../../materials/nodes/NodeMaterial.js';
|
|
8
7
|
|
|
9
8
|
class ParallaxBarrierPassNode extends StereoCompositePassNode {
|
|
10
9
|
|
|
10
|
+
static get type() {
|
|
11
|
+
|
|
12
|
+
return 'ParallaxBarrierPassNode';
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
11
16
|
constructor( scene, camera ) {
|
|
12
17
|
|
|
13
18
|
super( scene, camera );
|
|
@@ -24,7 +29,7 @@ class ParallaxBarrierPassNode extends StereoCompositePassNode {
|
|
|
24
29
|
|
|
25
30
|
const color = vec4().toVar();
|
|
26
31
|
|
|
27
|
-
If( mod(
|
|
32
|
+
If( mod( screenCoordinate.y, 2 ).greaterThan( 1 ), () => {
|
|
28
33
|
|
|
29
34
|
color.assign( this._mapLeft.uv( uvNode ) );
|
|
30
35
|
|
|
@@ -50,6 +55,4 @@ class ParallaxBarrierPassNode extends StereoCompositePassNode {
|
|
|
50
55
|
|
|
51
56
|
export default ParallaxBarrierPassNode;
|
|
52
57
|
|
|
53
|
-
ParallaxBarrierPassNode.type = /*@__PURE__*/ registerNode( 'ParallaxBarrierPass', ParallaxBarrierPassNode );
|
|
54
|
-
|
|
55
58
|
export const parallaxBarrierPass = ( scene, camera ) => nodeObject( new ParallaxBarrierPassNode( scene, camera ) );
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { default as TextureNode/*, texture*/ } from '../accessors/TextureNode.js';
|
|
4
3
|
import { NodeUpdateType } from '../core/constants.js';
|
|
@@ -15,6 +14,12 @@ const _size = /*@__PURE__*/ new Vector2();
|
|
|
15
14
|
|
|
16
15
|
class PassTextureNode extends TextureNode {
|
|
17
16
|
|
|
17
|
+
static get type() {
|
|
18
|
+
|
|
19
|
+
return 'PassTextureNode';
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
constructor( passNode, texture ) {
|
|
19
24
|
|
|
20
25
|
super( texture );
|
|
@@ -41,10 +46,14 @@ class PassTextureNode extends TextureNode {
|
|
|
41
46
|
|
|
42
47
|
}
|
|
43
48
|
|
|
44
|
-
PassTextureNode.type = /*@__PURE__*/ registerNode( 'PassTexture', PassTextureNode );
|
|
45
|
-
|
|
46
49
|
class PassMultipleTextureNode extends PassTextureNode {
|
|
47
50
|
|
|
51
|
+
static get type() {
|
|
52
|
+
|
|
53
|
+
return 'PassMultipleTextureNode';
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
48
57
|
constructor( passNode, textureName, previousTexture = false ) {
|
|
49
58
|
|
|
50
59
|
super( passNode, null );
|
|
@@ -76,10 +85,14 @@ class PassMultipleTextureNode extends PassTextureNode {
|
|
|
76
85
|
|
|
77
86
|
}
|
|
78
87
|
|
|
79
|
-
PassMultipleTextureNode.type = /*@__PURE__*/ registerNode( 'PassMultipleTexture', PassMultipleTextureNode );
|
|
80
|
-
|
|
81
88
|
class PassNode extends TempNode {
|
|
82
89
|
|
|
90
|
+
static get type() {
|
|
91
|
+
|
|
92
|
+
return 'PassNode';
|
|
93
|
+
|
|
94
|
+
}
|
|
95
|
+
|
|
83
96
|
constructor( scope, scene, camera, options = {} ) {
|
|
84
97
|
|
|
85
98
|
super( 'vec4' );
|
|
@@ -360,8 +373,6 @@ PassNode.DEPTH = 'depth';
|
|
|
360
373
|
|
|
361
374
|
export default PassNode;
|
|
362
375
|
|
|
363
|
-
PassNode.type = /*@__PURE__*/ registerNode( 'Pass', PassNode );
|
|
364
|
-
|
|
365
376
|
export const pass = ( scene, camera, options ) => nodeObject( new PassNode( PassNode.COLOR, scene, camera, options ) );
|
|
366
377
|
export const passTexture = ( pass, texture ) => nodeObject( new PassTextureNode( pass, texture ) );
|
|
367
378
|
export const depthPass = ( scene, camera ) => nodeObject( new PassNode( PassNode.DEPTH, scene, camera ) );
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { uv } from '../accessors/UV.js';
|
|
4
3
|
import { Fn, nodeObject, vec2, vec3, float, If } from '../tsl/TSLBase.js';
|
|
@@ -16,6 +15,12 @@ import { NearestFilter } from '../../constants.js';
|
|
|
16
15
|
|
|
17
16
|
class PixelationNode extends TempNode {
|
|
18
17
|
|
|
18
|
+
static get type() {
|
|
19
|
+
|
|
20
|
+
return 'PixelationNode';
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
constructor( textureNode, depthNode, normalNode, pixelSize, normalEdgeStrength, depthEdgeStrength ) {
|
|
20
25
|
|
|
21
26
|
super();
|
|
@@ -153,12 +158,16 @@ class PixelationNode extends TempNode {
|
|
|
153
158
|
|
|
154
159
|
}
|
|
155
160
|
|
|
156
|
-
PixelationNode.type = /*@__PURE__*/ registerNode( 'Pixelation', PixelationNode );
|
|
157
|
-
|
|
158
161
|
const pixelation = ( node, depthNode, normalNode, pixelSize = 6, normalEdgeStrength = 0.3, depthEdgeStrength = 0.4 ) => nodeObject( new PixelationNode( convertToTexture( node ), convertToTexture( depthNode ), convertToTexture( normalNode ), nodeObject( pixelSize ), nodeObject( normalEdgeStrength ), nodeObject( depthEdgeStrength ) ) );
|
|
159
162
|
|
|
160
163
|
class PixelationPassNode extends PassNode {
|
|
161
164
|
|
|
165
|
+
static get type() {
|
|
166
|
+
|
|
167
|
+
return 'PixelationPassNode';
|
|
168
|
+
|
|
169
|
+
}
|
|
170
|
+
|
|
162
171
|
constructor( scene, camera, pixelSize = 6, normalEdgeStrength = 0.3, depthEdgeStrength = 0.4 ) {
|
|
163
172
|
|
|
164
173
|
super( 'color', scene, camera, { minFilter: NearestFilter, magFilter: NearestFilter } );
|
|
@@ -202,5 +211,3 @@ class PixelationPassNode extends PassNode {
|
|
|
202
211
|
export const pixelationPass = ( scene, camera, pixelSize, normalEdgeStrength, depthEdgeStrength ) => nodeObject( new PixelationPassNode( scene, camera, pixelSize, normalEdgeStrength, depthEdgeStrength ) );
|
|
203
212
|
|
|
204
213
|
export default PixelationPassNode;
|
|
205
|
-
|
|
206
|
-
PixelationPassNode.type = /*@__PURE__*/ registerNode( 'PixelationPass', PixelationPassNode );
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { nodeProxy } from '../tsl/TSLBase.js';
|
|
4
3
|
|
|
5
4
|
class PosterizeNode extends TempNode {
|
|
6
5
|
|
|
6
|
+
static get type() {
|
|
7
|
+
|
|
8
|
+
return 'PosterizeNode';
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
constructor( sourceNode, stepsNode ) {
|
|
8
13
|
|
|
9
14
|
super();
|
|
@@ -25,6 +30,4 @@ class PosterizeNode extends TempNode {
|
|
|
25
30
|
|
|
26
31
|
export default PosterizeNode;
|
|
27
32
|
|
|
28
|
-
PosterizeNode.type = /*@__PURE__*/ registerNode( 'Posterize', PosterizeNode );
|
|
29
|
-
|
|
30
33
|
export const posterize = /*@__PURE__*/ nodeProxy( PosterizeNode );
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { nodeObject, Fn, vec2, vec4 } from '../tsl/TSLBase.js';
|
|
4
3
|
import { uniform } from '../core/UniformNode.js';
|
|
@@ -8,6 +7,12 @@ import { convertToTexture } from '../utils/RTTNode.js';
|
|
|
8
7
|
|
|
9
8
|
class RGBShiftNode extends TempNode {
|
|
10
9
|
|
|
10
|
+
static get type() {
|
|
11
|
+
|
|
12
|
+
return 'RGBShiftNode';
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
11
16
|
constructor( textureNode, amount = 0.005, angle = 0 ) {
|
|
12
17
|
|
|
13
18
|
super( 'vec4' );
|
|
@@ -45,6 +50,4 @@ class RGBShiftNode extends TempNode {
|
|
|
45
50
|
|
|
46
51
|
export default RGBShiftNode;
|
|
47
52
|
|
|
48
|
-
RGBShiftNode.type = /*@__PURE__*/ registerNode( 'RGBShift', RGBShiftNode );
|
|
49
|
-
|
|
50
53
|
export const rgbShift = ( node, amount, angle ) => nodeObject( new RGBShiftNode( convertToTexture( node ), amount, angle ) );
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { addMethodChaining, nodeObject } from '../tsl/TSLCore.js';
|
|
4
3
|
|
|
5
|
-
import {
|
|
4
|
+
import { NoColorSpace, NoToneMapping } from '../../constants.js';
|
|
5
|
+
import { ColorManagement } from '../../math/ColorManagement.js';
|
|
6
6
|
|
|
7
7
|
class RenderOutputNode extends TempNode {
|
|
8
8
|
|
|
9
|
+
static get type() {
|
|
10
|
+
|
|
11
|
+
return 'RenderOutputNode';
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
constructor( colorNode, toneMapping, outputColorSpace ) {
|
|
10
16
|
|
|
11
17
|
super( 'vec4' );
|
|
@@ -25,7 +31,7 @@ class RenderOutputNode extends TempNode {
|
|
|
25
31
|
// tone mapping
|
|
26
32
|
|
|
27
33
|
const toneMapping = ( this.toneMapping !== null ? this.toneMapping : context.toneMapping ) || NoToneMapping;
|
|
28
|
-
const outputColorSpace = ( this.outputColorSpace !== null ? this.outputColorSpace : context.outputColorSpace ) ||
|
|
34
|
+
const outputColorSpace = ( this.outputColorSpace !== null ? this.outputColorSpace : context.outputColorSpace ) || NoColorSpace;
|
|
29
35
|
|
|
30
36
|
if ( toneMapping !== NoToneMapping ) {
|
|
31
37
|
|
|
@@ -33,11 +39,11 @@ class RenderOutputNode extends TempNode {
|
|
|
33
39
|
|
|
34
40
|
}
|
|
35
41
|
|
|
36
|
-
// output color space
|
|
42
|
+
// working to output color space
|
|
37
43
|
|
|
38
|
-
if ( outputColorSpace
|
|
44
|
+
if ( outputColorSpace !== NoColorSpace && outputColorSpace !== ColorManagement.workingColorSpace ) {
|
|
39
45
|
|
|
40
|
-
outputNode = outputNode.
|
|
46
|
+
outputNode = outputNode.workingToColorSpace( outputColorSpace );
|
|
41
47
|
|
|
42
48
|
}
|
|
43
49
|
|
|
@@ -49,8 +55,6 @@ class RenderOutputNode extends TempNode {
|
|
|
49
55
|
|
|
50
56
|
export default RenderOutputNode;
|
|
51
57
|
|
|
52
|
-
RenderOutputNode.type = /*@__PURE__*/ registerNode( 'RenderOutput', RenderOutputNode );
|
|
53
|
-
|
|
54
58
|
export const renderOutput = ( color, toneMapping = null, outputColorSpace = null ) => nodeObject( new RenderOutputNode( nodeObject( color ), toneMapping, outputColorSpace ) );
|
|
55
59
|
|
|
56
60
|
addMethodChaining( 'renderOutput', renderOutput );
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import { nodeObject } from '../tsl/TSLBase.js';
|
|
3
2
|
import PassNode from './PassNode.js';
|
|
4
3
|
import { Color } from '../../math/Color.js';
|
|
@@ -24,6 +23,12 @@ const _size = /*@__PURE__*/ new Vector2();
|
|
|
24
23
|
|
|
25
24
|
class SSAAPassNode extends PassNode {
|
|
26
25
|
|
|
26
|
+
static get type() {
|
|
27
|
+
|
|
28
|
+
return 'SSAAPassNode';
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
|
|
27
32
|
constructor( scene, camera ) {
|
|
28
33
|
|
|
29
34
|
super( PassNode.COLOR, scene, camera );
|
|
@@ -242,8 +247,6 @@ class SSAAPassNode extends PassNode {
|
|
|
242
247
|
|
|
243
248
|
export default SSAAPassNode;
|
|
244
249
|
|
|
245
|
-
SSAAPassNode.type = /*@__PURE__*/ registerNode( 'SSAAPass', SSAAPassNode );
|
|
246
|
-
|
|
247
250
|
// These jitter vectors are specified in integers because it is easier.
|
|
248
251
|
// I am assuming a [-8,8) integer grid, but it needs to be mapped onto [-0.5,0.5)
|
|
249
252
|
// before being used, thus these integers need to be scaled by 1/16.
|