react-native-shine 0.5.0 → 0.7.0
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/lib/module/components/Content.js +56 -36
- package/lib/module/components/Content.js.map +1 -1
- package/lib/module/components/ShineGroup.js +16 -8
- package/lib/module/components/ShineGroup.js.map +1 -1
- package/lib/module/config/debugMode.js +1 -0
- package/lib/module/config/debugMode.js.map +1 -1
- package/lib/module/enums/colorHighlightPresets.js +24 -0
- package/lib/module/enums/colorHighlightPresets.js.map +1 -0
- package/lib/module/enums/effectPresets.js +16 -0
- package/lib/module/enums/effectPresets.js.map +1 -0
- package/lib/module/enums/waveCallback.js +2 -1
- package/lib/module/enums/waveCallback.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/shaders/bindGroupLayouts.js +21 -16
- package/lib/module/shaders/bindGroupLayouts.js.map +1 -1
- package/lib/module/shaders/bindGroupUtils.js +16 -7
- package/lib/module/shaders/bindGroupUtils.js.map +1 -1
- package/lib/module/shaders/fragmentShaders/baseTextureFragment.js +28 -0
- package/lib/module/shaders/fragmentShaders/baseTextureFragment.js.map +1 -0
- package/lib/module/shaders/fragmentShaders/colorMaskFragment.js +56 -39
- package/lib/module/shaders/fragmentShaders/colorMaskFragment.js.map +1 -1
- package/lib/module/shaders/fragmentShaders/glareFragment.js +13 -11
- package/lib/module/shaders/fragmentShaders/glareFragment.js.map +1 -1
- package/lib/module/shaders/fragmentShaders/holoFragment.js +13 -4
- package/lib/module/shaders/fragmentShaders/holoFragment.js.map +1 -1
- package/lib/module/shaders/fragmentShaders/maskFragment.js +1 -0
- package/lib/module/shaders/fragmentShaders/maskFragment.js.map +1 -1
- package/lib/module/shaders/fragmentShaders/reverseHoloFragment.js +13 -8
- package/lib/module/shaders/fragmentShaders/reverseHoloFragment.js.map +1 -1
- package/lib/module/shaders/resourceManagement/textures.js.map +1 -1
- package/lib/module/shaders/tgpuUtils.js +49 -29
- package/lib/module/shaders/tgpuUtils.js.map +1 -1
- package/lib/module/shaders/vertexShaders/mainRotationEffectVertex.js +1 -0
- package/lib/module/shaders/vertexShaders/mainRotationEffectVertex.js.map +1 -1
- package/lib/module/shaders/vertexShaders/mainVertex.js +1 -0
- package/lib/module/shaders/vertexShaders/mainVertex.js.map +1 -1
- package/lib/module/types/size.js +2 -0
- package/lib/module/types/typeUtils.js +100 -51
- package/lib/module/types/typeUtils.js.map +1 -1
- package/lib/module/types/vector.js +2 -0
- package/lib/module/utils/vector.js +6 -6
- package/lib/typescript/src/components/Content.d.ts +11 -8
- package/lib/typescript/src/components/Content.d.ts.map +1 -1
- package/lib/typescript/src/components/ShineGroup.d.ts +1 -1
- package/lib/typescript/src/components/ShineGroup.d.ts.map +1 -1
- package/lib/typescript/src/config/debugMode.d.ts +1 -0
- package/lib/typescript/src/config/debugMode.d.ts.map +1 -1
- package/lib/typescript/src/enums/colorHighlightPresets.d.ts +12 -0
- package/lib/typescript/src/enums/colorHighlightPresets.d.ts.map +1 -0
- package/lib/typescript/src/enums/effectPresets.d.ts +14 -0
- package/lib/typescript/src/enums/effectPresets.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/shaders/bindGroupLayouts.d.ts +90 -51
- package/lib/typescript/src/shaders/bindGroupLayouts.d.ts.map +1 -1
- package/lib/typescript/src/shaders/bindGroupUtils.d.ts +41 -46
- package/lib/typescript/src/shaders/bindGroupUtils.d.ts.map +1 -1
- package/lib/typescript/src/shaders/fragmentShaders/baseTextureFragment.d.ts +5 -0
- package/lib/typescript/src/shaders/fragmentShaders/baseTextureFragment.d.ts.map +1 -0
- package/lib/typescript/src/shaders/fragmentShaders/colorMaskFragment.d.ts.map +1 -1
- package/lib/typescript/src/shaders/fragmentShaders/glareFragment.d.ts.map +1 -1
- package/lib/typescript/src/shaders/fragmentShaders/holoFragment.d.ts.map +1 -1
- package/lib/typescript/src/shaders/fragmentShaders/reverseHoloFragment.d.ts.map +1 -1
- package/lib/typescript/src/shaders/resourceManagement/textures.d.ts +3 -3
- package/lib/typescript/src/shaders/resourceManagement/textures.d.ts.map +1 -1
- package/lib/typescript/src/shaders/tgpuUtils.d.ts.map +1 -1
- package/lib/typescript/src/types/typeUtils.d.ts +33 -3
- package/lib/typescript/src/types/typeUtils.d.ts.map +1 -1
- package/lib/typescript/src/types/types.d.ts +32 -4
- package/lib/typescript/src/types/types.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/components/Content.tsx +92 -47
- package/src/components/ShineGroup.tsx +16 -8
- package/src/config/debugMode.ts +1 -0
- package/src/enums/colorHighlightPresets.ts +33 -0
- package/src/enums/effectPresets.ts +11 -0
- package/src/enums/waveCallback.ts +1 -1
- package/src/index.tsx +2 -0
- package/src/shaders/bindGroupLayouts.ts +27 -10
- package/src/shaders/bindGroupUtils.ts +19 -26
- package/src/shaders/fragmentShaders/baseTextureFragment.ts +18 -0
- package/src/shaders/fragmentShaders/colorMaskFragment.ts +70 -42
- package/src/shaders/fragmentShaders/glareFragment.ts +10 -8
- package/src/shaders/fragmentShaders/holoFragment.ts +9 -3
- package/src/shaders/fragmentShaders/reverseHoloFragment.ts +12 -7
- package/src/shaders/resourceManagement/textures.ts +3 -3
- package/src/shaders/tgpuUtils.ts +41 -46
- package/src/types/typeUtils.ts +102 -56
- package/src/types/types.ts +37 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type TgpuBuffer, type TgpuRoot, type UniformFlag } from 'typegpu';
|
|
2
2
|
import * as d from 'typegpu/data';
|
|
3
|
-
import { type
|
|
4
|
-
import type { GlareOptions
|
|
3
|
+
import { type GlareSchema, type ReverseHoloDetectionChannelFlagsSchema, type ColorMaskArraySchema } from './bindGroupLayouts';
|
|
4
|
+
import type { GlareOptions } from '../types/types';
|
|
5
5
|
export declare const createRotationBuffer: (root: TgpuRoot, initValues?: {
|
|
6
6
|
x: number;
|
|
7
7
|
y: number;
|
|
@@ -13,58 +13,51 @@ export declare const createRotationValuesBindGroup: (root: TgpuRoot, buffer: Tgp
|
|
|
13
13
|
};
|
|
14
14
|
}>;
|
|
15
15
|
export declare const createGlareOptionsBuffer: (root: TgpuRoot, initValues?: Partial<GlareOptions>) => TgpuBuffer<d.WgslStruct<{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
glareColor: d.WgslStruct<{
|
|
17
|
+
hueShiftAngleMax: d.F32;
|
|
18
|
+
hueShiftAngleMin: d.F32;
|
|
19
|
+
hueBlendPower: d.F32;
|
|
20
|
+
}>;
|
|
21
|
+
glowPower: d.Decorated<d.F32, [d.Align<16>]>;
|
|
20
22
|
lightIntensity: d.F32;
|
|
21
23
|
glareIntensity: d.F32;
|
|
22
24
|
}>> & UniformFlag;
|
|
23
25
|
export declare const createGlareBindGroup: (root: TgpuRoot, buffer: TgpuBuffer<GlareSchema> & UniformFlag) => import("typegpu").TgpuBindGroup<{
|
|
24
26
|
glareOptions: {
|
|
25
27
|
uniform: d.WgslStruct<{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
glareColor: d.WgslStruct<{
|
|
29
|
+
hueShiftAngleMax: d.F32;
|
|
30
|
+
hueShiftAngleMin: d.F32;
|
|
31
|
+
hueBlendPower: d.F32;
|
|
32
|
+
}>;
|
|
33
|
+
glowPower: d.Decorated<d.F32, [d.Align<16>]>;
|
|
30
34
|
lightIntensity: d.F32;
|
|
31
35
|
glareIntensity: d.F32;
|
|
32
36
|
}>;
|
|
33
37
|
};
|
|
34
38
|
}>;
|
|
35
|
-
export declare const
|
|
36
|
-
|
|
37
|
-
rgbToleranceRange: d.WgslStruct<{
|
|
38
|
-
upper: d.Vec3f;
|
|
39
|
-
lower: d.Vec3f;
|
|
40
|
-
}>;
|
|
41
|
-
hueToleranceRange: d.WgslStruct<{
|
|
42
|
-
upper: d.F32;
|
|
43
|
-
lower: d.F32;
|
|
44
|
-
}>;
|
|
45
|
-
useHSV: d.Decorated<d.U32, [d.Align<16>]>;
|
|
46
|
-
brightnessTolerance: d.F32;
|
|
47
|
-
saturationTolerance: d.F32;
|
|
48
|
-
lowSaturationThreshold: d.F32;
|
|
49
|
-
lowBrightnessThreshold: d.F32;
|
|
50
|
-
}>> & UniformFlag;
|
|
51
|
-
export declare const createColorMaskBindGroup: (root: TgpuRoot, buffer: TgpuBuffer<ColorMaskSchema> & UniformFlag) => import("typegpu").TgpuBindGroup<{
|
|
52
|
-
mask: {
|
|
39
|
+
export declare const createColorMaskBindGroup: (root: TgpuRoot, buffer: TgpuBuffer<ColorMaskArraySchema> & UniformFlag) => import("typegpu").TgpuBindGroup<{
|
|
40
|
+
colorMasks: {
|
|
53
41
|
uniform: d.WgslStruct<{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
42
|
+
masks: d.WgslArray<d.WgslStruct<{
|
|
43
|
+
baseColor: d.Vec3f;
|
|
44
|
+
rgbToleranceRange: d.WgslStruct<{
|
|
45
|
+
upper: d.Vec3f;
|
|
46
|
+
lower: d.Vec3f;
|
|
47
|
+
}>;
|
|
48
|
+
hueToleranceRange: d.WgslStruct<{
|
|
49
|
+
upper: d.F32;
|
|
50
|
+
lower: d.F32;
|
|
51
|
+
}>;
|
|
52
|
+
useHSV: d.Decorated<d.U32, [d.Align<16>]>;
|
|
53
|
+
brightnessTolerance: d.F32;
|
|
54
|
+
saturationTolerance: d.F32;
|
|
55
|
+
lowSaturationThreshold: d.F32;
|
|
56
|
+
lowBrightnessThreshold: d.F32;
|
|
57
|
+
debugMode: d.U32;
|
|
58
|
+
}>>;
|
|
59
|
+
usedMaskCount: d.I32;
|
|
60
|
+
reverseHighlight: d.I32;
|
|
68
61
|
}>;
|
|
69
62
|
};
|
|
70
63
|
}>;
|
|
@@ -81,10 +74,12 @@ export declare const createReverseHoloDetectionChannelFlagsBindGroup: (root: Tgp
|
|
|
81
74
|
};
|
|
82
75
|
glareOptions: {
|
|
83
76
|
uniform: d.WgslStruct<{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
glareColor: d.WgslStruct<{
|
|
78
|
+
hueShiftAngleMax: d.F32;
|
|
79
|
+
hueShiftAngleMin: d.F32;
|
|
80
|
+
hueBlendPower: d.F32;
|
|
81
|
+
}>;
|
|
82
|
+
glowPower: d.Decorated<d.F32, [d.Align<16>]>;
|
|
88
83
|
lightIntensity: d.F32;
|
|
89
84
|
glareIntensity: d.F32;
|
|
90
85
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindGroupUtils.d.ts","sourceRoot":"","sources":["../../../../src/shaders/bindGroupUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"bindGroupUtils.d.ts","sourceRoot":"","sources":["../../../../src/shaders/bindGroupUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,sCAAsC,EAE3C,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAInD,eAAO,MAAM,oBAAoB,GAAI,MAAM,QAAQ,EAAE;;;;CAAoB,sCAGnD,CAAC;AAEvB,eAAO,MAAM,6BAA6B,GACxC,MAAM,QAAQ,EACd,QAAQ,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;;;;EAIzB,CAAC;AAEL,eAAO,MAAM,wBAAwB,GACnC,MAAM,QAAQ,EACd,aAAa,OAAO,CAAC,YAAY,CAAC;;;;;;;;;iBAOd,CAAC;AAEvB,eAAO,MAAM,oBAAoB,GAC/B,MAAM,QAAQ,EACd,QAAQ,UAAU,CAAC,WAAW,CAAC,GAAG,WAAW;;;;;;;;;;;;;EAI3C,CAAC;AAaL,eAAO,MAAM,wBAAwB,GACnC,MAAM,QAAQ,EACd,QAAQ,UAAU,CAAC,oBAAoB,CAAC,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;EAIpD,CAAC;AAEL,eAAO,MAAM,+CAA+C,GAC1D,MAAM,QAAQ,EACd,wBAAwB,UAAU,CAAC,sCAAsC,CAAC,GACxE,WAAW,EACb,oBAAoB,UAAU,CAAC,WAAW,CAAC,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;EAKvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseTextureFragment.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/fragmentShaders/baseTextureFragment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAIlC,eAAO,MAAM,mBAAmB;;WAY9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorMaskFragment.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/fragmentShaders/colorMaskFragment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"colorMaskFragment.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/fragmentShaders/colorMaskFragment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AASlC,QAAA,MAAM,iBAAiB;;WA4FrB,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glareFragment.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/fragmentShaders/glareFragment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAUlC,eAAO,MAAM,aAAa;;
|
|
1
|
+
{"version":3,"file":"glareFragment.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/fragmentShaders/glareFragment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAUlC,eAAO,MAAM,aAAa;;WAuExB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;WA4D3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"holoFragment.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/fragmentShaders/holoFragment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AASlC,eAAO,MAAM,YAAY;;
|
|
1
|
+
{"version":3,"file":"holoFragment.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/fragmentShaders/holoFragment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AASlC,eAAO,MAAM,YAAY;;WA8BvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reverseHoloFragment.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/fragmentShaders/reverseHoloFragment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAUlC,eAAO,MAAM,mBAAmB;;
|
|
1
|
+
{"version":3,"file":"reverseHoloFragment.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/fragmentShaders/reverseHoloFragment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAUlC,eAAO,MAAM,mBAAmB;;WA6F9B,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { type TextureProps, type TgpuRoot, type TgpuTexture } from 'typegpu';
|
|
|
2
2
|
export declare const createTexture: (root: TgpuRoot, size: {
|
|
3
3
|
width: number;
|
|
4
4
|
height: number;
|
|
5
|
-
}) => Promise<TgpuTexture
|
|
6
|
-
export declare const loadTexture: (root: TgpuRoot, imageBitmap: ImageBitmap, texture: TgpuTexture) => Promise<void>;
|
|
5
|
+
}) => Promise<TgpuTexture<any>>;
|
|
6
|
+
export declare const loadTexture: (root: TgpuRoot, imageBitmap: ImageBitmap, texture: TgpuTexture<any>) => Promise<void>;
|
|
7
7
|
export declare function loadBitmap(root: TgpuRoot, imageURI: string, setTexture: (texture: TgpuTexture<TextureProps>) => void, usage?: ('sampled' | 'render')[]): Promise<void>;
|
|
8
|
-
export declare function addTextureUsage(texture: TgpuTexture, usage: ('sampled' | 'render')[]): Promise<TgpuTexture<TextureProps> & import("typegpu").
|
|
8
|
+
export declare function addTextureUsage(texture: TgpuTexture, usage: ('sampled' | 'render')[]): Promise<TgpuTexture<TextureProps> & import("typegpu").SampledFlag & import("typegpu").RenderFlag>;
|
|
9
9
|
//# sourceMappingURL=textures.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textures.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/resourceManagement/textures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAG7E,eAAO,MAAM,aAAa,GACxB,MAAM,QAAQ,EACd,MAAM;IACJ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,KAEA,OAAO,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"textures.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/resourceManagement/textures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAG7E,eAAO,MAAM,aAAa,GACxB,MAAM,QAAQ,EACd,MAAM;IACJ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,KAEA,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAO1B,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,MAAM,QAAQ,EACd,aAAa,WAAW,EACxB,SAAS,WAAW,CAAC,GAAG,CAAC,kBAO1B,CAAC;AAEF,wBAAsB,UAAU,CAC9B,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC,KAAK,IAAI,EACxD,KAAK,GAAE,CAAC,SAAS,GAAG,QAAQ,CAAC,EAA0B,iBAQxD;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,CAAC,SAAS,GAAG,QAAQ,CAAC,EAAE,qGAGhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tgpuUtils.d.ts","sourceRoot":"","sources":["../../../../src/shaders/tgpuUtils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"tgpuUtils.d.ts","sourceRoot":"","sources":["../../../../src/shaders/tgpuUtils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,eAAO,MAAM,QAAQ,mEAQnB,CAAC;AAEH,eAAO,MAAM,QAAQ,qDA4BnB,CAAC;AAEH,eAAO,MAAM,QAAQ,qDA8BnB,CAAC;AAEH,eAAO,MAAM,IAAI,+DASf,CAAC;AAEH,eAAO,MAAM,eAAe,qEAc1B,CAAC;AAEH,eAAO,MAAM,cAAc,gEAYzB,CAAC;AAEH,eAAO,MAAM,eAAe,sEAS1B,CAAC;AAEH,mBAAmB;AACnB,eAAO,MAAM,OAAO,mDAQlB,CAAC;AAEH,eAAO,MAAM,0BAA0B,+DAcrC,CAAC;AAEH,eAAO,MAAM,UAAU,yEAMrB,CAAC"}
|
|
@@ -1,8 +1,37 @@
|
|
|
1
|
-
import { f32 } from 'typegpu/data';
|
|
2
1
|
import type { GlareOptions, ColorMask, DeepPartiallyOptional, HoloOptions, ReverseHoloDetectionChannelFlags } from './types';
|
|
3
2
|
export declare const createGlareOptions: (options: Partial<GlareOptions>) => GlareOptions;
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
3
|
+
export declare const glareOptionsToTyped: (glareOptions: GlareOptions) => {
|
|
4
|
+
glowPower: number;
|
|
5
|
+
lightIntensity: number;
|
|
6
|
+
glareIntensity: number;
|
|
7
|
+
glareColor: {
|
|
8
|
+
hueShiftAngleMax: number;
|
|
9
|
+
hueShiftAngleMin: number;
|
|
10
|
+
hueBlendPower: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const createColorMasks: (colorMasks: DeepPartiallyOptional<ColorMask, "baseColor">[]) => ColorMask[];
|
|
14
|
+
export declare const colorMasksToTyped: (colorMasks: ColorMask[], reverseHighlight: boolean) => {
|
|
15
|
+
masks: {
|
|
16
|
+
baseColor: any;
|
|
17
|
+
rgbToleranceRange: {
|
|
18
|
+
upper: any;
|
|
19
|
+
lower: any;
|
|
20
|
+
};
|
|
21
|
+
useHSV: number;
|
|
22
|
+
hueToleranceRange: {
|
|
23
|
+
lower: number;
|
|
24
|
+
upper: number;
|
|
25
|
+
};
|
|
26
|
+
brightnessTolerance: number;
|
|
27
|
+
saturationTolerance: number;
|
|
28
|
+
lowSaturationThreshold: number;
|
|
29
|
+
lowBrightnessThreshold: number;
|
|
30
|
+
debugMode: number;
|
|
31
|
+
}[];
|
|
32
|
+
usedMaskCount: number;
|
|
33
|
+
reverseHighlight: number;
|
|
34
|
+
};
|
|
6
35
|
export declare const colorMaskToTyped: (colorMask: ColorMask) => {
|
|
7
36
|
baseColor: any;
|
|
8
37
|
rgbToleranceRange: {
|
|
@@ -18,6 +47,7 @@ export declare const colorMaskToTyped: (colorMask: ColorMask) => {
|
|
|
18
47
|
saturationTolerance: number;
|
|
19
48
|
lowSaturationThreshold: number;
|
|
20
49
|
lowBrightnessThreshold: number;
|
|
50
|
+
debugMode: number;
|
|
21
51
|
};
|
|
22
52
|
export declare const createHoloOptions: (options: Partial<HoloOptions>) => HoloOptions;
|
|
23
53
|
export declare const createReverseHoloDetectionChannelFlags: (options?: Partial<ReverseHoloDetectionChannelFlags>) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeUtils.d.ts","sourceRoot":"","sources":["../../../../src/types/typeUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typeUtils.d.ts","sourceRoot":"","sources":["../../../../src/types/typeUtils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,qBAAqB,EAErB,WAAW,EACX,gCAAgC,EACjC,MAAM,SAAS,CAAC;AAMjB,eAAO,MAAM,kBAAkB,GAC7B,SAAS,OAAO,CAAC,YAAY,CAAC,KAC7B,YAiBF,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,cAAc,YAAY;;;;;;;;;CAW7D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,YAAY,qBAAqB,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,KAC1D,SAAS,EA2CX,CAAC;AA2BF,eAAO,MAAM,iBAAiB,GAC5B,YAAY,SAAS,EAAE,EACvB,kBAAkB,OAAO;;;;;;;;;;;;;;;;;;;;CAU1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,WAAW,SAAS;;;;;;;;;;;;;;;;CAoBpD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,SAAS,OAAO,CAAC,WAAW,CAAC,KAC5B,WAQF,CAAC;AAEF,eAAO,MAAM,sCAAsC,GACjD,UAAU,OAAO,CAAC,gCAAgC,CAAC;;;;;;;CA2BpD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,EAAE,QAkB7C,CAAC"}
|
|
@@ -6,11 +6,13 @@ export type vec4 = [number, number, number, number];
|
|
|
6
6
|
export type quaternion = vec4;
|
|
7
7
|
export type GlareOptions = {
|
|
8
8
|
glowPower: number;
|
|
9
|
-
hueShiftAngleMax: number;
|
|
10
|
-
hueShiftAngleMin: number;
|
|
11
|
-
hueBlendPower: number;
|
|
12
9
|
lightIntensity: number;
|
|
13
10
|
glareIntensity: number;
|
|
11
|
+
glareColor: {
|
|
12
|
+
hueBlendPower: number;
|
|
13
|
+
hueShiftAngleMax: number;
|
|
14
|
+
hueShiftAngleMin: number;
|
|
15
|
+
};
|
|
14
16
|
};
|
|
15
17
|
export type ColorMask = {
|
|
16
18
|
baseColor: vec3;
|
|
@@ -20,13 +22,39 @@ export type ColorMask = {
|
|
|
20
22
|
lower: number;
|
|
21
23
|
};
|
|
22
24
|
brightnessTolerance?: number;
|
|
23
|
-
lowBrightnessThreshold?: number;
|
|
24
25
|
saturationTolerance?: number;
|
|
26
|
+
lowBrightnessThreshold?: number;
|
|
25
27
|
lowSaturationThreshold?: number;
|
|
26
28
|
rgbToleranceRange: {
|
|
27
29
|
upper: vec3;
|
|
28
30
|
lower: vec3;
|
|
29
31
|
};
|
|
32
|
+
debugMode?: boolean;
|
|
33
|
+
};
|
|
34
|
+
export type ColorMaskArrayShaderAssert = [
|
|
35
|
+
any,
|
|
36
|
+
any,
|
|
37
|
+
any,
|
|
38
|
+
any,
|
|
39
|
+
any,
|
|
40
|
+
any,
|
|
41
|
+
any,
|
|
42
|
+
any,
|
|
43
|
+
any,
|
|
44
|
+
any,
|
|
45
|
+
any,
|
|
46
|
+
any,
|
|
47
|
+
any,
|
|
48
|
+
any,
|
|
49
|
+
any,
|
|
50
|
+
any
|
|
51
|
+
];
|
|
52
|
+
export type Effect = {
|
|
53
|
+
name: 'reverseHolo';
|
|
54
|
+
options: Partial<ReverseHoloDetectionChannelFlags>;
|
|
55
|
+
} | {
|
|
56
|
+
name: 'holo';
|
|
57
|
+
options?: HoloOptions;
|
|
30
58
|
};
|
|
31
59
|
export type ReverseHoloDetectionChannelFlags = {
|
|
32
60
|
redChannel: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACpC,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC5C,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACpD,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC;AAE9B,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACpC,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC5C,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACpD,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC;AAE9B,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE;QACV,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE,MAAM,CAAC;QACzB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE;QACjB,KAAK,EAAE,IAAI,CAAC;QACZ,KAAK,EAAE,IAAI,CAAC;KACb,CAAC;IACF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAGF,MAAM,MAAM,0BAA0B,GAAG;IACvC,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;CACJ,CAAC;AAEF,MAAM,MAAM,MAAM,GACd;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC,gCAAgC,CAAC,CAAC;CACpD,GACD;IACE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAEN,MAAM,MAAM,gCAAgC,GAAG;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,cAAc,CAAC;CAC9B,CAAC;AAGF,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI;KACnD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACf,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAExB,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,IAAI,GACJ,SAAS,CAAC;AAId,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,SAAS,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3E,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAC5E,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE1B,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,UAAU,CACtC,kBAAkB,CAAC,qBAAqB,CAAC,CAC1C,CAAC,CAAC,CAAC,CAAC;AAEL,MAAM,MAAM,sBAAsB,GAAG,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-shine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Fast and efficient way of adding interactive effects that are run entirely on shaders using typeGPU.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"registry": "https://registry.npmjs.org/"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
+
"@babel/plugin-transform-typescript": "^7.28.5",
|
|
65
66
|
"@commitlint/config-conventional": "^19.6.0",
|
|
66
67
|
"@eslint/compat": "^1.2.7",
|
|
67
68
|
"@eslint/eslintrc": "^3.3.0",
|
|
@@ -88,9 +89,9 @@
|
|
|
88
89
|
"react-native-wgpu": "^0.3.1",
|
|
89
90
|
"react-native-worklets": "^0.5.2",
|
|
90
91
|
"release-it": "^17.10.0",
|
|
91
|
-
"typegpu": "0.
|
|
92
|
+
"typegpu": "^0.8.2",
|
|
92
93
|
"typescript": "^5.8.3",
|
|
93
|
-
"unplugin-typegpu": "0.
|
|
94
|
+
"unplugin-typegpu": "^0.8.0"
|
|
94
95
|
},
|
|
95
96
|
"peerDependencies": {
|
|
96
97
|
"react": "*",
|
|
@@ -98,7 +99,7 @@
|
|
|
98
99
|
"react-native-reanimated": "^4.1.3",
|
|
99
100
|
"react-native-wgpu": "^0.3.1",
|
|
100
101
|
"react-native-worklets": "^0.5.2",
|
|
101
|
-
"typegpu": "0.
|
|
102
|
+
"typegpu": "^0.8.2"
|
|
102
103
|
},
|
|
103
104
|
"workspaces": [
|
|
104
105
|
"example"
|
|
@@ -49,13 +49,13 @@ import type {
|
|
|
49
49
|
ColorAttachment,
|
|
50
50
|
ColorMask,
|
|
51
51
|
DeepPartiallyOptional,
|
|
52
|
+
Effect,
|
|
52
53
|
GlareOptions,
|
|
53
54
|
PipelineAttachmentPair,
|
|
54
|
-
ReverseHoloDetectionChannelFlags,
|
|
55
55
|
} from '../types/types';
|
|
56
56
|
import {
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
colorMasksToTyped,
|
|
58
|
+
createColorMasks,
|
|
59
59
|
createGlareOptions,
|
|
60
60
|
createReverseHoloDetectionChannelFlags,
|
|
61
61
|
} from '../types/typeUtils';
|
|
@@ -74,19 +74,28 @@ import {
|
|
|
74
74
|
transformV2d,
|
|
75
75
|
zeroV3d,
|
|
76
76
|
} from '../utils/vector';
|
|
77
|
+
import { baseTextureFragment } from '../shaders/fragmentShaders/baseTextureFragment';
|
|
77
78
|
|
|
78
79
|
export interface SharedProps {
|
|
79
80
|
width: number;
|
|
80
81
|
height: number;
|
|
81
82
|
glareOptions?: Partial<GlareOptions>;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
enableGlare?: boolean;
|
|
84
|
+
highlightColors?: DeepPartiallyOptional<ColorMask, 'baseColor'>[];
|
|
85
|
+
isHighlightInclusive?: boolean;
|
|
86
|
+
lightPosition?: SharedValue<V2d>;
|
|
87
|
+
// addReverseHolo?: boolean;
|
|
88
|
+
// reverseHoloDetectionChannelOptions?: Partial<ReverseHoloDetectionChannelFlags>;
|
|
89
|
+
// addHolo?: boolean;
|
|
90
|
+
translateViewIn3d?:
|
|
91
|
+
| boolean
|
|
92
|
+
| {
|
|
93
|
+
perspective?: number;
|
|
94
|
+
intensity?: number;
|
|
95
|
+
};
|
|
88
96
|
style?: ViewStyle;
|
|
89
97
|
containerStyle?: ViewStyle;
|
|
98
|
+
effects?: Effect[];
|
|
90
99
|
}
|
|
91
100
|
|
|
92
101
|
interface ContentProps extends SharedProps {
|
|
@@ -96,24 +105,28 @@ interface ContentProps extends SharedProps {
|
|
|
96
105
|
}
|
|
97
106
|
|
|
98
107
|
interface PipelineMap {
|
|
99
|
-
|
|
100
|
-
|
|
108
|
+
baseTexture: TgpuRenderPipeline;
|
|
109
|
+
glare: TgpuRenderPipeline | void;
|
|
110
|
+
colorMask: TgpuRenderPipeline | void;
|
|
101
111
|
mask: TgpuRenderPipeline | void;
|
|
102
112
|
reverseHolo: TgpuRenderPipeline | void;
|
|
103
113
|
holo: TgpuRenderPipeline | void;
|
|
104
114
|
}
|
|
105
115
|
|
|
106
116
|
export default function Content({
|
|
107
|
-
addHolo,
|
|
108
|
-
addReverseHolo,
|
|
109
|
-
reverseHoloDetectionChannelOptions,
|
|
110
|
-
|
|
117
|
+
// addHolo,
|
|
118
|
+
// addReverseHolo,
|
|
119
|
+
// reverseHoloDetectionChannelOptions,
|
|
120
|
+
effects,
|
|
121
|
+
highlightColors,
|
|
122
|
+
isHighlightInclusive = true,
|
|
111
123
|
glareOptions,
|
|
124
|
+
enableGlare = true,
|
|
112
125
|
height,
|
|
113
126
|
imageTexture,
|
|
114
127
|
maskTexture,
|
|
115
128
|
root,
|
|
116
|
-
touchPosition,
|
|
129
|
+
lightPosition: touchPosition,
|
|
117
130
|
width,
|
|
118
131
|
translateViewIn3d = false,
|
|
119
132
|
style,
|
|
@@ -155,12 +168,19 @@ export default function Content({
|
|
|
155
168
|
);
|
|
156
169
|
|
|
157
170
|
const animatedStyle = useAnimatedStyle(() => {
|
|
158
|
-
|
|
159
|
-
|
|
171
|
+
let perspective: number = 300;
|
|
172
|
+
let intensity: number = 10;
|
|
173
|
+
if (typeof translateViewIn3d === 'object') {
|
|
174
|
+
perspective = translateViewIn3d.perspective ?? perspective;
|
|
175
|
+
intensity = translateViewIn3d.intensity ?? intensity;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const rotX = rotation.value.x * intensity;
|
|
179
|
+
const rotY = rotation.value.y * intensity;
|
|
160
180
|
|
|
161
181
|
return {
|
|
162
182
|
transform: [
|
|
163
|
-
{ perspective:
|
|
183
|
+
{ perspective: perspective },
|
|
164
184
|
{ rotateX: `${-rotY}deg` },
|
|
165
185
|
{ rotateY: `${rotX}deg` },
|
|
166
186
|
],
|
|
@@ -252,18 +272,17 @@ export default function Content({
|
|
|
252
272
|
alphaMode: 'premultiplied',
|
|
253
273
|
});
|
|
254
274
|
|
|
255
|
-
const sampler = device.createSampler({
|
|
256
|
-
magFilter: 'linear',
|
|
257
|
-
minFilter: 'linear',
|
|
258
|
-
mipmapFilter: 'linear',
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
// TODO: revert to this one after version bump
|
|
262
|
-
// const sampler = root['~unstable'].createSampler({
|
|
275
|
+
// const sampler = device.createSampler({
|
|
263
276
|
// magFilter: 'linear',
|
|
264
277
|
// minFilter: 'linear',
|
|
265
278
|
// mipmapFilter: 'linear',
|
|
266
|
-
// })
|
|
279
|
+
// });
|
|
280
|
+
|
|
281
|
+
const sampler = root['~unstable'].createSampler({
|
|
282
|
+
magFilter: 'linear',
|
|
283
|
+
minFilter: 'linear',
|
|
284
|
+
mipmapFilter: 'linear',
|
|
285
|
+
}) as any as GPUSampler; //TODO: delete this cast when TgpuFixedSampler gets exposed
|
|
267
286
|
|
|
268
287
|
const imageTextureBindGroup = root.createBindGroup(textureBindGroupLayout, {
|
|
269
288
|
texture: root.unwrap(imageTexture).createView(),
|
|
@@ -287,18 +306,22 @@ export default function Content({
|
|
|
287
306
|
const colorMaskBuffer = bufferMap.addBuffer(
|
|
288
307
|
root,
|
|
289
308
|
'colorMask',
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
)
|
|
309
|
+
colorMasksToTyped(
|
|
310
|
+
createColorMasks(
|
|
311
|
+
highlightColors ?? [{ baseColor: [-20, -20, -20], useHSV: false }]
|
|
312
|
+
),
|
|
313
|
+
isHighlightInclusive
|
|
294
314
|
)
|
|
295
315
|
);
|
|
296
316
|
const colorMaskBindGroup = createColorMaskBindGroup(root, colorMaskBuffer);
|
|
297
317
|
|
|
318
|
+
const reverseHoloEffect = effects
|
|
319
|
+
? effects.find((e) => e.name === 'reverseHolo')
|
|
320
|
+
: undefined;
|
|
298
321
|
const reverseHoloDetectionChannelFlagsBuffer = bufferMap.addBuffer(
|
|
299
322
|
root,
|
|
300
323
|
'reverseHoloDetectionChannelFlags',
|
|
301
|
-
createReverseHoloDetectionChannelFlags(
|
|
324
|
+
createReverseHoloDetectionChannelFlags(reverseHoloEffect?.options)
|
|
302
325
|
);
|
|
303
326
|
const reverseHoloDetectionChannelFlagsBindGroup =
|
|
304
327
|
createReverseHoloDetectionChannelFlagsBindGroup(
|
|
@@ -307,7 +330,21 @@ export default function Content({
|
|
|
307
330
|
glareBuffer
|
|
308
331
|
);
|
|
309
332
|
|
|
333
|
+
const holoEffect = effects
|
|
334
|
+
? effects.find((e) => e.name === 'holo')
|
|
335
|
+
: undefined;
|
|
336
|
+
|
|
310
337
|
const pipelineMap: PipelineMap = {
|
|
338
|
+
baseTexture: attachBindGroups(
|
|
339
|
+
root['~unstable']
|
|
340
|
+
.withVertex(mainVertex, {})
|
|
341
|
+
.withFragment(
|
|
342
|
+
baseTextureFragment,
|
|
343
|
+
getDefaultTarget(presentationFormat)
|
|
344
|
+
)
|
|
345
|
+
.createPipeline(),
|
|
346
|
+
[imageTextureBindGroup, rotationBindGroup]
|
|
347
|
+
),
|
|
311
348
|
glare: attachBindGroups(
|
|
312
349
|
root['~unstable']
|
|
313
350
|
.withVertex(mainVertex, {})
|
|
@@ -376,15 +413,21 @@ export default function Content({
|
|
|
376
413
|
storeOp: 'store',
|
|
377
414
|
};
|
|
378
415
|
|
|
379
|
-
const { glare, mask, colorMask, holo, reverseHolo } =
|
|
416
|
+
const { baseTexture, glare, mask, colorMask, holo, reverseHolo } =
|
|
417
|
+
pipelineMap;
|
|
380
418
|
|
|
381
|
-
const pairs: PipelineAttachmentPair[] = [
|
|
419
|
+
const pairs: PipelineAttachmentPair[] = [
|
|
420
|
+
[baseTexture, initialAttachment],
|
|
421
|
+
];
|
|
382
422
|
|
|
423
|
+
if ((glareOptions || !enableGlare) && glare) {
|
|
424
|
+
pairs.push([glare, loadingAttachment]);
|
|
425
|
+
}
|
|
383
426
|
if (mask) pairs.push([mask, loadingAttachment]);
|
|
384
|
-
if (
|
|
427
|
+
if (reverseHoloEffect && reverseHolo)
|
|
385
428
|
pairs.push([reverseHolo, loadingAttachment]);
|
|
386
|
-
if (
|
|
387
|
-
pairs.push([colorMask, loadingAttachment]);
|
|
429
|
+
if (holoEffect && holo) pairs.push([holo, loadingAttachment]);
|
|
430
|
+
if (colorMask) pairs.push([colorMask, loadingAttachment]);
|
|
388
431
|
|
|
389
432
|
pairs.forEach(([pipeline, attachment]) =>
|
|
390
433
|
pipeline.withColorAttachment(attachment).draw(6)
|
|
@@ -411,11 +454,11 @@ export default function Content({
|
|
|
411
454
|
rotation,
|
|
412
455
|
bufferMap,
|
|
413
456
|
glareOptions,
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
addReverseHolo,
|
|
417
|
-
reverseHoloDetectionChannelOptions,
|
|
457
|
+
enableGlare,
|
|
458
|
+
highlightColors,
|
|
418
459
|
pixelSize,
|
|
460
|
+
effects,
|
|
461
|
+
isHighlightInclusive,
|
|
419
462
|
]);
|
|
420
463
|
|
|
421
464
|
useAnimationFrame(() => renderRef.current?.());
|
|
@@ -423,11 +466,13 @@ export default function Content({
|
|
|
423
466
|
return (
|
|
424
467
|
<View
|
|
425
468
|
style={{
|
|
426
|
-
transform:
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
469
|
+
transform: translateViewIn3d
|
|
470
|
+
? [
|
|
471
|
+
{
|
|
472
|
+
matrix: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 50, 1],
|
|
473
|
+
},
|
|
474
|
+
]
|
|
475
|
+
: [],
|
|
431
476
|
...containerStyle,
|
|
432
477
|
}}
|
|
433
478
|
>
|
|
@@ -16,11 +16,15 @@ type ShineGroupProps = PropsWithChildren<Partial<ShineProps>>;
|
|
|
16
16
|
export function ShineGroup({
|
|
17
17
|
children,
|
|
18
18
|
glareOptions,
|
|
19
|
-
|
|
19
|
+
highlightColors,
|
|
20
20
|
maskURI,
|
|
21
|
-
touchPosition,
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
lightPosition: touchPosition,
|
|
22
|
+
effects,
|
|
23
|
+
enableGlare = true,
|
|
24
|
+
isHighlightInclusive = true,
|
|
25
|
+
translateViewIn3d = false,
|
|
26
|
+
containerStyle,
|
|
27
|
+
style,
|
|
24
28
|
}: ShineGroupProps) {
|
|
25
29
|
const viewShotRef = useRef<ViewShot>(null);
|
|
26
30
|
const [capturedURI, setCapturedURI] = useState<string | null>(null);
|
|
@@ -76,11 +80,15 @@ export function ShineGroup({
|
|
|
76
80
|
{...sizeFromV2d(size)}
|
|
77
81
|
imageURI={capturedURI}
|
|
78
82
|
glareOptions={glareOptions}
|
|
79
|
-
|
|
83
|
+
highlightColors={highlightColors}
|
|
80
84
|
maskURI={maskURI}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
lightPosition={touchPosition}
|
|
86
|
+
effects={effects}
|
|
87
|
+
translateViewIn3d={translateViewIn3d}
|
|
88
|
+
enableGlare={enableGlare}
|
|
89
|
+
containerStyle={containerStyle}
|
|
90
|
+
isHighlightInclusive={isHighlightInclusive}
|
|
91
|
+
style={style}
|
|
84
92
|
/>
|
|
85
93
|
)}
|
|
86
94
|
</View>
|
package/src/config/debugMode.ts
CHANGED