Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,446 changes: 523 additions & 923 deletions build/three.core.js

Large diffs are not rendered by default.

18 changes: 10 additions & 8 deletions build/three.module.js

Large diffs are not rendered by default.

97 changes: 52 additions & 45 deletions build/three.tsl.js

Large diffs are not rendered by default.

419 changes: 324 additions & 95 deletions build/three.webgpu.js

Large diffs are not rendered by default.

419 changes: 324 additions & 95 deletions build/three.webgpu.nodes.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/nodes/accessors/BuiltinNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ export default BuiltinNode;
* @param {string} name - The name of the built-in shader variable.
* @returns {BuiltinNode}
*/
export const builtin = nodeProxy( BuiltinNode ).setParameterLength( 1 );
export const builtin = /*@__PURE__*/ nodeProxy( BuiltinNode ).setParameterLength( 1 );
2 changes: 1 addition & 1 deletion src/nodes/accessors/Texture3DNode.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import TextureNode from './TextureNode.js';
import { nodeProxy, vec3, Fn, If } from '../tsl/TSLBase.js';

const normal = Fn( ( { texture, uv } ) => {
const normal = /*@__PURE__*/ Fn( ( { texture, uv } ) => {

const epsilon = 0.0001;

Expand Down
4 changes: 2 additions & 2 deletions src/nodes/display/BumpMapNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Fn, nodeProxy, float, vec2 } from '../tsl/TSLBase.js';
// Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen
// https://mmikk.github.io/papers3d/mm_sfgrad_bump.pdf

const dHdxy_fwd = Fn( ( { textureNode, bumpScale } ) => {
const dHdxy_fwd = /*@__PURE__*/ Fn( ( { textureNode, bumpScale } ) => {

// It's used to preserve the same TextureNode instance
const sampleTexture = ( callback ) => textureNode.isolate().context( { getUV: ( texNode ) => callback( texNode.uvNode || uv() ), forceUVContext: true } );
Expand All @@ -24,7 +24,7 @@ const dHdxy_fwd = Fn( ( { textureNode, bumpScale } ) => {

// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)

const perturbNormalArb = Fn( ( inputs ) => {
const perturbNormalArb = /*@__PURE__*/ Fn( ( inputs ) => {

const { surf_pos, surf_norm, dHdxy } = inputs;

Expand Down
2 changes: 1 addition & 1 deletion src/nodes/display/ColorAdjustment.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export const cdl = /*@__PURE__*/ Fn( ( [
* @param {Node} stepsNode - Controls the intensity of the posterization effect. A lower number results in a more blocky appearance.
* @returns {Node} The posterized color.
*/
export const posterize = Fn( ( [ source, steps ] ) => {
export const posterize = /*@__PURE__*/ Fn( ( [ source, steps ] ) => {

return source.mul( steps ).floor().div( steps );

Expand Down
34 changes: 21 additions & 13 deletions src/nodes/display/PassNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -1044,21 +1044,29 @@ class PassNode extends TempNode {
}


}
/**
* @static
* @type {'color'}
* @default 'color'
*/
static get COLOR() {

/**
* @static
* @type {'color'}
* @default 'color'
*/
PassNode.COLOR = 'color';
return 'color';

/**
* @static
* @type {'depth'}
* @default 'depth'
*/
PassNode.DEPTH = 'depth';
}

/**
* @static
* @type {'depth'}
* @default 'depth'
*/
static get DEPTH() {

return 'depth';

}

}

export default PassNode;

Expand Down
8 changes: 4 additions & 4 deletions src/nodes/fog/Fog.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function getViewZNode( builder ) {
* @param {Node} near - Defines the near value.
* @param {Node} far - Defines the far value.
*/
export const rangeFogFactor = Fn( ( [ near, far ], builder ) => {
export const rangeFogFactor = /*@__PURE__*/ Fn( ( [ near, far ], builder ) => {

const viewZ = getViewZNode( builder );

Expand All @@ -54,7 +54,7 @@ export const rangeFogFactor = Fn( ( [ near, far ], builder ) => {
* @function
* @param {Node} density - Defines the fog density.
*/
export const densityFogFactor = Fn( ( [ density ], builder ) => {
export const densityFogFactor = /*@__PURE__*/ Fn( ( [ density ], builder ) => {

const viewZ = getViewZNode( builder );

Expand All @@ -70,7 +70,7 @@ export const densityFogFactor = Fn( ( [ density ], builder ) => {
* @param {Node} density - Defines the fog density.
* @param {Node} height - The height threshold in world space. Everything below this y-coordinate is affected by fog.
*/
export const exponentialHeightFogFactor = Fn( ( [ density, height ], builder ) => {
export const exponentialHeightFogFactor = /*@__PURE__*/ Fn( ( [ density, height ], builder ) => {

const viewZ = getViewZNode( builder );

Expand All @@ -90,7 +90,7 @@ export const exponentialHeightFogFactor = Fn( ( [ density, height ], builder ) =
* @param {Node} color - Defines the color of the fog.
* @param {Node} factor - Defines how the fog is factored in the scene.
*/
export const fog = Fn( ( [ color, factor ] ) => {
export const fog = /*@__PURE__*/ Fn( ( [ color, factor ] ) => {

return vec4( factor.toFloat().mix( output.rgb, color.toVec3() ), output.a );

Expand Down
66 changes: 55 additions & 11 deletions src/nodes/gpgpu/AtomicFunctionNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,61 @@ class AtomicFunctionNode extends Node {

}

}
static get ATOMIC_LOAD() {

return 'atomicLoad';

}

static get ATOMIC_STORE() {

return 'atomicStore';

}

static get ATOMIC_ADD() {

return 'atomicAdd';

AtomicFunctionNode.ATOMIC_LOAD = 'atomicLoad';
AtomicFunctionNode.ATOMIC_STORE = 'atomicStore';
AtomicFunctionNode.ATOMIC_ADD = 'atomicAdd';
AtomicFunctionNode.ATOMIC_SUB = 'atomicSub';
AtomicFunctionNode.ATOMIC_MAX = 'atomicMax';
AtomicFunctionNode.ATOMIC_MIN = 'atomicMin';
AtomicFunctionNode.ATOMIC_AND = 'atomicAnd';
AtomicFunctionNode.ATOMIC_OR = 'atomicOr';
AtomicFunctionNode.ATOMIC_XOR = 'atomicXor';
}

static get ATOMIC_SUB() {

return 'atomicSub';

}

static get ATOMIC_MAX() {

return 'atomicMax';

}

static get ATOMIC_MIN() {

return 'atomicMin';

}

static get ATOMIC_AND() {

return 'atomicAnd';

}

static get ATOMIC_OR() {

return 'atomicOr';

}

static get ATOMIC_XOR() {

return 'atomicXor';

}

}

export default AtomicFunctionNode;

Expand All @@ -157,7 +201,7 @@ export default AtomicFunctionNode;
* @param {Node} valueNode - The value that mutates the atomic variable.
* @returns {AtomicFunctionNode}
*/
const atomicNode = nodeProxy( AtomicFunctionNode );
const atomicNode = /*@__PURE__*/ nodeProxy( AtomicFunctionNode );

/**
* TSL function for appending an atomic function call into the programmatic flow of a compute shader.
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/gpgpu/BarrierNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default BarrierNode;
* @param {string} scope - The scope defines the behavior of the node..
* @returns {BarrierNode}
*/
const barrier = nodeProxy( BarrierNode );
const barrier = /*@__PURE__*/ nodeProxy( BarrierNode );

/**
* TSL function for creating a workgroup barrier. All compute shader
Expand Down
Loading
Loading