@flighthq/materials 0.5.1-next.903.f434bc2 → 0.5.1-next.905.5fbf787
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +4 -4
- package/src/anisotropyPbrExtension.test.ts +10 -1
- package/src/clearcoatPbrExtension.test.ts +10 -1
- package/src/colorScaleBias.test.ts +8 -1
- package/src/iridescencePbrExtension.test.ts +10 -1
- package/src/material.test.ts +13 -1
- package/src/sheenPbrExtension.test.ts +6 -1
- package/src/specularPbrExtension.test.ts +10 -1
- package/src/standardMaterial.test.ts +6 -1
- package/src/transmissionVolumePbrExtension.test.ts +6 -0
- package/src/wrappedDiffusePbrExtension.test.ts +10 -1
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/materials`. The `@fl
|
|
|
13
13
|
This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
|
|
14
14
|
|
|
15
15
|
- [Flight project](https://github.com/flighthq/flight)
|
|
16
|
-
- [Source for @flighthq/materials@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/materials@0.5.1-next.905.5fbf787](https://github.com/flighthq/flight/tree/5fbf7874064c384307542d68b4dcb6a895ff0dcf/packages/materials)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/5fbf7874064c384307542d68b4dcb6a895ff0dcf/LICENSE.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/materials",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.905.5fbf787",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/color": "0.5.1-next.
|
|
42
|
-
"@flighthq/entity": "0.5.1-next.
|
|
43
|
-
"@flighthq/types": "0.5.1-next.
|
|
41
|
+
"@flighthq/color": "0.5.1-next.905.5fbf787",
|
|
42
|
+
"@flighthq/entity": "0.5.1-next.905.5fbf787",
|
|
43
|
+
"@flighthq/types": "0.5.1-next.905.5fbf787"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"typescript": "^5.3.0"
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
createAnisotropyPbrExtension,
|
|
5
|
+
initializeAnisotropyPbrExtension,
|
|
6
|
+
isValidAnisotropyPbrExtension,
|
|
7
|
+
} from './anisotropyPbrExtension';
|
|
4
8
|
|
|
5
9
|
describe('createAnisotropyPbrExtension', () => {
|
|
6
10
|
it('creates an Entity with canonical defaults and per-map UV selection', () => {
|
|
@@ -11,6 +15,11 @@ describe('createAnisotropyPbrExtension', () => {
|
|
|
11
15
|
});
|
|
12
16
|
});
|
|
13
17
|
|
|
18
|
+
describe('initializeAnisotropyPbrExtension', () => {
|
|
19
|
+
it('is the construction initializer of createAnisotropyPbrExtension', () => {
|
|
20
|
+
expect(typeof initializeAnisotropyPbrExtension).toBe('function');
|
|
21
|
+
});
|
|
22
|
+
});
|
|
14
23
|
describe('isValidAnisotropyPbrExtension', () => {
|
|
15
24
|
it('rejects invalid strength, rotation, and UV selection', () => {
|
|
16
25
|
expect(isValidAnisotropyPbrExtension(createAnisotropyPbrExtension())).toBe(true);
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
createClearcoatPbrExtension,
|
|
5
|
+
initializeClearcoatPbrExtension,
|
|
6
|
+
isValidClearcoatPbrExtension,
|
|
7
|
+
} from './clearcoatPbrExtension';
|
|
4
8
|
|
|
5
9
|
describe('createClearcoatPbrExtension', () => {
|
|
6
10
|
it('creates an Entity with an explicit normal scale and independent UV sets', () => {
|
|
@@ -12,6 +16,11 @@ describe('createClearcoatPbrExtension', () => {
|
|
|
12
16
|
});
|
|
13
17
|
});
|
|
14
18
|
|
|
19
|
+
describe('initializeClearcoatPbrExtension', () => {
|
|
20
|
+
it('is the construction initializer of createClearcoatPbrExtension', () => {
|
|
21
|
+
expect(typeof initializeClearcoatPbrExtension).toBe('function');
|
|
22
|
+
});
|
|
23
|
+
});
|
|
15
24
|
describe('isValidClearcoatPbrExtension', () => {
|
|
16
25
|
it('rejects invalid weights, normal scale, and map UV sets', () => {
|
|
17
26
|
expect(isValidClearcoatPbrExtension(createClearcoatPbrExtension())).toBe(true);
|
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
setColorScaleBiasBiasRgba,
|
|
18
18
|
} from '@flighthq/materials/contract';
|
|
19
19
|
|
|
20
|
+
import { initializeColorScaleBias } from './colorScaleBias';
|
|
21
|
+
|
|
20
22
|
describe('cloneColorScaleBias', () => {
|
|
21
23
|
it('returns a new object with identical values', () => {
|
|
22
24
|
const ct = createColorScaleBias({ redScale: 0.5, greenBias: 64 });
|
|
@@ -311,6 +313,12 @@ describe('getColorScaleBiasBiasRgba', () => {
|
|
|
311
313
|
});
|
|
312
314
|
});
|
|
313
315
|
|
|
316
|
+
describe('initializeColorScaleBias', () => {
|
|
317
|
+
it('is the construction initializer of createColorScaleBias', () => {
|
|
318
|
+
expect(typeof initializeColorScaleBias).toBe('function');
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
|
|
314
322
|
describe('invertColorScaleBias', () => {
|
|
315
323
|
it('reciprocates scales', () => {
|
|
316
324
|
const source = createColorScaleBias({
|
|
@@ -425,7 +433,6 @@ describe('setColorScaleBiasBiasRgba', () => {
|
|
|
425
433
|
expect(ct.alphaScale).toBe(0);
|
|
426
434
|
});
|
|
427
435
|
});
|
|
428
|
-
|
|
429
436
|
describe('setColorScaleBiasIdentity', () => {
|
|
430
437
|
it('resets scales to 1 and biases to 0', () => {
|
|
431
438
|
const ct = createColorScaleBias({ redScale: 0.5, greenBias: 128, alphaScale: 0, blueBias: 64 });
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
createIridescencePbrExtension,
|
|
5
|
+
initializeIridescencePbrExtension,
|
|
6
|
+
isValidIridescencePbrExtension,
|
|
7
|
+
} from './iridescencePbrExtension';
|
|
4
8
|
|
|
5
9
|
describe('createIridescencePbrExtension', () => {
|
|
6
10
|
it('creates an Entity with glTF thickness defaults and independent UV sets', () => {
|
|
@@ -13,6 +17,11 @@ describe('createIridescencePbrExtension', () => {
|
|
|
13
17
|
});
|
|
14
18
|
});
|
|
15
19
|
|
|
20
|
+
describe('initializeIridescencePbrExtension', () => {
|
|
21
|
+
it('is the construction initializer of createIridescencePbrExtension', () => {
|
|
22
|
+
expect(typeof initializeIridescencePbrExtension).toBe('function');
|
|
23
|
+
});
|
|
24
|
+
});
|
|
16
25
|
describe('isValidIridescencePbrExtension', () => {
|
|
17
26
|
it('rejects invalid strength, IOR, thickness ordering, and UV selection', () => {
|
|
18
27
|
expect(isValidIridescencePbrExtension(createIridescencePbrExtension())).toBe(true);
|
package/src/material.test.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { BlinnPhongMaterial, StandardPbrMaterial } from '@flighthq/types/contract';
|
|
2
2
|
import { BlinnPhongMaterialKind, StandardPbrMaterialKind } from '@flighthq/types/contract';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
cloneMaterial,
|
|
6
|
+
copyMaterial,
|
|
7
|
+
createMaterial,
|
|
8
|
+
equalsMaterial,
|
|
9
|
+
getMaterialOfKind,
|
|
10
|
+
initializeMaterial,
|
|
11
|
+
} from './material';
|
|
5
12
|
import { createStandardPbrMaterial } from './pbrMaterials';
|
|
6
13
|
|
|
7
14
|
const TestMaterialKind = 'TestMaterial';
|
|
@@ -116,3 +123,8 @@ describe('getMaterialOfKind', () => {
|
|
|
116
123
|
expect(getMaterialOfKind<BlinnPhongMaterial>(material, BlinnPhongMaterialKind)).toBeNull();
|
|
117
124
|
});
|
|
118
125
|
});
|
|
126
|
+
describe('initializeMaterial', () => {
|
|
127
|
+
it('is the construction initializer of createMaterial', () => {
|
|
128
|
+
expect(typeof initializeMaterial).toBe('function');
|
|
129
|
+
});
|
|
130
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import { createSheenPbrExtension, isValidSheenPbrExtension } from './sheenPbrExtension';
|
|
3
|
+
import { createSheenPbrExtension, initializeSheenPbrExtension, isValidSheenPbrExtension } from './sheenPbrExtension';
|
|
4
4
|
|
|
5
5
|
describe('createSheenPbrExtension', () => {
|
|
6
6
|
it('creates an Entity with independent color and roughness UV sets', () => {
|
|
@@ -12,6 +12,11 @@ describe('createSheenPbrExtension', () => {
|
|
|
12
12
|
});
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
+
describe('initializeSheenPbrExtension', () => {
|
|
16
|
+
it('is the construction initializer of createSheenPbrExtension', () => {
|
|
17
|
+
expect(typeof initializeSheenPbrExtension).toBe('function');
|
|
18
|
+
});
|
|
19
|
+
});
|
|
15
20
|
describe('isValidSheenPbrExtension', () => {
|
|
16
21
|
it('rejects invalid roughness and UV selection', () => {
|
|
17
22
|
expect(isValidSheenPbrExtension(createSheenPbrExtension({ sheenRoughness: 1 }))).toBe(true);
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
createSpecularPbrExtension,
|
|
5
|
+
initializeSpecularPbrExtension,
|
|
6
|
+
isValidSpecularPbrExtension,
|
|
7
|
+
} from './specularPbrExtension';
|
|
4
8
|
|
|
5
9
|
describe('createSpecularPbrExtension', () => {
|
|
6
10
|
it('creates an Entity with independent strength and color UV sets', () => {
|
|
@@ -12,6 +16,11 @@ describe('createSpecularPbrExtension', () => {
|
|
|
12
16
|
});
|
|
13
17
|
});
|
|
14
18
|
|
|
19
|
+
describe('initializeSpecularPbrExtension', () => {
|
|
20
|
+
it('is the construction initializer of createSpecularPbrExtension', () => {
|
|
21
|
+
expect(typeof initializeSpecularPbrExtension).toBe('function');
|
|
22
|
+
});
|
|
23
|
+
});
|
|
15
24
|
describe('isValidSpecularPbrExtension', () => {
|
|
16
25
|
it('rejects invalid strength and UV selection', () => {
|
|
17
26
|
expect(isValidSpecularPbrExtension(createSpecularPbrExtension())).toBe(true);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StandardMaterialKind } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import { createStandardMaterial } from './standardMaterial';
|
|
3
|
+
import { createStandardMaterial, initializeStandardMaterial } from './standardMaterial';
|
|
4
4
|
|
|
5
5
|
describe('createStandardMaterial', () => {
|
|
6
6
|
it('creates the authorable unlit textured material used by the default 2D pipeline', () => {
|
|
@@ -14,3 +14,8 @@ describe('createStandardMaterial', () => {
|
|
|
14
14
|
expect(createStandardMaterial({ name: 'ui' }).name).toBe('ui');
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
+
describe('initializeStandardMaterial', () => {
|
|
18
|
+
it('is the construction initializer of createStandardMaterial', () => {
|
|
19
|
+
expect(typeof initializeStandardMaterial).toBe('function');
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -2,6 +2,7 @@ import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
createTransmissionVolumePbrExtension,
|
|
5
|
+
initializeTransmissionVolumePbrExtension,
|
|
5
6
|
isValidTransmissionVolumePbrExtension,
|
|
6
7
|
} from './transmissionVolumePbrExtension';
|
|
7
8
|
|
|
@@ -16,6 +17,11 @@ describe('createTransmissionVolumePbrExtension', () => {
|
|
|
16
17
|
});
|
|
17
18
|
});
|
|
18
19
|
|
|
20
|
+
describe('initializeTransmissionVolumePbrExtension', () => {
|
|
21
|
+
it('is the construction initializer of createTransmissionVolumePbrExtension', () => {
|
|
22
|
+
expect(typeof initializeTransmissionVolumePbrExtension).toBe('function');
|
|
23
|
+
});
|
|
24
|
+
});
|
|
19
25
|
describe('isValidTransmissionVolumePbrExtension', () => {
|
|
20
26
|
it('accepts infinite attenuation and rejects invalid transport relationships or UV sets', () => {
|
|
21
27
|
expect(isValidTransmissionVolumePbrExtension(createTransmissionVolumePbrExtension())).toBe(true);
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { EntityRuntimeKey, WrappedDiffusePbrExtensionKind } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
createWrappedDiffusePbrExtension,
|
|
5
|
+
initializeWrappedDiffusePbrExtension,
|
|
6
|
+
isValidWrappedDiffusePbrExtension,
|
|
7
|
+
} from './wrappedDiffusePbrExtension';
|
|
4
8
|
|
|
5
9
|
describe('createWrappedDiffusePbrExtension', () => {
|
|
6
10
|
it('names the approximation honestly and creates an Entity with independent UV sets', () => {
|
|
@@ -13,6 +17,11 @@ describe('createWrappedDiffusePbrExtension', () => {
|
|
|
13
17
|
});
|
|
14
18
|
});
|
|
15
19
|
|
|
20
|
+
describe('initializeWrappedDiffusePbrExtension', () => {
|
|
21
|
+
it('is the construction initializer of createWrappedDiffusePbrExtension', () => {
|
|
22
|
+
expect(typeof initializeWrappedDiffusePbrExtension).toBe('function');
|
|
23
|
+
});
|
|
24
|
+
});
|
|
16
25
|
describe('isValidWrappedDiffusePbrExtension', () => {
|
|
17
26
|
it('rejects invalid strength, thickness, and UV selection', () => {
|
|
18
27
|
expect(isValidWrappedDiffusePbrExtension(createWrappedDiffusePbrExtension())).toBe(true);
|