Explorar el Código

Examples: Clamp smooth intensity in Sculpt addon.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mr.doob hace 1 mes
padre
commit
12c3d3eaff
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      examples/jsm/sculpt/SculptTools.js

+ 2 - 2
examples/jsm/sculpt/SculptTools.js

@@ -818,7 +818,7 @@ function smoothTangentVerts( mesh, iVerts, intensity ) {
 		const i3 = i * 3;
 		const smx = smoothVerts[ i3 ], smy = smoothVerts[ i3 + 1 ], smz = smoothVerts[ i3 + 2 ];
 		const d = nx * ( smx - vx ) + ny * ( smy - vy ) + nz * ( smz - vz );
-		const mI = intensity * mAr[ ind + 2 ];
+		const mI = Math.min( intensity * mAr[ ind + 2 ], 1.0 );
 		vAr[ ind ] = vx + ( smx - nx * d - vx ) * mI;
 		vAr[ ind + 1 ] = vy + ( smy - ny * d - vy ) * mI;
 		vAr[ ind + 2 ] = vz + ( smz - nz * d - vz ) * mI;
@@ -977,7 +977,7 @@ function toolSmooth( mesh, iVerts, intensity ) {
 		const ind = iVerts[ i ] * 3;
 		const vx = vAr[ ind ], vy = vAr[ ind + 1 ], vz = vAr[ ind + 2 ];
 		const i3 = i * 3;
-		const mI = intensity * mAr[ ind + 2 ];
+		const mI = Math.min( intensity * mAr[ ind + 2 ], 1.0 );
 		const intComp = 1.0 - mI;
 		vAr[ ind ] = vx * intComp + smoothVerts[ i3 ] * mI;
 		vAr[ ind + 1 ] = vy * intComp + smoothVerts[ i3 + 1 ] * mI;

粤ICP备19079148号