ソースを参照

TSL: Update MaterialX library (#28711)

sunag 1 年間 前
コミット
73982039c5

+ 9 - 17
examples/jsm/nodes/materialx/lib/mx_hsv.js

@@ -5,7 +5,7 @@ import { int, float, vec3, If, tslFn } from '../../shadernode/ShaderNode.js';
 import { add, sub, mul } from '../../math/OperatorNode.js';
 import { floor, trunc, max, min } from '../../math/MathNode.js';
 
-const mx_hsvtorgb = tslFn( ( [ hsv_immutable ] ) => {
+export const mx_hsvtorgb = /*#__PURE__*/ tslFn( ( [ hsv_immutable ] ) => {
 
 	const hsv = vec3( hsv_immutable ).toVar();
 	const h = float( hsv.x ).toVar();
@@ -51,9 +51,15 @@ const mx_hsvtorgb = tslFn( ( [ hsv_immutable ] ) => {
 
 	} );
 
+} ).setLayout( {
+	name: 'mx_hsvtorgb',
+	type: 'vec3',
+	inputs: [
+		{ name: 'hsv', type: 'vec3' }
+	]
 } );
 
-const mx_rgbtohsv = tslFn( ( [ c_immutable ] ) => {
+export const mx_rgbtohsv = /*#__PURE__*/ tslFn( ( [ c_immutable ] ) => {
 
 	const c = vec3( c_immutable ).toVar();
 	const r = float( c.x ).toVar();
@@ -107,24 +113,10 @@ const mx_rgbtohsv = tslFn( ( [ c_immutable ] ) => {
 
 	return vec3( h, s, v );
 
-} );
-
-// layouts
-
-mx_hsvtorgb.setLayout( {
-	name: 'mx_hsvtorgb',
-	type: 'vec3',
-	inputs: [
-		{ name: 'hsv', type: 'vec3' }
-	]
-} );
-
-mx_rgbtohsv.setLayout( {
+} ).setLayout( {
 	name: 'mx_rgbtohsv',
 	type: 'vec3',
 	inputs: [
 		{ name: 'c', type: 'vec3' }
 	]
 } );
-
-export { mx_hsvtorgb, mx_rgbtohsv };

ファイルの差分が大きいため隠しています
+ 460 - 78
examples/jsm/nodes/materialx/lib/mx_noise.js


+ 2 - 8
examples/jsm/nodes/materialx/lib/mx_transform_color.js

@@ -5,7 +5,7 @@ import { bvec3, vec3, tslFn } from '../../shadernode/ShaderNode.js';
 import { greaterThan } from '../../math/OperatorNode.js';
 import { max, pow, mix } from '../../math/MathNode.js';
 
-const mx_srgb_texture_to_lin_rec709 = tslFn( ( [ color_immutable ] ) => {
+export const mx_srgb_texture_to_lin_rec709 = /*#__PURE__*/ tslFn( ( [ color_immutable ] ) => {
 
 	const color = vec3( color_immutable ).toVar();
 	const isAbove = bvec3( greaterThan( color, vec3( 0.04045 ) ) ).toVar();
@@ -14,16 +14,10 @@ const mx_srgb_texture_to_lin_rec709 = tslFn( ( [ color_immutable ] ) => {
 
 	return mix( linSeg, powSeg, isAbove );
 
-} );
-
-// layouts
-
-mx_srgb_texture_to_lin_rec709.setLayout( {
+} ).setLayout( {
 	name: 'mx_srgb_texture_to_lin_rec709',
 	type: 'vec3',
 	inputs: [
 		{ name: 'color', type: 'vec3' }
 	]
 } );
-
-export { mx_srgb_texture_to_lin_rec709 };

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません