Просмотр исходного кода

Nodes: Avoid vector reuse in luminance() input (#29540)

Don McCurdy 1 год назад
Родитель
Сommit
612cca41dc
1 измененных файлов с 1 добавлено и 2 удалено
  1. 1 2
      src/nodes/display/ColorAdjustment.js

+ 1 - 2
src/nodes/display/ColorAdjustment.js

@@ -37,10 +37,9 @@ export const hue = /*@__PURE__*/ Fn( ( [ color, adjustment = float( 1 ) ] ) => {
 
 } );
 
-const _luminanceCoefficients = /*@__PURE__*/ new Vector3();
 export const luminance = (
 	color,
-	luminanceCoefficients = vec3( ... ColorManagement.getLuminanceCoefficients( _luminanceCoefficients ) )
+	luminanceCoefficients = vec3( ColorManagement.getLuminanceCoefficients( new Vector3() ) )
 ) => dot( color, luminanceCoefficients );
 
 export const threshold = ( color, threshold ) => mix( vec3( 0.0 ), color, luminance( color ).sub( threshold ).max( 0 ) );

粤ICP备19079148号