diff --git a/examples/jsm/tsl/utils/Raymarching.js b/examples/jsm/tsl/utils/Raymarching.js index a1a60d3365c424..ea9b61caa02d12 100644 --- a/examples/jsm/tsl/utils/Raymarching.js +++ b/examples/jsm/tsl/utils/Raymarching.js @@ -53,17 +53,17 @@ export const RaymarchingBox = ( steps, callback ) => { bounds.assign( vec2( max( bounds.x, 0.0 ), bounds.y ) ); const inc = vec3( rayDir.abs().reciprocal() ).toVar(); - const delta = float( min( inc.x, min( inc.y, inc.z ) ) ).toVar(); + const stepSize = float( min( inc.x, min( inc.y, inc.z ) ) ).toVar(); - delta.divAssign( float( steps ) ); + stepSize.divAssign( float( steps ) ); const positionRay = vec3( vOrigin.add( bounds.x.mul( rayDir ) ) ).toVar(); - Loop( { type: 'float', start: bounds.x, end: bounds.y, update: delta }, () => { + Loop( { type: 'float', start: bounds.x, end: bounds.y, update: stepSize }, () => { - callback( { positionRay } ); + callback( { positionRay, stepSize } ); - positionRay.addAssign( rayDir.mul( delta ) ); + positionRay.addAssign( rayDir.mul( stepSize ) ); } );