@plastic-software/three 0.167.1 → 0.167.3
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 +17 -8
- package/build/three.module.js +17 -8
- package/build/three.module.min.js +1 -1
- package/build/three.webgpu.js +746 -374
- package/build/three.webgpu.min.js +1 -1
- package/examples/jsm/controls/Controls.js +32 -0
- package/examples/jsm/controls/DragControls.js +260 -132
- package/examples/jsm/transpiler/TSLEncoder.js +8 -8
- package/package.json +1 -1
- package/src/loaders/ObjectLoader.js +3 -3
- package/src/nodes/Nodes.js +3 -2
- package/src/nodes/accessors/BatchNode.js +2 -2
- package/src/nodes/accessors/ClippingNode.js +8 -8
- package/src/nodes/accessors/MorphNode.js +4 -4
- package/src/nodes/accessors/TangentNode.js +2 -2
- package/src/nodes/accessors/Texture3DNode.js +8 -8
- package/src/nodes/accessors/UniformArrayNode.js +5 -3
- package/src/nodes/core/StackNode.js +22 -6
- package/src/nodes/display/AfterImageNode.js +3 -3
- package/src/nodes/display/AnamorphicNode.js +4 -4
- package/src/nodes/display/BleachBypassNode.js +2 -2
- package/src/nodes/display/BlendModeNode.js +8 -8
- package/src/nodes/display/BloomNode.js +9 -9
- package/src/nodes/display/BumpMapNode.js +3 -3
- package/src/nodes/display/ColorAdjustmentNode.js +4 -4
- package/src/nodes/display/ColorSpaceNode.js +3 -3
- package/src/nodes/display/DenoiseNode.js +8 -8
- package/src/nodes/display/DepthOfFieldNode.js +2 -2
- package/src/nodes/display/DotScreenNode.js +3 -3
- package/src/nodes/display/FXAANode.js +11 -11
- package/src/nodes/display/FilmNode.js +2 -2
- package/src/nodes/display/GTAONode.js +9 -9
- package/src/nodes/display/GaussianBlurNode.js +2 -2
- package/src/nodes/display/Lut3DNode.js +2 -2
- package/src/nodes/display/NormalMapNode.js +2 -2
- package/src/nodes/display/PassNode.js +71 -3
- package/src/nodes/display/PixelationPassNode.js +3 -3
- package/src/nodes/display/RGBShiftNode.js +2 -2
- package/src/nodes/display/SepiaNode.js +2 -2
- package/src/nodes/display/SobelOperatorNode.js +2 -2
- package/src/nodes/display/ToneMappingNode.js +13 -13
- package/src/nodes/display/TransitionNode.js +3 -3
- package/src/nodes/functions/BSDF/BRDF_GGX.js +2 -2
- package/src/nodes/functions/BSDF/BRDF_Lambert.js +2 -2
- package/src/nodes/functions/BSDF/BRDF_Sheen.js +4 -4
- package/src/nodes/functions/BSDF/DFGApprox.js +2 -2
- package/src/nodes/functions/BSDF/D_GGX.js +2 -2
- package/src/nodes/functions/BSDF/D_GGX_Anisotropic.js +2 -2
- package/src/nodes/functions/BSDF/EnvironmentBRDF.js +2 -2
- package/src/nodes/functions/BSDF/F_Schlick.js +2 -2
- package/src/nodes/functions/BSDF/LTC.js +6 -6
- package/src/nodes/functions/BSDF/Schlick_to_F0.js +2 -2
- package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +2 -2
- package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +2 -2
- package/src/nodes/functions/PhongLightingModel.js +3 -3
- package/src/nodes/functions/PhysicalLightingModel.js +18 -18
- package/src/nodes/functions/ToonLightingModel.js +2 -2
- package/src/nodes/functions/material/getGeometryRoughness.js +2 -2
- package/src/nodes/functions/material/getRoughness.js +2 -2
- package/src/nodes/lighting/AnalyticLightNode.js +5 -5
- package/src/nodes/lighting/BasicEnvironmentNode.js +2 -1
- package/src/nodes/lighting/LightProbeNode.js +80 -0
- package/src/nodes/lighting/LightUtils.js +3 -3
- package/src/nodes/materials/InstancedPointsNodeMaterial.js +3 -3
- package/src/nodes/materials/Line2NodeMaterial.js +17 -17
- package/src/nodes/materials/MeshPhysicalNodeMaterial.js +1 -1
- package/src/nodes/materials/VolumeNodeMaterial.js +5 -5
- package/src/nodes/materialx/lib/mx_hsv.js +12 -12
- package/src/nodes/materialx/lib/mx_noise.js +80 -80
- package/src/nodes/materialx/lib/mx_transform_color.js +2 -2
- package/src/nodes/math/CondNode.js +13 -2
- package/src/nodes/math/MathNode.js +2 -2
- package/src/nodes/math/TriNoise3D.js +6 -6
- package/src/nodes/pmrem/PMREMUtils.js +34 -34
- package/src/nodes/procedural/CheckerNode.js +2 -2
- package/src/nodes/shadernode/ShaderNode.js +11 -4
- package/src/nodes/utils/CubeMapNode.js +157 -0
- package/src/nodes/utils/LoopNode.js +10 -4
- package/src/nodes/utils/SpriteUtils.js +2 -2
- package/src/nodes/utils/UVUtils.js +3 -3
- package/src/nodes/utils/ViewportUtils.js +3 -3
- package/src/renderers/WebGLRenderer.js +8 -0
- package/src/renderers/common/RenderContext.js +24 -0
- package/src/renderers/common/RenderObject.js +1 -1
- package/src/renderers/shaders/ShaderChunk/batching_pars_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/batching_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/linedashed.glsl.js +0 -2
- package/src/renderers/shaders/ShaderLib/points.glsl.js +0 -2
- package/src/renderers/webgl/WebGLPrograms.js +2 -1
- package/src/renderers/webgl-fallback/WebGLBackend.js +31 -27
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +12 -8
- package/src/renderers/webgpu/WebGPUBackend.js +10 -14
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +30 -2
- package/src/renderers/webgpu/utils/WebGPUConstants.js +2 -1
package/build/three.webgpu.js
CHANGED
|
@@ -1551,13 +1551,13 @@ function createCanvasElement() {
|
|
|
1551
1551
|
|
|
1552
1552
|
}
|
|
1553
1553
|
|
|
1554
|
-
const _cache$
|
|
1554
|
+
const _cache$2 = {};
|
|
1555
1555
|
|
|
1556
1556
|
function warnOnce( message ) {
|
|
1557
1557
|
|
|
1558
|
-
if ( message in _cache$
|
|
1558
|
+
if ( message in _cache$2 ) return;
|
|
1559
1559
|
|
|
1560
|
-
_cache$
|
|
1560
|
+
_cache$2[ message ] = true;
|
|
1561
1561
|
|
|
1562
1562
|
console.warn( message );
|
|
1563
1563
|
|
|
@@ -29543,7 +29543,7 @@ class ObjectLoader extends Loader {
|
|
|
29543
29543
|
case 'DirectionalLight':
|
|
29544
29544
|
|
|
29545
29545
|
object = new DirectionalLight( data.color, data.intensity );
|
|
29546
|
-
object.target = data.target ||
|
|
29546
|
+
object.target = data.target || '';
|
|
29547
29547
|
|
|
29548
29548
|
break;
|
|
29549
29549
|
|
|
@@ -29562,7 +29562,7 @@ class ObjectLoader extends Loader {
|
|
|
29562
29562
|
case 'SpotLight':
|
|
29563
29563
|
|
|
29564
29564
|
object = new SpotLight( data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay );
|
|
29565
|
-
object.target = data.target ||
|
|
29565
|
+
object.target = data.target || '';
|
|
29566
29566
|
|
|
29567
29567
|
break;
|
|
29568
29568
|
|
|
@@ -29839,7 +29839,7 @@ class ObjectLoader extends Loader {
|
|
|
29839
29839
|
|
|
29840
29840
|
object.traverse( function ( child ) {
|
|
29841
29841
|
|
|
29842
|
-
if ( child.isDirectionalLight ||
|
|
29842
|
+
if ( child.isDirectionalLight || child.isSpotLight ) {
|
|
29843
29843
|
|
|
29844
29844
|
const uuid = child.target;
|
|
29845
29845
|
|
|
@@ -36822,7 +36822,7 @@ class RenderObject {
|
|
|
36822
36822
|
|
|
36823
36823
|
if ( object.count > 1 ) {
|
|
36824
36824
|
|
|
36825
|
-
cacheKey += object.count + ',';
|
|
36825
|
+
cacheKey += object.count + ',' + object.uuid + ',';
|
|
36826
36826
|
|
|
36827
36827
|
}
|
|
36828
36828
|
|
|
@@ -38059,7 +38059,7 @@ const defaultBuildStages = [ 'setup', 'analyze', 'generate' ];
|
|
|
38059
38059
|
const shaderStages = [ ...defaultShaderStages, 'compute' ];
|
|
38060
38060
|
const vectorComponents = [ 'x', 'y', 'z', 'w' ];
|
|
38061
38061
|
|
|
38062
|
-
function getCacheKey( object, force = false ) {
|
|
38062
|
+
function getCacheKey$1( object, force = false ) {
|
|
38063
38063
|
|
|
38064
38064
|
let cacheKey = '{';
|
|
38065
38065
|
|
|
@@ -38272,7 +38272,7 @@ var NodeUtils = /*#__PURE__*/Object.freeze({
|
|
|
38272
38272
|
__proto__: null,
|
|
38273
38273
|
arrayBufferToBase64: arrayBufferToBase64,
|
|
38274
38274
|
base64ToArrayBuffer: base64ToArrayBuffer,
|
|
38275
|
-
getCacheKey: getCacheKey,
|
|
38275
|
+
getCacheKey: getCacheKey$1,
|
|
38276
38276
|
getNodeChildren: getNodeChildren,
|
|
38277
38277
|
getValueFromType: getValueFromType,
|
|
38278
38278
|
getValueType: getValueType
|
|
@@ -38414,7 +38414,7 @@ class Node extends EventDispatcher {
|
|
|
38414
38414
|
|
|
38415
38415
|
if ( force === true || this._cacheKey === null ) {
|
|
38416
38416
|
|
|
38417
|
-
this._cacheKey = getCacheKey( this, force );
|
|
38417
|
+
this._cacheKey = getCacheKey$1( this, force );
|
|
38418
38418
|
this._cacheKeyVersion = this.version;
|
|
38419
38419
|
|
|
38420
38420
|
}
|
|
@@ -39477,7 +39477,7 @@ const ShaderNodeObject = function ( obj, altType = null ) {
|
|
|
39477
39477
|
|
|
39478
39478
|
} else if ( type === 'shader' ) {
|
|
39479
39479
|
|
|
39480
|
-
return
|
|
39480
|
+
return Fn( obj );
|
|
39481
39481
|
|
|
39482
39482
|
}
|
|
39483
39483
|
|
|
@@ -39613,7 +39613,7 @@ class ShaderCallNodeInternal extends Node {
|
|
|
39613
39613
|
}
|
|
39614
39614
|
|
|
39615
39615
|
const jsFunc = shaderNode.jsFunc;
|
|
39616
|
-
const outputNode = inputNodes !== null ? jsFunc( inputNodes, builder
|
|
39616
|
+
const outputNode = inputNodes !== null ? jsFunc( inputNodes, builder ) : jsFunc( builder );
|
|
39617
39617
|
|
|
39618
39618
|
return nodeObject( outputNode );
|
|
39619
39619
|
|
|
@@ -39805,7 +39805,7 @@ const nodeArray = ( val, altType = null ) => new ShaderNodeArray( val, altType )
|
|
|
39805
39805
|
const nodeProxy = ( ...params ) => new ShaderNodeProxy( ...params );
|
|
39806
39806
|
const nodeImmutable = ( ...params ) => new ShaderNodeImmutable( ...params );
|
|
39807
39807
|
|
|
39808
|
-
const
|
|
39808
|
+
const Fn = ( jsFunc ) => {
|
|
39809
39809
|
|
|
39810
39810
|
const shaderNode = new ShaderNode( jsFunc );
|
|
39811
39811
|
|
|
@@ -39842,6 +39842,13 @@ const tslFn = ( jsFunc ) => {
|
|
|
39842
39842
|
|
|
39843
39843
|
};
|
|
39844
39844
|
|
|
39845
|
+
const tslFn = ( ...params ) => { // @deprecated, r168
|
|
39846
|
+
|
|
39847
|
+
console.warn( 'TSL.tslFn: tslFn() has been renamed to Fn().' );
|
|
39848
|
+
return Fn( ...params );
|
|
39849
|
+
|
|
39850
|
+
};
|
|
39851
|
+
|
|
39845
39852
|
addNodeClass( 'ShaderNode', ShaderNode );
|
|
39846
39853
|
|
|
39847
39854
|
//
|
|
@@ -39864,7 +39871,7 @@ const setCurrentStack = ( stack ) => {
|
|
|
39864
39871
|
|
|
39865
39872
|
const getCurrentStack = () => currentStack;
|
|
39866
39873
|
|
|
39867
|
-
const If = ( ...params ) => currentStack.
|
|
39874
|
+
const If = ( ...params ) => currentStack.If( ...params );
|
|
39868
39875
|
|
|
39869
39876
|
function append( node ) {
|
|
39870
39877
|
|
|
@@ -41922,7 +41929,7 @@ const refract = nodeProxy( MathNode, MathNode.REFRACT );
|
|
|
41922
41929
|
const smoothstep = nodeProxy( MathNode, MathNode.SMOOTHSTEP );
|
|
41923
41930
|
const faceForward = nodeProxy( MathNode, MathNode.FACEFORWARD );
|
|
41924
41931
|
|
|
41925
|
-
const rand =
|
|
41932
|
+
const rand = Fn( ( [ uv ] ) => {
|
|
41926
41933
|
|
|
41927
41934
|
const a = 12.9898, b = 78.233, c = 43758.5453;
|
|
41928
41935
|
const dt = dot( uv.xy, vec2( a, b ) ), sn = mod( dt, PI );
|
|
@@ -41995,7 +42002,7 @@ addNodeElement( 'rand', rand );
|
|
|
41995
42002
|
|
|
41996
42003
|
addNodeClass( 'MathNode', MathNode );
|
|
41997
42004
|
|
|
41998
|
-
const sRGBToLinearShader =
|
|
42005
|
+
const sRGBToLinearShader = Fn( ( inputs ) => {
|
|
41999
42006
|
|
|
42000
42007
|
const { value } = inputs;
|
|
42001
42008
|
const { rgb } = value;
|
|
@@ -42010,7 +42017,7 @@ const sRGBToLinearShader = tslFn( ( inputs ) => {
|
|
|
42010
42017
|
|
|
42011
42018
|
} );
|
|
42012
42019
|
|
|
42013
|
-
const LinearTosRGBShader =
|
|
42020
|
+
const LinearTosRGBShader = Fn( ( inputs ) => {
|
|
42014
42021
|
|
|
42015
42022
|
const { value } = inputs;
|
|
42016
42023
|
const { rgb } = value;
|
|
@@ -43983,7 +43990,7 @@ const instance = nodeProxy( InstanceNode );
|
|
|
43983
43990
|
|
|
43984
43991
|
addNodeClass( 'InstanceNode', InstanceNode );
|
|
43985
43992
|
|
|
43986
|
-
const tangentGeometry = /*#__PURE__*/
|
|
43993
|
+
const tangentGeometry = /*#__PURE__*/ Fn( ( builder ) => {
|
|
43987
43994
|
|
|
43988
43995
|
if ( builder.geometry.hasAttribute( 'tangent' ) === false ) {
|
|
43989
43996
|
|
|
@@ -44034,7 +44041,7 @@ class BatchNode extends Node {
|
|
|
44034
44041
|
|
|
44035
44042
|
}
|
|
44036
44043
|
|
|
44037
|
-
const getIndirectIndex =
|
|
44044
|
+
const getIndirectIndex = Fn( ( [ id ] ) => {
|
|
44038
44045
|
|
|
44039
44046
|
const size = textureSize( textureLoad( this.batchMesh._indirectTexture ), 0 );
|
|
44040
44047
|
const x = int( id ).remainder( int( size ) );
|
|
@@ -44385,18 +44392,16 @@ class LoopNode extends Node {
|
|
|
44385
44392
|
|
|
44386
44393
|
}
|
|
44387
44394
|
|
|
44388
|
-
const
|
|
44395
|
+
const Loop = ( ...params ) => nodeObject( new LoopNode( nodeArray( params, 'int' ) ) ).append();
|
|
44389
44396
|
const Continue = () => expression( 'continue' ).append();
|
|
44390
44397
|
const Break = () => expression( 'break' ).append();
|
|
44391
44398
|
|
|
44392
|
-
addNodeElement( 'loop', ( returns, ...params ) => bypass( returns, loop( ...params ) ) );
|
|
44393
|
-
|
|
44394
44399
|
addNodeClass( 'LoopNode', LoopNode );
|
|
44395
44400
|
|
|
44396
44401
|
const _morphTextures = new WeakMap();
|
|
44397
44402
|
const _morphVec4 = /*@__PURE__*/ new Vector4();
|
|
44398
44403
|
|
|
44399
|
-
const getMorph =
|
|
44404
|
+
const getMorph = Fn( ( { bufferMap, influence, stride, width, depth, offset } ) => {
|
|
44400
44405
|
|
|
44401
44406
|
const texelIndex = int( vertexIndex ).mul( stride ).add( offset );
|
|
44402
44407
|
|
|
@@ -44568,7 +44573,7 @@ class MorphNode extends Node {
|
|
|
44568
44573
|
|
|
44569
44574
|
const width = int( size.width );
|
|
44570
44575
|
|
|
44571
|
-
|
|
44576
|
+
Loop( morphTargetsCount, ( { i } ) => {
|
|
44572
44577
|
|
|
44573
44578
|
const influence = float( 0 ).toVar();
|
|
44574
44579
|
|
|
@@ -44654,13 +44659,13 @@ class LightingNode extends Node {
|
|
|
44654
44659
|
|
|
44655
44660
|
addNodeClass( 'LightingNode', LightingNode );
|
|
44656
44661
|
|
|
44657
|
-
const BasicShadowMap =
|
|
44662
|
+
const BasicShadowMap = Fn( ( { depthTexture, shadowCoord } ) => {
|
|
44658
44663
|
|
|
44659
44664
|
return texture( depthTexture, shadowCoord.xy ).compare( shadowCoord.z );
|
|
44660
44665
|
|
|
44661
44666
|
} );
|
|
44662
44667
|
|
|
44663
|
-
const PCFShadowMap =
|
|
44668
|
+
const PCFShadowMap = Fn( ( { depthTexture, shadowCoord, shadow } ) => {
|
|
44664
44669
|
|
|
44665
44670
|
const depthCompare = ( uv, compare ) => texture( depthTexture, uv ).compare( compare );
|
|
44666
44671
|
|
|
@@ -44699,7 +44704,7 @@ const PCFShadowMap = tslFn( ( { depthTexture, shadowCoord, shadow } ) => {
|
|
|
44699
44704
|
|
|
44700
44705
|
} );
|
|
44701
44706
|
|
|
44702
|
-
const PCFSoftShadowMap =
|
|
44707
|
+
const PCFSoftShadowMap = Fn( ( { depthTexture, shadowCoord, shadow } ) => {
|
|
44703
44708
|
|
|
44704
44709
|
const depthCompare = ( uv, compare ) => texture( depthTexture, uv ).compare( compare );
|
|
44705
44710
|
|
|
@@ -44863,7 +44868,7 @@ class AnalyticLightNode extends LightingNode {
|
|
|
44863
44868
|
}
|
|
44864
44869
|
|
|
44865
44870
|
const shadowColor = texture( shadowMap.texture, shadowCoord );
|
|
44866
|
-
const shadowNode = frustumTest.
|
|
44871
|
+
const shadowNode = frustumTest.select( filterFn( { depthTexture, shadowCoord, shadow } ), float( 1 ) );
|
|
44867
44872
|
|
|
44868
44873
|
this.shadowMap = shadowMap;
|
|
44869
44874
|
|
|
@@ -45649,7 +45654,7 @@ class ClippingNode extends Node {
|
|
|
45649
45654
|
|
|
45650
45655
|
setupAlphaToCoverage( planes, numClippingPlanes, numUnionClippingPlanes ) {
|
|
45651
45656
|
|
|
45652
|
-
return
|
|
45657
|
+
return Fn( () => {
|
|
45653
45658
|
|
|
45654
45659
|
const clippingPlanes = uniformArray( planes );
|
|
45655
45660
|
|
|
@@ -45662,7 +45667,7 @@ class ClippingNode extends Node {
|
|
|
45662
45667
|
|
|
45663
45668
|
let plane;
|
|
45664
45669
|
|
|
45665
|
-
|
|
45670
|
+
Loop( numUnionClippingPlanes, ( { i } ) => {
|
|
45666
45671
|
|
|
45667
45672
|
plane = clippingPlanes.element( i );
|
|
45668
45673
|
|
|
@@ -45681,7 +45686,7 @@ class ClippingNode extends Node {
|
|
|
45681
45686
|
|
|
45682
45687
|
unionClipOpacity.assign( 1 );
|
|
45683
45688
|
|
|
45684
|
-
|
|
45689
|
+
Loop( { start: numUnionClippingPlanes, end: numClippingPlanes }, ( { i } ) => {
|
|
45685
45690
|
|
|
45686
45691
|
plane = clippingPlanes.element( i );
|
|
45687
45692
|
|
|
@@ -45706,13 +45711,13 @@ class ClippingNode extends Node {
|
|
|
45706
45711
|
|
|
45707
45712
|
setupDefault( planes, numClippingPlanes, numUnionClippingPlanes ) {
|
|
45708
45713
|
|
|
45709
|
-
return
|
|
45714
|
+
return Fn( () => {
|
|
45710
45715
|
|
|
45711
45716
|
const clippingPlanes = uniformArray( planes );
|
|
45712
45717
|
|
|
45713
45718
|
let plane;
|
|
45714
45719
|
|
|
45715
|
-
|
|
45720
|
+
Loop( numUnionClippingPlanes, ( { i } ) => {
|
|
45716
45721
|
|
|
45717
45722
|
plane = clippingPlanes.element( i );
|
|
45718
45723
|
positionView.dot( plane.xyz ).greaterThan( plane.w ).discard();
|
|
@@ -45725,7 +45730,7 @@ class ClippingNode extends Node {
|
|
|
45725
45730
|
|
|
45726
45731
|
clipped.assign( true );
|
|
45727
45732
|
|
|
45728
|
-
|
|
45733
|
+
Loop( { start: numUnionClippingPlanes, end: numClippingPlanes }, ( { i } ) => {
|
|
45729
45734
|
|
|
45730
45735
|
plane = clippingPlanes.element( i );
|
|
45731
45736
|
clipped.assign( positionView.dot( plane.xyz ).greaterThan( plane.w ).and( clipped ) );
|
|
@@ -45829,7 +45834,7 @@ class NodeMaterial extends Material {
|
|
|
45829
45834
|
|
|
45830
45835
|
customProgramCacheKey() {
|
|
45831
45836
|
|
|
45832
|
-
return this.type + getCacheKey( this );
|
|
45837
|
+
return this.type + getCacheKey$1( this );
|
|
45833
45838
|
|
|
45834
45839
|
}
|
|
45835
45840
|
|
|
@@ -46813,12 +46818,23 @@ class CondNode extends Node {
|
|
|
46813
46818
|
|
|
46814
46819
|
}
|
|
46815
46820
|
|
|
46816
|
-
const
|
|
46821
|
+
const select = nodeProxy( CondNode );
|
|
46817
46822
|
|
|
46818
|
-
addNodeElement( '
|
|
46823
|
+
addNodeElement( 'select', select );
|
|
46819
46824
|
|
|
46820
46825
|
addNodeClass( 'CondNode', CondNode );
|
|
46821
46826
|
|
|
46827
|
+
//
|
|
46828
|
+
|
|
46829
|
+
const cond = ( ...params ) => { // @deprecated, r168
|
|
46830
|
+
|
|
46831
|
+
console.warn( 'TSL.CondNode: cond() has been renamed to select().' );
|
|
46832
|
+
return select( ...params );
|
|
46833
|
+
|
|
46834
|
+
};
|
|
46835
|
+
|
|
46836
|
+
addNodeElement( 'cond', cond );
|
|
46837
|
+
|
|
46822
46838
|
class StackNode extends Node {
|
|
46823
46839
|
|
|
46824
46840
|
constructor( parent = null ) {
|
|
@@ -46850,19 +46866,19 @@ class StackNode extends Node {
|
|
|
46850
46866
|
|
|
46851
46867
|
}
|
|
46852
46868
|
|
|
46853
|
-
|
|
46869
|
+
If( boolNode, method ) {
|
|
46854
46870
|
|
|
46855
46871
|
const methodNode = new ShaderNode( method );
|
|
46856
|
-
this._currentCond =
|
|
46872
|
+
this._currentCond = select( boolNode, methodNode );
|
|
46857
46873
|
|
|
46858
46874
|
return this.add( this._currentCond );
|
|
46859
46875
|
|
|
46860
46876
|
}
|
|
46861
46877
|
|
|
46862
|
-
|
|
46878
|
+
ElseIf( boolNode, method ) {
|
|
46863
46879
|
|
|
46864
46880
|
const methodNode = new ShaderNode( method );
|
|
46865
|
-
const ifNode =
|
|
46881
|
+
const ifNode = select( boolNode, methodNode );
|
|
46866
46882
|
|
|
46867
46883
|
this._currentCond.elseNode = ifNode;
|
|
46868
46884
|
this._currentCond = ifNode;
|
|
@@ -46871,7 +46887,7 @@ class StackNode extends Node {
|
|
|
46871
46887
|
|
|
46872
46888
|
}
|
|
46873
46889
|
|
|
46874
|
-
|
|
46890
|
+
Else( method ) {
|
|
46875
46891
|
|
|
46876
46892
|
this._currentCond.elseNode = new ShaderNode( method );
|
|
46877
46893
|
|
|
@@ -46897,6 +46913,22 @@ class StackNode extends Node {
|
|
|
46897
46913
|
|
|
46898
46914
|
}
|
|
46899
46915
|
|
|
46916
|
+
//
|
|
46917
|
+
|
|
46918
|
+
else( ...params ) { // @deprecated, r168
|
|
46919
|
+
|
|
46920
|
+
console.warn( 'TSL.StackNode: .else() has been renamed to .Else().' );
|
|
46921
|
+
return this.Else( ...params );
|
|
46922
|
+
|
|
46923
|
+
}
|
|
46924
|
+
|
|
46925
|
+
elseif( ...params ) { // @deprecated, r168
|
|
46926
|
+
|
|
46927
|
+
console.warn( 'TSL.StackNode: .elseif() has been renamed to .ElseIf().' );
|
|
46928
|
+
return this.ElseIf( ...params );
|
|
46929
|
+
|
|
46930
|
+
}
|
|
46931
|
+
|
|
46900
46932
|
}
|
|
46901
46933
|
|
|
46902
46934
|
const stack = nodeProxy( StackNode );
|
|
@@ -47008,7 +47040,7 @@ const cubeUV_minTileSize = float( 16.0 );
|
|
|
47008
47040
|
// a cubemap, the 0-5 integer index of a cube face, and the direction vector for
|
|
47009
47041
|
// sampling a textureCube (not generally normalized ).
|
|
47010
47042
|
|
|
47011
|
-
const getFace =
|
|
47043
|
+
const getFace = Fn( ( [ direction ] ) => {
|
|
47012
47044
|
|
|
47013
47045
|
const absDirection = vec3( abs( direction ) ).toVar();
|
|
47014
47046
|
const face = float( - 1.0 ).toVar();
|
|
@@ -47017,23 +47049,23 @@ const getFace = tslFn( ( [ direction ] ) => {
|
|
|
47017
47049
|
|
|
47018
47050
|
If( absDirection.x.greaterThan( absDirection.y ), () => {
|
|
47019
47051
|
|
|
47020
|
-
face.assign(
|
|
47052
|
+
face.assign( select( direction.x.greaterThan( 0.0 ), 0.0, 3.0 ) );
|
|
47021
47053
|
|
|
47022
|
-
} ).
|
|
47054
|
+
} ).Else( () => {
|
|
47023
47055
|
|
|
47024
|
-
face.assign(
|
|
47056
|
+
face.assign( select( direction.y.greaterThan( 0.0 ), 1.0, 4.0 ) );
|
|
47025
47057
|
|
|
47026
47058
|
} );
|
|
47027
47059
|
|
|
47028
|
-
} ).
|
|
47060
|
+
} ).Else( () => {
|
|
47029
47061
|
|
|
47030
47062
|
If( absDirection.z.greaterThan( absDirection.y ), () => {
|
|
47031
47063
|
|
|
47032
|
-
face.assign(
|
|
47064
|
+
face.assign( select( direction.z.greaterThan( 0.0 ), 2.0, 5.0 ) );
|
|
47033
47065
|
|
|
47034
|
-
} ).
|
|
47066
|
+
} ).Else( () => {
|
|
47035
47067
|
|
|
47036
|
-
face.assign(
|
|
47068
|
+
face.assign( select( direction.y.greaterThan( 0.0 ), 1.0, 4.0 ) );
|
|
47037
47069
|
|
|
47038
47070
|
} );
|
|
47039
47071
|
|
|
@@ -47050,7 +47082,7 @@ const getFace = tslFn( ( [ direction ] ) => {
|
|
|
47050
47082
|
} );
|
|
47051
47083
|
|
|
47052
47084
|
// RH coordinate system; PMREM face-indexing convention
|
|
47053
|
-
const getUV =
|
|
47085
|
+
const getUV = Fn( ( [ direction, face ] ) => {
|
|
47054
47086
|
|
|
47055
47087
|
const uv = vec2().toVar();
|
|
47056
47088
|
|
|
@@ -47058,23 +47090,23 @@ const getUV = tslFn( ( [ direction, face ] ) => {
|
|
|
47058
47090
|
|
|
47059
47091
|
uv.assign( vec2( direction.z, direction.y ).div( abs( direction.x ) ) ); // pos x
|
|
47060
47092
|
|
|
47061
|
-
} ).
|
|
47093
|
+
} ).ElseIf( face.equal( 1.0 ), () => {
|
|
47062
47094
|
|
|
47063
47095
|
uv.assign( vec2( direction.x.negate(), direction.z.negate() ).div( abs( direction.y ) ) ); // pos y
|
|
47064
47096
|
|
|
47065
|
-
} ).
|
|
47097
|
+
} ).ElseIf( face.equal( 2.0 ), () => {
|
|
47066
47098
|
|
|
47067
47099
|
uv.assign( vec2( direction.x.negate(), direction.y ).div( abs( direction.z ) ) ); // pos z
|
|
47068
47100
|
|
|
47069
|
-
} ).
|
|
47101
|
+
} ).ElseIf( face.equal( 3.0 ), () => {
|
|
47070
47102
|
|
|
47071
47103
|
uv.assign( vec2( direction.z.negate(), direction.y ).div( abs( direction.x ) ) ); // neg x
|
|
47072
47104
|
|
|
47073
|
-
} ).
|
|
47105
|
+
} ).ElseIf( face.equal( 4.0 ), () => {
|
|
47074
47106
|
|
|
47075
47107
|
uv.assign( vec2( direction.x.negate(), direction.z ).div( abs( direction.y ) ) ); // neg y
|
|
47076
47108
|
|
|
47077
|
-
} ).
|
|
47109
|
+
} ).Else( () => {
|
|
47078
47110
|
|
|
47079
47111
|
uv.assign( vec2( direction.x, direction.y ).div( abs( direction.z ) ) ); // neg z
|
|
47080
47112
|
|
|
@@ -47091,7 +47123,7 @@ const getUV = tslFn( ( [ direction, face ] ) => {
|
|
|
47091
47123
|
]
|
|
47092
47124
|
} );
|
|
47093
47125
|
|
|
47094
|
-
const roughnessToMip =
|
|
47126
|
+
const roughnessToMip = Fn( ( [ roughness ] ) => {
|
|
47095
47127
|
|
|
47096
47128
|
const mip = float( 0.0 ).toVar();
|
|
47097
47129
|
|
|
@@ -47099,19 +47131,19 @@ const roughnessToMip = tslFn( ( [ roughness ] ) => {
|
|
|
47099
47131
|
|
|
47100
47132
|
mip.assign( cubeUV_r0.sub( roughness ).mul( cubeUV_m1.sub( cubeUV_m0 ) ).div( cubeUV_r0.sub( cubeUV_r1 ) ).add( cubeUV_m0 ) );
|
|
47101
47133
|
|
|
47102
|
-
} ).
|
|
47134
|
+
} ).ElseIf( roughness.greaterThanEqual( cubeUV_r4 ), () => {
|
|
47103
47135
|
|
|
47104
47136
|
mip.assign( cubeUV_r1.sub( roughness ).mul( cubeUV_m4.sub( cubeUV_m1 ) ).div( cubeUV_r1.sub( cubeUV_r4 ) ).add( cubeUV_m1 ) );
|
|
47105
47137
|
|
|
47106
|
-
} ).
|
|
47138
|
+
} ).ElseIf( roughness.greaterThanEqual( cubeUV_r5 ), () => {
|
|
47107
47139
|
|
|
47108
47140
|
mip.assign( cubeUV_r4.sub( roughness ).mul( cubeUV_m5.sub( cubeUV_m4 ) ).div( cubeUV_r4.sub( cubeUV_r5 ) ).add( cubeUV_m4 ) );
|
|
47109
47141
|
|
|
47110
|
-
} ).
|
|
47142
|
+
} ).ElseIf( roughness.greaterThanEqual( cubeUV_r6 ), () => {
|
|
47111
47143
|
|
|
47112
47144
|
mip.assign( cubeUV_r5.sub( roughness ).mul( cubeUV_m6.sub( cubeUV_m5 ) ).div( cubeUV_r5.sub( cubeUV_r6 ) ).add( cubeUV_m5 ) );
|
|
47113
47145
|
|
|
47114
|
-
} ).
|
|
47146
|
+
} ).Else( () => {
|
|
47115
47147
|
|
|
47116
47148
|
mip.assign( float( - 2.0 ).mul( log2( mul( 1.16, roughness ) ) ) ); // 1.16 = 1.79^0.25
|
|
47117
47149
|
|
|
@@ -47128,7 +47160,7 @@ const roughnessToMip = tslFn( ( [ roughness ] ) => {
|
|
|
47128
47160
|
} );
|
|
47129
47161
|
|
|
47130
47162
|
// RH coordinate system; PMREM face-indexing convention
|
|
47131
|
-
const getDirection =
|
|
47163
|
+
const getDirection = Fn( ( [ uv_immutable, face ] ) => {
|
|
47132
47164
|
|
|
47133
47165
|
const uv = uv_immutable.toVar();
|
|
47134
47166
|
uv.assign( mul( 2.0, uv ).sub( 1.0 ) );
|
|
@@ -47138,26 +47170,26 @@ const getDirection = tslFn( ( [ uv_immutable, face ] ) => {
|
|
|
47138
47170
|
|
|
47139
47171
|
direction.assign( direction.zyx ); // ( 1, v, u ) pos x
|
|
47140
47172
|
|
|
47141
|
-
} ).
|
|
47173
|
+
} ).ElseIf( face.equal( 1.0 ), () => {
|
|
47142
47174
|
|
|
47143
47175
|
direction.assign( direction.xzy );
|
|
47144
47176
|
direction.xz.mulAssign( - 1.0 ); // ( -u, 1, -v ) pos y
|
|
47145
47177
|
|
|
47146
|
-
} ).
|
|
47178
|
+
} ).ElseIf( face.equal( 2.0 ), () => {
|
|
47147
47179
|
|
|
47148
47180
|
direction.x.mulAssign( - 1.0 ); // ( -u, v, 1 ) pos z
|
|
47149
47181
|
|
|
47150
|
-
} ).
|
|
47182
|
+
} ).ElseIf( face.equal( 3.0 ), () => {
|
|
47151
47183
|
|
|
47152
47184
|
direction.assign( direction.zyx );
|
|
47153
47185
|
direction.xz.mulAssign( - 1.0 ); // ( -1, v, -u ) neg x
|
|
47154
47186
|
|
|
47155
|
-
} ).
|
|
47187
|
+
} ).ElseIf( face.equal( 4.0 ), () => {
|
|
47156
47188
|
|
|
47157
47189
|
direction.assign( direction.xzy );
|
|
47158
47190
|
direction.xy.mulAssign( - 1.0 ); // ( -u, -1, v ) neg y
|
|
47159
47191
|
|
|
47160
|
-
} ).
|
|
47192
|
+
} ).ElseIf( face.equal( 5.0 ), () => {
|
|
47161
47193
|
|
|
47162
47194
|
direction.z.mulAssign( - 1.0 ); // ( u, v, -1 ) neg zS
|
|
47163
47195
|
|
|
@@ -47176,7 +47208,7 @@ const getDirection = tslFn( ( [ uv_immutable, face ] ) => {
|
|
|
47176
47208
|
|
|
47177
47209
|
//
|
|
47178
47210
|
|
|
47179
|
-
const textureCubeUV =
|
|
47211
|
+
const textureCubeUV = Fn( ( [ envMap, sampleDir_immutable, roughness_immutable, CUBEUV_TEXEL_WIDTH, CUBEUV_TEXEL_HEIGHT, CUBEUV_MAX_MIP ] ) => {
|
|
47180
47212
|
|
|
47181
47213
|
const roughness = float( roughness_immutable );
|
|
47182
47214
|
const sampleDir = vec3( sampleDir_immutable );
|
|
@@ -47198,7 +47230,7 @@ const textureCubeUV = tslFn( ( [ envMap, sampleDir_immutable, roughness_immutabl
|
|
|
47198
47230
|
|
|
47199
47231
|
} );
|
|
47200
47232
|
|
|
47201
|
-
const bilinearCubeUV =
|
|
47233
|
+
const bilinearCubeUV = Fn( ( [ envMap, direction_immutable, mipInt_immutable, CUBEUV_TEXEL_WIDTH, CUBEUV_TEXEL_HEIGHT, CUBEUV_MAX_MIP ] ) => {
|
|
47202
47234
|
|
|
47203
47235
|
const mipInt = float( mipInt_immutable ).toVar();
|
|
47204
47236
|
const direction = vec3( direction_immutable );
|
|
@@ -47225,7 +47257,7 @@ const bilinearCubeUV = tslFn( ( [ envMap, direction_immutable, mipInt_immutable,
|
|
|
47225
47257
|
|
|
47226
47258
|
} );
|
|
47227
47259
|
|
|
47228
|
-
const getSample =
|
|
47260
|
+
const getSample = Fn( ( { envMap, mipInt, outputDirection, theta, axis, CUBEUV_TEXEL_WIDTH, CUBEUV_TEXEL_HEIGHT, CUBEUV_MAX_MIP } ) => {
|
|
47229
47261
|
|
|
47230
47262
|
const cosTheta = cos( theta );
|
|
47231
47263
|
|
|
@@ -47238,9 +47270,9 @@ const getSample = tslFn( ( { envMap, mipInt, outputDirection, theta, axis, CUBEU
|
|
|
47238
47270
|
|
|
47239
47271
|
} );
|
|
47240
47272
|
|
|
47241
|
-
const blur =
|
|
47273
|
+
const blur = Fn( ( { n, latitudinal, poleAxis, outputDirection, weights, samples, dTheta, mipInt, envMap, CUBEUV_TEXEL_WIDTH, CUBEUV_TEXEL_HEIGHT, CUBEUV_MAX_MIP } ) => {
|
|
47242
47274
|
|
|
47243
|
-
const axis = vec3(
|
|
47275
|
+
const axis = vec3( select( latitudinal, poleAxis, cross( poleAxis, outputDirection ) ) ).toVar();
|
|
47244
47276
|
|
|
47245
47277
|
If( all( axis.equals( vec3( 0.0 ) ) ), () => {
|
|
47246
47278
|
|
|
@@ -47253,7 +47285,7 @@ const blur = tslFn( ( { n, latitudinal, poleAxis, outputDirection, weights, samp
|
|
|
47253
47285
|
const gl_FragColor = vec3().toVar();
|
|
47254
47286
|
gl_FragColor.addAssign( weights.element( int( 0 ) ).mul( getSample( { theta: 0.0, axis, outputDirection, mipInt, envMap, CUBEUV_TEXEL_WIDTH, CUBEUV_TEXEL_HEIGHT, CUBEUV_MAX_MIP } ) ) );
|
|
47255
47287
|
|
|
47256
|
-
|
|
47288
|
+
Loop( { start: int( 1 ), end: n }, ( { i } ) => {
|
|
47257
47289
|
|
|
47258
47290
|
If( i.greaterThanEqual( samples ), () => {
|
|
47259
47291
|
|
|
@@ -49779,26 +49811,26 @@ addNodeElement( 'sinc', sinc );
|
|
|
49779
49811
|
// https://github.com/cabbibo/glsl-tri-noise-3d
|
|
49780
49812
|
|
|
49781
49813
|
|
|
49782
|
-
const tri =
|
|
49814
|
+
const tri = Fn( ( [ x ] ) => {
|
|
49783
49815
|
|
|
49784
49816
|
return x.fract().sub( .5 ).abs();
|
|
49785
49817
|
|
|
49786
49818
|
} );
|
|
49787
49819
|
|
|
49788
|
-
const tri3 =
|
|
49820
|
+
const tri3 = Fn( ( [ p ] ) => {
|
|
49789
49821
|
|
|
49790
49822
|
return vec3( tri( p.z.add( tri( p.y.mul( 1. ) ) ) ), tri( p.z.add( tri( p.x.mul( 1. ) ) ) ), tri( p.y.add( tri( p.x.mul( 1. ) ) ) ) );
|
|
49791
49823
|
|
|
49792
49824
|
} );
|
|
49793
49825
|
|
|
49794
|
-
const triNoise3D =
|
|
49826
|
+
const triNoise3D = Fn( ( [ p_immutable, spd, time ] ) => {
|
|
49795
49827
|
|
|
49796
49828
|
const p = vec3( p_immutable ).toVar();
|
|
49797
49829
|
const z = float( 1.4 ).toVar();
|
|
49798
49830
|
const rz = float( 0.0 ).toVar();
|
|
49799
49831
|
const bp = vec3( p ).toVar();
|
|
49800
49832
|
|
|
49801
|
-
|
|
49833
|
+
Loop( { start: float( 0.0 ), end: float( 3.0 ), type: 'float', condition: '<=' }, () => {
|
|
49802
49834
|
|
|
49803
49835
|
const dg = vec3( tri3( bp.mul( 2.0 ) ) ).toVar();
|
|
49804
49836
|
p.addAssign( dg.add( time.mul( float( 0.1 ).mul( spd ) ) ) );
|
|
@@ -50234,13 +50266,13 @@ addNodeElement( 'remapClamp', remapClamp );
|
|
|
50234
50266
|
|
|
50235
50267
|
addNodeClass( 'RemapNode', RemapNode );
|
|
50236
50268
|
|
|
50237
|
-
const rotateUV =
|
|
50269
|
+
const rotateUV = Fn( ( [ uv, rotation, center = vec2( 0.5 ) ] ) => {
|
|
50238
50270
|
|
|
50239
50271
|
return uv.sub( center ).rotate( rotation ).add( center );
|
|
50240
50272
|
|
|
50241
50273
|
} );
|
|
50242
50274
|
|
|
50243
|
-
const spherizeUV =
|
|
50275
|
+
const spherizeUV = Fn( ( [ uv, strength, center = vec2( 0.5 ) ] ) => {
|
|
50244
50276
|
|
|
50245
50277
|
const delta = uv.sub( center );
|
|
50246
50278
|
const delta2 = delta.dot( delta );
|
|
@@ -50254,7 +50286,7 @@ const spherizeUV = tslFn( ( [ uv, strength, center = vec2( 0.5 ) ] ) => {
|
|
|
50254
50286
|
addNodeElement( 'rotateUV', rotateUV );
|
|
50255
50287
|
addNodeElement( 'spherizeUV', spherizeUV );
|
|
50256
50288
|
|
|
50257
|
-
const billboarding =
|
|
50289
|
+
const billboarding = Fn( ( { position = null, horizontal = true, vertical = false } ) => {
|
|
50258
50290
|
|
|
50259
50291
|
let worldMatrix;
|
|
50260
50292
|
|
|
@@ -50297,11 +50329,11 @@ const billboarding = tslFn( ( { position = null, horizontal = true, vertical = f
|
|
|
50297
50329
|
|
|
50298
50330
|
} );
|
|
50299
50331
|
|
|
50300
|
-
const viewportSafeUV =
|
|
50332
|
+
const viewportSafeUV = Fn( ( [ uv = null ] ) => {
|
|
50301
50333
|
|
|
50302
50334
|
const depth = linearDepth();
|
|
50303
50335
|
const depthDiff = linearDepth( viewportDepthTexture( uv ) ).sub( depth );
|
|
50304
|
-
const finalUV = depthDiff.lessThan( 0 ).
|
|
50336
|
+
const finalUV = depthDiff.lessThan( 0 ).select( viewportTopLeft, uv );
|
|
50305
50337
|
|
|
50306
50338
|
return finalUV;
|
|
50307
50339
|
|
|
@@ -51483,7 +51515,8 @@ const GPUFeatureName = {
|
|
|
51483
51515
|
BGRA8UNormStorage: 'bgra8unorm-storage',
|
|
51484
51516
|
Float32Filterable: 'float32-filterable',
|
|
51485
51517
|
ClipDistances: 'clip-distances',
|
|
51486
|
-
DualSourceBlending: 'dual-source-blending'
|
|
51518
|
+
DualSourceBlending: 'dual-source-blending',
|
|
51519
|
+
Subgroups: 'subgroups'
|
|
51487
51520
|
};
|
|
51488
51521
|
|
|
51489
51522
|
class StorageBufferNode extends BufferNode {
|
|
@@ -51705,7 +51738,7 @@ const textureStore = ( value, uvNode, storeNode ) => {
|
|
|
51705
51738
|
|
|
51706
51739
|
addNodeClass( 'StorageTextureNode', StorageTextureNode );
|
|
51707
51740
|
|
|
51708
|
-
const normal =
|
|
51741
|
+
const normal = Fn( ( { texture, uv } ) => {
|
|
51709
51742
|
|
|
51710
51743
|
const epsilon = 0.0001;
|
|
51711
51744
|
|
|
@@ -51715,27 +51748,27 @@ const normal = tslFn( ( { texture, uv } ) => {
|
|
|
51715
51748
|
|
|
51716
51749
|
ret.assign( vec3( 1, 0, 0 ) );
|
|
51717
51750
|
|
|
51718
|
-
} ).
|
|
51751
|
+
} ).ElseIf( uv.y.lessThan( epsilon ), () => {
|
|
51719
51752
|
|
|
51720
51753
|
ret.assign( vec3( 0, 1, 0 ) );
|
|
51721
51754
|
|
|
51722
|
-
} ).
|
|
51755
|
+
} ).ElseIf( uv.z.lessThan( epsilon ), () => {
|
|
51723
51756
|
|
|
51724
51757
|
ret.assign( vec3( 0, 0, 1 ) );
|
|
51725
51758
|
|
|
51726
|
-
} ).
|
|
51759
|
+
} ).ElseIf( uv.x.greaterThan( 1 - epsilon ), () => {
|
|
51727
51760
|
|
|
51728
51761
|
ret.assign( vec3( - 1, 0, 0 ) );
|
|
51729
51762
|
|
|
51730
|
-
} ).
|
|
51763
|
+
} ).ElseIf( uv.y.greaterThan( 1 - epsilon ), () => {
|
|
51731
51764
|
|
|
51732
51765
|
ret.assign( vec3( 0, - 1, 0 ) );
|
|
51733
51766
|
|
|
51734
|
-
} ).
|
|
51767
|
+
} ).ElseIf( uv.z.greaterThan( 1 - epsilon ), () => {
|
|
51735
51768
|
|
|
51736
51769
|
ret.assign( vec3( 0, 0, - 1 ) );
|
|
51737
51770
|
|
|
51738
|
-
} ).
|
|
51771
|
+
} ).Else( () => {
|
|
51739
51772
|
|
|
51740
51773
|
const step = 0.01;
|
|
51741
51774
|
|
|
@@ -51824,9 +51857,9 @@ const userData = ( name, inputType, userData ) => nodeObject( new UserDataNode(
|
|
|
51824
51857
|
|
|
51825
51858
|
addNodeClass( 'UserDataNode', UserDataNode );
|
|
51826
51859
|
|
|
51827
|
-
const BurnNode =
|
|
51860
|
+
const BurnNode = Fn( ( { base, blend } ) => {
|
|
51828
51861
|
|
|
51829
|
-
const fn = ( c ) => blend[ c ].lessThan( EPSILON ).
|
|
51862
|
+
const fn = ( c ) => blend[ c ].lessThan( EPSILON ).select( blend[ c ], base[ c ].oneMinus().div( blend[ c ] ).oneMinus().max( 0 ) );
|
|
51830
51863
|
|
|
51831
51864
|
return vec3( fn( 'x' ), fn( 'y' ), fn( 'z' ) );
|
|
51832
51865
|
|
|
@@ -51839,9 +51872,9 @@ const BurnNode = tslFn( ( { base, blend } ) => {
|
|
|
51839
51872
|
]
|
|
51840
51873
|
} );
|
|
51841
51874
|
|
|
51842
|
-
const DodgeNode =
|
|
51875
|
+
const DodgeNode = Fn( ( { base, blend } ) => {
|
|
51843
51876
|
|
|
51844
|
-
const fn = ( c ) => blend[ c ].equal( 1.0 ).
|
|
51877
|
+
const fn = ( c ) => blend[ c ].equal( 1.0 ).select( blend[ c ], base[ c ].div( blend[ c ].oneMinus() ).max( 0 ) );
|
|
51845
51878
|
|
|
51846
51879
|
return vec3( fn( 'x' ), fn( 'y' ), fn( 'z' ) );
|
|
51847
51880
|
|
|
@@ -51854,7 +51887,7 @@ const DodgeNode = tslFn( ( { base, blend } ) => {
|
|
|
51854
51887
|
]
|
|
51855
51888
|
} );
|
|
51856
51889
|
|
|
51857
|
-
const ScreenNode =
|
|
51890
|
+
const ScreenNode = Fn( ( { base, blend } ) => {
|
|
51858
51891
|
|
|
51859
51892
|
const fn = ( c ) => base[ c ].oneMinus().mul( blend[ c ].oneMinus() ).oneMinus();
|
|
51860
51893
|
|
|
@@ -51869,9 +51902,9 @@ const ScreenNode = tslFn( ( { base, blend } ) => {
|
|
|
51869
51902
|
]
|
|
51870
51903
|
} );
|
|
51871
51904
|
|
|
51872
|
-
const OverlayNode =
|
|
51905
|
+
const OverlayNode = Fn( ( { base, blend } ) => {
|
|
51873
51906
|
|
|
51874
|
-
const fn = ( c ) => base[ c ].lessThan( 0.5 ).
|
|
51907
|
+
const fn = ( c ) => base[ c ].lessThan( 0.5 ).select( base[ c ].mul( blend[ c ], 2.0 ), base[ c ].oneMinus().mul( blend[ c ].oneMinus() ).oneMinus() );
|
|
51875
51908
|
//const fn = ( c ) => mix( base[ c ].oneMinus().mul( blend[ c ].oneMinus() ).oneMinus(), base[ c ].mul( blend[ c ], 2.0 ), step( base[ c ], 0.5 ) );
|
|
51876
51909
|
|
|
51877
51910
|
return vec3( fn( 'x' ), fn( 'y' ), fn( 'z' ) );
|
|
@@ -51949,7 +51982,7 @@ addNodeClass( 'BlendModeNode', BlendModeNode );
|
|
|
51949
51982
|
// Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen
|
|
51950
51983
|
// https://mmikk.github.io/papers3d/mm_sfgrad_bump.pdf
|
|
51951
51984
|
|
|
51952
|
-
const dHdxy_fwd =
|
|
51985
|
+
const dHdxy_fwd = Fn( ( { textureNode, bumpScale } ) => {
|
|
51953
51986
|
|
|
51954
51987
|
// It's used to preserve the same TextureNode instance
|
|
51955
51988
|
const sampleTexture = ( callback ) => textureNode.cache().context( { getUV: ( texNode ) => callback( texNode.uvNode || uv() ), forceUVContext: true } );
|
|
@@ -51965,7 +51998,7 @@ const dHdxy_fwd = tslFn( ( { textureNode, bumpScale } ) => {
|
|
|
51965
51998
|
|
|
51966
51999
|
// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)
|
|
51967
52000
|
|
|
51968
|
-
const perturbNormalArb =
|
|
52001
|
+
const perturbNormalArb = Fn( ( inputs ) => {
|
|
51969
52002
|
|
|
51970
52003
|
const { surf_pos, surf_norm, dHdxy } = inputs;
|
|
51971
52004
|
|
|
@@ -52017,13 +52050,13 @@ addNodeElement( 'bumpMap', bumpMap );
|
|
|
52017
52050
|
|
|
52018
52051
|
addNodeClass( 'BumpMapNode', BumpMapNode );
|
|
52019
52052
|
|
|
52020
|
-
const saturationNode =
|
|
52053
|
+
const saturationNode = Fn( ( { color, adjustment } ) => {
|
|
52021
52054
|
|
|
52022
52055
|
return adjustment.mix( luminance( color.rgb ), color.rgb );
|
|
52023
52056
|
|
|
52024
52057
|
} );
|
|
52025
52058
|
|
|
52026
|
-
const vibranceNode =
|
|
52059
|
+
const vibranceNode = Fn( ( { color, adjustment } ) => {
|
|
52027
52060
|
|
|
52028
52061
|
const average = add( color.r, color.g, color.b ).div( 3.0 );
|
|
52029
52062
|
|
|
@@ -52034,7 +52067,7 @@ const vibranceNode = tslFn( ( { color, adjustment } ) => {
|
|
|
52034
52067
|
|
|
52035
52068
|
} );
|
|
52036
52069
|
|
|
52037
|
-
const hueNode =
|
|
52070
|
+
const hueNode = Fn( ( { color, adjustment } ) => {
|
|
52038
52071
|
|
|
52039
52072
|
const k = vec3( 0.57735, 0.57735, 0.57735 );
|
|
52040
52073
|
|
|
@@ -52115,7 +52148,7 @@ addNodeClass( 'ColorAdjustmentNode', ColorAdjustmentNode );
|
|
|
52115
52148
|
// Normal Mapping Without Precomputed Tangents
|
|
52116
52149
|
// http://www.thetenthplanet.de/archives/1180
|
|
52117
52150
|
|
|
52118
|
-
const perturbNormal2Arb =
|
|
52151
|
+
const perturbNormal2Arb = Fn( ( inputs ) => {
|
|
52119
52152
|
|
|
52120
52153
|
const { eye_pos, surf_norm, mapN, uv } = inputs;
|
|
52121
52154
|
|
|
@@ -52231,14 +52264,14 @@ addNodeElement( 'posterize', posterize );
|
|
|
52231
52264
|
addNodeClass( 'PosterizeNode', PosterizeNode );
|
|
52232
52265
|
|
|
52233
52266
|
// exposure only
|
|
52234
|
-
const LinearToneMappingNode =
|
|
52267
|
+
const LinearToneMappingNode = Fn( ( { color, exposure } ) => {
|
|
52235
52268
|
|
|
52236
52269
|
return color.mul( exposure ).clamp();
|
|
52237
52270
|
|
|
52238
52271
|
} );
|
|
52239
52272
|
|
|
52240
52273
|
// source: https://www.cs.utah.edu/docs/techreports/2002/pdf/UUCS-02-001.pdf
|
|
52241
|
-
const ReinhardToneMappingNode =
|
|
52274
|
+
const ReinhardToneMappingNode = Fn( ( { color, exposure } ) => {
|
|
52242
52275
|
|
|
52243
52276
|
color = color.mul( exposure );
|
|
52244
52277
|
|
|
@@ -52247,7 +52280,7 @@ const ReinhardToneMappingNode = tslFn( ( { color, exposure } ) => {
|
|
|
52247
52280
|
} );
|
|
52248
52281
|
|
|
52249
52282
|
// source: http://filmicworlds.com/blog/filmic-tonemapping-operators/
|
|
52250
|
-
const OptimizedCineonToneMappingNode =
|
|
52283
|
+
const OptimizedCineonToneMappingNode = Fn( ( { color, exposure } ) => {
|
|
52251
52284
|
|
|
52252
52285
|
// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson
|
|
52253
52286
|
color = color.mul( exposure );
|
|
@@ -52261,7 +52294,7 @@ const OptimizedCineonToneMappingNode = tslFn( ( { color, exposure } ) => {
|
|
|
52261
52294
|
} );
|
|
52262
52295
|
|
|
52263
52296
|
// source: https://github.com/selfshadow/ltc_code/blob/master/webgl/shaders/ltc/ltc_blit.fs
|
|
52264
|
-
const RRTAndODTFit =
|
|
52297
|
+
const RRTAndODTFit = Fn( ( { color } ) => {
|
|
52265
52298
|
|
|
52266
52299
|
const a = color.mul( color.add( 0.0245786 ) ).sub( 0.000090537 );
|
|
52267
52300
|
const b = color.mul( color.add( 0.4329510 ).mul( 0.983729 ) ).add( 0.238081 );
|
|
@@ -52271,7 +52304,7 @@ const RRTAndODTFit = tslFn( ( { color } ) => {
|
|
|
52271
52304
|
} );
|
|
52272
52305
|
|
|
52273
52306
|
// source: https://github.com/selfshadow/ltc_code/blob/master/webgl/shaders/ltc/ltc_blit.fs
|
|
52274
|
-
const ACESFilmicToneMappingNode =
|
|
52307
|
+
const ACESFilmicToneMappingNode = Fn( ( { color, exposure } ) => {
|
|
52275
52308
|
|
|
52276
52309
|
// sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT
|
|
52277
52310
|
const ACESInputMat = mat3(
|
|
@@ -52306,7 +52339,7 @@ const ACESFilmicToneMappingNode = tslFn( ( { color, exposure } ) => {
|
|
|
52306
52339
|
const LINEAR_REC2020_TO_LINEAR_SRGB = mat3( vec3( 1.6605, - 0.1246, - 0.0182 ), vec3( - 0.5876, 1.1329, - 0.1006 ), vec3( - 0.0728, - 0.0083, 1.1187 ) );
|
|
52307
52340
|
const LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( vec3( 0.6274, 0.0691, 0.0164 ), vec3( 0.3293, 0.9195, 0.0880 ), vec3( 0.0433, 0.0113, 0.8956 ) );
|
|
52308
52341
|
|
|
52309
|
-
const agxDefaultContrastApprox =
|
|
52342
|
+
const agxDefaultContrastApprox = Fn( ( [ x_immutable ] ) => {
|
|
52310
52343
|
|
|
52311
52344
|
const x = vec3( x_immutable ).toVar();
|
|
52312
52345
|
const x2 = vec3( x.mul( x ) ).toVar();
|
|
@@ -52316,7 +52349,7 @@ const agxDefaultContrastApprox = tslFn( ( [ x_immutable ] ) => {
|
|
|
52316
52349
|
|
|
52317
52350
|
} );
|
|
52318
52351
|
|
|
52319
|
-
const AGXToneMappingNode =
|
|
52352
|
+
const AGXToneMappingNode = Fn( ( { color, exposure } ) => {
|
|
52320
52353
|
|
|
52321
52354
|
const colortone = vec3( color ).toVar();
|
|
52322
52355
|
const AgXInsetMatrix = mat3( vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) );
|
|
@@ -52342,7 +52375,7 @@ const AGXToneMappingNode = tslFn( ( { color, exposure } ) => {
|
|
|
52342
52375
|
|
|
52343
52376
|
// https://modelviewer.dev/examples/tone-mapping
|
|
52344
52377
|
|
|
52345
|
-
const NeutralToneMappingNode =
|
|
52378
|
+
const NeutralToneMappingNode = Fn( ( { color, exposure } ) => {
|
|
52346
52379
|
|
|
52347
52380
|
const StartCompression = float( 0.8 - 0.04 );
|
|
52348
52381
|
const Desaturation = float( 0.15 );
|
|
@@ -52350,7 +52383,7 @@ const NeutralToneMappingNode = tslFn( ( { color, exposure } ) => {
|
|
|
52350
52383
|
color = color.mul( exposure );
|
|
52351
52384
|
|
|
52352
52385
|
const x = min$1( color.r, min$1( color.g, color.b ) );
|
|
52353
|
-
const offset =
|
|
52386
|
+
const offset = select( x.lessThan( 0.08 ), x.sub( mul( 6.25, x.mul( x ) ) ), 0.04 );
|
|
52354
52387
|
|
|
52355
52388
|
color.subAssign( offset );
|
|
52356
52389
|
|
|
@@ -52416,14 +52449,14 @@ class ToneMappingNode extends TempNode {
|
|
|
52416
52449
|
|
|
52417
52450
|
if ( toneMapping === NoToneMapping ) return colorNode;
|
|
52418
52451
|
|
|
52419
|
-
const toneMappingParams = { exposure: this.exposureNode, color: colorNode };
|
|
52452
|
+
const toneMappingParams = { exposure: this.exposureNode, color: colorNode.rgb };
|
|
52420
52453
|
const toneMappingNode = toneMappingLib[ toneMapping ];
|
|
52421
52454
|
|
|
52422
52455
|
let outputNode = null;
|
|
52423
52456
|
|
|
52424
52457
|
if ( toneMappingNode ) {
|
|
52425
52458
|
|
|
52426
|
-
outputNode = toneMappingNode( toneMappingParams );
|
|
52459
|
+
outputNode = vec4( toneMappingNode( toneMappingParams ), colorNode.a );
|
|
52427
52460
|
|
|
52428
52461
|
} else {
|
|
52429
52462
|
|
|
@@ -52508,17 +52541,24 @@ class PassTextureNode extends TextureNode {
|
|
|
52508
52541
|
|
|
52509
52542
|
class PassMultipleTextureNode extends PassTextureNode {
|
|
52510
52543
|
|
|
52511
|
-
constructor( passNode, textureName ) {
|
|
52544
|
+
constructor( passNode, textureName, previousTexture = false ) {
|
|
52512
52545
|
|
|
52513
52546
|
super( passNode, null );
|
|
52514
52547
|
|
|
52515
52548
|
this.textureName = textureName;
|
|
52549
|
+
this.previousTexture = previousTexture;
|
|
52550
|
+
|
|
52551
|
+
}
|
|
52552
|
+
|
|
52553
|
+
updateTexture() {
|
|
52554
|
+
|
|
52555
|
+
this.value = this.previousTexture ? this.passNode.getPreviousTexture( this.textureName ) : this.passNode.getTexture( this.textureName );
|
|
52516
52556
|
|
|
52517
52557
|
}
|
|
52518
52558
|
|
|
52519
52559
|
setup( builder ) {
|
|
52520
52560
|
|
|
52521
|
-
this.
|
|
52561
|
+
this.updateTexture();
|
|
52522
52562
|
|
|
52523
52563
|
return super.setup( builder );
|
|
52524
52564
|
|
|
@@ -52526,7 +52566,7 @@ class PassMultipleTextureNode extends PassTextureNode {
|
|
|
52526
52566
|
|
|
52527
52567
|
clone() {
|
|
52528
52568
|
|
|
52529
|
-
return new this.constructor( this.passNode, this.textureName );
|
|
52569
|
+
return new this.constructor( this.passNode, this.textureName, this.previousTexture );
|
|
52530
52570
|
|
|
52531
52571
|
}
|
|
52532
52572
|
|
|
@@ -52569,6 +52609,9 @@ class PassNode extends TempNode {
|
|
|
52569
52609
|
this._linearDepthNodes = {};
|
|
52570
52610
|
this._viewZNodes = {};
|
|
52571
52611
|
|
|
52612
|
+
this._previousTextures = {};
|
|
52613
|
+
this._previousTextureNodes = {};
|
|
52614
|
+
|
|
52572
52615
|
this._cameraNear = uniform( 0 );
|
|
52573
52616
|
this._cameraFar = uniform( 0 );
|
|
52574
52617
|
|
|
@@ -52620,6 +52663,44 @@ class PassNode extends TempNode {
|
|
|
52620
52663
|
|
|
52621
52664
|
}
|
|
52622
52665
|
|
|
52666
|
+
getPreviousTexture( name ) {
|
|
52667
|
+
|
|
52668
|
+
let texture = this._previousTextures[ name ];
|
|
52669
|
+
|
|
52670
|
+
if ( texture === undefined ) {
|
|
52671
|
+
|
|
52672
|
+
texture = this.getTexture( name ).clone();
|
|
52673
|
+
texture.isRenderTargetTexture = true;
|
|
52674
|
+
|
|
52675
|
+
this._previousTextures[ name ] = texture;
|
|
52676
|
+
|
|
52677
|
+
}
|
|
52678
|
+
|
|
52679
|
+
return texture;
|
|
52680
|
+
|
|
52681
|
+
}
|
|
52682
|
+
|
|
52683
|
+
toggleTexture( name ) {
|
|
52684
|
+
|
|
52685
|
+
const prevTexture = this._previousTextures[ name ];
|
|
52686
|
+
|
|
52687
|
+
if ( prevTexture !== undefined ) {
|
|
52688
|
+
|
|
52689
|
+
const texture = this._textures[ name ];
|
|
52690
|
+
|
|
52691
|
+
const index = this.renderTarget.textures.indexOf( texture );
|
|
52692
|
+
this.renderTarget.textures[ index ] = prevTexture;
|
|
52693
|
+
|
|
52694
|
+
this._textures[ name ] = prevTexture;
|
|
52695
|
+
this._previousTextures[ name ] = texture;
|
|
52696
|
+
|
|
52697
|
+
this._textureNodes[ name ].updateTexture();
|
|
52698
|
+
this._previousTextureNodes[ name ].updateTexture();
|
|
52699
|
+
|
|
52700
|
+
}
|
|
52701
|
+
|
|
52702
|
+
}
|
|
52703
|
+
|
|
52623
52704
|
getTextureNode( name = 'output' ) {
|
|
52624
52705
|
|
|
52625
52706
|
let textureNode = this._textureNodes[ name ];
|
|
@@ -52634,6 +52715,20 @@ class PassNode extends TempNode {
|
|
|
52634
52715
|
|
|
52635
52716
|
}
|
|
52636
52717
|
|
|
52718
|
+
getPreviousTextureNode( name = 'output' ) {
|
|
52719
|
+
|
|
52720
|
+
let textureNode = this._previousTextureNodes[ name ];
|
|
52721
|
+
|
|
52722
|
+
if ( textureNode === undefined ) {
|
|
52723
|
+
|
|
52724
|
+
this._previousTextureNodes[ name ] = textureNode = nodeObject( new PassMultipleTextureNode( this, name, true ) );
|
|
52725
|
+
|
|
52726
|
+
}
|
|
52727
|
+
|
|
52728
|
+
return textureNode;
|
|
52729
|
+
|
|
52730
|
+
}
|
|
52731
|
+
|
|
52637
52732
|
getViewZNode( name = 'depth' ) {
|
|
52638
52733
|
|
|
52639
52734
|
let viewZNode = this._viewZNodes[ name ];
|
|
@@ -52705,6 +52800,12 @@ class PassNode extends TempNode {
|
|
|
52705
52800
|
this._cameraNear.value = camera.near;
|
|
52706
52801
|
this._cameraFar.value = camera.far;
|
|
52707
52802
|
|
|
52803
|
+
for ( const name in this._previousTextures ) {
|
|
52804
|
+
|
|
52805
|
+
this.toggleTexture( name );
|
|
52806
|
+
|
|
52807
|
+
}
|
|
52808
|
+
|
|
52708
52809
|
renderer.setRenderTarget( this.renderTarget );
|
|
52709
52810
|
renderer.setMRT( this._mrt );
|
|
52710
52811
|
|
|
@@ -52872,7 +52973,7 @@ class GaussianBlurNode extends TempNode {
|
|
|
52872
52973
|
|
|
52873
52974
|
const sampleTexture = ( uv ) => textureNode.uv( uv );
|
|
52874
52975
|
|
|
52875
|
-
const blur =
|
|
52976
|
+
const blur = Fn( () => {
|
|
52876
52977
|
|
|
52877
52978
|
const kernelSize = 3 + ( 2 * this.sigma );
|
|
52878
52979
|
const gaussianCoefficients = this._getCoefficients( kernelSize );
|
|
@@ -53033,7 +53134,7 @@ class AfterImageNode extends TempNode {
|
|
|
53033
53134
|
|
|
53034
53135
|
const sampleTexture = ( uv ) => textureNode.uv( uv );
|
|
53035
53136
|
|
|
53036
|
-
const when_gt =
|
|
53137
|
+
const when_gt = Fn( ( [ x_immutable, y_immutable ] ) => {
|
|
53037
53138
|
|
|
53038
53139
|
const y = float( y_immutable ).toVar();
|
|
53039
53140
|
const x = vec4( x_immutable ).toVar();
|
|
@@ -53042,7 +53143,7 @@ class AfterImageNode extends TempNode {
|
|
|
53042
53143
|
|
|
53043
53144
|
} );
|
|
53044
53145
|
|
|
53045
|
-
const afterImg =
|
|
53146
|
+
const afterImg = Fn( () => {
|
|
53046
53147
|
|
|
53047
53148
|
const texelOld = vec4( textureNodeOld );
|
|
53048
53149
|
const texelNew = vec4( sampleTexture( uvNode ) );
|
|
@@ -53162,14 +53263,14 @@ class AnamorphicNode extends TempNode {
|
|
|
53162
53263
|
|
|
53163
53264
|
const sampleTexture = ( uv ) => textureNode.uv( uv );
|
|
53164
53265
|
|
|
53165
|
-
const anamorph =
|
|
53266
|
+
const anamorph = Fn( () => {
|
|
53166
53267
|
|
|
53167
53268
|
const samples = this.samples;
|
|
53168
53269
|
const halfSamples = Math.floor( samples / 2 );
|
|
53169
53270
|
|
|
53170
53271
|
const total = vec3( 0 ).toVar();
|
|
53171
53272
|
|
|
53172
|
-
|
|
53273
|
+
Loop( { start: - halfSamples, end: halfSamples }, ( { i } ) => {
|
|
53173
53274
|
|
|
53174
53275
|
const softness = float( i ).abs().div( halfSamples ).oneMinus();
|
|
53175
53276
|
|
|
@@ -53243,7 +53344,7 @@ class SobelOperatorNode extends TempNode {
|
|
|
53243
53344
|
|
|
53244
53345
|
const sampleTexture = ( uv ) => textureNode.uv( uv );
|
|
53245
53346
|
|
|
53246
|
-
const sobel =
|
|
53347
|
+
const sobel = Fn( () => {
|
|
53247
53348
|
|
|
53248
53349
|
// Sobel Edge Detection (see https://youtu.be/uihBwtPIBxM)
|
|
53249
53350
|
|
|
@@ -53357,7 +53458,7 @@ class DepthOfFieldNode extends TempNode {
|
|
|
53357
53458
|
|
|
53358
53459
|
const sampleTexture = ( uv ) => textureNode.uv( uv );
|
|
53359
53460
|
|
|
53360
|
-
const dof =
|
|
53461
|
+
const dof = Fn( () => {
|
|
53361
53462
|
|
|
53362
53463
|
const aspectcorrect = vec2( 1.0, this._aspect );
|
|
53363
53464
|
|
|
@@ -53463,7 +53564,7 @@ class DotScreenNode extends TempNode {
|
|
|
53463
53564
|
|
|
53464
53565
|
const inputNode = this.inputNode;
|
|
53465
53566
|
|
|
53466
|
-
const pattern =
|
|
53567
|
+
const pattern = Fn( () => {
|
|
53467
53568
|
|
|
53468
53569
|
const s = sin( this.angle );
|
|
53469
53570
|
const c = cos( this.angle );
|
|
@@ -53475,7 +53576,7 @@ class DotScreenNode extends TempNode {
|
|
|
53475
53576
|
|
|
53476
53577
|
} );
|
|
53477
53578
|
|
|
53478
|
-
const dotScreen =
|
|
53579
|
+
const dotScreen = Fn( () => {
|
|
53479
53580
|
|
|
53480
53581
|
const color = inputNode;
|
|
53481
53582
|
|
|
@@ -53517,7 +53618,7 @@ class RGBShiftNode extends TempNode {
|
|
|
53517
53618
|
|
|
53518
53619
|
const sampleTexture = ( uv ) => textureNode.uv( uv );
|
|
53519
53620
|
|
|
53520
|
-
const rgbShift =
|
|
53621
|
+
const rgbShift = Fn( () => {
|
|
53521
53622
|
|
|
53522
53623
|
const offset = vec2( cos( this.angle ), sin( this.angle ) ).mul( this.amount );
|
|
53523
53624
|
const cr = sampleTexture( uvNode.add( offset ) );
|
|
@@ -53554,7 +53655,7 @@ class FilmNode extends TempNode {
|
|
|
53554
53655
|
|
|
53555
53656
|
const uvNode = this.uvNode || uv();
|
|
53556
53657
|
|
|
53557
|
-
const film =
|
|
53658
|
+
const film = Fn( () => {
|
|
53558
53659
|
|
|
53559
53660
|
const base = this.inputNode.rgb;
|
|
53560
53661
|
const noise = rand( fract( uvNode.add( timerLocal() ) ) );
|
|
@@ -53602,7 +53703,7 @@ class Lut3DNode extends TempNode {
|
|
|
53602
53703
|
|
|
53603
53704
|
const sampleLut = ( uv ) => lutNode.uv( uv );
|
|
53604
53705
|
|
|
53605
|
-
const lut3D =
|
|
53706
|
+
const lut3D = Fn( () => {
|
|
53606
53707
|
|
|
53607
53708
|
const base = inputNode;
|
|
53608
53709
|
|
|
@@ -53719,7 +53820,7 @@ class GTAONode extends TempNode {
|
|
|
53719
53820
|
const sampleDepth = ( uv ) => this.depthNode.uv( uv ).x;
|
|
53720
53821
|
const sampleNoise = ( uv ) => this.noiseNode.uv( uv );
|
|
53721
53822
|
|
|
53722
|
-
const getSceneUvAndDepth =
|
|
53823
|
+
const getSceneUvAndDepth = Fn( ( [ sampleViewPos ] )=> {
|
|
53723
53824
|
|
|
53724
53825
|
const sampleClipPos = this.cameraProjectionMatrix.mul( vec4( sampleViewPos, 1.0 ) );
|
|
53725
53826
|
let sampleUv = sampleClipPos.xy.div( sampleClipPos.w ).mul( 0.5 ).add( 0.5 ).toVar();
|
|
@@ -53729,7 +53830,7 @@ class GTAONode extends TempNode {
|
|
|
53729
53830
|
|
|
53730
53831
|
} );
|
|
53731
53832
|
|
|
53732
|
-
const getViewPosition =
|
|
53833
|
+
const getViewPosition = Fn( ( [ screenPosition, depth ] ) => {
|
|
53733
53834
|
|
|
53734
53835
|
screenPosition = vec2( screenPosition.x, screenPosition.y.oneMinus() ).mul( 2.0 ).sub( 1.0 );
|
|
53735
53836
|
|
|
@@ -53740,7 +53841,7 @@ class GTAONode extends TempNode {
|
|
|
53740
53841
|
|
|
53741
53842
|
} );
|
|
53742
53843
|
|
|
53743
|
-
const ao =
|
|
53844
|
+
const ao = Fn( () => {
|
|
53744
53845
|
|
|
53745
53846
|
const depth = sampleDepth( uvNode );
|
|
53746
53847
|
|
|
@@ -53760,12 +53861,12 @@ class GTAONode extends TempNode {
|
|
|
53760
53861
|
const bitangent = vec3( tangent.y.mul( - 1.0 ), tangent.x, 0.0 );
|
|
53761
53862
|
const kernelMatrix = mat3( tangent, bitangent, vec3( 0.0, 0.0, 1.0 ) );
|
|
53762
53863
|
|
|
53763
|
-
const DIRECTIONS = this.SAMPLES.lessThan( 30 ).
|
|
53864
|
+
const DIRECTIONS = this.SAMPLES.lessThan( 30 ).select( 3, 5 );
|
|
53764
53865
|
const STEPS = add( this.SAMPLES, DIRECTIONS.sub( 1 ) ).div( DIRECTIONS );
|
|
53765
53866
|
|
|
53766
53867
|
const ao = float( 0 ).toVar();
|
|
53767
53868
|
|
|
53768
|
-
|
|
53869
|
+
Loop( { start: int( 0 ), end: DIRECTIONS, type: 'int', condition: '<' }, ( { i } ) => {
|
|
53769
53870
|
|
|
53770
53871
|
const angle = float( i ).div( float( DIRECTIONS ) ).mul( PI );
|
|
53771
53872
|
const sampleDir = vec4( cos( angle ), sin( angle ), 0., add( 0.5, mul( 0.5, noiseTexel.w ) ) );
|
|
@@ -53779,7 +53880,7 @@ class GTAONode extends TempNode {
|
|
|
53779
53880
|
const tangentToNormalInSlice = cross( normalInSlice, sliceBitangent );
|
|
53780
53881
|
const cosHorizons = vec2( dot( viewDir, tangentToNormalInSlice ), dot( viewDir, tangentToNormalInSlice.negate() ) ).toVar();
|
|
53781
53882
|
|
|
53782
|
-
|
|
53883
|
+
Loop( { end: STEPS, type: 'int', name: 'j', condition: '<' }, ( { j } ) => {
|
|
53783
53884
|
|
|
53784
53885
|
const sampleViewOffset = sampleDir.xyz.mul( radiusToUse ).mul( sampleDir.w ).mul( pow( div( float( j ).add( 1.0 ), float( STEPS ) ), this.distanceExponent ) );
|
|
53785
53886
|
|
|
@@ -53819,7 +53920,7 @@ class GTAONode extends TempNode {
|
|
|
53819
53920
|
const occlusion = nx.mul( nxb ).add( ny.mul( nyb ) );
|
|
53820
53921
|
ao.addAssign( occlusion );
|
|
53821
53922
|
|
|
53822
|
-
}
|
|
53923
|
+
} );
|
|
53823
53924
|
|
|
53824
53925
|
ao.assign( clamp( ao.div( DIRECTIONS ), 0, 1 ) );
|
|
53825
53926
|
ao.assign( pow( ao, this.scale ) );
|
|
@@ -53976,7 +54077,7 @@ class DenoiseNode extends TempNode {
|
|
|
53976
54077
|
const sampleNormal = ( uv ) => this.normalNode.uv( uv );
|
|
53977
54078
|
const sampleNoise = ( uv ) => this.noiseNode.uv( uv );
|
|
53978
54079
|
|
|
53979
|
-
const getViewPosition =
|
|
54080
|
+
const getViewPosition = Fn( ( [ screenPosition, depth ] ) => {
|
|
53980
54081
|
|
|
53981
54082
|
screenPosition = vec2( screenPosition.x, screenPosition.y.oneMinus() ).mul( 2.0 ).sub( 1.0 );
|
|
53982
54083
|
|
|
@@ -53987,7 +54088,7 @@ class DenoiseNode extends TempNode {
|
|
|
53987
54088
|
|
|
53988
54089
|
} );
|
|
53989
54090
|
|
|
53990
|
-
const denoiseSample =
|
|
54091
|
+
const denoiseSample = Fn( ( [ center, viewNormal, viewPosition, sampleUv ] ) => {
|
|
53991
54092
|
|
|
53992
54093
|
const texel = sampleTexture( sampleUv );
|
|
53993
54094
|
const depth = sampleDepth( sampleUv );
|
|
@@ -54007,7 +54108,7 @@ class DenoiseNode extends TempNode {
|
|
|
54007
54108
|
|
|
54008
54109
|
} );
|
|
54009
54110
|
|
|
54010
|
-
const denoise =
|
|
54111
|
+
const denoise = Fn( ( [ uvNode ] ) => {
|
|
54011
54112
|
|
|
54012
54113
|
const depth = sampleDepth( uvNode );
|
|
54013
54114
|
const viewNormal = sampleNormal( uvNode ).rgb.normalize();
|
|
@@ -54038,7 +54139,7 @@ class DenoiseNode extends TempNode {
|
|
|
54038
54139
|
const totalWeight = float( 1.0 ).toVar();
|
|
54039
54140
|
const denoised = vec3( texel.rgb ).toVar();
|
|
54040
54141
|
|
|
54041
|
-
|
|
54142
|
+
Loop( { start: int( 0 ), end: int( 16 ), type: 'int', condition: '<' }, ( { i } ) => {
|
|
54042
54143
|
|
|
54043
54144
|
const sampleDir = this._sampleVectors.element( i ).toVar();
|
|
54044
54145
|
const offset = rotationMatrix.mul( sampleDir.xy.mul( float( 1.0 ).add( sampleDir.z.mul( this.radius.sub( 1 ) ) ) ) ).div( this._resolution ).toVar();
|
|
@@ -54049,7 +54150,7 @@ class DenoiseNode extends TempNode {
|
|
|
54049
54150
|
denoised.addAssign( result.xyz );
|
|
54050
54151
|
totalWeight.addAssign( result.w );
|
|
54051
54152
|
|
|
54052
|
-
}
|
|
54153
|
+
} );
|
|
54053
54154
|
|
|
54054
54155
|
If( totalWeight.greaterThan( float( 0 ) ), () => {
|
|
54055
54156
|
|
|
@@ -54067,7 +54168,7 @@ class DenoiseNode extends TempNode {
|
|
|
54067
54168
|
]
|
|
54068
54169
|
} );
|
|
54069
54170
|
|
|
54070
|
-
const output =
|
|
54171
|
+
const output = Fn( () => {
|
|
54071
54172
|
|
|
54072
54173
|
return denoise( uvNode );
|
|
54073
54174
|
|
|
@@ -54186,7 +54287,7 @@ class FXAANode extends TempNode {
|
|
|
54186
54287
|
|
|
54187
54288
|
const NUM_SAMPLES = int( 5 );
|
|
54188
54289
|
|
|
54189
|
-
const contrast =
|
|
54290
|
+
const contrast = Fn( ( [ a_immutable, b_immutable ] ) => {
|
|
54190
54291
|
|
|
54191
54292
|
// assumes colors have premultipliedAlpha, so that the calculated color contrast is scaled by alpha
|
|
54192
54293
|
|
|
@@ -54200,7 +54301,7 @@ class FXAANode extends TempNode {
|
|
|
54200
54301
|
|
|
54201
54302
|
// FXAA3 QUALITY - PC
|
|
54202
54303
|
|
|
54203
|
-
const FxaaPixelShader =
|
|
54304
|
+
const FxaaPixelShader = Fn( ( [ uv, fxaaQualityRcpFrame, fxaaQualityEdgeThreshold, fxaaQualityinvEdgeThreshold ] ) => {
|
|
54204
54305
|
|
|
54205
54306
|
const rgbaM = FxaaTexTop( uv ).toVar();
|
|
54206
54307
|
const rgbaS = FxaaTexOff( uv, vec2( 0.0, - 1.0 ), fxaaQualityRcpFrame.xy ).toVar();
|
|
@@ -54239,8 +54340,8 @@ class FXAANode extends TempNode {
|
|
|
54239
54340
|
|
|
54240
54341
|
// locate the edge
|
|
54241
54342
|
|
|
54242
|
-
const x = contrastE.greaterThan( contrastW ).
|
|
54243
|
-
const y = contrastS.greaterThan( contrastN ).
|
|
54343
|
+
const x = contrastE.greaterThan( contrastW ).select( 1, - 1 ).toVar();
|
|
54344
|
+
const y = contrastS.greaterThan( contrastN ).select( 1, - 1 ).toVar();
|
|
54244
54345
|
|
|
54245
54346
|
const dirToEdge = vec2( x, y ).toVar();
|
|
54246
54347
|
// . 2 . . 1 .
|
|
@@ -54293,7 +54394,7 @@ class FXAANode extends TempNode {
|
|
|
54293
54394
|
offNP.x.assign( 0 );
|
|
54294
54395
|
offNP.y.assign( fxaaQualityRcpFrame.y );
|
|
54295
54396
|
|
|
54296
|
-
} ).
|
|
54397
|
+
} ).Else( () => {
|
|
54297
54398
|
|
|
54298
54399
|
offNP.x.assign( fxaaQualityRcpFrame.x );
|
|
54299
54400
|
offNP.y.assign( 0 );
|
|
@@ -54321,7 +54422,7 @@ class FXAANode extends TempNode {
|
|
|
54321
54422
|
const iterationsUsedN = int( 0 ).toVar();
|
|
54322
54423
|
const iterationsUsedP = int( 0 ).toVar();
|
|
54323
54424
|
|
|
54324
|
-
|
|
54425
|
+
Loop( NUM_SAMPLES, ( { i } ) => {
|
|
54325
54426
|
|
|
54326
54427
|
const increment = i.add( 1 ).toVar();
|
|
54327
54428
|
|
|
@@ -54342,7 +54443,7 @@ class FXAANode extends TempNode {
|
|
|
54342
54443
|
|
|
54343
54444
|
iterationsUsedN.assign( i );
|
|
54344
54445
|
|
|
54345
|
-
}
|
|
54446
|
+
} );
|
|
54346
54447
|
|
|
54347
54448
|
If( doneP.equal( 0 ), () => {
|
|
54348
54449
|
|
|
@@ -54361,7 +54462,7 @@ class FXAANode extends TempNode {
|
|
|
54361
54462
|
|
|
54362
54463
|
iterationsUsedP.assign( i );
|
|
54363
54464
|
|
|
54364
|
-
}
|
|
54465
|
+
} );
|
|
54365
54466
|
|
|
54366
54467
|
If( doneN.equal( 1 ).or( doneP.equal( 1 ) ), () => {
|
|
54367
54468
|
|
|
@@ -54412,7 +54513,7 @@ class FXAANode extends TempNode {
|
|
|
54412
54513
|
]
|
|
54413
54514
|
} );
|
|
54414
54515
|
|
|
54415
|
-
const fxaa =
|
|
54516
|
+
const fxaa = Fn( () => {
|
|
54416
54517
|
|
|
54417
54518
|
const edgeDetectionQuality = float( 0.2 );
|
|
54418
54519
|
const invEdgeDetectionQuality = float( 1 ).div( edgeDetectionQuality );
|
|
@@ -54599,7 +54700,7 @@ class BloomNode extends TempNode {
|
|
|
54599
54700
|
|
|
54600
54701
|
// luminosity high pass material
|
|
54601
54702
|
|
|
54602
|
-
const luminosityHighPass =
|
|
54703
|
+
const luminosityHighPass = Fn( () => {
|
|
54603
54704
|
|
|
54604
54705
|
const texel = this.inputNode;
|
|
54605
54706
|
const v = luminance( texel.rgb );
|
|
@@ -54610,7 +54711,7 @@ class BloomNode extends TempNode {
|
|
|
54610
54711
|
|
|
54611
54712
|
} );
|
|
54612
54713
|
|
|
54613
|
-
this._highPassFilterMaterial = this._highPassFilterMaterial ||
|
|
54714
|
+
this._highPassFilterMaterial = this._highPassFilterMaterial || builder.createNodeMaterial();
|
|
54614
54715
|
this._highPassFilterMaterial.fragmentNode = luminosityHighPass().context( builder.getSharedContext() );
|
|
54615
54716
|
this._highPassFilterMaterial.needsUpdate = true;
|
|
54616
54717
|
|
|
@@ -54629,7 +54730,7 @@ class BloomNode extends TempNode {
|
|
|
54629
54730
|
const bloomFactors = uniformArray( [ 1.0, 0.8, 0.6, 0.4, 0.2 ] );
|
|
54630
54731
|
const bloomTintColors = uniformArray( [ new Vector3( 1, 1, 1 ), new Vector3( 1, 1, 1 ), new Vector3( 1, 1, 1 ), new Vector3( 1, 1, 1 ), new Vector3( 1, 1, 1 ) ] );
|
|
54631
54732
|
|
|
54632
|
-
const lerpBloomFactor =
|
|
54733
|
+
const lerpBloomFactor = Fn( ( [ factor, radius ] ) => {
|
|
54633
54734
|
|
|
54634
54735
|
const mirrorFactor = float( 1.2 ).sub( factor );
|
|
54635
54736
|
return mix( factor, mirrorFactor, radius );
|
|
@@ -54644,7 +54745,7 @@ class BloomNode extends TempNode {
|
|
|
54644
54745
|
} );
|
|
54645
54746
|
|
|
54646
54747
|
|
|
54647
|
-
const compositePass =
|
|
54748
|
+
const compositePass = Fn( () => {
|
|
54648
54749
|
|
|
54649
54750
|
const color0 = lerpBloomFactor( bloomFactors.element( 0 ), this.radius ).mul( vec4( bloomTintColors.element( 0 ), 1.0 ) ).mul( this._textureNodeBlur0 );
|
|
54650
54751
|
const color1 = lerpBloomFactor( bloomFactors.element( 1 ), this.radius ).mul( vec4( bloomTintColors.element( 1 ), 1.0 ) ).mul( this._textureNodeBlur1 );
|
|
@@ -54658,7 +54759,7 @@ class BloomNode extends TempNode {
|
|
|
54658
54759
|
|
|
54659
54760
|
} );
|
|
54660
54761
|
|
|
54661
|
-
this._compositeMaterial = this._compositeMaterial ||
|
|
54762
|
+
this._compositeMaterial = this._compositeMaterial || builder.createNodeMaterial();
|
|
54662
54763
|
this._compositeMaterial.fragmentNode = compositePass().context( builder.getSharedContext() );
|
|
54663
54764
|
this._compositeMaterial.needsUpdate = true;
|
|
54664
54765
|
|
|
@@ -54706,12 +54807,12 @@ class BloomNode extends TempNode {
|
|
|
54706
54807
|
const uvNode = uv();
|
|
54707
54808
|
const sampleTexel = ( uv ) => colorTexture.uv( uv );
|
|
54708
54809
|
|
|
54709
|
-
const seperableBlurPass =
|
|
54810
|
+
const seperableBlurPass = Fn( () => {
|
|
54710
54811
|
|
|
54711
54812
|
const weightSum = gaussianCoefficients.element( 0 ).toVar();
|
|
54712
54813
|
const diffuseSum = sampleTexel( uvNode ).rgb.mul( weightSum ).toVar();
|
|
54713
54814
|
|
|
54714
|
-
|
|
54815
|
+
Loop( { start: int( 1 ), end: int( kernelRadius ), type: 'int', condition: '<' }, ( { i } ) => {
|
|
54715
54816
|
|
|
54716
54817
|
const x = float( i );
|
|
54717
54818
|
const w = gaussianCoefficients.element( i );
|
|
@@ -54777,7 +54878,7 @@ class TransitionNode extends TempNode {
|
|
|
54777
54878
|
|
|
54778
54879
|
};
|
|
54779
54880
|
|
|
54780
|
-
const transition =
|
|
54881
|
+
const transition = Fn( () => {
|
|
54781
54882
|
|
|
54782
54883
|
const texelOne = sampleTexture( textureNodeA );
|
|
54783
54884
|
const texelTwo = sampleTexture( textureNodeB );
|
|
@@ -54792,7 +54893,7 @@ class TransitionNode extends TempNode {
|
|
|
54792
54893
|
|
|
54793
54894
|
color.assign( mix( texelOne, texelTwo, mixf ) );
|
|
54794
54895
|
|
|
54795
|
-
} ).
|
|
54896
|
+
} ).Else( () => {
|
|
54796
54897
|
|
|
54797
54898
|
color.assign( mix( texelTwo, texelOne, mixRatioNode ) );
|
|
54798
54899
|
|
|
@@ -54958,7 +55059,7 @@ class PixelationNode extends TempNode {
|
|
|
54958
55059
|
|
|
54959
55060
|
};
|
|
54960
55061
|
|
|
54961
|
-
const pixelation =
|
|
55062
|
+
const pixelation = Fn( () => {
|
|
54962
55063
|
|
|
54963
55064
|
const texel = sampleTexture();
|
|
54964
55065
|
|
|
@@ -54988,7 +55089,7 @@ class PixelationNode extends TempNode {
|
|
|
54988
55089
|
|
|
54989
55090
|
} );
|
|
54990
55091
|
|
|
54991
|
-
const strength = dei.greaterThan( 0 ).
|
|
55092
|
+
const strength = dei.greaterThan( 0 ).select( float( 1.0 ).sub( dei.mul( this.depthEdgeStrength ) ), nei.mul( this.normalEdgeStrength ).add( 1 ) );
|
|
54992
55093
|
|
|
54993
55094
|
return texel.mul( strength );
|
|
54994
55095
|
|
|
@@ -55050,7 +55151,7 @@ class PixelationPassNode extends PassNode {
|
|
|
55050
55151
|
|
|
55051
55152
|
const pixelationPass = ( scene, camera, pixelSize, normalEdgeStrength, depthEdgeStrength ) => nodeObject( new PixelationPassNode( scene, camera, pixelSize, normalEdgeStrength, depthEdgeStrength ) );
|
|
55052
55153
|
|
|
55053
|
-
const bleach = /*@__PURE__*/
|
|
55154
|
+
const bleach = /*@__PURE__*/ Fn( ( [ color, opacity = 1 ] ) => {
|
|
55054
55155
|
|
|
55055
55156
|
const base = color;
|
|
55056
55157
|
const lum = luminance( base.rgb );
|
|
@@ -55075,7 +55176,7 @@ const bleach = /*@__PURE__*/ tslFn( ( [ color, opacity = 1 ] ) => {
|
|
|
55075
55176
|
|
|
55076
55177
|
addNodeElement( 'bleach', bleach );
|
|
55077
55178
|
|
|
55078
|
-
const sepia = /*@__PURE__*/
|
|
55179
|
+
const sepia = /*@__PURE__*/ Fn( ( [ color ] ) => {
|
|
55079
55180
|
|
|
55080
55181
|
const c = vec3( color );
|
|
55081
55182
|
|
|
@@ -56177,7 +56278,7 @@ const lightTargetDirection = nodeProxy( LightNode, LightNode.TARGET_DIRECTION );
|
|
|
56177
56278
|
|
|
56178
56279
|
addNodeClass( 'LightNode', LightNode );
|
|
56179
56280
|
|
|
56180
|
-
const getDistanceAttenuation =
|
|
56281
|
+
const getDistanceAttenuation = Fn( ( inputs ) => {
|
|
56181
56282
|
|
|
56182
56283
|
const { lightDistance, cutoffDistance, decayExponent } = inputs;
|
|
56183
56284
|
|
|
@@ -56186,7 +56287,7 @@ const getDistanceAttenuation = tslFn( ( inputs ) => {
|
|
|
56186
56287
|
// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf
|
|
56187
56288
|
const distanceFalloff = lightDistance.pow( decayExponent ).max( 0.01 ).reciprocal();
|
|
56188
56289
|
|
|
56189
|
-
return cutoffDistance.greaterThan( 0 ).
|
|
56290
|
+
return cutoffDistance.greaterThan( 0 ).select(
|
|
56190
56291
|
distanceFalloff.mul( lightDistance.div( cutoffDistance ).pow4().oneMinus().clamp().pow2() ),
|
|
56191
56292
|
distanceFalloff
|
|
56192
56293
|
);
|
|
@@ -56559,9 +56660,78 @@ addNodeClass( 'HemisphereLightNode', HemisphereLightNode );
|
|
|
56559
56660
|
|
|
56560
56661
|
addLightNode( HemisphereLight, HemisphereLightNode );
|
|
56561
56662
|
|
|
56663
|
+
class LightProbeNode extends AnalyticLightNode {
|
|
56664
|
+
|
|
56665
|
+
constructor( light = null ) {
|
|
56666
|
+
|
|
56667
|
+
super( light );
|
|
56668
|
+
|
|
56669
|
+
const array = [];
|
|
56670
|
+
|
|
56671
|
+
for ( let i = 0; i < 9; i ++ ) array.push( new Vector3() );
|
|
56672
|
+
|
|
56673
|
+
this.lightProbe = uniformArray( array );
|
|
56674
|
+
|
|
56675
|
+
}
|
|
56676
|
+
|
|
56677
|
+
update( frame ) {
|
|
56678
|
+
|
|
56679
|
+
const { light } = this;
|
|
56680
|
+
|
|
56681
|
+
super.update( frame );
|
|
56682
|
+
|
|
56683
|
+
//
|
|
56684
|
+
|
|
56685
|
+
for ( let i = 0; i < 9; i ++ ) {
|
|
56686
|
+
|
|
56687
|
+
this.lightProbe.array[ i ].copy( light.sh.coefficients[ i ] ).multiplyScalar( light.intensity );
|
|
56688
|
+
|
|
56689
|
+
}
|
|
56690
|
+
|
|
56691
|
+
}
|
|
56692
|
+
|
|
56693
|
+
setup( builder ) {
|
|
56694
|
+
|
|
56695
|
+
const irradiance = shGetIrradianceAt( normalWorld, this.lightProbe );
|
|
56696
|
+
|
|
56697
|
+
builder.context.irradiance.addAssign( irradiance );
|
|
56698
|
+
|
|
56699
|
+
}
|
|
56700
|
+
|
|
56701
|
+
}
|
|
56702
|
+
|
|
56703
|
+
const shGetIrradianceAt = Fn( ( [ normal, shCoefficients ] ) => {
|
|
56704
|
+
|
|
56705
|
+
// normal is assumed to have unit length
|
|
56706
|
+
|
|
56707
|
+
const x = normal.x, y = normal.y, z = normal.z;
|
|
56708
|
+
|
|
56709
|
+
// band 0
|
|
56710
|
+
const result = shCoefficients.element( 0 ).mul( 0.886227 );
|
|
56711
|
+
|
|
56712
|
+
// band 1
|
|
56713
|
+
result.addAssign( shCoefficients.element( 1 ).mul( 2.0 * 0.511664 ).mul( y ) );
|
|
56714
|
+
result.addAssign( shCoefficients.element( 2 ).mul( 2.0 * 0.511664 ).mul( z ) );
|
|
56715
|
+
result.addAssign( shCoefficients.element( 3 ).mul( 2.0 * 0.511664 ).mul( x ) );
|
|
56716
|
+
|
|
56717
|
+
// band 2
|
|
56718
|
+
result.addAssign( shCoefficients.element( 4 ).mul( 2.0 * 0.429043 ).mul( x ).mul( y ) );
|
|
56719
|
+
result.addAssign( shCoefficients.element( 5 ).mul( 2.0 * 0.429043 ).mul( y ).mul( z ) );
|
|
56720
|
+
result.addAssign( shCoefficients.element( 6 ).mul( z.mul( z ).mul( 0.743125 ).sub( 0.247708 ) ) );
|
|
56721
|
+
result.addAssign( shCoefficients.element( 7 ).mul( 2.0 * 0.429043 ).mul( x ).mul( z ) );
|
|
56722
|
+
result.addAssign( shCoefficients.element( 8 ).mul( 0.429043 ).mul( mul( x, x ).sub( mul( y, y ) ) ) );
|
|
56723
|
+
|
|
56724
|
+
return result;
|
|
56725
|
+
|
|
56726
|
+
} );
|
|
56727
|
+
|
|
56728
|
+
addNodeClass( 'LightProbeNode', LightProbeNode );
|
|
56729
|
+
|
|
56730
|
+
addLightNode( LightProbe, LightProbeNode );
|
|
56731
|
+
|
|
56562
56732
|
let _generator = null;
|
|
56563
56733
|
|
|
56564
|
-
const _cache = new WeakMap();
|
|
56734
|
+
const _cache$1 = new WeakMap();
|
|
56565
56735
|
|
|
56566
56736
|
function _generateCubeUVSize( imageHeight ) {
|
|
56567
56737
|
|
|
@@ -56577,7 +56747,7 @@ function _generateCubeUVSize( imageHeight ) {
|
|
|
56577
56747
|
|
|
56578
56748
|
function _getPMREMFromTexture( texture ) {
|
|
56579
56749
|
|
|
56580
|
-
let cacheTexture = _cache.get( texture );
|
|
56750
|
+
let cacheTexture = _cache$1.get( texture );
|
|
56581
56751
|
|
|
56582
56752
|
const pmremVersion = cacheTexture !== undefined ? cacheTexture.pmremVersion : - 1;
|
|
56583
56753
|
|
|
@@ -56600,7 +56770,7 @@ function _getPMREMFromTexture( texture ) {
|
|
|
56600
56770
|
|
|
56601
56771
|
} else {
|
|
56602
56772
|
|
|
56603
|
-
if ( isEquirectangularMapReady( image ) ) {
|
|
56773
|
+
if ( isEquirectangularMapReady$1( image ) ) {
|
|
56604
56774
|
|
|
56605
56775
|
cacheTexture = _generator.fromEquirectangular( texture, cacheTexture );
|
|
56606
56776
|
|
|
@@ -56614,7 +56784,7 @@ function _getPMREMFromTexture( texture ) {
|
|
|
56614
56784
|
|
|
56615
56785
|
cacheTexture.pmremVersion = texture.pmremVersion;
|
|
56616
56786
|
|
|
56617
|
-
_cache.set( texture, cacheTexture );
|
|
56787
|
+
_cache$1.set( texture, cacheTexture );
|
|
56618
56788
|
|
|
56619
56789
|
}
|
|
56620
56790
|
|
|
@@ -56772,7 +56942,7 @@ function isCubeMapReady( image ) {
|
|
|
56772
56942
|
|
|
56773
56943
|
}
|
|
56774
56944
|
|
|
56775
|
-
function isEquirectangularMapReady( image ) {
|
|
56945
|
+
function isEquirectangularMapReady$1( image ) {
|
|
56776
56946
|
|
|
56777
56947
|
if ( image === null || image === undefined ) return false;
|
|
56778
56948
|
|
|
@@ -56906,6 +57076,153 @@ const createIrradianceContext = ( normalWorldNode ) => {
|
|
|
56906
57076
|
|
|
56907
57077
|
addNodeClass( 'EnvironmentNode', EnvironmentNode );
|
|
56908
57078
|
|
|
57079
|
+
const _cache = new WeakMap();
|
|
57080
|
+
|
|
57081
|
+
class CubeMapNode extends TempNode {
|
|
57082
|
+
|
|
57083
|
+
constructor( envNode ) {
|
|
57084
|
+
|
|
57085
|
+
super( 'vec3' );
|
|
57086
|
+
|
|
57087
|
+
this.envNode = envNode;
|
|
57088
|
+
|
|
57089
|
+
this._cubeTexture = null;
|
|
57090
|
+
this._cubeTextureNode = cubeTexture();
|
|
57091
|
+
|
|
57092
|
+
const defaultTexture = new CubeTexture();
|
|
57093
|
+
defaultTexture.isRenderTargetTexture = true;
|
|
57094
|
+
|
|
57095
|
+
this._defaultTexture = defaultTexture;
|
|
57096
|
+
|
|
57097
|
+
this.updateBeforeType = NodeUpdateType.RENDER;
|
|
57098
|
+
|
|
57099
|
+
}
|
|
57100
|
+
|
|
57101
|
+
updateBefore( frame ) {
|
|
57102
|
+
|
|
57103
|
+
const { renderer, material } = frame;
|
|
57104
|
+
|
|
57105
|
+
const envNode = this.envNode;
|
|
57106
|
+
|
|
57107
|
+
if ( envNode.isTextureNode || envNode.isMaterialReferenceNode ) {
|
|
57108
|
+
|
|
57109
|
+
const texture = ( envNode.isTextureNode ) ? envNode.value : material[ envNode.property ];
|
|
57110
|
+
|
|
57111
|
+
if ( texture && texture.isTexture ) {
|
|
57112
|
+
|
|
57113
|
+
const mapping = texture.mapping;
|
|
57114
|
+
|
|
57115
|
+
if ( mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping ) {
|
|
57116
|
+
|
|
57117
|
+
// check for converted cubemap map
|
|
57118
|
+
|
|
57119
|
+
if ( _cache.has( texture ) ) {
|
|
57120
|
+
|
|
57121
|
+
const cubeMap = _cache.get( texture );
|
|
57122
|
+
|
|
57123
|
+
mapTextureMapping( cubeMap, texture.mapping );
|
|
57124
|
+
this._cubeTexture = cubeMap;
|
|
57125
|
+
|
|
57126
|
+
} else {
|
|
57127
|
+
|
|
57128
|
+
// create cube map from equirectangular map
|
|
57129
|
+
|
|
57130
|
+
const image = texture.image;
|
|
57131
|
+
|
|
57132
|
+
if ( isEquirectangularMapReady( image ) ) {
|
|
57133
|
+
|
|
57134
|
+
const renderTarget = new CubeRenderTarget( image.height );
|
|
57135
|
+
renderTarget.fromEquirectangularTexture( renderer, texture );
|
|
57136
|
+
|
|
57137
|
+
mapTextureMapping( renderTarget.texture, texture.mapping );
|
|
57138
|
+
this._cubeTexture = renderTarget.texture;
|
|
57139
|
+
|
|
57140
|
+
_cache.set( texture, renderTarget.texture );
|
|
57141
|
+
|
|
57142
|
+
texture.addEventListener( 'dispose', onTextureDispose );
|
|
57143
|
+
|
|
57144
|
+
} else {
|
|
57145
|
+
|
|
57146
|
+
// default cube texture as fallback when equirectangular texture is not yet loaded
|
|
57147
|
+
|
|
57148
|
+
this._cubeTexture = this._defaultTexture;
|
|
57149
|
+
|
|
57150
|
+
}
|
|
57151
|
+
|
|
57152
|
+
}
|
|
57153
|
+
|
|
57154
|
+
//
|
|
57155
|
+
|
|
57156
|
+
this._cubeTextureNode.value = this._cubeTexture;
|
|
57157
|
+
|
|
57158
|
+
} else {
|
|
57159
|
+
|
|
57160
|
+
// envNode already refers to a cube map
|
|
57161
|
+
|
|
57162
|
+
this._cubeTextureNode = this.envNode;
|
|
57163
|
+
|
|
57164
|
+
}
|
|
57165
|
+
|
|
57166
|
+
}
|
|
57167
|
+
|
|
57168
|
+
}
|
|
57169
|
+
|
|
57170
|
+
}
|
|
57171
|
+
|
|
57172
|
+
setup( builder ) {
|
|
57173
|
+
|
|
57174
|
+
this.updateBefore( builder );
|
|
57175
|
+
|
|
57176
|
+
return this._cubeTextureNode;
|
|
57177
|
+
|
|
57178
|
+
}
|
|
57179
|
+
|
|
57180
|
+
}
|
|
57181
|
+
|
|
57182
|
+
function isEquirectangularMapReady( image ) {
|
|
57183
|
+
|
|
57184
|
+
if ( image === null || image === undefined ) return false;
|
|
57185
|
+
|
|
57186
|
+
return image.height > 0;
|
|
57187
|
+
|
|
57188
|
+
}
|
|
57189
|
+
|
|
57190
|
+
function onTextureDispose( event ) {
|
|
57191
|
+
|
|
57192
|
+
const texture = event.target;
|
|
57193
|
+
|
|
57194
|
+
texture.removeEventListener( 'dispose', onTextureDispose );
|
|
57195
|
+
|
|
57196
|
+
const renderTarget = _cache.get( texture );
|
|
57197
|
+
|
|
57198
|
+
if ( renderTarget !== undefined ) {
|
|
57199
|
+
|
|
57200
|
+
_cache.delete( texture );
|
|
57201
|
+
|
|
57202
|
+
renderTarget.dispose();
|
|
57203
|
+
|
|
57204
|
+
}
|
|
57205
|
+
|
|
57206
|
+
}
|
|
57207
|
+
|
|
57208
|
+
function mapTextureMapping( texture, mapping ) {
|
|
57209
|
+
|
|
57210
|
+
if ( mapping === EquirectangularReflectionMapping ) {
|
|
57211
|
+
|
|
57212
|
+
texture.mapping = CubeReflectionMapping;
|
|
57213
|
+
|
|
57214
|
+
} else if ( mapping === EquirectangularRefractionMapping ) {
|
|
57215
|
+
|
|
57216
|
+
texture.mapping = CubeRefractionMapping;
|
|
57217
|
+
|
|
57218
|
+
}
|
|
57219
|
+
|
|
57220
|
+
}
|
|
57221
|
+
|
|
57222
|
+
const cubeMapNode = nodeProxy( CubeMapNode );
|
|
57223
|
+
|
|
57224
|
+
addNodeClass( 'CubeMapNode', CubeMapNode );
|
|
57225
|
+
|
|
56909
57226
|
class BasicEnvironmentNode extends LightingNode {
|
|
56910
57227
|
|
|
56911
57228
|
constructor( envNode = null ) {
|
|
@@ -56920,7 +57237,7 @@ class BasicEnvironmentNode extends LightingNode {
|
|
|
56920
57237
|
|
|
56921
57238
|
// environment property is used in the finish() method of BasicLightingModel
|
|
56922
57239
|
|
|
56923
|
-
builder.context.environment = this.envNode;
|
|
57240
|
+
builder.context.environment = cubeMapNode( this.envNode );
|
|
56924
57241
|
|
|
56925
57242
|
}
|
|
56926
57243
|
|
|
@@ -56928,7 +57245,7 @@ class BasicEnvironmentNode extends LightingNode {
|
|
|
56928
57245
|
|
|
56929
57246
|
addNodeClass( 'BasicEnvironmentNode', BasicEnvironmentNode );
|
|
56930
57247
|
|
|
56931
|
-
const checkerShaderNode =
|
|
57248
|
+
const checkerShaderNode = Fn( ( inputs ) => {
|
|
56932
57249
|
|
|
56933
57250
|
const uv = inputs.uv.mul( 2.0 );
|
|
56934
57251
|
|
|
@@ -57100,7 +57417,7 @@ class InstancedPointsNodeMaterial extends NodeMaterial {
|
|
|
57100
57417
|
const useAlphaToCoverage = this.alphaToCoverage;
|
|
57101
57418
|
const useColor = this.useColor;
|
|
57102
57419
|
|
|
57103
|
-
this.vertexNode =
|
|
57420
|
+
this.vertexNode = Fn( () => {
|
|
57104
57421
|
|
|
57105
57422
|
//vUv = uv;
|
|
57106
57423
|
varying( vec2(), 'vUv' ).assign( uv() ); // @TODO: Analyze other way to do this
|
|
@@ -57135,7 +57452,7 @@ class InstancedPointsNodeMaterial extends NodeMaterial {
|
|
|
57135
57452
|
|
|
57136
57453
|
} )();
|
|
57137
57454
|
|
|
57138
|
-
this.fragmentNode =
|
|
57455
|
+
this.fragmentNode = Fn( () => {
|
|
57139
57456
|
|
|
57140
57457
|
const vUv = varying( vec2(), 'vUv' );
|
|
57141
57458
|
|
|
@@ -57328,7 +57645,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
57328
57645
|
const useDash = this.dashed;
|
|
57329
57646
|
const useWorldUnits = this.worldUnits;
|
|
57330
57647
|
|
|
57331
|
-
const trimSegment =
|
|
57648
|
+
const trimSegment = Fn( ( { start, end } ) => {
|
|
57332
57649
|
|
|
57333
57650
|
const a = cameraProjectionMatrix.element( 2 ).element( 2 ); // 3nd entry in 3th column
|
|
57334
57651
|
const b = cameraProjectionMatrix.element( 3 ).element( 2 ); // 3nd entry in 4th column
|
|
@@ -57340,7 +57657,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
57340
57657
|
|
|
57341
57658
|
} );
|
|
57342
57659
|
|
|
57343
|
-
this.vertexNode =
|
|
57660
|
+
this.vertexNode = Fn( () => {
|
|
57344
57661
|
|
|
57345
57662
|
varyingProperty( 'vec2', 'vUv' ).assign( uv() );
|
|
57346
57663
|
|
|
@@ -57377,7 +57694,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
57377
57694
|
|
|
57378
57695
|
end.assign( trimSegment( { start: start, end: end } ) );
|
|
57379
57696
|
|
|
57380
|
-
} ).
|
|
57697
|
+
} ).ElseIf( end.z.lessThan( 0.0 ).and( start.z.greaterThanEqual( 0.0 ) ), () => {
|
|
57381
57698
|
|
|
57382
57699
|
start.assign( trimSegment( { start: end, end: start } ) );
|
|
57383
57700
|
|
|
@@ -57413,18 +57730,18 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
57413
57730
|
|
|
57414
57731
|
const worldPos = varyingProperty( 'vec4', 'worldPos' );
|
|
57415
57732
|
|
|
57416
|
-
worldPos.assign( positionGeometry.y.lessThan( 0.5 ).
|
|
57733
|
+
worldPos.assign( positionGeometry.y.lessThan( 0.5 ).select( start, end ) );
|
|
57417
57734
|
|
|
57418
57735
|
// height offset
|
|
57419
57736
|
const hw = materialLineWidth.mul( 0.5 );
|
|
57420
|
-
worldPos.addAssign( vec4( positionGeometry.x.lessThan( 0.0 ).
|
|
57737
|
+
worldPos.addAssign( vec4( positionGeometry.x.lessThan( 0.0 ).select( worldUp.mul( hw ), worldUp.mul( hw ).negate() ), 0 ) );
|
|
57421
57738
|
|
|
57422
57739
|
// don't extend the line if we're rendering dashes because we
|
|
57423
57740
|
// won't be rendering the endcaps
|
|
57424
57741
|
if ( ! useDash ) {
|
|
57425
57742
|
|
|
57426
57743
|
// cap extension
|
|
57427
|
-
worldPos.addAssign( vec4( positionGeometry.y.lessThan( 0.5 ).
|
|
57744
|
+
worldPos.addAssign( vec4( positionGeometry.y.lessThan( 0.5 ).select( worldDir.mul( hw ).negate(), worldDir.mul( hw ) ), 0 ) );
|
|
57428
57745
|
|
|
57429
57746
|
// add width to the box
|
|
57430
57747
|
worldPos.addAssign( vec4( worldFwd.mul( hw ), 0 ) );
|
|
@@ -57445,7 +57762,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
57445
57762
|
// segments overlap neatly
|
|
57446
57763
|
const clipPose = temp( vec3() );
|
|
57447
57764
|
|
|
57448
|
-
clipPose.assign( positionGeometry.y.lessThan( 0.5 ).
|
|
57765
|
+
clipPose.assign( positionGeometry.y.lessThan( 0.5 ).select( ndcStart, ndcEnd ) );
|
|
57449
57766
|
clip.z.assign( clipPose.z.mul( clip.w ) );
|
|
57450
57767
|
|
|
57451
57768
|
} else {
|
|
@@ -57459,14 +57776,14 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
57459
57776
|
offset.x.assign( offset.x.div( aspect ) );
|
|
57460
57777
|
|
|
57461
57778
|
// sign flip
|
|
57462
|
-
offset.assign( positionGeometry.x.lessThan( 0.0 ).
|
|
57779
|
+
offset.assign( positionGeometry.x.lessThan( 0.0 ).select( offset.negate(), offset ) );
|
|
57463
57780
|
|
|
57464
57781
|
// endcaps
|
|
57465
57782
|
If( positionGeometry.y.lessThan( 0.0 ), () => {
|
|
57466
57783
|
|
|
57467
57784
|
offset.assign( offset.sub( dir ) );
|
|
57468
57785
|
|
|
57469
|
-
} ).
|
|
57786
|
+
} ).ElseIf( positionGeometry.y.greaterThan( 1.0 ), () => {
|
|
57470
57787
|
|
|
57471
57788
|
offset.assign( offset.add( dir ) );
|
|
57472
57789
|
|
|
@@ -57479,7 +57796,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
57479
57796
|
offset.assign( offset.div( viewport.w ) );
|
|
57480
57797
|
|
|
57481
57798
|
// select end
|
|
57482
|
-
clip.assign( positionGeometry.y.lessThan( 0.5 ).
|
|
57799
|
+
clip.assign( positionGeometry.y.lessThan( 0.5 ).select( clipStart, clipEnd ) );
|
|
57483
57800
|
|
|
57484
57801
|
// back to clip space
|
|
57485
57802
|
offset.assign( offset.mul( clip.w ) );
|
|
@@ -57492,7 +57809,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
57492
57809
|
|
|
57493
57810
|
} )();
|
|
57494
57811
|
|
|
57495
|
-
const closestLineToLine =
|
|
57812
|
+
const closestLineToLine = Fn( ( { p1, p2, p3, p4 } ) => {
|
|
57496
57813
|
|
|
57497
57814
|
const p13 = p1.sub( p3 );
|
|
57498
57815
|
const p43 = p4.sub( p3 );
|
|
@@ -57515,7 +57832,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
57515
57832
|
|
|
57516
57833
|
} );
|
|
57517
57834
|
|
|
57518
|
-
this.fragmentNode =
|
|
57835
|
+
this.fragmentNode = Fn( () => {
|
|
57519
57836
|
|
|
57520
57837
|
const vUv = varyingProperty( 'vec2', 'vUv' );
|
|
57521
57838
|
|
|
@@ -57532,7 +57849,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
57532
57849
|
const instanceDistanceStart = attribute( 'instanceDistanceStart' );
|
|
57533
57850
|
const instanceDistanceEnd = attribute( 'instanceDistanceEnd' );
|
|
57534
57851
|
|
|
57535
|
-
const lineDistance = positionGeometry.y.lessThan( 0.5 ).
|
|
57852
|
+
const lineDistance = positionGeometry.y.lessThan( 0.5 ).select( dashScaleNode.mul( instanceDistanceStart ), materialLineScale.mul( instanceDistanceEnd ) );
|
|
57536
57853
|
|
|
57537
57854
|
const vLineDistance = varying( lineDistance.add( materialLineDashOffset ) );
|
|
57538
57855
|
const vLineDistanceOffset = offsetNode ? vLineDistance.add( offsetNode ) : vLineDistance;
|
|
@@ -57584,7 +57901,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
57584
57901
|
if ( useAlphaToCoverage ) {
|
|
57585
57902
|
|
|
57586
57903
|
const a = vUv.x;
|
|
57587
|
-
const b = vUv.y.greaterThan( 0.0 ).
|
|
57904
|
+
const b = vUv.y.greaterThan( 0.0 ).select( vUv.y.sub( 1.0 ), vUv.y.add( 1.0 ) );
|
|
57588
57905
|
|
|
57589
57906
|
const len2 = a.mul( a ).add( b.mul( b ) );
|
|
57590
57907
|
|
|
@@ -57603,7 +57920,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
57603
57920
|
If( vUv.y.abs().greaterThan( 1.0 ), () => {
|
|
57604
57921
|
|
|
57605
57922
|
const a = vUv.x;
|
|
57606
|
-
const b = vUv.y.greaterThan( 0.0 ).
|
|
57923
|
+
const b = vUv.y.greaterThan( 0.0 ).select( vUv.y.sub( 1.0 ), vUv.y.add( 1.0 ) );
|
|
57607
57924
|
const len2 = a.mul( a ).add( b.mul( b ) );
|
|
57608
57925
|
|
|
57609
57926
|
len2.greaterThan( 1.0 ).discard();
|
|
@@ -57627,7 +57944,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
57627
57944
|
const instanceColorStart = attribute( 'instanceColorStart' );
|
|
57628
57945
|
const instanceColorEnd = attribute( 'instanceColorEnd' );
|
|
57629
57946
|
|
|
57630
|
-
const instanceColor = positionGeometry.y.lessThan( 0.5 ).
|
|
57947
|
+
const instanceColor = positionGeometry.y.lessThan( 0.5 ).select( instanceColorStart, instanceColorEnd );
|
|
57631
57948
|
|
|
57632
57949
|
lineColorNode = instanceColor.mul( materialColor );
|
|
57633
57950
|
|
|
@@ -57890,7 +58207,7 @@ class MeshBasicNodeMaterial extends NodeMaterial {
|
|
|
57890
58207
|
|
|
57891
58208
|
addNodeMaterial( 'MeshBasicNodeMaterial', MeshBasicNodeMaterial );
|
|
57892
58209
|
|
|
57893
|
-
const F_Schlick =
|
|
58210
|
+
const F_Schlick = Fn( ( { f0, f90, dotVH } ) => {
|
|
57894
58211
|
|
|
57895
58212
|
// Original approximation by Christophe Schlick '94
|
|
57896
58213
|
// float fresnel = pow( 1.0 - dotVH, 5.0 );
|
|
@@ -57903,7 +58220,7 @@ const F_Schlick = tslFn( ( { f0, f90, dotVH } ) => {
|
|
|
57903
58220
|
|
|
57904
58221
|
} ); // validated
|
|
57905
58222
|
|
|
57906
|
-
const BRDF_Lambert =
|
|
58223
|
+
const BRDF_Lambert = Fn( ( inputs ) => {
|
|
57907
58224
|
|
|
57908
58225
|
return inputs.diffuseColor.mul( 1 / Math.PI ); // punctual light
|
|
57909
58226
|
|
|
@@ -57911,13 +58228,13 @@ const BRDF_Lambert = tslFn( ( inputs ) => {
|
|
|
57911
58228
|
|
|
57912
58229
|
const G_BlinnPhong_Implicit = () => float( 0.25 );
|
|
57913
58230
|
|
|
57914
|
-
const D_BlinnPhong =
|
|
58231
|
+
const D_BlinnPhong = Fn( ( { dotNH } ) => {
|
|
57915
58232
|
|
|
57916
58233
|
return shininess.mul( float( 0.5 ) ).add( 1.0 ).mul( float( 1 / Math.PI ) ).mul( dotNH.pow( shininess ) );
|
|
57917
58234
|
|
|
57918
58235
|
} );
|
|
57919
58236
|
|
|
57920
|
-
const BRDF_BlinnPhong =
|
|
58237
|
+
const BRDF_BlinnPhong = Fn( ( { lightDirection } ) => {
|
|
57921
58238
|
|
|
57922
58239
|
const halfDir = lightDirection.add( positionViewDirection ).normalize();
|
|
57923
58240
|
|
|
@@ -58067,7 +58384,7 @@ class MeshPhongNodeMaterial extends NodeMaterial {
|
|
|
58067
58384
|
|
|
58068
58385
|
addNodeMaterial( 'MeshPhongNodeMaterial', MeshPhongNodeMaterial );
|
|
58069
58386
|
|
|
58070
|
-
const getGeometryRoughness =
|
|
58387
|
+
const getGeometryRoughness = Fn( () => {
|
|
58071
58388
|
|
|
58072
58389
|
const dxy = normalGeometry.dFdx().abs().max( normalGeometry.dFdy().abs() );
|
|
58073
58390
|
const geometryRoughness = dxy.x.max( dxy.y ).max( dxy.z );
|
|
@@ -58076,7 +58393,7 @@ const getGeometryRoughness = tslFn( () => {
|
|
|
58076
58393
|
|
|
58077
58394
|
} );
|
|
58078
58395
|
|
|
58079
|
-
const getRoughness =
|
|
58396
|
+
const getRoughness = Fn( ( inputs ) => {
|
|
58080
58397
|
|
|
58081
58398
|
const { roughness } = inputs;
|
|
58082
58399
|
|
|
@@ -58092,7 +58409,7 @@ const getRoughness = tslFn( ( inputs ) => {
|
|
|
58092
58409
|
|
|
58093
58410
|
// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2
|
|
58094
58411
|
// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf
|
|
58095
|
-
const V_GGX_SmithCorrelated =
|
|
58412
|
+
const V_GGX_SmithCorrelated = Fn( ( { alpha, dotNL, dotNV } ) => {
|
|
58096
58413
|
|
|
58097
58414
|
const a2 = alpha.pow2();
|
|
58098
58415
|
|
|
@@ -58113,7 +58430,7 @@ const V_GGX_SmithCorrelated = tslFn( ( { alpha, dotNL, dotNV } ) => {
|
|
|
58113
58430
|
|
|
58114
58431
|
// https://google.github.io/filament/Filament.md.html#materialsystem/anisotropicmodel/anisotropicspecularbrdf
|
|
58115
58432
|
|
|
58116
|
-
const V_GGX_SmithCorrelated_Anisotropic =
|
|
58433
|
+
const V_GGX_SmithCorrelated_Anisotropic = Fn( ( { alphaT, alphaB, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL } ) => {
|
|
58117
58434
|
|
|
58118
58435
|
const gv = dotNL.mul( vec3( alphaT.mul( dotTV ), alphaB.mul( dotBV ), dotNV ).length() );
|
|
58119
58436
|
const gl = dotNV.mul( vec3( alphaT.mul( dotTL ), alphaB.mul( dotBL ), dotNL ).length() );
|
|
@@ -58139,7 +58456,7 @@ const V_GGX_SmithCorrelated_Anisotropic = tslFn( ( { alphaT, alphaB, dotTV, dotB
|
|
|
58139
58456
|
// Microfacet Models for Refraction through Rough Surfaces - equation (33)
|
|
58140
58457
|
// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html
|
|
58141
58458
|
// alpha is "roughness squared" in Disney’s reparameterization
|
|
58142
|
-
const D_GGX =
|
|
58459
|
+
const D_GGX = Fn( ( { alpha, dotNH } ) => {
|
|
58143
58460
|
|
|
58144
58461
|
const a2 = alpha.pow2();
|
|
58145
58462
|
|
|
@@ -58160,7 +58477,7 @@ const RECIPROCAL_PI = float( 1 / Math.PI );
|
|
|
58160
58477
|
|
|
58161
58478
|
// https://google.github.io/filament/Filament.md.html#materialsystem/anisotropicmodel/anisotropicspecularbrdf
|
|
58162
58479
|
|
|
58163
|
-
const D_GGX_Anisotropic =
|
|
58480
|
+
const D_GGX_Anisotropic = Fn( ( { alphaT, alphaB, dotNH, dotTH, dotBH } ) => {
|
|
58164
58481
|
|
|
58165
58482
|
const a2 = alphaT.mul( alphaB );
|
|
58166
58483
|
const v = vec3( alphaB.mul( dotTH ), alphaT.mul( dotBH ), a2.mul( dotNH ) );
|
|
@@ -58182,7 +58499,7 @@ const D_GGX_Anisotropic = tslFn( ( { alphaT, alphaB, dotNH, dotTH, dotBH } ) =>
|
|
|
58182
58499
|
} );
|
|
58183
58500
|
|
|
58184
58501
|
// GGX Distribution, Schlick Fresnel, GGX_SmithCorrelated Visibility
|
|
58185
|
-
const BRDF_GGX =
|
|
58502
|
+
const BRDF_GGX = Fn( ( inputs ) => {
|
|
58186
58503
|
|
|
58187
58504
|
const { lightDirection, f0, f90, roughness, f, USE_IRIDESCENCE, USE_ANISOTROPY } = inputs;
|
|
58188
58505
|
|
|
@@ -58233,7 +58550,7 @@ const BRDF_GGX = tslFn( ( inputs ) => {
|
|
|
58233
58550
|
// split-sum approximation used in indirect specular lighting.
|
|
58234
58551
|
// via 'environmentBRDF' from "Physically Based Shading on Mobile"
|
|
58235
58552
|
// https://www.unrealengine.com/blog/physically-based-shading-on-mobile
|
|
58236
|
-
const DFGApprox =
|
|
58553
|
+
const DFGApprox = Fn( ( { roughness, dotNV } ) => {
|
|
58237
58554
|
|
|
58238
58555
|
const c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
|
|
58239
58556
|
|
|
@@ -58256,7 +58573,7 @@ const DFGApprox = tslFn( ( { roughness, dotNV } ) => {
|
|
|
58256
58573
|
]
|
|
58257
58574
|
} );
|
|
58258
58575
|
|
|
58259
|
-
const EnvironmentBRDF =
|
|
58576
|
+
const EnvironmentBRDF = Fn( ( inputs ) => {
|
|
58260
58577
|
|
|
58261
58578
|
const { dotNV, specularColor, specularF90, roughness } = inputs;
|
|
58262
58579
|
|
|
@@ -58265,7 +58582,7 @@ const EnvironmentBRDF = tslFn( ( inputs ) => {
|
|
|
58265
58582
|
|
|
58266
58583
|
} );
|
|
58267
58584
|
|
|
58268
|
-
const Schlick_to_F0 =
|
|
58585
|
+
const Schlick_to_F0 = Fn( ( { f, f90, dotVH } ) => {
|
|
58269
58586
|
|
|
58270
58587
|
const x = dotVH.oneMinus().saturate();
|
|
58271
58588
|
const x2 = x.mul( x );
|
|
@@ -58284,7 +58601,7 @@ const Schlick_to_F0 = tslFn( ( { f, f90, dotVH } ) => {
|
|
|
58284
58601
|
} );
|
|
58285
58602
|
|
|
58286
58603
|
// https://github.com/google/filament/blob/master/shaders/src/brdf.fs
|
|
58287
|
-
const D_Charlie =
|
|
58604
|
+
const D_Charlie = Fn( ( { roughness, dotNH } ) => {
|
|
58288
58605
|
|
|
58289
58606
|
const alpha = roughness.pow2();
|
|
58290
58607
|
|
|
@@ -58305,7 +58622,7 @@ const D_Charlie = tslFn( ( { roughness, dotNH } ) => {
|
|
|
58305
58622
|
} );
|
|
58306
58623
|
|
|
58307
58624
|
// https://github.com/google/filament/blob/master/shaders/src/brdf.fs
|
|
58308
|
-
const V_Neubelt =
|
|
58625
|
+
const V_Neubelt = Fn( ( { dotNV, dotNL } ) => {
|
|
58309
58626
|
|
|
58310
58627
|
// Neubelt and Pettineo 2013, "Crafting a Next-gen Material Pipeline for The Order: 1886"
|
|
58311
58628
|
return float( 1.0 ).div( float( 4.0 ).mul( dotNL.add( dotNV ).sub( dotNL.mul( dotNV ) ) ) );
|
|
@@ -58319,7 +58636,7 @@ const V_Neubelt = tslFn( ( { dotNV, dotNL } ) => {
|
|
|
58319
58636
|
]
|
|
58320
58637
|
} );
|
|
58321
58638
|
|
|
58322
|
-
const BRDF_Sheen =
|
|
58639
|
+
const BRDF_Sheen = Fn( ( { lightDirection } ) => {
|
|
58323
58640
|
|
|
58324
58641
|
const halfDir = lightDirection.add( positionViewDirection ).normalize();
|
|
58325
58642
|
|
|
@@ -58340,7 +58657,7 @@ const BRDF_Sheen = tslFn( ( { lightDirection } ) => {
|
|
|
58340
58657
|
// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt
|
|
58341
58658
|
// code: https://github.com/selfshadow/ltc_code/
|
|
58342
58659
|
|
|
58343
|
-
const LTC_Uv =
|
|
58660
|
+
const LTC_Uv = Fn( ( { N, V, roughness } ) => {
|
|
58344
58661
|
|
|
58345
58662
|
const LUT_SIZE = 64.0;
|
|
58346
58663
|
const LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
|
|
@@ -58365,7 +58682,7 @@ const LTC_Uv = tslFn( ( { N, V, roughness } ) => {
|
|
|
58365
58682
|
]
|
|
58366
58683
|
} );
|
|
58367
58684
|
|
|
58368
|
-
const LTC_ClippedSphereFormFactor =
|
|
58685
|
+
const LTC_ClippedSphereFormFactor = Fn( ( { f } ) => {
|
|
58369
58686
|
|
|
58370
58687
|
// Real-Time Area Lighting: a Journey from Research to Production (p.102)
|
|
58371
58688
|
// An approximation of the form factor of a horizon-clipped rectangle.
|
|
@@ -58382,7 +58699,7 @@ const LTC_ClippedSphereFormFactor = tslFn( ( { f } ) => {
|
|
|
58382
58699
|
]
|
|
58383
58700
|
} );
|
|
58384
58701
|
|
|
58385
|
-
const LTC_EdgeVectorFormFactor =
|
|
58702
|
+
const LTC_EdgeVectorFormFactor = Fn( ( { v1, v2 } ) => {
|
|
58386
58703
|
|
|
58387
58704
|
const x = v1.dot( v2 );
|
|
58388
58705
|
const y = x.abs().toVar();
|
|
@@ -58392,7 +58709,7 @@ const LTC_EdgeVectorFormFactor = tslFn( ( { v1, v2 } ) => {
|
|
|
58392
58709
|
const b = y.add( 4.1616724 ).mul( y ).add( 3.4175940 ).toVar();
|
|
58393
58710
|
const v = a.div( b );
|
|
58394
58711
|
|
|
58395
|
-
const theta_sintheta = x.greaterThan( 0.0 ).
|
|
58712
|
+
const theta_sintheta = x.greaterThan( 0.0 ).select( v, max$1( x.mul( x ).oneMinus(), 1e-7 ).inverseSqrt().mul( 0.5 ).sub( v ) );
|
|
58396
58713
|
|
|
58397
58714
|
return v1.cross( v2 ).mul( theta_sintheta );
|
|
58398
58715
|
|
|
@@ -58405,7 +58722,7 @@ const LTC_EdgeVectorFormFactor = tslFn( ( { v1, v2 } ) => {
|
|
|
58405
58722
|
]
|
|
58406
58723
|
} );
|
|
58407
58724
|
|
|
58408
|
-
const LTC_Evaluate =
|
|
58725
|
+
const LTC_Evaluate = Fn( ( { N, V, P, mInv, p0, p1, p2, p3 } ) => {
|
|
58409
58726
|
|
|
58410
58727
|
// bail if point is on back side of plane of light
|
|
58411
58728
|
// assumes ccw winding order of light vertices
|
|
@@ -58464,7 +58781,7 @@ const LTC_Evaluate = tslFn( ( { N, V, P, mInv, p0, p1, p2, p3 } ) => {
|
|
|
58464
58781
|
// Transmission
|
|
58465
58782
|
//
|
|
58466
58783
|
|
|
58467
|
-
const getVolumeTransmissionRay =
|
|
58784
|
+
const getVolumeTransmissionRay = Fn( ( [ n, v, thickness, ior, modelMatrix ] ) => {
|
|
58468
58785
|
|
|
58469
58786
|
// Direction of refracted light.
|
|
58470
58787
|
const refractionVector = vec3( refract( v.negate(), normalize( n ), div( 1.0, ior ) ) );
|
|
@@ -58491,7 +58808,7 @@ const getVolumeTransmissionRay = tslFn( ( [ n, v, thickness, ior, modelMatrix ]
|
|
|
58491
58808
|
]
|
|
58492
58809
|
} );
|
|
58493
58810
|
|
|
58494
|
-
const applyIorToRoughness =
|
|
58811
|
+
const applyIorToRoughness = Fn( ( [ roughness, ior ] ) => {
|
|
58495
58812
|
|
|
58496
58813
|
// Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and
|
|
58497
58814
|
// an IOR of 1.5 results in the default amount of microfacet refraction.
|
|
@@ -58508,7 +58825,7 @@ const applyIorToRoughness = tslFn( ( [ roughness, ior ] ) => {
|
|
|
58508
58825
|
|
|
58509
58826
|
const singleViewportMipTexture = viewportMipTexture();
|
|
58510
58827
|
|
|
58511
|
-
const getTransmissionSample =
|
|
58828
|
+
const getTransmissionSample = Fn( ( [ fragCoord, roughness, ior ] ) => {
|
|
58512
58829
|
|
|
58513
58830
|
const transmissionSample = singleViewportMipTexture.uv( fragCoord );
|
|
58514
58831
|
//const transmissionSample = viewportMipTexture( fragCoord );
|
|
@@ -58519,7 +58836,7 @@ const getTransmissionSample = tslFn( ( [ fragCoord, roughness, ior ] ) => {
|
|
|
58519
58836
|
|
|
58520
58837
|
} );
|
|
58521
58838
|
|
|
58522
|
-
const volumeAttenuation =
|
|
58839
|
+
const volumeAttenuation = Fn( ( [ transmissionDistance, attenuationColor, attenuationDistance ] ) => {
|
|
58523
58840
|
|
|
58524
58841
|
If( attenuationDistance.notEqual( 0 ), () => {
|
|
58525
58842
|
|
|
@@ -58544,7 +58861,7 @@ const volumeAttenuation = tslFn( ( [ transmissionDistance, attenuationColor, att
|
|
|
58544
58861
|
]
|
|
58545
58862
|
} );
|
|
58546
58863
|
|
|
58547
|
-
const getIBLVolumeRefraction =
|
|
58864
|
+
const getIBLVolumeRefraction = Fn( ( [ n, v, roughness, diffuseColor, specularColor, specularF90, position, modelMatrix, viewMatrix, projMatrix, ior, thickness, attenuationColor, attenuationDistance, dispersion ] ) => {
|
|
58548
58865
|
|
|
58549
58866
|
let transmittedLight, transmittance;
|
|
58550
58867
|
|
|
@@ -58556,7 +58873,7 @@ const getIBLVolumeRefraction = tslFn( ( [ n, v, roughness, diffuseColor, specula
|
|
|
58556
58873
|
const halfSpread = ior.sub( 1.0 ).mul( dispersion.mul( 0.025 ) );
|
|
58557
58874
|
const iors = vec3( ior.sub( halfSpread ), ior, ior.add( halfSpread ) );
|
|
58558
58875
|
|
|
58559
|
-
|
|
58876
|
+
Loop( { start: 0, end: 3 }, ( { i } ) => {
|
|
58560
58877
|
|
|
58561
58878
|
const ior = iors.element( i );
|
|
58562
58879
|
|
|
@@ -58667,7 +58984,7 @@ const evalSensitivity = ( OPD, shift ) => {
|
|
|
58667
58984
|
|
|
58668
58985
|
};
|
|
58669
58986
|
|
|
58670
|
-
const evalIridescence =
|
|
58987
|
+
const evalIridescence = Fn( ( { outsideIOR, eta2, cosTheta1, thinFilmThickness, baseF0 } ) => {
|
|
58671
58988
|
|
|
58672
58989
|
// Force iridescenceIOR -> outsideIOR when thinFilmThickness -> 0.0
|
|
58673
58990
|
const iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
|
|
@@ -58689,7 +59006,7 @@ const evalIridescence = tslFn( ( { outsideIOR, eta2, cosTheta1, thinFilmThicknes
|
|
|
58689
59006
|
const R12 = F_Schlick( { f0: R0, f90: 1.0, dotVH: cosTheta1 } );
|
|
58690
59007
|
//const R21 = R12;
|
|
58691
59008
|
const T121 = R12.oneMinus();
|
|
58692
|
-
const phi12 = iridescenceIOR.lessThan( outsideIOR ).
|
|
59009
|
+
const phi12 = iridescenceIOR.lessThan( outsideIOR ).select( Math.PI, 0.0 );
|
|
58693
59010
|
const phi21 = float( Math.PI ).sub( phi12 );
|
|
58694
59011
|
|
|
58695
59012
|
// Second interface
|
|
@@ -58697,9 +59014,9 @@ const evalIridescence = tslFn( ( { outsideIOR, eta2, cosTheta1, thinFilmThicknes
|
|
|
58697
59014
|
const R1 = IorToFresnel0( baseIOR, iridescenceIOR.toVec3() );
|
|
58698
59015
|
const R23 = F_Schlick( { f0: R1, f90: 1.0, dotVH: cosTheta2 } );
|
|
58699
59016
|
const phi23 = vec3(
|
|
58700
|
-
baseIOR.x.lessThan( iridescenceIOR ).
|
|
58701
|
-
baseIOR.y.lessThan( iridescenceIOR ).
|
|
58702
|
-
baseIOR.z.lessThan( iridescenceIOR ).
|
|
59017
|
+
baseIOR.x.lessThan( iridescenceIOR ).select( Math.PI, 0.0 ),
|
|
59018
|
+
baseIOR.y.lessThan( iridescenceIOR ).select( Math.PI, 0.0 ),
|
|
59019
|
+
baseIOR.z.lessThan( iridescenceIOR ).select( Math.PI, 0.0 )
|
|
58703
59020
|
);
|
|
58704
59021
|
|
|
58705
59022
|
// Phase shift
|
|
@@ -58747,25 +59064,25 @@ const evalIridescence = tslFn( ( { outsideIOR, eta2, cosTheta1, thinFilmThicknes
|
|
|
58747
59064
|
// This is a curve-fit approxmation to the "Charlie sheen" BRDF integrated over the hemisphere from
|
|
58748
59065
|
// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF". The analysis can be found
|
|
58749
59066
|
// in the Sheen section of https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing
|
|
58750
|
-
const IBLSheenBRDF =
|
|
59067
|
+
const IBLSheenBRDF = Fn( ( { normal, viewDir, roughness } ) => {
|
|
58751
59068
|
|
|
58752
59069
|
const dotNV = normal.dot( viewDir ).saturate();
|
|
58753
59070
|
|
|
58754
59071
|
const r2 = roughness.pow2();
|
|
58755
59072
|
|
|
58756
|
-
const a =
|
|
59073
|
+
const a = select(
|
|
58757
59074
|
roughness.lessThan( 0.25 ),
|
|
58758
59075
|
float( - 339.2 ).mul( r2 ).add( float( 161.4 ).mul( roughness ) ).sub( 25.9 ),
|
|
58759
59076
|
float( - 8.48 ).mul( r2 ).add( float( 14.3 ).mul( roughness ) ).sub( 9.95 )
|
|
58760
59077
|
);
|
|
58761
59078
|
|
|
58762
|
-
const b =
|
|
59079
|
+
const b = select(
|
|
58763
59080
|
roughness.lessThan( 0.25 ),
|
|
58764
59081
|
float( 44.0 ).mul( r2 ).sub( float( 23.7 ).mul( roughness ) ).add( 3.26 ),
|
|
58765
59082
|
float( 1.97 ).mul( r2 ).sub( float( 3.27 ).mul( roughness ) ).add( 0.72 )
|
|
58766
59083
|
);
|
|
58767
59084
|
|
|
58768
|
-
const DG =
|
|
59085
|
+
const DG = select( roughness.lessThan( 0.25 ), 0.0, float( 0.1 ).mul( roughness ).sub( 0.025 ) ).add( a.mul( dotNV ).add( b ).exp() );
|
|
58769
59086
|
|
|
58770
59087
|
return DG.mul( 1.0 / Math.PI ).saturate();
|
|
58771
59088
|
|
|
@@ -59306,7 +59623,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
|
|
|
59306
59623
|
|
|
59307
59624
|
anisotropyV.assign( vec2( 1.0, 0.0 ) );
|
|
59308
59625
|
|
|
59309
|
-
} ).
|
|
59626
|
+
} ).Else( () => {
|
|
59310
59627
|
|
|
59311
59628
|
anisotropyV.divAssign( vec2( anisotropy ) );
|
|
59312
59629
|
anisotropy.assign( anisotropy.saturate() );
|
|
@@ -59467,7 +59784,7 @@ class MeshSSSNodeMaterial extends MeshPhysicalNodeMaterial {
|
|
|
59467
59784
|
|
|
59468
59785
|
addNodeMaterial( 'MeshSSSNodeMaterial', MeshSSSNodeMaterial );
|
|
59469
59786
|
|
|
59470
|
-
const getGradientIrradiance =
|
|
59787
|
+
const getGradientIrradiance = Fn( ( { normal, lightDirection, builder } ) => {
|
|
59471
59788
|
|
|
59472
59789
|
// dotNL will be from -1.0 to 1.0
|
|
59473
59790
|
const dotNL = normal.dot( lightDirection );
|
|
@@ -59765,7 +60082,7 @@ class VolumeNodeMaterial extends NodeMaterial {
|
|
|
59765
60082
|
|
|
59766
60083
|
const map = texture3D( this.map, null, 0 );
|
|
59767
60084
|
|
|
59768
|
-
const hitBox =
|
|
60085
|
+
const hitBox = Fn( ( { orig, dir } ) => {
|
|
59769
60086
|
|
|
59770
60087
|
const box_min = vec3( - 0.5 );
|
|
59771
60088
|
const box_max = vec3( 0.5 );
|
|
@@ -59785,7 +60102,7 @@ class VolumeNodeMaterial extends NodeMaterial {
|
|
|
59785
60102
|
|
|
59786
60103
|
} );
|
|
59787
60104
|
|
|
59788
|
-
this.fragmentNode =
|
|
60105
|
+
this.fragmentNode = Fn( () => {
|
|
59789
60106
|
|
|
59790
60107
|
const vOrigin = varying( vec3( modelWorldMatrixInverse.mul( vec4( cameraPosition, 1.0 ) ) ) );
|
|
59791
60108
|
const vDirection = varying( positionGeometry.sub( vOrigin ) );
|
|
@@ -59805,7 +60122,7 @@ class VolumeNodeMaterial extends NodeMaterial {
|
|
|
59805
60122
|
|
|
59806
60123
|
const ac = property( 'vec4', 'ac' ).assign( vec4( materialReference( 'base', 'color' ), 0.0 ) );
|
|
59807
60124
|
|
|
59808
|
-
|
|
60125
|
+
Loop( { type: 'float', start: bounds.x, end: bounds.y, update: '+= delta' }, () => {
|
|
59809
60126
|
|
|
59810
60127
|
const d = property( 'float', 'd' ).assign( map.uv( p.add( 0.5 ) ).r );
|
|
59811
60128
|
|
|
@@ -60153,13 +60470,13 @@ class GLSLNodeParser extends NodeParser {
|
|
|
60153
60470
|
|
|
60154
60471
|
|
|
60155
60472
|
|
|
60156
|
-
const mx_select = /*#__PURE__*/
|
|
60473
|
+
const mx_select = /*#__PURE__*/ Fn( ( [ b_immutable, t_immutable, f_immutable ] ) => {
|
|
60157
60474
|
|
|
60158
60475
|
const f = float( f_immutable ).toVar();
|
|
60159
60476
|
const t = float( t_immutable ).toVar();
|
|
60160
60477
|
const b = bool( b_immutable ).toVar();
|
|
60161
60478
|
|
|
60162
|
-
return
|
|
60479
|
+
return select( b, t, f );
|
|
60163
60480
|
|
|
60164
60481
|
} ).setLayout( {
|
|
60165
60482
|
name: 'mx_select',
|
|
@@ -60171,12 +60488,12 @@ const mx_select = /*#__PURE__*/ tslFn( ( [ b_immutable, t_immutable, f_immutable
|
|
|
60171
60488
|
]
|
|
60172
60489
|
} );
|
|
60173
60490
|
|
|
60174
|
-
const mx_negate_if = /*#__PURE__*/
|
|
60491
|
+
const mx_negate_if = /*#__PURE__*/ Fn( ( [ val_immutable, b_immutable ] ) => {
|
|
60175
60492
|
|
|
60176
60493
|
const b = bool( b_immutable ).toVar();
|
|
60177
60494
|
const val = float( val_immutable ).toVar();
|
|
60178
60495
|
|
|
60179
|
-
return
|
|
60496
|
+
return select( b, val.negate(), val );
|
|
60180
60497
|
|
|
60181
60498
|
} ).setLayout( {
|
|
60182
60499
|
name: 'mx_negate_if',
|
|
@@ -60187,7 +60504,7 @@ const mx_negate_if = /*#__PURE__*/ tslFn( ( [ val_immutable, b_immutable ] ) =>
|
|
|
60187
60504
|
]
|
|
60188
60505
|
} );
|
|
60189
60506
|
|
|
60190
|
-
const mx_floor = /*#__PURE__*/
|
|
60507
|
+
const mx_floor = /*#__PURE__*/ Fn( ( [ x_immutable ] ) => {
|
|
60191
60508
|
|
|
60192
60509
|
const x = float( x_immutable ).toVar();
|
|
60193
60510
|
|
|
@@ -60201,7 +60518,7 @@ const mx_floor = /*#__PURE__*/ tslFn( ( [ x_immutable ] ) => {
|
|
|
60201
60518
|
]
|
|
60202
60519
|
} );
|
|
60203
60520
|
|
|
60204
|
-
const mx_floorfrac = /*#__PURE__*/
|
|
60521
|
+
const mx_floorfrac = /*#__PURE__*/ Fn( ( [ x_immutable, i ] ) => {
|
|
60205
60522
|
|
|
60206
60523
|
const x = float( x_immutable ).toVar();
|
|
60207
60524
|
i.assign( mx_floor( x ) );
|
|
@@ -60210,7 +60527,7 @@ const mx_floorfrac = /*#__PURE__*/ tslFn( ( [ x_immutable, i ] ) => {
|
|
|
60210
60527
|
|
|
60211
60528
|
} );
|
|
60212
60529
|
|
|
60213
|
-
const mx_bilerp_0 = /*#__PURE__*/
|
|
60530
|
+
const mx_bilerp_0 = /*#__PURE__*/ Fn( ( [ v0_immutable, v1_immutable, v2_immutable, v3_immutable, s_immutable, t_immutable ] ) => {
|
|
60214
60531
|
|
|
60215
60532
|
const t = float( t_immutable ).toVar();
|
|
60216
60533
|
const s = float( s_immutable ).toVar();
|
|
@@ -60235,7 +60552,7 @@ const mx_bilerp_0 = /*#__PURE__*/ tslFn( ( [ v0_immutable, v1_immutable, v2_immu
|
|
|
60235
60552
|
]
|
|
60236
60553
|
} );
|
|
60237
60554
|
|
|
60238
|
-
const mx_bilerp_1 = /*#__PURE__*/
|
|
60555
|
+
const mx_bilerp_1 = /*#__PURE__*/ Fn( ( [ v0_immutable, v1_immutable, v2_immutable, v3_immutable, s_immutable, t_immutable ] ) => {
|
|
60239
60556
|
|
|
60240
60557
|
const t = float( t_immutable ).toVar();
|
|
60241
60558
|
const s = float( s_immutable ).toVar();
|
|
@@ -60262,7 +60579,7 @@ const mx_bilerp_1 = /*#__PURE__*/ tslFn( ( [ v0_immutable, v1_immutable, v2_immu
|
|
|
60262
60579
|
|
|
60263
60580
|
const mx_bilerp = /*#__PURE__*/ overloadingFn( [ mx_bilerp_0, mx_bilerp_1 ] );
|
|
60264
60581
|
|
|
60265
|
-
const mx_trilerp_0 = /*#__PURE__*/
|
|
60582
|
+
const mx_trilerp_0 = /*#__PURE__*/ Fn( ( [ v0_immutable, v1_immutable, v2_immutable, v3_immutable, v4_immutable, v5_immutable, v6_immutable, v7_immutable, s_immutable, t_immutable, r_immutable ] ) => {
|
|
60266
60583
|
|
|
60267
60584
|
const r = float( r_immutable ).toVar();
|
|
60268
60585
|
const t = float( t_immutable ).toVar();
|
|
@@ -60299,7 +60616,7 @@ const mx_trilerp_0 = /*#__PURE__*/ tslFn( ( [ v0_immutable, v1_immutable, v2_imm
|
|
|
60299
60616
|
]
|
|
60300
60617
|
} );
|
|
60301
60618
|
|
|
60302
|
-
const mx_trilerp_1 = /*#__PURE__*/
|
|
60619
|
+
const mx_trilerp_1 = /*#__PURE__*/ Fn( ( [ v0_immutable, v1_immutable, v2_immutable, v3_immutable, v4_immutable, v5_immutable, v6_immutable, v7_immutable, s_immutable, t_immutable, r_immutable ] ) => {
|
|
60303
60620
|
|
|
60304
60621
|
const r = float( r_immutable ).toVar();
|
|
60305
60622
|
const t = float( t_immutable ).toVar();
|
|
@@ -60338,7 +60655,7 @@ const mx_trilerp_1 = /*#__PURE__*/ tslFn( ( [ v0_immutable, v1_immutable, v2_imm
|
|
|
60338
60655
|
|
|
60339
60656
|
const mx_trilerp = /*#__PURE__*/ overloadingFn( [ mx_trilerp_0, mx_trilerp_1 ] );
|
|
60340
60657
|
|
|
60341
|
-
const mx_gradient_float_0 = /*#__PURE__*/
|
|
60658
|
+
const mx_gradient_float_0 = /*#__PURE__*/ Fn( ( [ hash_immutable, x_immutable, y_immutable ] ) => {
|
|
60342
60659
|
|
|
60343
60660
|
const y = float( y_immutable ).toVar();
|
|
60344
60661
|
const x = float( x_immutable ).toVar();
|
|
@@ -60359,7 +60676,7 @@ const mx_gradient_float_0 = /*#__PURE__*/ tslFn( ( [ hash_immutable, x_immutable
|
|
|
60359
60676
|
]
|
|
60360
60677
|
} );
|
|
60361
60678
|
|
|
60362
|
-
const mx_gradient_float_1 = /*#__PURE__*/
|
|
60679
|
+
const mx_gradient_float_1 = /*#__PURE__*/ Fn( ( [ hash_immutable, x_immutable, y_immutable, z_immutable ] ) => {
|
|
60363
60680
|
|
|
60364
60681
|
const z = float( z_immutable ).toVar();
|
|
60365
60682
|
const y = float( y_immutable ).toVar();
|
|
@@ -60384,7 +60701,7 @@ const mx_gradient_float_1 = /*#__PURE__*/ tslFn( ( [ hash_immutable, x_immutable
|
|
|
60384
60701
|
|
|
60385
60702
|
const mx_gradient_float = /*#__PURE__*/ overloadingFn( [ mx_gradient_float_0, mx_gradient_float_1 ] );
|
|
60386
60703
|
|
|
60387
|
-
const mx_gradient_vec3_0 = /*#__PURE__*/
|
|
60704
|
+
const mx_gradient_vec3_0 = /*#__PURE__*/ Fn( ( [ hash_immutable, x_immutable, y_immutable ] ) => {
|
|
60388
60705
|
|
|
60389
60706
|
const y = float( y_immutable ).toVar();
|
|
60390
60707
|
const x = float( x_immutable ).toVar();
|
|
@@ -60402,7 +60719,7 @@ const mx_gradient_vec3_0 = /*#__PURE__*/ tslFn( ( [ hash_immutable, x_immutable,
|
|
|
60402
60719
|
]
|
|
60403
60720
|
} );
|
|
60404
60721
|
|
|
60405
|
-
const mx_gradient_vec3_1 = /*#__PURE__*/
|
|
60722
|
+
const mx_gradient_vec3_1 = /*#__PURE__*/ Fn( ( [ hash_immutable, x_immutable, y_immutable, z_immutable ] ) => {
|
|
60406
60723
|
|
|
60407
60724
|
const z = float( z_immutable ).toVar();
|
|
60408
60725
|
const y = float( y_immutable ).toVar();
|
|
@@ -60424,7 +60741,7 @@ const mx_gradient_vec3_1 = /*#__PURE__*/ tslFn( ( [ hash_immutable, x_immutable,
|
|
|
60424
60741
|
|
|
60425
60742
|
const mx_gradient_vec3 = /*#__PURE__*/ overloadingFn( [ mx_gradient_vec3_0, mx_gradient_vec3_1 ] );
|
|
60426
60743
|
|
|
60427
|
-
const mx_gradient_scale2d_0 = /*#__PURE__*/
|
|
60744
|
+
const mx_gradient_scale2d_0 = /*#__PURE__*/ Fn( ( [ v_immutable ] ) => {
|
|
60428
60745
|
|
|
60429
60746
|
const v = float( v_immutable ).toVar();
|
|
60430
60747
|
|
|
@@ -60438,7 +60755,7 @@ const mx_gradient_scale2d_0 = /*#__PURE__*/ tslFn( ( [ v_immutable ] ) => {
|
|
|
60438
60755
|
]
|
|
60439
60756
|
} );
|
|
60440
60757
|
|
|
60441
|
-
const mx_gradient_scale3d_0 = /*#__PURE__*/
|
|
60758
|
+
const mx_gradient_scale3d_0 = /*#__PURE__*/ Fn( ( [ v_immutable ] ) => {
|
|
60442
60759
|
|
|
60443
60760
|
const v = float( v_immutable ).toVar();
|
|
60444
60761
|
|
|
@@ -60452,7 +60769,7 @@ const mx_gradient_scale3d_0 = /*#__PURE__*/ tslFn( ( [ v_immutable ] ) => {
|
|
|
60452
60769
|
]
|
|
60453
60770
|
} );
|
|
60454
60771
|
|
|
60455
|
-
const mx_gradient_scale2d_1 = /*#__PURE__*/
|
|
60772
|
+
const mx_gradient_scale2d_1 = /*#__PURE__*/ Fn( ( [ v_immutable ] ) => {
|
|
60456
60773
|
|
|
60457
60774
|
const v = vec3( v_immutable ).toVar();
|
|
60458
60775
|
|
|
@@ -60468,7 +60785,7 @@ const mx_gradient_scale2d_1 = /*#__PURE__*/ tslFn( ( [ v_immutable ] ) => {
|
|
|
60468
60785
|
|
|
60469
60786
|
const mx_gradient_scale2d = /*#__PURE__*/ overloadingFn( [ mx_gradient_scale2d_0, mx_gradient_scale2d_1 ] );
|
|
60470
60787
|
|
|
60471
|
-
const mx_gradient_scale3d_1 = /*#__PURE__*/
|
|
60788
|
+
const mx_gradient_scale3d_1 = /*#__PURE__*/ Fn( ( [ v_immutable ] ) => {
|
|
60472
60789
|
|
|
60473
60790
|
const v = vec3( v_immutable ).toVar();
|
|
60474
60791
|
|
|
@@ -60484,7 +60801,7 @@ const mx_gradient_scale3d_1 = /*#__PURE__*/ tslFn( ( [ v_immutable ] ) => {
|
|
|
60484
60801
|
|
|
60485
60802
|
const mx_gradient_scale3d = /*#__PURE__*/ overloadingFn( [ mx_gradient_scale3d_0, mx_gradient_scale3d_1 ] );
|
|
60486
60803
|
|
|
60487
|
-
const mx_rotl32 = /*#__PURE__*/
|
|
60804
|
+
const mx_rotl32 = /*#__PURE__*/ Fn( ( [ x_immutable, k_immutable ] ) => {
|
|
60488
60805
|
|
|
60489
60806
|
const k = int( k_immutable ).toVar();
|
|
60490
60807
|
const x = uint( x_immutable ).toVar();
|
|
@@ -60500,7 +60817,7 @@ const mx_rotl32 = /*#__PURE__*/ tslFn( ( [ x_immutable, k_immutable ] ) => {
|
|
|
60500
60817
|
]
|
|
60501
60818
|
} );
|
|
60502
60819
|
|
|
60503
|
-
const mx_bjmix = /*#__PURE__*/
|
|
60820
|
+
const mx_bjmix = /*#__PURE__*/ Fn( ( [ a, b, c ] ) => {
|
|
60504
60821
|
|
|
60505
60822
|
a.subAssign( c );
|
|
60506
60823
|
a.bitXorAssign( mx_rotl32( c, int( 4 ) ) );
|
|
@@ -60523,7 +60840,7 @@ const mx_bjmix = /*#__PURE__*/ tslFn( ( [ a, b, c ] ) => {
|
|
|
60523
60840
|
|
|
60524
60841
|
} );
|
|
60525
60842
|
|
|
60526
|
-
const mx_bjfinal = /*#__PURE__*/
|
|
60843
|
+
const mx_bjfinal = /*#__PURE__*/ Fn( ( [ a_immutable, b_immutable, c_immutable ] ) => {
|
|
60527
60844
|
|
|
60528
60845
|
const c = uint( c_immutable ).toVar();
|
|
60529
60846
|
const b = uint( b_immutable ).toVar();
|
|
@@ -60555,7 +60872,7 @@ const mx_bjfinal = /*#__PURE__*/ tslFn( ( [ a_immutable, b_immutable, c_immutabl
|
|
|
60555
60872
|
]
|
|
60556
60873
|
} );
|
|
60557
60874
|
|
|
60558
|
-
const mx_bits_to_01 = /*#__PURE__*/
|
|
60875
|
+
const mx_bits_to_01 = /*#__PURE__*/ Fn( ( [ bits_immutable ] ) => {
|
|
60559
60876
|
|
|
60560
60877
|
const bits = uint( bits_immutable ).toVar();
|
|
60561
60878
|
|
|
@@ -60569,7 +60886,7 @@ const mx_bits_to_01 = /*#__PURE__*/ tslFn( ( [ bits_immutable ] ) => {
|
|
|
60569
60886
|
]
|
|
60570
60887
|
} );
|
|
60571
60888
|
|
|
60572
|
-
const mx_fade = /*#__PURE__*/
|
|
60889
|
+
const mx_fade = /*#__PURE__*/ Fn( ( [ t_immutable ] ) => {
|
|
60573
60890
|
|
|
60574
60891
|
const t = float( t_immutable ).toVar();
|
|
60575
60892
|
|
|
@@ -60583,7 +60900,7 @@ const mx_fade = /*#__PURE__*/ tslFn( ( [ t_immutable ] ) => {
|
|
|
60583
60900
|
]
|
|
60584
60901
|
} );
|
|
60585
60902
|
|
|
60586
|
-
const mx_hash_int_0 = /*#__PURE__*/
|
|
60903
|
+
const mx_hash_int_0 = /*#__PURE__*/ Fn( ( [ x_immutable ] ) => {
|
|
60587
60904
|
|
|
60588
60905
|
const x = int( x_immutable ).toVar();
|
|
60589
60906
|
const len = uint( uint( 1 ) ).toVar();
|
|
@@ -60599,7 +60916,7 @@ const mx_hash_int_0 = /*#__PURE__*/ tslFn( ( [ x_immutable ] ) => {
|
|
|
60599
60916
|
]
|
|
60600
60917
|
} );
|
|
60601
60918
|
|
|
60602
|
-
const mx_hash_int_1 = /*#__PURE__*/
|
|
60919
|
+
const mx_hash_int_1 = /*#__PURE__*/ Fn( ( [ x_immutable, y_immutable ] ) => {
|
|
60603
60920
|
|
|
60604
60921
|
const y = int( y_immutable ).toVar();
|
|
60605
60922
|
const x = int( x_immutable ).toVar();
|
|
@@ -60620,7 +60937,7 @@ const mx_hash_int_1 = /*#__PURE__*/ tslFn( ( [ x_immutable, y_immutable ] ) => {
|
|
|
60620
60937
|
]
|
|
60621
60938
|
} );
|
|
60622
60939
|
|
|
60623
|
-
const mx_hash_int_2 = /*#__PURE__*/
|
|
60940
|
+
const mx_hash_int_2 = /*#__PURE__*/ Fn( ( [ x_immutable, y_immutable, z_immutable ] ) => {
|
|
60624
60941
|
|
|
60625
60942
|
const z = int( z_immutable ).toVar();
|
|
60626
60943
|
const y = int( y_immutable ).toVar();
|
|
@@ -60644,7 +60961,7 @@ const mx_hash_int_2 = /*#__PURE__*/ tslFn( ( [ x_immutable, y_immutable, z_immut
|
|
|
60644
60961
|
]
|
|
60645
60962
|
} );
|
|
60646
60963
|
|
|
60647
|
-
const mx_hash_int_3 = /*#__PURE__*/
|
|
60964
|
+
const mx_hash_int_3 = /*#__PURE__*/ Fn( ( [ x_immutable, y_immutable, z_immutable, xx_immutable ] ) => {
|
|
60648
60965
|
|
|
60649
60966
|
const xx = int( xx_immutable ).toVar();
|
|
60650
60967
|
const z = int( z_immutable ).toVar();
|
|
@@ -60672,7 +60989,7 @@ const mx_hash_int_3 = /*#__PURE__*/ tslFn( ( [ x_immutable, y_immutable, z_immut
|
|
|
60672
60989
|
]
|
|
60673
60990
|
} );
|
|
60674
60991
|
|
|
60675
|
-
const mx_hash_int_4 = /*#__PURE__*/
|
|
60992
|
+
const mx_hash_int_4 = /*#__PURE__*/ Fn( ( [ x_immutable, y_immutable, z_immutable, xx_immutable, yy_immutable ] ) => {
|
|
60676
60993
|
|
|
60677
60994
|
const yy = int( yy_immutable ).toVar();
|
|
60678
60995
|
const xx = int( xx_immutable ).toVar();
|
|
@@ -60705,7 +61022,7 @@ const mx_hash_int_4 = /*#__PURE__*/ tslFn( ( [ x_immutable, y_immutable, z_immut
|
|
|
60705
61022
|
|
|
60706
61023
|
const mx_hash_int = /*#__PURE__*/ overloadingFn( [ mx_hash_int_0, mx_hash_int_1, mx_hash_int_2, mx_hash_int_3, mx_hash_int_4 ] );
|
|
60707
61024
|
|
|
60708
|
-
const mx_hash_vec3_0 = /*#__PURE__*/
|
|
61025
|
+
const mx_hash_vec3_0 = /*#__PURE__*/ Fn( ( [ x_immutable, y_immutable ] ) => {
|
|
60709
61026
|
|
|
60710
61027
|
const y = int( y_immutable ).toVar();
|
|
60711
61028
|
const x = int( x_immutable ).toVar();
|
|
@@ -60726,7 +61043,7 @@ const mx_hash_vec3_0 = /*#__PURE__*/ tslFn( ( [ x_immutable, y_immutable ] ) =>
|
|
|
60726
61043
|
]
|
|
60727
61044
|
} );
|
|
60728
61045
|
|
|
60729
|
-
const mx_hash_vec3_1 = /*#__PURE__*/
|
|
61046
|
+
const mx_hash_vec3_1 = /*#__PURE__*/ Fn( ( [ x_immutable, y_immutable, z_immutable ] ) => {
|
|
60730
61047
|
|
|
60731
61048
|
const z = int( z_immutable ).toVar();
|
|
60732
61049
|
const y = int( y_immutable ).toVar();
|
|
@@ -60751,7 +61068,7 @@ const mx_hash_vec3_1 = /*#__PURE__*/ tslFn( ( [ x_immutable, y_immutable, z_immu
|
|
|
60751
61068
|
|
|
60752
61069
|
const mx_hash_vec3 = /*#__PURE__*/ overloadingFn( [ mx_hash_vec3_0, mx_hash_vec3_1 ] );
|
|
60753
61070
|
|
|
60754
|
-
const mx_perlin_noise_float_0 = /*#__PURE__*/
|
|
61071
|
+
const mx_perlin_noise_float_0 = /*#__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
60755
61072
|
|
|
60756
61073
|
const p = vec2( p_immutable ).toVar();
|
|
60757
61074
|
const X = int().toVar(), Y = int().toVar();
|
|
@@ -60771,7 +61088,7 @@ const mx_perlin_noise_float_0 = /*#__PURE__*/ tslFn( ( [ p_immutable ] ) => {
|
|
|
60771
61088
|
]
|
|
60772
61089
|
} );
|
|
60773
61090
|
|
|
60774
|
-
const mx_perlin_noise_float_1 = /*#__PURE__*/
|
|
61091
|
+
const mx_perlin_noise_float_1 = /*#__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
60775
61092
|
|
|
60776
61093
|
const p = vec3( p_immutable ).toVar();
|
|
60777
61094
|
const X = int().toVar(), Y = int().toVar(), Z = int().toVar();
|
|
@@ -60795,7 +61112,7 @@ const mx_perlin_noise_float_1 = /*#__PURE__*/ tslFn( ( [ p_immutable ] ) => {
|
|
|
60795
61112
|
|
|
60796
61113
|
const mx_perlin_noise_float = /*#__PURE__*/ overloadingFn( [ mx_perlin_noise_float_0, mx_perlin_noise_float_1 ] );
|
|
60797
61114
|
|
|
60798
|
-
const mx_perlin_noise_vec3_0 = /*#__PURE__*/
|
|
61115
|
+
const mx_perlin_noise_vec3_0 = /*#__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
60799
61116
|
|
|
60800
61117
|
const p = vec2( p_immutable ).toVar();
|
|
60801
61118
|
const X = int().toVar(), Y = int().toVar();
|
|
@@ -60815,7 +61132,7 @@ const mx_perlin_noise_vec3_0 = /*#__PURE__*/ tslFn( ( [ p_immutable ] ) => {
|
|
|
60815
61132
|
]
|
|
60816
61133
|
} );
|
|
60817
61134
|
|
|
60818
|
-
const mx_perlin_noise_vec3_1 = /*#__PURE__*/
|
|
61135
|
+
const mx_perlin_noise_vec3_1 = /*#__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
60819
61136
|
|
|
60820
61137
|
const p = vec3( p_immutable ).toVar();
|
|
60821
61138
|
const X = int().toVar(), Y = int().toVar(), Z = int().toVar();
|
|
@@ -60839,7 +61156,7 @@ const mx_perlin_noise_vec3_1 = /*#__PURE__*/ tslFn( ( [ p_immutable ] ) => {
|
|
|
60839
61156
|
|
|
60840
61157
|
const mx_perlin_noise_vec3 = /*#__PURE__*/ overloadingFn( [ mx_perlin_noise_vec3_0, mx_perlin_noise_vec3_1 ] );
|
|
60841
61158
|
|
|
60842
|
-
const mx_cell_noise_float_0 = /*#__PURE__*/
|
|
61159
|
+
const mx_cell_noise_float_0 = /*#__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
60843
61160
|
|
|
60844
61161
|
const p = float( p_immutable ).toVar();
|
|
60845
61162
|
const ix = int( mx_floor( p ) ).toVar();
|
|
@@ -60854,7 +61171,7 @@ const mx_cell_noise_float_0 = /*#__PURE__*/ tslFn( ( [ p_immutable ] ) => {
|
|
|
60854
61171
|
]
|
|
60855
61172
|
} );
|
|
60856
61173
|
|
|
60857
|
-
const mx_cell_noise_float_1 = /*#__PURE__*/
|
|
61174
|
+
const mx_cell_noise_float_1 = /*#__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
60858
61175
|
|
|
60859
61176
|
const p = vec2( p_immutable ).toVar();
|
|
60860
61177
|
const ix = int( mx_floor( p.x ) ).toVar();
|
|
@@ -60870,7 +61187,7 @@ const mx_cell_noise_float_1 = /*#__PURE__*/ tslFn( ( [ p_immutable ] ) => {
|
|
|
60870
61187
|
]
|
|
60871
61188
|
} );
|
|
60872
61189
|
|
|
60873
|
-
const mx_cell_noise_float_2 = /*#__PURE__*/
|
|
61190
|
+
const mx_cell_noise_float_2 = /*#__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
60874
61191
|
|
|
60875
61192
|
const p = vec3( p_immutable ).toVar();
|
|
60876
61193
|
const ix = int( mx_floor( p.x ) ).toVar();
|
|
@@ -60887,7 +61204,7 @@ const mx_cell_noise_float_2 = /*#__PURE__*/ tslFn( ( [ p_immutable ] ) => {
|
|
|
60887
61204
|
]
|
|
60888
61205
|
} );
|
|
60889
61206
|
|
|
60890
|
-
const mx_cell_noise_float_3 = /*#__PURE__*/
|
|
61207
|
+
const mx_cell_noise_float_3 = /*#__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
60891
61208
|
|
|
60892
61209
|
const p = vec4( p_immutable ).toVar();
|
|
60893
61210
|
const ix = int( mx_floor( p.x ) ).toVar();
|
|
@@ -60907,7 +61224,7 @@ const mx_cell_noise_float_3 = /*#__PURE__*/ tslFn( ( [ p_immutable ] ) => {
|
|
|
60907
61224
|
|
|
60908
61225
|
const mx_cell_noise_float$1 = /*#__PURE__*/ overloadingFn( [ mx_cell_noise_float_0, mx_cell_noise_float_1, mx_cell_noise_float_2, mx_cell_noise_float_3 ] );
|
|
60909
61226
|
|
|
60910
|
-
const mx_cell_noise_vec3_0 = /*#__PURE__*/
|
|
61227
|
+
const mx_cell_noise_vec3_0 = /*#__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
60911
61228
|
|
|
60912
61229
|
const p = float( p_immutable ).toVar();
|
|
60913
61230
|
const ix = int( mx_floor( p ) ).toVar();
|
|
@@ -60922,7 +61239,7 @@ const mx_cell_noise_vec3_0 = /*#__PURE__*/ tslFn( ( [ p_immutable ] ) => {
|
|
|
60922
61239
|
]
|
|
60923
61240
|
} );
|
|
60924
61241
|
|
|
60925
|
-
const mx_cell_noise_vec3_1 = /*#__PURE__*/
|
|
61242
|
+
const mx_cell_noise_vec3_1 = /*#__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
60926
61243
|
|
|
60927
61244
|
const p = vec2( p_immutable ).toVar();
|
|
60928
61245
|
const ix = int( mx_floor( p.x ) ).toVar();
|
|
@@ -60938,7 +61255,7 @@ const mx_cell_noise_vec3_1 = /*#__PURE__*/ tslFn( ( [ p_immutable ] ) => {
|
|
|
60938
61255
|
]
|
|
60939
61256
|
} );
|
|
60940
61257
|
|
|
60941
|
-
const mx_cell_noise_vec3_2 = /*#__PURE__*/
|
|
61258
|
+
const mx_cell_noise_vec3_2 = /*#__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
60942
61259
|
|
|
60943
61260
|
const p = vec3( p_immutable ).toVar();
|
|
60944
61261
|
const ix = int( mx_floor( p.x ) ).toVar();
|
|
@@ -60955,7 +61272,7 @@ const mx_cell_noise_vec3_2 = /*#__PURE__*/ tslFn( ( [ p_immutable ] ) => {
|
|
|
60955
61272
|
]
|
|
60956
61273
|
} );
|
|
60957
61274
|
|
|
60958
|
-
const mx_cell_noise_vec3_3 = /*#__PURE__*/
|
|
61275
|
+
const mx_cell_noise_vec3_3 = /*#__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
60959
61276
|
|
|
60960
61277
|
const p = vec4( p_immutable ).toVar();
|
|
60961
61278
|
const ix = int( mx_floor( p.x ) ).toVar();
|
|
@@ -60975,7 +61292,7 @@ const mx_cell_noise_vec3_3 = /*#__PURE__*/ tslFn( ( [ p_immutable ] ) => {
|
|
|
60975
61292
|
|
|
60976
61293
|
const mx_cell_noise_vec3 = /*#__PURE__*/ overloadingFn( [ mx_cell_noise_vec3_0, mx_cell_noise_vec3_1, mx_cell_noise_vec3_2, mx_cell_noise_vec3_3 ] );
|
|
60977
61294
|
|
|
60978
|
-
const mx_fractal_noise_float$1 = /*#__PURE__*/
|
|
61295
|
+
const mx_fractal_noise_float$1 = /*#__PURE__*/ Fn( ( [ p_immutable, octaves_immutable, lacunarity_immutable, diminish_immutable ] ) => {
|
|
60979
61296
|
|
|
60980
61297
|
const diminish = float( diminish_immutable ).toVar();
|
|
60981
61298
|
const lacunarity = float( lacunarity_immutable ).toVar();
|
|
@@ -60984,7 +61301,7 @@ const mx_fractal_noise_float$1 = /*#__PURE__*/ tslFn( ( [ p_immutable, octaves_i
|
|
|
60984
61301
|
const result = float( 0.0 ).toVar();
|
|
60985
61302
|
const amplitude = float( 1.0 ).toVar();
|
|
60986
61303
|
|
|
60987
|
-
|
|
61304
|
+
Loop( octaves, () => {
|
|
60988
61305
|
|
|
60989
61306
|
result.addAssign( amplitude.mul( mx_perlin_noise_float( p ) ) );
|
|
60990
61307
|
amplitude.mulAssign( diminish );
|
|
@@ -61005,7 +61322,7 @@ const mx_fractal_noise_float$1 = /*#__PURE__*/ tslFn( ( [ p_immutable, octaves_i
|
|
|
61005
61322
|
]
|
|
61006
61323
|
} );
|
|
61007
61324
|
|
|
61008
|
-
const mx_fractal_noise_vec3$1 = /*#__PURE__*/
|
|
61325
|
+
const mx_fractal_noise_vec3$1 = /*#__PURE__*/ Fn( ( [ p_immutable, octaves_immutable, lacunarity_immutable, diminish_immutable ] ) => {
|
|
61009
61326
|
|
|
61010
61327
|
const diminish = float( diminish_immutable ).toVar();
|
|
61011
61328
|
const lacunarity = float( lacunarity_immutable ).toVar();
|
|
@@ -61014,7 +61331,7 @@ const mx_fractal_noise_vec3$1 = /*#__PURE__*/ tslFn( ( [ p_immutable, octaves_im
|
|
|
61014
61331
|
const result = vec3( 0.0 ).toVar();
|
|
61015
61332
|
const amplitude = float( 1.0 ).toVar();
|
|
61016
61333
|
|
|
61017
|
-
|
|
61334
|
+
Loop( octaves, () => {
|
|
61018
61335
|
|
|
61019
61336
|
result.addAssign( amplitude.mul( mx_perlin_noise_vec3( p ) ) );
|
|
61020
61337
|
amplitude.mulAssign( diminish );
|
|
@@ -61035,7 +61352,7 @@ const mx_fractal_noise_vec3$1 = /*#__PURE__*/ tslFn( ( [ p_immutable, octaves_im
|
|
|
61035
61352
|
]
|
|
61036
61353
|
} );
|
|
61037
61354
|
|
|
61038
|
-
const mx_fractal_noise_vec2$1 = /*#__PURE__*/
|
|
61355
|
+
const mx_fractal_noise_vec2$1 = /*#__PURE__*/ Fn( ( [ p_immutable, octaves_immutable, lacunarity_immutable, diminish_immutable ] ) => {
|
|
61039
61356
|
|
|
61040
61357
|
const diminish = float( diminish_immutable ).toVar();
|
|
61041
61358
|
const lacunarity = float( lacunarity_immutable ).toVar();
|
|
@@ -61055,7 +61372,7 @@ const mx_fractal_noise_vec2$1 = /*#__PURE__*/ tslFn( ( [ p_immutable, octaves_im
|
|
|
61055
61372
|
]
|
|
61056
61373
|
} );
|
|
61057
61374
|
|
|
61058
|
-
const mx_fractal_noise_vec4$1 = /*#__PURE__*/
|
|
61375
|
+
const mx_fractal_noise_vec4$1 = /*#__PURE__*/ Fn( ( [ p_immutable, octaves_immutable, lacunarity_immutable, diminish_immutable ] ) => {
|
|
61059
61376
|
|
|
61060
61377
|
const diminish = float( diminish_immutable ).toVar();
|
|
61061
61378
|
const lacunarity = float( lacunarity_immutable ).toVar();
|
|
@@ -61077,7 +61394,7 @@ const mx_fractal_noise_vec4$1 = /*#__PURE__*/ tslFn( ( [ p_immutable, octaves_im
|
|
|
61077
61394
|
]
|
|
61078
61395
|
} );
|
|
61079
61396
|
|
|
61080
|
-
const mx_worley_distance_0 = /*#__PURE__*/
|
|
61397
|
+
const mx_worley_distance_0 = /*#__PURE__*/ Fn( ( [ p_immutable, x_immutable, y_immutable, xoff_immutable, yoff_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
61081
61398
|
|
|
61082
61399
|
const metric = int( metric_immutable ).toVar();
|
|
61083
61400
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -61122,7 +61439,7 @@ const mx_worley_distance_0 = /*#__PURE__*/ tslFn( ( [ p_immutable, x_immutable,
|
|
|
61122
61439
|
]
|
|
61123
61440
|
} );
|
|
61124
61441
|
|
|
61125
|
-
const mx_worley_distance_1 = /*#__PURE__*/
|
|
61442
|
+
const mx_worley_distance_1 = /*#__PURE__*/ Fn( ( [ p_immutable, x_immutable, y_immutable, z_immutable, xoff_immutable, yoff_immutable, zoff_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
61126
61443
|
|
|
61127
61444
|
const metric = int( metric_immutable ).toVar();
|
|
61128
61445
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -61172,7 +61489,7 @@ const mx_worley_distance_1 = /*#__PURE__*/ tslFn( ( [ p_immutable, x_immutable,
|
|
|
61172
61489
|
|
|
61173
61490
|
const mx_worley_distance = /*#__PURE__*/ overloadingFn( [ mx_worley_distance_0, mx_worley_distance_1 ] );
|
|
61174
61491
|
|
|
61175
|
-
const mx_worley_noise_float_0 = /*#__PURE__*/
|
|
61492
|
+
const mx_worley_noise_float_0 = /*#__PURE__*/ Fn( ( [ p_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
61176
61493
|
|
|
61177
61494
|
const metric = int( metric_immutable ).toVar();
|
|
61178
61495
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -61181,9 +61498,9 @@ const mx_worley_noise_float_0 = /*#__PURE__*/ tslFn( ( [ p_immutable, jitter_imm
|
|
|
61181
61498
|
const localpos = vec2( mx_floorfrac( p.x, X ), mx_floorfrac( p.y, Y ) ).toVar();
|
|
61182
61499
|
const sqdist = float( 1e6 ).toVar();
|
|
61183
61500
|
|
|
61184
|
-
|
|
61501
|
+
Loop( { start: - 1, end: int( 1 ), name: 'x', condition: '<=' }, ( { x } ) => {
|
|
61185
61502
|
|
|
61186
|
-
|
|
61503
|
+
Loop( { start: - 1, end: int( 1 ), name: 'y', condition: '<=' }, ( { y } ) => {
|
|
61187
61504
|
|
|
61188
61505
|
const dist = float( mx_worley_distance( localpos, x, y, X, Y, jitter, metric ) ).toVar();
|
|
61189
61506
|
sqdist.assign( min$1( sqdist, dist ) );
|
|
@@ -61210,7 +61527,7 @@ const mx_worley_noise_float_0 = /*#__PURE__*/ tslFn( ( [ p_immutable, jitter_imm
|
|
|
61210
61527
|
]
|
|
61211
61528
|
} );
|
|
61212
61529
|
|
|
61213
|
-
const mx_worley_noise_vec2_0 = /*#__PURE__*/
|
|
61530
|
+
const mx_worley_noise_vec2_0 = /*#__PURE__*/ Fn( ( [ p_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
61214
61531
|
|
|
61215
61532
|
const metric = int( metric_immutable ).toVar();
|
|
61216
61533
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -61219,9 +61536,9 @@ const mx_worley_noise_vec2_0 = /*#__PURE__*/ tslFn( ( [ p_immutable, jitter_immu
|
|
|
61219
61536
|
const localpos = vec2( mx_floorfrac( p.x, X ), mx_floorfrac( p.y, Y ) ).toVar();
|
|
61220
61537
|
const sqdist = vec2( 1e6, 1e6 ).toVar();
|
|
61221
61538
|
|
|
61222
|
-
|
|
61539
|
+
Loop( { start: - 1, end: int( 1 ), name: 'x', condition: '<=' }, ( { x } ) => {
|
|
61223
61540
|
|
|
61224
|
-
|
|
61541
|
+
Loop( { start: - 1, end: int( 1 ), name: 'y', condition: '<=' }, ( { y } ) => {
|
|
61225
61542
|
|
|
61226
61543
|
const dist = float( mx_worley_distance( localpos, x, y, X, Y, jitter, metric ) ).toVar();
|
|
61227
61544
|
|
|
@@ -61230,7 +61547,7 @@ const mx_worley_noise_vec2_0 = /*#__PURE__*/ tslFn( ( [ p_immutable, jitter_immu
|
|
|
61230
61547
|
sqdist.y.assign( sqdist.x );
|
|
61231
61548
|
sqdist.x.assign( dist );
|
|
61232
61549
|
|
|
61233
|
-
} ).
|
|
61550
|
+
} ).ElseIf( dist.lessThan( sqdist.y ), () => {
|
|
61234
61551
|
|
|
61235
61552
|
sqdist.y.assign( dist );
|
|
61236
61553
|
|
|
@@ -61258,7 +61575,7 @@ const mx_worley_noise_vec2_0 = /*#__PURE__*/ tslFn( ( [ p_immutable, jitter_immu
|
|
|
61258
61575
|
]
|
|
61259
61576
|
} );
|
|
61260
61577
|
|
|
61261
|
-
const mx_worley_noise_vec3_0 = /*#__PURE__*/
|
|
61578
|
+
const mx_worley_noise_vec3_0 = /*#__PURE__*/ Fn( ( [ p_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
61262
61579
|
|
|
61263
61580
|
const metric = int( metric_immutable ).toVar();
|
|
61264
61581
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -61267,9 +61584,9 @@ const mx_worley_noise_vec3_0 = /*#__PURE__*/ tslFn( ( [ p_immutable, jitter_immu
|
|
|
61267
61584
|
const localpos = vec2( mx_floorfrac( p.x, X ), mx_floorfrac( p.y, Y ) ).toVar();
|
|
61268
61585
|
const sqdist = vec3( 1e6, 1e6, 1e6 ).toVar();
|
|
61269
61586
|
|
|
61270
|
-
|
|
61587
|
+
Loop( { start: - 1, end: int( 1 ), name: 'x', condition: '<=' }, ( { x } ) => {
|
|
61271
61588
|
|
|
61272
|
-
|
|
61589
|
+
Loop( { start: - 1, end: int( 1 ), name: 'y', condition: '<=' }, ( { y } ) => {
|
|
61273
61590
|
|
|
61274
61591
|
const dist = float( mx_worley_distance( localpos, x, y, X, Y, jitter, metric ) ).toVar();
|
|
61275
61592
|
|
|
@@ -61279,12 +61596,12 @@ const mx_worley_noise_vec3_0 = /*#__PURE__*/ tslFn( ( [ p_immutable, jitter_immu
|
|
|
61279
61596
|
sqdist.y.assign( sqdist.x );
|
|
61280
61597
|
sqdist.x.assign( dist );
|
|
61281
61598
|
|
|
61282
|
-
} ).
|
|
61599
|
+
} ).ElseIf( dist.lessThan( sqdist.y ), () => {
|
|
61283
61600
|
|
|
61284
61601
|
sqdist.z.assign( sqdist.y );
|
|
61285
61602
|
sqdist.y.assign( dist );
|
|
61286
61603
|
|
|
61287
|
-
} ).
|
|
61604
|
+
} ).ElseIf( dist.lessThan( sqdist.z ), () => {
|
|
61288
61605
|
|
|
61289
61606
|
sqdist.z.assign( dist );
|
|
61290
61607
|
|
|
@@ -61312,7 +61629,7 @@ const mx_worley_noise_vec3_0 = /*#__PURE__*/ tslFn( ( [ p_immutable, jitter_immu
|
|
|
61312
61629
|
]
|
|
61313
61630
|
} );
|
|
61314
61631
|
|
|
61315
|
-
const mx_worley_noise_float_1 = /*#__PURE__*/
|
|
61632
|
+
const mx_worley_noise_float_1 = /*#__PURE__*/ Fn( ( [ p_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
61316
61633
|
|
|
61317
61634
|
const metric = int( metric_immutable ).toVar();
|
|
61318
61635
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -61321,11 +61638,11 @@ const mx_worley_noise_float_1 = /*#__PURE__*/ tslFn( ( [ p_immutable, jitter_imm
|
|
|
61321
61638
|
const localpos = vec3( mx_floorfrac( p.x, X ), mx_floorfrac( p.y, Y ), mx_floorfrac( p.z, Z ) ).toVar();
|
|
61322
61639
|
const sqdist = float( 1e6 ).toVar();
|
|
61323
61640
|
|
|
61324
|
-
|
|
61641
|
+
Loop( { start: - 1, end: int( 1 ), name: 'x', condition: '<=' }, ( { x } ) => {
|
|
61325
61642
|
|
|
61326
|
-
|
|
61643
|
+
Loop( { start: - 1, end: int( 1 ), name: 'y', condition: '<=' }, ( { y } ) => {
|
|
61327
61644
|
|
|
61328
|
-
|
|
61645
|
+
Loop( { start: - 1, end: int( 1 ), name: 'z', condition: '<=' }, ( { z } ) => {
|
|
61329
61646
|
|
|
61330
61647
|
const dist = float( mx_worley_distance( localpos, x, y, z, X, Y, Z, jitter, metric ) ).toVar();
|
|
61331
61648
|
sqdist.assign( min$1( sqdist, dist ) );
|
|
@@ -61356,7 +61673,7 @@ const mx_worley_noise_float_1 = /*#__PURE__*/ tslFn( ( [ p_immutable, jitter_imm
|
|
|
61356
61673
|
|
|
61357
61674
|
const mx_worley_noise_float$1 = /*#__PURE__*/ overloadingFn( [ mx_worley_noise_float_0, mx_worley_noise_float_1 ] );
|
|
61358
61675
|
|
|
61359
|
-
const mx_worley_noise_vec2_1 = /*#__PURE__*/
|
|
61676
|
+
const mx_worley_noise_vec2_1 = /*#__PURE__*/ Fn( ( [ p_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
61360
61677
|
|
|
61361
61678
|
const metric = int( metric_immutable ).toVar();
|
|
61362
61679
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -61365,11 +61682,11 @@ const mx_worley_noise_vec2_1 = /*#__PURE__*/ tslFn( ( [ p_immutable, jitter_immu
|
|
|
61365
61682
|
const localpos = vec3( mx_floorfrac( p.x, X ), mx_floorfrac( p.y, Y ), mx_floorfrac( p.z, Z ) ).toVar();
|
|
61366
61683
|
const sqdist = vec2( 1e6, 1e6 ).toVar();
|
|
61367
61684
|
|
|
61368
|
-
|
|
61685
|
+
Loop( { start: - 1, end: int( 1 ), name: 'x', condition: '<=' }, ( { x } ) => {
|
|
61369
61686
|
|
|
61370
|
-
|
|
61687
|
+
Loop( { start: - 1, end: int( 1 ), name: 'y', condition: '<=' }, ( { y } ) => {
|
|
61371
61688
|
|
|
61372
|
-
|
|
61689
|
+
Loop( { start: - 1, end: int( 1 ), name: 'z', condition: '<=' }, ( { z } ) => {
|
|
61373
61690
|
|
|
61374
61691
|
const dist = float( mx_worley_distance( localpos, x, y, z, X, Y, Z, jitter, metric ) ).toVar();
|
|
61375
61692
|
|
|
@@ -61378,7 +61695,7 @@ const mx_worley_noise_vec2_1 = /*#__PURE__*/ tslFn( ( [ p_immutable, jitter_immu
|
|
|
61378
61695
|
sqdist.y.assign( sqdist.x );
|
|
61379
61696
|
sqdist.x.assign( dist );
|
|
61380
61697
|
|
|
61381
|
-
} ).
|
|
61698
|
+
} ).ElseIf( dist.lessThan( sqdist.y ), () => {
|
|
61382
61699
|
|
|
61383
61700
|
sqdist.y.assign( dist );
|
|
61384
61701
|
|
|
@@ -61410,7 +61727,7 @@ const mx_worley_noise_vec2_1 = /*#__PURE__*/ tslFn( ( [ p_immutable, jitter_immu
|
|
|
61410
61727
|
|
|
61411
61728
|
const mx_worley_noise_vec2$1 = /*#__PURE__*/ overloadingFn( [ mx_worley_noise_vec2_0, mx_worley_noise_vec2_1 ] );
|
|
61412
61729
|
|
|
61413
|
-
const mx_worley_noise_vec3_1 = /*#__PURE__*/
|
|
61730
|
+
const mx_worley_noise_vec3_1 = /*#__PURE__*/ Fn( ( [ p_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
61414
61731
|
|
|
61415
61732
|
const metric = int( metric_immutable ).toVar();
|
|
61416
61733
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -61419,11 +61736,11 @@ const mx_worley_noise_vec3_1 = /*#__PURE__*/ tslFn( ( [ p_immutable, jitter_immu
|
|
|
61419
61736
|
const localpos = vec3( mx_floorfrac( p.x, X ), mx_floorfrac( p.y, Y ), mx_floorfrac( p.z, Z ) ).toVar();
|
|
61420
61737
|
const sqdist = vec3( 1e6, 1e6, 1e6 ).toVar();
|
|
61421
61738
|
|
|
61422
|
-
|
|
61739
|
+
Loop( { start: - 1, end: int( 1 ), name: 'x', condition: '<=' }, ( { x } ) => {
|
|
61423
61740
|
|
|
61424
|
-
|
|
61741
|
+
Loop( { start: - 1, end: int( 1 ), name: 'y', condition: '<=' }, ( { y } ) => {
|
|
61425
61742
|
|
|
61426
|
-
|
|
61743
|
+
Loop( { start: - 1, end: int( 1 ), name: 'z', condition: '<=' }, ( { z } ) => {
|
|
61427
61744
|
|
|
61428
61745
|
const dist = float( mx_worley_distance( localpos, x, y, z, X, Y, Z, jitter, metric ) ).toVar();
|
|
61429
61746
|
|
|
@@ -61433,12 +61750,12 @@ const mx_worley_noise_vec3_1 = /*#__PURE__*/ tslFn( ( [ p_immutable, jitter_immu
|
|
|
61433
61750
|
sqdist.y.assign( sqdist.x );
|
|
61434
61751
|
sqdist.x.assign( dist );
|
|
61435
61752
|
|
|
61436
|
-
} ).
|
|
61753
|
+
} ).ElseIf( dist.lessThan( sqdist.y ), () => {
|
|
61437
61754
|
|
|
61438
61755
|
sqdist.z.assign( sqdist.y );
|
|
61439
61756
|
sqdist.y.assign( dist );
|
|
61440
61757
|
|
|
61441
|
-
} ).
|
|
61758
|
+
} ).ElseIf( dist.lessThan( sqdist.z ), () => {
|
|
61442
61759
|
|
|
61443
61760
|
sqdist.z.assign( dist );
|
|
61444
61761
|
|
|
@@ -61474,7 +61791,7 @@ const mx_worley_noise_vec3$1 = /*#__PURE__*/ overloadingFn( [ mx_worley_noise_ve
|
|
|
61474
61791
|
// https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/libraries/stdlib/genglsl/lib/mx_hsv.glsl
|
|
61475
61792
|
|
|
61476
61793
|
|
|
61477
|
-
const mx_hsvtorgb = /*#__PURE__*/
|
|
61794
|
+
const mx_hsvtorgb = /*#__PURE__*/ Fn( ( [ hsv_immutable ] ) => {
|
|
61478
61795
|
|
|
61479
61796
|
const hsv = vec3( hsv_immutable ).toVar();
|
|
61480
61797
|
const h = float( hsv.x ).toVar();
|
|
@@ -61485,7 +61802,7 @@ const mx_hsvtorgb = /*#__PURE__*/ tslFn( ( [ hsv_immutable ] ) => {
|
|
|
61485
61802
|
|
|
61486
61803
|
return vec3( v, v, v );
|
|
61487
61804
|
|
|
61488
|
-
} ).
|
|
61805
|
+
} ).Else( () => {
|
|
61489
61806
|
|
|
61490
61807
|
h.assign( mul( 6.0, h.sub( floor( h ) ) ) );
|
|
61491
61808
|
const hi = int( trunc( h ) ).toVar();
|
|
@@ -61498,19 +61815,19 @@ const mx_hsvtorgb = /*#__PURE__*/ tslFn( ( [ hsv_immutable ] ) => {
|
|
|
61498
61815
|
|
|
61499
61816
|
return vec3( v, t, p );
|
|
61500
61817
|
|
|
61501
|
-
} ).
|
|
61818
|
+
} ).ElseIf( hi.equal( int( 1 ) ), () => {
|
|
61502
61819
|
|
|
61503
61820
|
return vec3( q, v, p );
|
|
61504
61821
|
|
|
61505
|
-
} ).
|
|
61822
|
+
} ).ElseIf( hi.equal( int( 2 ) ), () => {
|
|
61506
61823
|
|
|
61507
61824
|
return vec3( p, v, t );
|
|
61508
61825
|
|
|
61509
|
-
} ).
|
|
61826
|
+
} ).ElseIf( hi.equal( int( 3 ) ), () => {
|
|
61510
61827
|
|
|
61511
61828
|
return vec3( p, q, v );
|
|
61512
61829
|
|
|
61513
|
-
} ).
|
|
61830
|
+
} ).ElseIf( hi.equal( int( 4 ) ), () => {
|
|
61514
61831
|
|
|
61515
61832
|
return vec3( t, p, v );
|
|
61516
61833
|
|
|
@@ -61528,7 +61845,7 @@ const mx_hsvtorgb = /*#__PURE__*/ tslFn( ( [ hsv_immutable ] ) => {
|
|
|
61528
61845
|
]
|
|
61529
61846
|
} );
|
|
61530
61847
|
|
|
61531
|
-
const mx_rgbtohsv = /*#__PURE__*/
|
|
61848
|
+
const mx_rgbtohsv = /*#__PURE__*/ Fn( ( [ c_immutable ] ) => {
|
|
61532
61849
|
|
|
61533
61850
|
const c = vec3( c_immutable ).toVar();
|
|
61534
61851
|
const r = float( c.x ).toVar();
|
|
@@ -61544,7 +61861,7 @@ const mx_rgbtohsv = /*#__PURE__*/ tslFn( ( [ c_immutable ] ) => {
|
|
|
61544
61861
|
|
|
61545
61862
|
s.assign( delta.div( maxcomp ) );
|
|
61546
61863
|
|
|
61547
|
-
} ).
|
|
61864
|
+
} ).Else( () => {
|
|
61548
61865
|
|
|
61549
61866
|
s.assign( 0.0 );
|
|
61550
61867
|
|
|
@@ -61554,17 +61871,17 @@ const mx_rgbtohsv = /*#__PURE__*/ tslFn( ( [ c_immutable ] ) => {
|
|
|
61554
61871
|
|
|
61555
61872
|
h.assign( 0.0 );
|
|
61556
61873
|
|
|
61557
|
-
} ).
|
|
61874
|
+
} ).Else( () => {
|
|
61558
61875
|
|
|
61559
61876
|
If( r.greaterThanEqual( maxcomp ), () => {
|
|
61560
61877
|
|
|
61561
61878
|
h.assign( g.sub( b ).div( delta ) );
|
|
61562
61879
|
|
|
61563
|
-
} ).
|
|
61880
|
+
} ).ElseIf( g.greaterThanEqual( maxcomp ), () => {
|
|
61564
61881
|
|
|
61565
61882
|
h.assign( add( 2.0, b.sub( r ).div( delta ) ) );
|
|
61566
61883
|
|
|
61567
|
-
} ).
|
|
61884
|
+
} ).Else( () => {
|
|
61568
61885
|
|
|
61569
61886
|
h.assign( add( 4.0, r.sub( g ).div( delta ) ) );
|
|
61570
61887
|
|
|
@@ -61594,7 +61911,7 @@ const mx_rgbtohsv = /*#__PURE__*/ tslFn( ( [ c_immutable ] ) => {
|
|
|
61594
61911
|
// https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/libraries/stdlib/genglsl/lib/mx_transform_color.glsl
|
|
61595
61912
|
|
|
61596
61913
|
|
|
61597
|
-
const mx_srgb_texture_to_lin_rec709 = /*#__PURE__*/
|
|
61914
|
+
const mx_srgb_texture_to_lin_rec709 = /*#__PURE__*/ Fn( ( [ color_immutable ] ) => {
|
|
61598
61915
|
|
|
61599
61916
|
const color = vec3( color_immutable ).toVar();
|
|
61600
61917
|
const isAbove = bvec3( greaterThan( color, vec3( 0.04045 ) ) ).toVar();
|
|
@@ -61930,6 +62247,30 @@ class RenderContext {
|
|
|
61930
62247
|
|
|
61931
62248
|
}
|
|
61932
62249
|
|
|
62250
|
+
getCacheKey() {
|
|
62251
|
+
|
|
62252
|
+
return getCacheKey( this );
|
|
62253
|
+
|
|
62254
|
+
}
|
|
62255
|
+
|
|
62256
|
+
}
|
|
62257
|
+
|
|
62258
|
+
function getCacheKey( renderContext ) {
|
|
62259
|
+
|
|
62260
|
+
const { textures, activeCubeFace } = renderContext;
|
|
62261
|
+
|
|
62262
|
+
let key = '';
|
|
62263
|
+
|
|
62264
|
+
for ( const texture of textures ) {
|
|
62265
|
+
|
|
62266
|
+
key += texture.id + ',';
|
|
62267
|
+
|
|
62268
|
+
}
|
|
62269
|
+
|
|
62270
|
+
key += activeCubeFace;
|
|
62271
|
+
|
|
62272
|
+
return key;
|
|
62273
|
+
|
|
61933
62274
|
}
|
|
61934
62275
|
|
|
61935
62276
|
class RenderContexts {
|
|
@@ -68203,7 +68544,6 @@ class WebGLTextureUtils {
|
|
|
68203
68544
|
|
|
68204
68545
|
deallocateRenderBuffers( renderTarget ) {
|
|
68205
68546
|
|
|
68206
|
-
|
|
68207
68547
|
const { gl, backend } = this;
|
|
68208
68548
|
|
|
68209
68549
|
// remove framebuffer reference
|
|
@@ -68213,31 +68553,36 @@ class WebGLTextureUtils {
|
|
|
68213
68553
|
|
|
68214
68554
|
renderContextData.renderBufferStorageSetup = undefined;
|
|
68215
68555
|
|
|
68216
|
-
if ( renderContextData.
|
|
68556
|
+
if ( renderContextData.framebuffers ) {
|
|
68557
|
+
|
|
68558
|
+
for ( const cacheKey in renderContextData.framebuffers ) {
|
|
68559
|
+
|
|
68560
|
+
gl.deleteFramebuffer( renderContextData.framebuffers[ cacheKey ] );
|
|
68561
|
+
|
|
68562
|
+
}
|
|
68217
68563
|
|
|
68218
|
-
|
|
68219
|
-
renderContextData.framebuffer = undefined;
|
|
68564
|
+
delete renderContextData.framebuffers;
|
|
68220
68565
|
|
|
68221
68566
|
}
|
|
68222
68567
|
|
|
68223
68568
|
if ( renderContextData.depthRenderbuffer ) {
|
|
68224
68569
|
|
|
68225
68570
|
gl.deleteRenderbuffer( renderContextData.depthRenderbuffer );
|
|
68226
|
-
renderContextData.depthRenderbuffer
|
|
68571
|
+
delete renderContextData.depthRenderbuffer;
|
|
68227
68572
|
|
|
68228
68573
|
}
|
|
68229
68574
|
|
|
68230
68575
|
if ( renderContextData.stencilRenderbuffer ) {
|
|
68231
68576
|
|
|
68232
68577
|
gl.deleteRenderbuffer( renderContextData.stencilRenderbuffer );
|
|
68233
|
-
renderContextData.stencilRenderbuffer
|
|
68578
|
+
delete renderContextData.stencilRenderbuffer;
|
|
68234
68579
|
|
|
68235
68580
|
}
|
|
68236
68581
|
|
|
68237
68582
|
if ( renderContextData.msaaFrameBuffer ) {
|
|
68238
68583
|
|
|
68239
68584
|
gl.deleteFramebuffer( renderContextData.msaaFrameBuffer );
|
|
68240
|
-
renderContextData.msaaFrameBuffer
|
|
68585
|
+
delete renderContextData.msaaFrameBuffer;
|
|
68241
68586
|
|
|
68242
68587
|
}
|
|
68243
68588
|
|
|
@@ -68249,7 +68594,7 @@ class WebGLTextureUtils {
|
|
|
68249
68594
|
|
|
68250
68595
|
}
|
|
68251
68596
|
|
|
68252
|
-
renderContextData.msaaRenderbuffers
|
|
68597
|
+
delete renderContextData.msaaRenderbuffers;
|
|
68253
68598
|
|
|
68254
68599
|
}
|
|
68255
68600
|
|
|
@@ -69014,12 +69359,13 @@ class WebGLBackend extends Backend {
|
|
|
69014
69359
|
const renderTargetContextData = this.get( renderContext.renderTarget );
|
|
69015
69360
|
|
|
69016
69361
|
const { samples } = renderContext.renderTarget;
|
|
69017
|
-
const fb = renderTargetContextData.framebuffer;
|
|
69018
|
-
|
|
69019
|
-
const mask = gl.COLOR_BUFFER_BIT;
|
|
69020
69362
|
|
|
69021
69363
|
if ( samples > 0 ) {
|
|
69022
69364
|
|
|
69365
|
+
const fb = renderTargetContextData.framebuffers[ renderContext.getCacheKey() ];
|
|
69366
|
+
|
|
69367
|
+
const mask = gl.COLOR_BUFFER_BIT;
|
|
69368
|
+
|
|
69023
69369
|
const msaaFrameBuffer = renderTargetContextData.msaaFrameBuffer;
|
|
69024
69370
|
|
|
69025
69371
|
const textures = renderContext.textures;
|
|
@@ -69995,38 +70341,38 @@ class WebGLBackend extends Backend {
|
|
|
69995
70341
|
|
|
69996
70342
|
}
|
|
69997
70343
|
|
|
69998
|
-
_setFramebuffer(
|
|
70344
|
+
_setFramebuffer( descriptor ) {
|
|
69999
70345
|
|
|
70000
70346
|
const { gl, state } = this;
|
|
70001
70347
|
|
|
70002
70348
|
let currentFrameBuffer = null;
|
|
70003
70349
|
|
|
70004
|
-
if (
|
|
70350
|
+
if ( descriptor.textures !== null ) {
|
|
70005
70351
|
|
|
70006
|
-
const renderTarget =
|
|
70352
|
+
const renderTarget = descriptor.renderTarget;
|
|
70007
70353
|
const renderTargetContextData = this.get( renderTarget );
|
|
70008
70354
|
const { samples, depthBuffer, stencilBuffer } = renderTarget;
|
|
70009
|
-
|
|
70355
|
+
|
|
70010
70356
|
const isCube = renderTarget.isWebGLCubeRenderTarget === true;
|
|
70011
70357
|
|
|
70012
70358
|
let msaaFb = renderTargetContextData.msaaFrameBuffer;
|
|
70013
70359
|
let depthRenderbuffer = renderTargetContextData.depthRenderbuffer;
|
|
70014
70360
|
|
|
70361
|
+
const cacheKey = getCacheKey( descriptor );
|
|
70362
|
+
|
|
70015
70363
|
let fb;
|
|
70016
70364
|
|
|
70017
70365
|
if ( isCube ) {
|
|
70018
70366
|
|
|
70019
|
-
|
|
70367
|
+
renderTargetContextData.cubeFramebuffers || ( renderTargetContextData.cubeFramebuffers = {} );
|
|
70020
70368
|
|
|
70021
|
-
|
|
70022
|
-
|
|
70023
|
-
}
|
|
70024
|
-
|
|
70025
|
-
fb = renderTargetContextData.cubeFramebuffers[ cubeFace ];
|
|
70369
|
+
fb = renderTargetContextData.cubeFramebuffers[ cacheKey ];
|
|
70026
70370
|
|
|
70027
70371
|
} else {
|
|
70028
70372
|
|
|
70029
|
-
|
|
70373
|
+
renderTargetContextData.framebuffers || ( renderTargetContextData.framebuffers = {} );
|
|
70374
|
+
|
|
70375
|
+
fb = renderTargetContextData.framebuffers[ cacheKey ];
|
|
70030
70376
|
|
|
70031
70377
|
}
|
|
70032
70378
|
|
|
@@ -70036,22 +70382,27 @@ class WebGLBackend extends Backend {
|
|
|
70036
70382
|
|
|
70037
70383
|
state.bindFramebuffer( gl.FRAMEBUFFER, fb );
|
|
70038
70384
|
|
|
70039
|
-
const textures =
|
|
70385
|
+
const textures = descriptor.textures;
|
|
70040
70386
|
|
|
70041
70387
|
if ( isCube ) {
|
|
70042
70388
|
|
|
70043
|
-
renderTargetContextData.cubeFramebuffers[
|
|
70389
|
+
renderTargetContextData.cubeFramebuffers[ cacheKey ] = fb;
|
|
70390
|
+
|
|
70044
70391
|
const { textureGPU } = this.get( textures[ 0 ] );
|
|
70045
70392
|
|
|
70393
|
+
const cubeFace = this.renderer._activeCubeFace;
|
|
70394
|
+
|
|
70046
70395
|
gl.framebufferTexture2D( gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X + cubeFace, textureGPU, 0 );
|
|
70047
70396
|
|
|
70048
70397
|
} else {
|
|
70049
70398
|
|
|
70399
|
+
renderTargetContextData.framebuffers[ cacheKey ] = fb;
|
|
70400
|
+
|
|
70050
70401
|
for ( let i = 0; i < textures.length; i ++ ) {
|
|
70051
70402
|
|
|
70052
70403
|
const texture = textures[ i ];
|
|
70053
70404
|
const textureData = this.get( texture );
|
|
70054
|
-
textureData.renderTarget =
|
|
70405
|
+
textureData.renderTarget = descriptor.renderTarget;
|
|
70055
70406
|
|
|
70056
70407
|
const attachment = gl.COLOR_ATTACHMENT0 + i;
|
|
70057
70408
|
|
|
@@ -70059,15 +70410,13 @@ class WebGLBackend extends Backend {
|
|
|
70059
70410
|
|
|
70060
70411
|
}
|
|
70061
70412
|
|
|
70062
|
-
|
|
70063
|
-
|
|
70064
|
-
state.drawBuffers( renderContext, fb );
|
|
70413
|
+
state.drawBuffers( descriptor, fb );
|
|
70065
70414
|
|
|
70066
70415
|
}
|
|
70067
70416
|
|
|
70068
|
-
if (
|
|
70417
|
+
if ( descriptor.depthTexture !== null ) {
|
|
70069
70418
|
|
|
70070
|
-
const textureData = this.get(
|
|
70419
|
+
const textureData = this.get( descriptor.depthTexture );
|
|
70071
70420
|
const depthStyle = stencilBuffer ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT;
|
|
70072
70421
|
|
|
70073
70422
|
gl.framebufferTexture2D( gl.FRAMEBUFFER, depthStyle, gl.TEXTURE_2D, textureData.textureGPU, 0 );
|
|
@@ -70088,11 +70437,10 @@ class WebGLBackend extends Backend {
|
|
|
70088
70437
|
|
|
70089
70438
|
const msaaRenderbuffers = [];
|
|
70090
70439
|
|
|
70091
|
-
const textures =
|
|
70440
|
+
const textures = descriptor.textures;
|
|
70092
70441
|
|
|
70093
70442
|
for ( let i = 0; i < textures.length; i ++ ) {
|
|
70094
70443
|
|
|
70095
|
-
|
|
70096
70444
|
msaaRenderbuffers[ i ] = gl.createRenderbuffer();
|
|
70097
70445
|
|
|
70098
70446
|
gl.bindRenderbuffer( gl.RENDERBUFFER, msaaRenderbuffers[ i ] );
|
|
@@ -70106,10 +70454,10 @@ class WebGLBackend extends Backend {
|
|
|
70106
70454
|
|
|
70107
70455
|
}
|
|
70108
70456
|
|
|
70109
|
-
const texture =
|
|
70457
|
+
const texture = descriptor.textures[ i ];
|
|
70110
70458
|
const textureData = this.get( texture );
|
|
70111
70459
|
|
|
70112
|
-
gl.renderbufferStorageMultisample( gl.RENDERBUFFER, samples, textureData.glInternalFormat,
|
|
70460
|
+
gl.renderbufferStorageMultisample( gl.RENDERBUFFER, samples, textureData.glInternalFormat, descriptor.width, descriptor.height );
|
|
70113
70461
|
gl.framebufferRenderbuffer( gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i, gl.RENDERBUFFER, msaaRenderbuffers[ i ] );
|
|
70114
70462
|
|
|
70115
70463
|
|
|
@@ -70121,7 +70469,7 @@ class WebGLBackend extends Backend {
|
|
|
70121
70469
|
if ( depthRenderbuffer === undefined ) {
|
|
70122
70470
|
|
|
70123
70471
|
depthRenderbuffer = gl.createRenderbuffer();
|
|
70124
|
-
this.textureUtils.setupRenderBufferStorage( depthRenderbuffer,
|
|
70472
|
+
this.textureUtils.setupRenderBufferStorage( depthRenderbuffer, descriptor );
|
|
70125
70473
|
|
|
70126
70474
|
renderTargetContextData.depthRenderbuffer = depthRenderbuffer;
|
|
70127
70475
|
|
|
@@ -72643,6 +72991,22 @@ ${ flowData.code }
|
|
|
72643
72991
|
|
|
72644
72992
|
}
|
|
72645
72993
|
|
|
72994
|
+
getSubgroupSize() {
|
|
72995
|
+
|
|
72996
|
+
this.enableSubGroups();
|
|
72997
|
+
|
|
72998
|
+
return this.getBuiltin( 'subgroup_size', 'subgroupSize', 'u32', 'attribute' );
|
|
72999
|
+
|
|
73000
|
+
}
|
|
73001
|
+
|
|
73002
|
+
getSubgroupIndex() {
|
|
73003
|
+
|
|
73004
|
+
this.enableSubGroups();
|
|
73005
|
+
|
|
73006
|
+
return this.getBuiltin( 'subgroup_invocation_id', 'subgroupIndex', 'u32', 'attribute' );
|
|
73007
|
+
|
|
73008
|
+
}
|
|
73009
|
+
|
|
72646
73010
|
getDrawIndex() {
|
|
72647
73011
|
|
|
72648
73012
|
return null;
|
|
@@ -72675,8 +73039,8 @@ ${ flowData.code }
|
|
|
72675
73039
|
|
|
72676
73040
|
enableDirective( name, shaderStage = this.shaderStage ) {
|
|
72677
73041
|
|
|
72678
|
-
const stage = this.directives[ shaderStage ] || ( this.directives[ shaderStage ] =
|
|
72679
|
-
stage.
|
|
73042
|
+
const stage = this.directives[ shaderStage ] || ( this.directives[ shaderStage ] = new Set() );
|
|
73043
|
+
stage.add( name );
|
|
72680
73044
|
|
|
72681
73045
|
}
|
|
72682
73046
|
|
|
@@ -72699,6 +73063,18 @@ ${ flowData.code }
|
|
|
72699
73063
|
|
|
72700
73064
|
}
|
|
72701
73065
|
|
|
73066
|
+
enableSubGroups() {
|
|
73067
|
+
|
|
73068
|
+
this.enableDirective( 'subgroups' );
|
|
73069
|
+
|
|
73070
|
+
}
|
|
73071
|
+
|
|
73072
|
+
enableSubgroupsF16() {
|
|
73073
|
+
|
|
73074
|
+
this.enableDirective( 'subgroups-f16' );
|
|
73075
|
+
|
|
73076
|
+
}
|
|
73077
|
+
|
|
72702
73078
|
enableClipDistances() {
|
|
72703
73079
|
|
|
72704
73080
|
this.enableDirective( 'clip_distances' );
|
|
@@ -74805,22 +75181,16 @@ class WebGPUBackend extends Backend {
|
|
|
74805
75181
|
|
|
74806
75182
|
let descriptors = renderTargetData.descriptors;
|
|
74807
75183
|
|
|
74808
|
-
if ( descriptors === undefined
|
|
74809
|
-
|
|
74810
|
-
descriptors = [];
|
|
74811
|
-
|
|
74812
|
-
renderTargetData.descriptors = descriptors;
|
|
74813
|
-
|
|
74814
|
-
}
|
|
74815
|
-
|
|
74816
|
-
if ( renderTargetData.width !== renderTarget.width ||
|
|
75184
|
+
if ( descriptors === undefined ||
|
|
75185
|
+
renderTargetData.width !== renderTarget.width ||
|
|
74817
75186
|
renderTargetData.height !== renderTarget.height ||
|
|
74818
75187
|
renderTargetData.activeMipmapLevel !== renderTarget.activeMipmapLevel ||
|
|
74819
|
-
renderTargetData.samples !== renderTarget.samples
|
|
74820
|
-
descriptors.length !== renderTarget.textures.length
|
|
75188
|
+
renderTargetData.samples !== renderTarget.samples
|
|
74821
75189
|
) {
|
|
74822
75190
|
|
|
74823
|
-
descriptors
|
|
75191
|
+
descriptors = {};
|
|
75192
|
+
|
|
75193
|
+
renderTargetData.descriptors = descriptors;
|
|
74824
75194
|
|
|
74825
75195
|
// dispose
|
|
74826
75196
|
|
|
@@ -74836,7 +75206,9 @@ class WebGPUBackend extends Backend {
|
|
|
74836
75206
|
|
|
74837
75207
|
}
|
|
74838
75208
|
|
|
74839
|
-
|
|
75209
|
+
const cacheKey = renderContext.getCacheKey();
|
|
75210
|
+
|
|
75211
|
+
let descriptor = descriptors[ cacheKey ];
|
|
74840
75212
|
|
|
74841
75213
|
if ( descriptor === undefined ) {
|
|
74842
75214
|
|
|
@@ -74888,7 +75260,7 @@ class WebGPUBackend extends Backend {
|
|
|
74888
75260
|
depthStencilAttachment
|
|
74889
75261
|
};
|
|
74890
75262
|
|
|
74891
|
-
descriptors[
|
|
75263
|
+
descriptors[ cacheKey ] = descriptor;
|
|
74892
75264
|
|
|
74893
75265
|
renderTargetData.width = renderTarget.width;
|
|
74894
75266
|
renderTargetData.height = renderTarget.height;
|
|
@@ -76278,4 +76650,4 @@ if ( typeof window !== 'undefined' ) {
|
|
|
76278
76650
|
|
|
76279
76651
|
}
|
|
76280
76652
|
|
|
76281
|
-
export { ACESFilmicToneMapping, AONode, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AfterImageNode, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AmbientLightNode, AnalyticLightNode, AnamorphicNode, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrayElementNode, ArrowHelper, AssignNode, AttachedBindMode, AttributeNode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BRDF_GGX, BRDF_Lambert, BackSide, BasicDepthPacking, BasicEnvironmentNode, BasicShadowMap$1 as BasicShadowMap, BatchNode, BatchedMesh, BlendModeNode, BloomNode, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, Break, BufferAttribute, BufferAttributeNode, BufferGeometry, BufferGeometryLoader, BufferNode, BumpMapNode, BypassNode, ByteType, Cache, CacheNode, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CheckerNode, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, CodeNode, Color, ColorAdjustmentNode, ColorKeyframeTrack, ColorManagement, ColorSpaceNode, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ComputeNode, CondNode, ConeGeometry, ConstNode, ConstantAlphaFactor, ConstantColorFactor, ContextNode, Continue, ConvertNode, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeTextureNode, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, DFGApprox, D_GGX, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DenoiseNode, DepthFormat, DepthOfFieldNode, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DirectionalLightNode, DiscardNode, DiscreteInterpolant, DisplayP3ColorSpace, DodecahedronGeometry, DotScreenNode, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EPSILON, EdgesGeometry, EllipseCurve, EnvironmentNode, EqualCompare, EqualDepth, EqualStencilFunc, EquirectUVNode, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExpressionNode, ExtrudeGeometry, FXAANode, F_Schlick, FileLoader, FilmNode, Float16BufferAttribute, Float32BufferAttribute, FloatType, Fog, FogExp2, FogExp2Node, FogNode, FogRangeNode, FramebufferTexture, FrontFacingNode, FrontSide, Frustum, FunctionCallNode, FunctionNode, FunctionOverloadingNode, GLBufferAttribute, GLSL1, GLSL3, GLSLNodeParser, GTAONode, GaussianBlurNode, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HashNode, HemisphereLight, HemisphereLightHelper, HemisphereLightNode, IESSpotLight, IESSpotLightNode, INFINITY, IcosahedronGeometry, If, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, IndexNode, InstanceNode, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, InstancedPointsNodeMaterial, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, IrradianceNode, JoinNode, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightNode, LightProbe, LightingContextNode, LightingModel, LightingNode, LightsNode, Line, Line2NodeMaterial, Line3, LineBasicMaterial, LineBasicNodeMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineDashedNodeMaterial, LineLoop, LineSegments, LinearDisplayP3ColorSpace, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, LoopNode, LoopOnce, LoopPingPong, LoopRepeat, LuminanceAlphaFormat, LuminanceFormat, Lut3DNode, MOUSE, MRTNode, MatcapUVNode, Material, MaterialLoader, MaterialNode, MaterialReferenceNode, MathNode, MathUtils, Matrix2, Matrix3, Matrix4, MaxEquation, MaxMipLevelNode, Mesh, MeshBasicMaterial, MeshBasicNodeMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshLambertNodeMaterial, MeshMatcapMaterial, MeshMatcapNodeMaterial, MeshNormalMaterial, MeshNormalNodeMaterial, MeshPhongMaterial, MeshPhongNodeMaterial, MeshPhysicalMaterial, MeshPhysicalNodeMaterial, MeshSSSNodeMaterial, MeshStandardMaterial, MeshStandardNodeMaterial, MeshToonMaterial, MeshToonNodeMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, ModelNode, ModelViewProjectionNode, MorphNode, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, Node, NodeAttribute, NodeBuilder, NodeCache, NodeCode, NodeFrame, NodeFunctionInput, NodeKeywords, NodeLoader, NodeMaterial, NodeMaterialLoader, NodeObjectLoader, NodeShaderStage, NodeType, NodeUniform, NodeUpdateType, NodeUtils, NodeVar, NodeVarying, NormalAnimationBlendMode, NormalBlending, NormalMapNode, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, Object3DNode, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OperatorNode, OrthographicCamera, OscNode, OutputStructNode, P3Primaries, PCFShadowMap$1 as PCFShadowMap, PCFSoftShadowMap$1 as PCFSoftShadowMap, PI, PI2, PMREMGenerator, PMREMNode, PackingNode, ParameterNode, PassNode, Path, PerspectiveCamera, PhongLightingModel, PhysicalLightingModel, PixelationPassNode, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, PointLightNode, PointUVNode, Points, PointsMaterial, PointsNodeMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PostProcessing, PosterizeNode, PropertyBinding, PropertyMixer, PropertyNode, QuadMesh, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBDepthPacking, RGBFormat, RGBIntegerFormat, RGBShiftNode, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGDepthPacking, RGFormat, RGIntegerFormat, RTTNode, RangeNode, RawShaderMaterial, Ray, Raycaster, Rec709Primaries, RectAreaLight, RectAreaLightNode, RedFormat, RedIntegerFormat, ReferenceNode, ReflectorNode, ReinhardToneMapping, RemapNode, RenderOutputNode, RenderTarget, RendererReferenceNode, RepeatWrapping, ReplaceStencilOp, Return, ReverseSubtractEquation, RingGeometry, RotateNode, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SRGBColorSpace, SRGBTransfer, Scene, SceneNode, Schlick_to_F0, ScriptableNode, ScriptableValueNode, SetNode, ShaderMaterial, ShaderNode, ShadowMaterial, ShadowNodeMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, SkinningNode, SobelOperatorNode, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SplitNode, SpotLight, SpotLightHelper, SpotLightNode, Sprite, SpriteMaterial, SpriteNodeMaterial, SpriteSheetUVNode, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StackNode, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StorageArrayElementNode, StorageBufferAttribute, StorageBufferNode, StorageInstancedBufferAttribute, StorageTexture, StorageTextureNode, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TBNViewMatrix, TOUCH, TangentSpaceNormalMap, TempNode, TetrahedronGeometry, Texture, Texture3DNode, TextureBicubicNode, TextureLoader, TextureNode, TextureSizeNode, TimerNode, ToneMappingNode, TorusGeometry, TorusKnotGeometry, TransitionNode, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TriplanarTexturesNode, TubeGeometry, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform$1 as Uniform, UniformArrayNode, UniformGroupNode, UniformNode, UniformsGroup$1 as UniformsGroup, UnsignedByteType, UnsignedInt248Type, UnsignedInt5999Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, UserDataNode, VSMShadowMap, V_GGX_SmithCorrelated, VarNode, VaryingNode, Vector2, Vector3, Vector4, VectorKeyframeTrack, VertexColorNode, VideoTexture, ViewportDepthNode, ViewportDepthTextureNode, ViewportNode, ViewportSharedTextureNode, ViewportTextureNode, VolumeNodeMaterial, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLCubeRenderTarget, WebGLMultipleRenderTargets, WebGLRenderTarget, WebGPUCoordinateSystem, WebGPURenderer, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, abs, acos, add, addLightNode, addNodeClass, addNodeElement, addNodeMaterial, afterImage, all, alphaT, anamorphic, and, anisotropy, anisotropyB, anisotropyT, any, ao, append, arrayBuffer, asin, assign, atan, atan2, attribute, backgroundBlurriness, backgroundIntensity, batch, billboarding, bitAnd, bitNot, bitOr, bitXor, bitangentGeometry, bitangentLocal, bitangentView, bitangentWorld, bitcast, bleach, bloom, blur, bmat2, bmat3, bmat4, bool, buffer, bufferAttribute, bumpMap, burn, bvec2, bvec3, bvec4, bypass, cache, call, cameraFar, cameraLogDepth, cameraNear, cameraNormalMatrix, cameraPosition, cameraProjectionMatrix, cameraProjectionMatrixInverse, cameraViewMatrix, cameraWorldMatrix, cbrt, ceil, checker, clamp, clearcoat, clearcoatRoughness, code, color, colorSpaceToLinear, colorToDirection, compute, cond, context, convert, cos, createCanvasElement, createNodeFromType, createNodeMaterialFromType, cross, cubeTexture, dFdx, dFdy, dashSize, defaultBuildStages, defaultShaderStages, defined, degrees, denoise, densityFog, depth, depthPass, difference, diffuseColor, directionToColor, discard, distance, div, dodge, dof, dot, dotScreen, drawIndex, dynamicBufferAttribute, element, emissive, equal, equals, equirectUV, exp, exp2, expression, faceDirection, faceForward, film, float, floor, fog, fract, frameGroup, frameId, frontFacing, fwidth, fxaa, gain, gapSize, gaussianBlur, getConstNodeType, getCurrentStack, getDirection, getDistanceAttenuation, getGeometryRoughness, getRoughness, global, glsl, glslFn, greaterThan, greaterThanEqual, hash, hue, imat2, imat3, imat4, instance, instanceIndex, instancedBufferAttribute, instancedDynamicBufferAttribute, int, inverseSqrt, iridescence, iridescenceIOR, iridescenceThickness, ivec2, ivec3, ivec4, js, label, length, lengthSq, lessThan, lessThanEqual, lightTargetDirection, lightingContext, lights, lightsNode, linearDepth, linearToColorSpace, linearTosRGB, log, log2, loop, luminance, lut3D, mat2, mat3, mat4, matcapUV, materialAOMap, materialAlphaTest, materialAnisotropy, materialAnisotropyVector, materialClearcoat, materialClearcoatNormal, materialClearcoatRoughness, materialColor, materialDispersion, materialEmissive, materialIridescence, materialIridescenceIOR, materialIridescenceThickness, materialLightMap, materialLineDashOffset, materialLineDashSize, materialLineGapSize, materialLineScale, materialLineWidth, materialMetalness, materialNormal, materialOpacity, materialPointWidth, materialReference, materialReflectivity, materialRefractionRatio, materialRotation, materialRoughness, materialSheen, materialSheenRoughness, materialShininess, materialSpecular, materialSpecularStrength, max$1 as max, maxMipLevel, metalness, min$1 as min, mix, mod, modelDirection, modelNormalMatrix, modelPosition, modelScale, modelViewMatrix, modelViewPosition, modelViewProjection, modelWorldMatrix, modelWorldMatrixInverse, morphReference, mrt, mul, mx_aastep, mx_cell_noise_float, mx_contrast, mx_fractal_noise_float, mx_fractal_noise_vec2, mx_fractal_noise_vec3, mx_fractal_noise_vec4, mx_hsvtorgb, mx_noise_float, mx_noise_vec3, mx_noise_vec4, mx_ramplr, mx_ramptb, mx_rgbtohsv, mx_safepower, mx_splitlr, mx_splittb, mx_srgb_texture_to_lin_rec709, mx_transform_uv, mx_worley_noise_float, mx_worley_noise_vec2, mx_worley_noise_vec3, negate, nodeArray, nodeImmutable, nodeObject, nodeObjects, nodeProxy, normalGeometry, normalLocal, normalMap, normalView, normalWorld, normalize, not, objectDirection, objectGroup, objectNormalMatrix, objectPosition, objectScale, objectViewMatrix, objectViewPosition, objectWorldMatrix, oneMinus, or, orthographicDepthToViewZ, oscSawtooth, oscSine, oscSquare, oscTriangle, output, outputStruct, overlay, overloadingFn, parabola, parallaxDirection, parallaxUV, parameter, pass, passTexture, pcurve, perspectiveDepthToViewZ, pixelationPass, pmremTexture, pointUV, pointWidth, positionGeometry, positionLocal, positionView, positionViewDirection, positionWorld, positionWorldDirection, posterize, pow, pow2, pow3, pow4, property, radians, rand, range, rangeFog, reciprocal, reference, referenceBuffer, reflect, reflectVector, reflectView, reflector, refract, refractVector, refractView, remainder, remap, remapClamp, renderGroup, renderOutput, rendererReference, rgbShift, rotate, rotateUV, roughness, round, rtt, sRGBToLinear, sampler, saturate, saturation, screen, scriptable, scriptableValue, sepia, setCurrentStack, shaderStages, sheen, sheenRoughness, shiftLeft, shiftRight, shininess, sign, sin, sinc, skinning, skinningReference, smoothstep, sobel, specularColor, spherizeUV, split, spritesheetUV, sqrt, stack, step, storage, storageObject, storageTexture, string, sub, tan, tangentGeometry, tangentLocal, tangentView, tangentWorld, temp, texture, texture3D, textureBicubic, textureCubeUV, textureLoad, textureSize, textureStore, threshold, timerDelta, timerGlobal, timerLocal, toneMapping, transformDirection, transformedBentNormalView, transformedBitangentView, transformedBitangentWorld, transformedClearcoatNormalView, transformedNormalView, transformedNormalWorld, transformedTangentView, transformedTangentWorld, transition, transpose, triNoise3D, triplanarTexture, triplanarTextures, trunc, tslFn, uint, umat2, umat3, umat4, uniform, uniformArray, uniformGroup, userData, uv, uvec2, uvec3, uvec4, varying, varyingProperty, vec2, vec3, vec4, vectorComponents, vertexColor, vertexIndex, vibrance, viewZToOrthographicDepth, viewZToPerspectiveDepth, viewport, viewportBottomLeft, viewportBottomRight, viewportCoordinate, viewportDepthTexture, viewportLinearDepth, viewportMipTexture, viewportResolution, viewportSafeUV, viewportSharedTexture, viewportTexture, viewportTopLeft, viewportTopRight, wgsl, wgslFn, xor };
|
|
76653
|
+
export { ACESFilmicToneMapping, AONode, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AfterImageNode, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AmbientLightNode, AnalyticLightNode, AnamorphicNode, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrayElementNode, ArrowHelper, AssignNode, AttachedBindMode, AttributeNode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BRDF_GGX, BRDF_Lambert, BackSide, BasicDepthPacking, BasicEnvironmentNode, BasicShadowMap$1 as BasicShadowMap, BatchNode, BatchedMesh, BlendModeNode, BloomNode, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, Break, BufferAttribute, BufferAttributeNode, BufferGeometry, BufferGeometryLoader, BufferNode, BumpMapNode, BypassNode, ByteType, Cache, CacheNode, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CheckerNode, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, CodeNode, Color, ColorAdjustmentNode, ColorKeyframeTrack, ColorManagement, ColorSpaceNode, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ComputeNode, CondNode, ConeGeometry, ConstNode, ConstantAlphaFactor, ConstantColorFactor, ContextNode, Continue, ConvertNode, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeTextureNode, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, DFGApprox, D_GGX, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DenoiseNode, DepthFormat, DepthOfFieldNode, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DirectionalLightNode, DiscardNode, DiscreteInterpolant, DisplayP3ColorSpace, DodecahedronGeometry, DotScreenNode, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EPSILON, EdgesGeometry, EllipseCurve, EnvironmentNode, EqualCompare, EqualDepth, EqualStencilFunc, EquirectUVNode, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExpressionNode, ExtrudeGeometry, FXAANode, F_Schlick, FileLoader, FilmNode, Float16BufferAttribute, Float32BufferAttribute, FloatType, Fn, Fog, FogExp2, FogExp2Node, FogNode, FogRangeNode, FramebufferTexture, FrontFacingNode, FrontSide, Frustum, FunctionCallNode, FunctionNode, FunctionOverloadingNode, GLBufferAttribute, GLSL1, GLSL3, GLSLNodeParser, GTAONode, GaussianBlurNode, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HashNode, HemisphereLight, HemisphereLightHelper, HemisphereLightNode, IESSpotLight, IESSpotLightNode, INFINITY, IcosahedronGeometry, If, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, IndexNode, InstanceNode, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, InstancedPointsNodeMaterial, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, IrradianceNode, JoinNode, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightNode, LightProbe, LightProbeNode, LightingContextNode, LightingModel, LightingNode, LightsNode, Line, Line2NodeMaterial, Line3, LineBasicMaterial, LineBasicNodeMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineDashedNodeMaterial, LineLoop, LineSegments, LinearDisplayP3ColorSpace, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, Loop, LoopNode, LoopOnce, LoopPingPong, LoopRepeat, LuminanceAlphaFormat, LuminanceFormat, Lut3DNode, MOUSE, MRTNode, MatcapUVNode, Material, MaterialLoader, MaterialNode, MaterialReferenceNode, MathNode, MathUtils, Matrix2, Matrix3, Matrix4, MaxEquation, MaxMipLevelNode, Mesh, MeshBasicMaterial, MeshBasicNodeMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshLambertNodeMaterial, MeshMatcapMaterial, MeshMatcapNodeMaterial, MeshNormalMaterial, MeshNormalNodeMaterial, MeshPhongMaterial, MeshPhongNodeMaterial, MeshPhysicalMaterial, MeshPhysicalNodeMaterial, MeshSSSNodeMaterial, MeshStandardMaterial, MeshStandardNodeMaterial, MeshToonMaterial, MeshToonNodeMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, ModelNode, ModelViewProjectionNode, MorphNode, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, Node, NodeAttribute, NodeBuilder, NodeCache, NodeCode, NodeFrame, NodeFunctionInput, NodeKeywords, NodeLoader, NodeMaterial, NodeMaterialLoader, NodeObjectLoader, NodeShaderStage, NodeType, NodeUniform, NodeUpdateType, NodeUtils, NodeVar, NodeVarying, NormalAnimationBlendMode, NormalBlending, NormalMapNode, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, Object3DNode, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OperatorNode, OrthographicCamera, OscNode, OutputStructNode, P3Primaries, PCFShadowMap$1 as PCFShadowMap, PCFSoftShadowMap$1 as PCFSoftShadowMap, PI, PI2, PMREMGenerator, PMREMNode, PackingNode, ParameterNode, PassNode, Path, PerspectiveCamera, PhongLightingModel, PhysicalLightingModel, PixelationPassNode, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, PointLightNode, PointUVNode, Points, PointsMaterial, PointsNodeMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PostProcessing, PosterizeNode, PropertyBinding, PropertyMixer, PropertyNode, QuadMesh, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBDepthPacking, RGBFormat, RGBIntegerFormat, RGBShiftNode, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGDepthPacking, RGFormat, RGIntegerFormat, RTTNode, RangeNode, RawShaderMaterial, Ray, Raycaster, Rec709Primaries, RectAreaLight, RectAreaLightNode, RedFormat, RedIntegerFormat, ReferenceNode, ReflectorNode, ReinhardToneMapping, RemapNode, RenderOutputNode, RenderTarget, RendererReferenceNode, RepeatWrapping, ReplaceStencilOp, Return, ReverseSubtractEquation, RingGeometry, RotateNode, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SRGBColorSpace, SRGBTransfer, Scene, SceneNode, Schlick_to_F0, ScriptableNode, ScriptableValueNode, SetNode, ShaderMaterial, ShaderNode, ShadowMaterial, ShadowNodeMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, SkinningNode, SobelOperatorNode, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SplitNode, SpotLight, SpotLightHelper, SpotLightNode, Sprite, SpriteMaterial, SpriteNodeMaterial, SpriteSheetUVNode, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StackNode, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StorageArrayElementNode, StorageBufferAttribute, StorageBufferNode, StorageInstancedBufferAttribute, StorageTexture, StorageTextureNode, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TBNViewMatrix, TOUCH, TangentSpaceNormalMap, TempNode, TetrahedronGeometry, Texture, Texture3DNode, TextureBicubicNode, TextureLoader, TextureNode, TextureSizeNode, TimerNode, ToneMappingNode, TorusGeometry, TorusKnotGeometry, TransitionNode, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TriplanarTexturesNode, TubeGeometry, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform$1 as Uniform, UniformArrayNode, UniformGroupNode, UniformNode, UniformsGroup$1 as UniformsGroup, UnsignedByteType, UnsignedInt248Type, UnsignedInt5999Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, UserDataNode, VSMShadowMap, V_GGX_SmithCorrelated, VarNode, VaryingNode, Vector2, Vector3, Vector4, VectorKeyframeTrack, VertexColorNode, VideoTexture, ViewportDepthNode, ViewportDepthTextureNode, ViewportNode, ViewportSharedTextureNode, ViewportTextureNode, VolumeNodeMaterial, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLCubeRenderTarget, WebGLMultipleRenderTargets, WebGLRenderTarget, WebGPUCoordinateSystem, WebGPURenderer, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, abs, acos, add, addLightNode, addNodeClass, addNodeElement, addNodeMaterial, afterImage, all, alphaT, anamorphic, and, anisotropy, anisotropyB, anisotropyT, any, ao, append, arrayBuffer, asin, assign, atan, atan2, attribute, backgroundBlurriness, backgroundIntensity, batch, billboarding, bitAnd, bitNot, bitOr, bitXor, bitangentGeometry, bitangentLocal, bitangentView, bitangentWorld, bitcast, bleach, bloom, blur, bmat2, bmat3, bmat4, bool, buffer, bufferAttribute, bumpMap, burn, bvec2, bvec3, bvec4, bypass, cache, call, cameraFar, cameraLogDepth, cameraNear, cameraNormalMatrix, cameraPosition, cameraProjectionMatrix, cameraProjectionMatrixInverse, cameraViewMatrix, cameraWorldMatrix, cbrt, ceil, checker, clamp, clearcoat, clearcoatRoughness, code, color, colorSpaceToLinear, colorToDirection, compute, cond, context, convert, cos, createCanvasElement, createNodeFromType, createNodeMaterialFromType, cross, cubeTexture, dFdx, dFdy, dashSize, defaultBuildStages, defaultShaderStages, defined, degrees, denoise, densityFog, depth, depthPass, difference, diffuseColor, directionToColor, discard, distance, div, dodge, dof, dot, dotScreen, drawIndex, dynamicBufferAttribute, element, emissive, equal, equals, equirectUV, exp, exp2, expression, faceDirection, faceForward, film, float, floor, fog, fract, frameGroup, frameId, frontFacing, fwidth, fxaa, gain, gapSize, gaussianBlur, getConstNodeType, getCurrentStack, getDirection, getDistanceAttenuation, getGeometryRoughness, getRoughness, global, glsl, glslFn, greaterThan, greaterThanEqual, hash, hue, imat2, imat3, imat4, instance, instanceIndex, instancedBufferAttribute, instancedDynamicBufferAttribute, int, inverseSqrt, iridescence, iridescenceIOR, iridescenceThickness, ivec2, ivec3, ivec4, js, label, length, lengthSq, lessThan, lessThanEqual, lightTargetDirection, lightingContext, lights, lightsNode, linearDepth, linearToColorSpace, linearTosRGB, log, log2, luminance, lut3D, mat2, mat3, mat4, matcapUV, materialAOMap, materialAlphaTest, materialAnisotropy, materialAnisotropyVector, materialClearcoat, materialClearcoatNormal, materialClearcoatRoughness, materialColor, materialDispersion, materialEmissive, materialIridescence, materialIridescenceIOR, materialIridescenceThickness, materialLightMap, materialLineDashOffset, materialLineDashSize, materialLineGapSize, materialLineScale, materialLineWidth, materialMetalness, materialNormal, materialOpacity, materialPointWidth, materialReference, materialReflectivity, materialRefractionRatio, materialRotation, materialRoughness, materialSheen, materialSheenRoughness, materialShininess, materialSpecular, materialSpecularStrength, max$1 as max, maxMipLevel, metalness, min$1 as min, mix, mod, modelDirection, modelNormalMatrix, modelPosition, modelScale, modelViewMatrix, modelViewPosition, modelViewProjection, modelWorldMatrix, modelWorldMatrixInverse, morphReference, mrt, mul, mx_aastep, mx_cell_noise_float, mx_contrast, mx_fractal_noise_float, mx_fractal_noise_vec2, mx_fractal_noise_vec3, mx_fractal_noise_vec4, mx_hsvtorgb, mx_noise_float, mx_noise_vec3, mx_noise_vec4, mx_ramplr, mx_ramptb, mx_rgbtohsv, mx_safepower, mx_splitlr, mx_splittb, mx_srgb_texture_to_lin_rec709, mx_transform_uv, mx_worley_noise_float, mx_worley_noise_vec2, mx_worley_noise_vec3, negate, nodeArray, nodeImmutable, nodeObject, nodeObjects, nodeProxy, normalGeometry, normalLocal, normalMap, normalView, normalWorld, normalize, not, objectDirection, objectGroup, objectNormalMatrix, objectPosition, objectScale, objectViewMatrix, objectViewPosition, objectWorldMatrix, oneMinus, or, orthographicDepthToViewZ, oscSawtooth, oscSine, oscSquare, oscTriangle, output, outputStruct, overlay, overloadingFn, parabola, parallaxDirection, parallaxUV, parameter, pass, passTexture, pcurve, perspectiveDepthToViewZ, pixelationPass, pmremTexture, pointUV, pointWidth, positionGeometry, positionLocal, positionView, positionViewDirection, positionWorld, positionWorldDirection, posterize, pow, pow2, pow3, pow4, property, radians, rand, range, rangeFog, reciprocal, reference, referenceBuffer, reflect, reflectVector, reflectView, reflector, refract, refractVector, refractView, remainder, remap, remapClamp, renderGroup, renderOutput, rendererReference, rgbShift, rotate, rotateUV, roughness, round, rtt, sRGBToLinear, sampler, saturate, saturation, screen, scriptable, scriptableValue, select, sepia, setCurrentStack, shaderStages, sheen, sheenRoughness, shiftLeft, shiftRight, shininess, sign, sin, sinc, skinning, skinningReference, smoothstep, sobel, specularColor, spherizeUV, split, spritesheetUV, sqrt, stack, step, storage, storageObject, storageTexture, string, sub, tan, tangentGeometry, tangentLocal, tangentView, tangentWorld, temp, texture, texture3D, textureBicubic, textureCubeUV, textureLoad, textureSize, textureStore, threshold, timerDelta, timerGlobal, timerLocal, toneMapping, transformDirection, transformedBentNormalView, transformedBitangentView, transformedBitangentWorld, transformedClearcoatNormalView, transformedNormalView, transformedNormalWorld, transformedTangentView, transformedTangentWorld, transition, transpose, triNoise3D, triplanarTexture, triplanarTextures, trunc, tslFn, uint, umat2, umat3, umat4, uniform, uniformArray, uniformGroup, userData, uv, uvec2, uvec3, uvec4, varying, varyingProperty, vec2, vec3, vec4, vectorComponents, vertexColor, vertexIndex, vibrance, viewZToOrthographicDepth, viewZToPerspectiveDepth, viewport, viewportBottomLeft, viewportBottomRight, viewportCoordinate, viewportDepthTexture, viewportLinearDepth, viewportMipTexture, viewportResolution, viewportSafeUV, viewportSharedTexture, viewportTexture, viewportTopLeft, viewportTopRight, wgsl, wgslFn, xor };
|