Skip to content

Commit 7398203

Browse files
authored
TSL: Update MaterialX library (#28711)
1 parent 9a3bf42 commit 7398203

File tree

3 files changed

+483
-600
lines changed

3 files changed

+483
-600
lines changed

examples/jsm/nodes/materialx/lib/mx_hsv.js

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { int, float, vec3, If, tslFn } from '../../shadernode/ShaderNode.js';
55
import { add, sub, mul } from '../../math/OperatorNode.js';
66
import { floor, trunc, max, min } from '../../math/MathNode.js';
77

8-
const mx_hsvtorgb = tslFn( ( [ hsv_immutable ] ) => {
8+
export const mx_hsvtorgb = /*#__PURE__*/ tslFn( ( [ hsv_immutable ] ) => {
99

1010
const hsv = vec3( hsv_immutable ).toVar();
1111
const h = float( hsv.x ).toVar();
@@ -51,9 +51,15 @@ const mx_hsvtorgb = tslFn( ( [ hsv_immutable ] ) => {
5151

5252
} );
5353

54+
} ).setLayout( {
55+
name: 'mx_hsvtorgb',
56+
type: 'vec3',
57+
inputs: [
58+
{ name: 'hsv', type: 'vec3' }
59+
]
5460
} );
5561

56-
const mx_rgbtohsv = tslFn( ( [ c_immutable ] ) => {
62+
export const mx_rgbtohsv = /*#__PURE__*/ tslFn( ( [ c_immutable ] ) => {
5763

5864
const c = vec3( c_immutable ).toVar();
5965
const r = float( c.x ).toVar();
@@ -107,24 +113,10 @@ const mx_rgbtohsv = tslFn( ( [ c_immutable ] ) => {
107113

108114
return vec3( h, s, v );
109115

110-
} );
111-
112-
// layouts
113-
114-
mx_hsvtorgb.setLayout( {
115-
name: 'mx_hsvtorgb',
116-
type: 'vec3',
117-
inputs: [
118-
{ name: 'hsv', type: 'vec3' }
119-
]
120-
} );
121-
122-
mx_rgbtohsv.setLayout( {
116+
} ).setLayout( {
123117
name: 'mx_rgbtohsv',
124118
type: 'vec3',
125119
inputs: [
126120
{ name: 'c', type: 'vec3' }
127121
]
128122
} );
129-
130-
export { mx_hsvtorgb, mx_rgbtohsv };

0 commit comments

Comments
 (0)