@flighthq/shading 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 +3 -3
- package/src/createAnimatedNormalModifier.test.ts +6 -1
- package/src/createDissolveModifier.test.ts +6 -1
- package/src/createEmissiveModifier.test.ts +6 -1
- package/src/createEnvReflectModifier.test.ts +6 -1
- package/src/createFogModifier.test.ts +6 -1
- package/src/createRimModifier.test.ts +6 -1
- package/src/createShadedMaterial.test.ts +6 -1
- package/src/createToonModifier.test.ts +6 -1
- package/src/createVertexDisplaceModifier.test.ts +6 -1
- package/src/modifier.test.ts +7 -0
- package/src/modifierRegistry.test.ts +12 -2
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/shading`. The `@flig
|
|
|
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/shading@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/shading@0.5.1-next.905.5fbf787](https://github.com/flighthq/flight/tree/5fbf7874064c384307542d68b4dcb6a895ff0dcf/packages/shading)
|
|
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/shading",
|
|
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,8 +38,8 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/entity": "0.5.1-next.
|
|
42
|
-
"@flighthq/types": "0.5.1-next.
|
|
41
|
+
"@flighthq/entity": "0.5.1-next.905.5fbf787",
|
|
42
|
+
"@flighthq/types": "0.5.1-next.905.5fbf787"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"typescript": "^5.3.0"
|
|
@@ -2,7 +2,7 @@ import type { Texture, Vector2Like } from '@flighthq/types/contract';
|
|
|
2
2
|
import { AnimatedNormalModifierKind, ModifierSlot } from '@flighthq/types/contract';
|
|
3
3
|
import { describe, expect, it } from 'vitest';
|
|
4
4
|
|
|
5
|
-
import { createAnimatedNormalModifier } from './createAnimatedNormalModifier';
|
|
5
|
+
import { createAnimatedNormalModifier, initializeAnimatedNormalModifier } from './createAnimatedNormalModifier';
|
|
6
6
|
|
|
7
7
|
describe('createAnimatedNormalModifier', () => {
|
|
8
8
|
const scroll: Vector2Like = { x: 0.1, y: 0 };
|
|
@@ -47,3 +47,8 @@ describe('createAnimatedNormalModifier', () => {
|
|
|
47
47
|
expect(modifier.secondaryScroll).toBe(secondaryScroll);
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
|
+
describe('initializeAnimatedNormalModifier', () => {
|
|
51
|
+
it('is the construction initializer of createAnimatedNormalModifier', () => {
|
|
52
|
+
expect(typeof initializeAnimatedNormalModifier).toBe('function');
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -2,7 +2,7 @@ import type { Texture } from '@flighthq/types/contract';
|
|
|
2
2
|
import { DissolveModifierKind, ModifierSlot } from '@flighthq/types/contract';
|
|
3
3
|
import { describe, expect, it } from 'vitest';
|
|
4
4
|
|
|
5
|
-
import { createDissolveModifier } from './createDissolveModifier';
|
|
5
|
+
import { createDissolveModifier, initializeDissolveModifier } from './createDissolveModifier';
|
|
6
6
|
|
|
7
7
|
describe('createDissolveModifier', () => {
|
|
8
8
|
it('sets the kind and Effect slot', () => {
|
|
@@ -28,3 +28,8 @@ describe('createDissolveModifier', () => {
|
|
|
28
28
|
expect(modifier.edgeWidth).toBe(0.1);
|
|
29
29
|
});
|
|
30
30
|
});
|
|
31
|
+
describe('initializeDissolveModifier', () => {
|
|
32
|
+
it('is the construction initializer of createDissolveModifier', () => {
|
|
33
|
+
expect(typeof initializeDissolveModifier).toBe('function');
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -2,7 +2,7 @@ import type { Texture } from '@flighthq/types/contract';
|
|
|
2
2
|
import { EmissiveModifierFacing, EmissiveModifierKind, ModifierSlot } from '@flighthq/types/contract';
|
|
3
3
|
import { describe, expect, it } from 'vitest';
|
|
4
4
|
|
|
5
|
-
import { createEmissiveModifier } from './createEmissiveModifier';
|
|
5
|
+
import { createEmissiveModifier, initializeEmissiveModifier } from './createEmissiveModifier';
|
|
6
6
|
|
|
7
7
|
describe('createEmissiveModifier', () => {
|
|
8
8
|
it('sets the kind and Emissive slot', () => {
|
|
@@ -42,3 +42,8 @@ describe('createEmissiveModifier', () => {
|
|
|
42
42
|
expect(modifier.mask).toBe(mask);
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
|
+
describe('initializeEmissiveModifier', () => {
|
|
46
|
+
it('is the construction initializer of createEmissiveModifier', () => {
|
|
47
|
+
expect(typeof initializeEmissiveModifier).toBe('function');
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EnvReflectModifierKind, ModifierSlot } from '@flighthq/types/contract';
|
|
2
2
|
import { describe, expect, it } from 'vitest';
|
|
3
3
|
|
|
4
|
-
import { createEnvReflectModifier } from './createEnvReflectModifier';
|
|
4
|
+
import { createEnvReflectModifier, initializeEnvReflectModifier } from './createEnvReflectModifier';
|
|
5
5
|
|
|
6
6
|
describe('createEnvReflectModifier', () => {
|
|
7
7
|
it('sets the kind and Effect slot', () => {
|
|
@@ -26,3 +26,8 @@ describe('createEnvReflectModifier', () => {
|
|
|
26
26
|
expect(modifier.roughness).toBe(0.6);
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
|
+
describe('initializeEnvReflectModifier', () => {
|
|
30
|
+
it('is the construction initializer of createEnvReflectModifier', () => {
|
|
31
|
+
expect(typeof initializeEnvReflectModifier).toBe('function');
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FogModifierKind, FogModifierMode, ModifierSlot } from '@flighthq/types/contract';
|
|
2
2
|
import { describe, expect, it } from 'vitest';
|
|
3
3
|
|
|
4
|
-
import { createFogModifier } from './createFogModifier';
|
|
4
|
+
import { createFogModifier, initializeFogModifier } from './createFogModifier';
|
|
5
5
|
|
|
6
6
|
describe('createFogModifier', () => {
|
|
7
7
|
it('sets the kind and Effect slot', () => {
|
|
@@ -29,3 +29,8 @@ describe('createFogModifier', () => {
|
|
|
29
29
|
expect(modifier.density).toBe(0.05);
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
|
+
describe('initializeFogModifier', () => {
|
|
33
|
+
it('is the construction initializer of createFogModifier', () => {
|
|
34
|
+
expect(typeof initializeFogModifier).toBe('function');
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModifierSlot, RimModifierKind } from '@flighthq/types/contract';
|
|
2
2
|
import { describe, expect, it } from 'vitest';
|
|
3
3
|
|
|
4
|
-
import { createRimModifier } from './createRimModifier';
|
|
4
|
+
import { createRimModifier, initializeRimModifier } from './createRimModifier';
|
|
5
5
|
|
|
6
6
|
describe('createRimModifier', () => {
|
|
7
7
|
it('sets the kind and Effect slot', () => {
|
|
@@ -29,3 +29,8 @@ describe('createRimModifier', () => {
|
|
|
29
29
|
expect(modifier.bias).toBe(0.1);
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
|
+
describe('initializeRimModifier', () => {
|
|
33
|
+
it('is the construction initializer of createRimModifier', () => {
|
|
34
|
+
expect(typeof initializeRimModifier).toBe('function');
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -2,7 +2,7 @@ import { EntityRuntimeKey, ShadedMaterialKind } from '@flighthq/types/contract';
|
|
|
2
2
|
import { describe, expect, it } from 'vitest';
|
|
3
3
|
|
|
4
4
|
import { createEmissiveModifier } from './createEmissiveModifier';
|
|
5
|
-
import { createShadedMaterial } from './createShadedMaterial';
|
|
5
|
+
import { createShadedMaterial, initializeShadedMaterial } from './createShadedMaterial';
|
|
6
6
|
|
|
7
7
|
describe('createShadedMaterial', () => {
|
|
8
8
|
it('builds an entity with the ShadedMaterial kind', () => {
|
|
@@ -49,3 +49,8 @@ describe('createShadedMaterial', () => {
|
|
|
49
49
|
expect(material.modifiers).toBe(modifiers);
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
|
+
describe('initializeShadedMaterial', () => {
|
|
53
|
+
it('is the construction initializer of createShadedMaterial', () => {
|
|
54
|
+
expect(typeof initializeShadedMaterial).toBe('function');
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModifierSlot, ToonModifierKind } from '@flighthq/types/contract';
|
|
2
2
|
import { describe, expect, it } from 'vitest';
|
|
3
3
|
|
|
4
|
-
import { createToonModifier } from './createToonModifier';
|
|
4
|
+
import { createToonModifier, initializeToonModifier } from './createToonModifier';
|
|
5
5
|
|
|
6
6
|
describe('createToonModifier', () => {
|
|
7
7
|
it('sets the kind and Effect slot', () => {
|
|
@@ -21,3 +21,8 @@ describe('createToonModifier', () => {
|
|
|
21
21
|
expect(modifier.smoothness).toBe(0.2);
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
|
+
describe('initializeToonModifier', () => {
|
|
25
|
+
it('is the construction initializer of createToonModifier', () => {
|
|
26
|
+
expect(typeof initializeToonModifier).toBe('function');
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -2,7 +2,7 @@ import type { Texture, Vector3Like } from '@flighthq/types/contract';
|
|
|
2
2
|
import { ModifierSlot, VertexDisplaceModifierKind, VertexDisplaceModifierSource } from '@flighthq/types/contract';
|
|
3
3
|
import { describe, expect, it } from 'vitest';
|
|
4
4
|
|
|
5
|
-
import { createVertexDisplaceModifier } from './createVertexDisplaceModifier';
|
|
5
|
+
import { createVertexDisplaceModifier, initializeVertexDisplaceModifier } from './createVertexDisplaceModifier';
|
|
6
6
|
|
|
7
7
|
describe('createVertexDisplaceModifier', () => {
|
|
8
8
|
it('sets the kind and the Vertex slot', () => {
|
|
@@ -34,3 +34,8 @@ describe('createVertexDisplaceModifier', () => {
|
|
|
34
34
|
expect(modifier.map).toBe(map);
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
|
+
describe('initializeVertexDisplaceModifier', () => {
|
|
38
|
+
it('is the construction initializer of createVertexDisplaceModifier', () => {
|
|
39
|
+
expect(typeof initializeVertexDisplaceModifier).toBe('function');
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -2,7 +2,12 @@ import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
|
|
|
2
2
|
import type { Modifier } from '@flighthq/types/contract';
|
|
3
3
|
import { describe, expect, it } from 'vitest';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
createModifierRegistry,
|
|
7
|
+
initializeModifierRegistry,
|
|
8
|
+
registerModifier,
|
|
9
|
+
resolveModifier,
|
|
10
|
+
} from './modifierRegistry';
|
|
6
11
|
|
|
7
12
|
describe('createModifierRegistry', () => {
|
|
8
13
|
it('allocates an empty registry', () => {
|
|
@@ -18,6 +23,12 @@ describe('createModifierRegistry', () => {
|
|
|
18
23
|
});
|
|
19
24
|
});
|
|
20
25
|
|
|
26
|
+
describe('initializeModifierRegistry', () => {
|
|
27
|
+
it('is the construction initializer of createModifierRegistry', () => {
|
|
28
|
+
expect(typeof initializeModifierRegistry).toBe('function');
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
21
32
|
describe('registerModifier', () => {
|
|
22
33
|
it('stores a definition retrievable by kind', () => {
|
|
23
34
|
const registry = createModifierRegistry();
|
|
@@ -53,7 +64,6 @@ describe('registerModifier', () => {
|
|
|
53
64
|
).toBe('Effect');
|
|
54
65
|
});
|
|
55
66
|
});
|
|
56
|
-
|
|
57
67
|
describe('resolveModifier', () => {
|
|
58
68
|
it('returns null for an unregistered kind', () => {
|
|
59
69
|
const registry = createModifierRegistry();
|