From 503acfb194044640d7a036964848a9866932defc Mon Sep 17 00:00:00 2001 From: sunag Date: Fri, 5 Sep 2025 12:44:30 -0300 Subject: [PATCH 1/2] add convertToTexture --- src/nodes/display/BumpMapNode.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nodes/display/BumpMapNode.js b/src/nodes/display/BumpMapNode.js index 8e3ff12cfe750b..1ebcc292d89248 100644 --- a/src/nodes/display/BumpMapNode.js +++ b/src/nodes/display/BumpMapNode.js @@ -3,7 +3,8 @@ import { uv } from '../accessors/UV.js'; import { normalView } from '../accessors/Normal.js'; import { positionView } from '../accessors/Position.js'; import { faceDirection } from './FrontFacingNode.js'; -import { Fn, nodeProxy, float, vec2 } from '../tsl/TSLBase.js'; +import { convertToTexture } from '../utils/RTTNode.js'; +import { Fn, nodeObject, 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 @@ -111,7 +112,7 @@ export default BumpMapNode; * @tsl * @function * @param {Node} textureNode - Represents the bump map data. - * @param {?Node} [scaleNode=null] - Controls the intensity of the bump effect. + * @param {?Node} [scale=null] - Controls the intensity of the bump effect. * @returns {BumpMapNode} */ -export const bumpMap = /*@__PURE__*/ nodeProxy( BumpMapNode ).setParameterLength( 1, 2 ); +export const bumpMap = ( texture, scale = null ) => new BumpMapNode( convertToTexture( texture ), nodeObject( scale ) ); From 40111f4cf53a49320f5a44aee381d0e8c370c1a1 Mon Sep 17 00:00:00 2001 From: sunag Date: Fri, 5 Sep 2025 20:40:25 -0300 Subject: [PATCH 2/2] Update BumpMapNode.js --- src/nodes/display/BumpMapNode.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nodes/display/BumpMapNode.js b/src/nodes/display/BumpMapNode.js index 1ebcc292d89248..ea70e430e78e75 100644 --- a/src/nodes/display/BumpMapNode.js +++ b/src/nodes/display/BumpMapNode.js @@ -111,8 +111,8 @@ export default BumpMapNode; * * @tsl * @function - * @param {Node} textureNode - Represents the bump map data. + * @param {Node} node - Represents the bump map data. * @param {?Node} [scale=null] - Controls the intensity of the bump effect. * @returns {BumpMapNode} */ -export const bumpMap = ( texture, scale = null ) => new BumpMapNode( convertToTexture( texture ), nodeObject( scale ) ); +export const bumpMap = ( node, scale = null ) => new BumpMapNode( convertToTexture( node ), nodeObject( scale ) );