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
3 changes: 2 additions & 1 deletion build/three.tsl.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/three.tsl.min.js

Large diffs are not rendered by default.

28 changes: 24 additions & 4 deletions build/three.webgpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -18932,13 +18932,13 @@ class ViewportTextureNode extends TextureNode {
this.isOutputTextureNode = true;

/**
* The `updateBeforeType` is set to `NodeUpdateType.FRAME` since the node renders the
* scene once per frame in its {@link ViewportTextureNode#updateBefore} method.
* The `updateBeforeType` is set to `NodeUpdateType.RENDER` since the node should extract
* the current contents of the bound framebuffer for each render call.
*
* @type {string}
* @default 'frame'
* @default 'render'
*/
this.updateBeforeType = NodeUpdateType.FRAME;
this.updateBeforeType = NodeUpdateType.RENDER;

/**
* The framebuffer texture for the current renderer context.
Expand Down Expand Up @@ -41130,6 +41130,25 @@ const densityFogFactor = Fn( ( [ density ], builder ) => {

} );

/**
* Constructs a new height fog factor node. This fog factor requires a Y-up coordinate system.
*
* @tsl
* @function
* @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.
*/
const exponentialHeightFogFactor = Fn( ( [ density, height ], builder ) => {

const viewZ = getViewZNode( builder );

const distance = height.sub( positionWorld.y ).max( 0 ).toConst();
const m = distance.mul( viewZ ).toConst();

return density.mul( density, m, m ).negate().exp().oneMinus();

} );

/**
* This class can be used to configure a fog for the scene.
* Nodes of this type are assigned to `Scene.fogNode`.
Expand Down Expand Up @@ -47396,6 +47415,7 @@ var TSL = /*#__PURE__*/Object.freeze({
equirectUV: equirectUV,
exp: exp,
exp2: exp2,
exponentialHeightFogFactor: exponentialHeightFogFactor,
expression: expression,
faceDirection: faceDirection,
faceForward: faceForward,
Expand Down
2 changes: 1 addition & 1 deletion build/three.webgpu.min.js

Large diffs are not rendered by default.

28 changes: 24 additions & 4 deletions build/three.webgpu.nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -18932,13 +18932,13 @@ class ViewportTextureNode extends TextureNode {
this.isOutputTextureNode = true;

/**
* The `updateBeforeType` is set to `NodeUpdateType.FRAME` since the node renders the
* scene once per frame in its {@link ViewportTextureNode#updateBefore} method.
* The `updateBeforeType` is set to `NodeUpdateType.RENDER` since the node should extract
* the current contents of the bound framebuffer for each render call.
*
* @type {string}
* @default 'frame'
* @default 'render'
*/
this.updateBeforeType = NodeUpdateType.FRAME;
this.updateBeforeType = NodeUpdateType.RENDER;

/**
* The framebuffer texture for the current renderer context.
Expand Down Expand Up @@ -41130,6 +41130,25 @@ const densityFogFactor = Fn( ( [ density ], builder ) => {

} );

/**
* Constructs a new height fog factor node. This fog factor requires a Y-up coordinate system.
*
* @tsl
* @function
* @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.
*/
const exponentialHeightFogFactor = Fn( ( [ density, height ], builder ) => {

const viewZ = getViewZNode( builder );

const distance = height.sub( positionWorld.y ).max( 0 ).toConst();
const m = distance.mul( viewZ ).toConst();

return density.mul( density, m, m ).negate().exp().oneMinus();

} );

/**
* This class can be used to configure a fog for the scene.
* Nodes of this type are assigned to `Scene.fogNode`.
Expand Down Expand Up @@ -47396,6 +47415,7 @@ var TSL = /*#__PURE__*/Object.freeze({
equirectUV: equirectUV,
exp: exp,
exp2: exp2,
exponentialHeightFogFactor: exponentialHeightFogFactor,
expression: expression,
faceDirection: faceDirection,
faceForward: faceForward,
Expand Down
2 changes: 1 addition & 1 deletion build/three.webgpu.nodes.min.js

Large diffs are not rendered by default.

Loading
Loading