@3driseai/3drise-core 1.0.1 → 1.0.3

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.
Files changed (48) hide show
  1. package/dist/services/MaterialRegistry.d.ts +25 -0
  2. package/dist/services/MaterialRegistry.d.ts.map +1 -1
  3. package/dist/services/MaterialRegistry.js +102 -1
  4. package/dist/shaders/CircuitGridMaterial.d.ts +76 -0
  5. package/dist/shaders/CircuitGridMaterial.d.ts.map +1 -0
  6. package/dist/shaders/CircuitGridMaterial.js +298 -0
  7. package/dist/shaders/ContourGridMaterial.d.ts +80 -0
  8. package/dist/shaders/ContourGridMaterial.d.ts.map +1 -0
  9. package/dist/shaders/ContourGridMaterial.js +259 -0
  10. package/dist/shaders/FractalGridMaterial.d.ts +76 -0
  11. package/dist/shaders/FractalGridMaterial.d.ts.map +1 -0
  12. package/dist/shaders/FractalGridMaterial.js +247 -0
  13. package/dist/shaders/HexGridMaterial.d.ts +73 -0
  14. package/dist/shaders/HexGridMaterial.d.ts.map +1 -0
  15. package/dist/shaders/HexGridMaterial.js +265 -0
  16. package/dist/shaders/MoireGridMaterial.d.ts +79 -0
  17. package/dist/shaders/MoireGridMaterial.d.ts.map +1 -0
  18. package/dist/shaders/MoireGridMaterial.js +271 -0
  19. package/dist/shaders/MyGridMaterial.d.ts +7 -0
  20. package/dist/shaders/MyGridMaterial.d.ts.map +1 -1
  21. package/dist/shaders/MyGridMaterial.js +19 -0
  22. package/dist/shaders/QuasiGridMaterial.d.ts +76 -0
  23. package/dist/shaders/QuasiGridMaterial.d.ts.map +1 -0
  24. package/dist/shaders/QuasiGridMaterial.js +238 -0
  25. package/dist/shaders/RadarGridMaterial.d.ts +77 -0
  26. package/dist/shaders/RadarGridMaterial.d.ts.map +1 -0
  27. package/dist/shaders/RadarGridMaterial.js +291 -0
  28. package/dist/shaders/RainMaterial copy.d.ts +34 -0
  29. package/dist/shaders/RainMaterial copy.d.ts.map +1 -0
  30. package/dist/shaders/RainMaterial copy.js +56 -0
  31. package/dist/shaders/ShaderEffectsMaterial copy 2.d.ts +228 -0
  32. package/dist/shaders/ShaderEffectsMaterial copy 2.d.ts.map +1 -0
  33. package/dist/shaders/ShaderEffectsMaterial copy 2.js +233 -0
  34. package/dist/shaders/ShootingStarMaterial copy.d.ts +14 -0
  35. package/dist/shaders/ShootingStarMaterial copy.d.ts.map +1 -0
  36. package/dist/shaders/ShootingStarMaterial copy.js +33 -0
  37. package/dist/shaders/SkyboxMaterial copy.d.ts +38 -0
  38. package/dist/shaders/SkyboxMaterial copy.d.ts.map +1 -0
  39. package/dist/shaders/SkyboxMaterial copy.js +57 -0
  40. package/dist/shaders/VoronoiGridMaterial.d.ts +73 -0
  41. package/dist/shaders/VoronoiGridMaterial.d.ts.map +1 -0
  42. package/dist/shaders/VoronoiGridMaterial.js +266 -0
  43. package/dist/shaders/index.d.ts +11 -0
  44. package/dist/shaders/index.d.ts.map +1 -1
  45. package/dist/shaders/index.js +11 -0
  46. package/dist/types/objectsConfigs.d.ts +12 -0
  47. package/dist/types/objectsConfigs.d.ts.map +1 -1
  48. package/package.json +1 -1
@@ -0,0 +1,57 @@
1
+ import { Color } from 'three';
2
+ import { extend } from '@react-three/fiber';
3
+ import { shaderMaterial } from '@react-three/drei';
4
+ const vertexShader = /*glsl*/ `
5
+ varying vec3 vWorldPosition;
6
+ varying vec3 vDirection;
7
+
8
+ void main() {
9
+ vec4 worldPosition = modelMatrix * vec4(position, 1.0);
10
+ vWorldPosition = worldPosition.xyz;
11
+ vDirection = normalize(worldPosition.xyz);
12
+
13
+ vec4 pos = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
14
+ gl_Position = pos.xyww;
15
+ }
16
+ `;
17
+ const fragmentShader = /*glsl*/ `
18
+ precision mediump float;
19
+ varying vec3 vWorldPosition;
20
+ varying vec3 vDirection;
21
+
22
+ uniform float uSunAzimuth;
23
+ uniform float uSunElevation;
24
+ uniform vec3 uSunColor;
25
+ uniform vec3 uSkyColorLow;
26
+ uniform vec3 uSkyColorHigh;
27
+ uniform float uSunSize;
28
+
29
+ void main() {
30
+ vec3 direction = normalize(vWorldPosition);
31
+
32
+ vec3 skyColor = mix(uSkyColorLow, uSkyColorHigh, clamp(direction.y * 0.5 + 0.5, 0.0, 1.0));
33
+
34
+ float azimuth = radians(uSunAzimuth);
35
+ float elevation = radians(uSunElevation);
36
+ vec3 sunDirection = normalize(vec3(
37
+ cos(elevation) * sin(azimuth),
38
+ sin(elevation),
39
+ cos(elevation) * cos(azimuth)
40
+ ));
41
+
42
+ float sunIntensity = pow(max(dot(direction, sunDirection), 0.0), 1000.0 / uSunSize);
43
+ vec3 sunColor = uSunColor * sunIntensity;
44
+
45
+ gl_FragColor = vec4(skyColor + sunColor, 1.0);
46
+ }
47
+ `;
48
+ const SkyboxMaterial = shaderMaterial({
49
+ uSunAzimuth: 216,
50
+ uSunElevation: 24.68698059628387,
51
+ uSunColor: new Color(0xffe5b0),
52
+ uSkyColorLow: new Color(0x6fa2ef),
53
+ uSkyColorHigh: new Color(0x2053ff),
54
+ uSunSize: 1,
55
+ }, vertexShader, fragmentShader);
56
+ extend({ SkyboxMaterial });
57
+ export { SkyboxMaterial };
@@ -0,0 +1,73 @@
1
+ import * as THREE from 'three';
2
+ export interface VoronoiGridMaterialUniforms {
3
+ u_time: number;
4
+ /** average cell width, in world units */
5
+ u_cellSize: number;
6
+ /** cell-edge thickness, in pixels */
7
+ u_lineWidth: number;
8
+ /** how many cells make one accent group */
9
+ u_sectionSize: number;
10
+ /** nucleus size; 0 hides the nuclei */
11
+ u_sectionWidth: number;
12
+ u_lineColor: THREE.Color;
13
+ u_sectionColor: THREE.Color;
14
+ u_cellColor: THREE.Color;
15
+ u_glowColor: THREE.Color;
16
+ u_bgColor: THREE.Color;
17
+ u_bgOpacity: number;
18
+ u_lineMode: number;
19
+ u_cellMode: number;
20
+ u_animSpeed: number;
21
+ u_animScale: number;
22
+ u_animIntensity: number;
23
+ u_fadeDistance: number;
24
+ u_fadeStrength: number;
25
+ u_focus: THREE.Vector2;
26
+ u_mouse: THREE.Vector2;
27
+ u_displace: number;
28
+ /**
29
+ * 0..1 assemble/dissolve. The build boundary sweeps outward from u_focus
30
+ * with a bright leading edge; 1 is fully built, 0 is gone. Animate it
31
+ * downward to dissolve.
32
+ */
33
+ u_reveal: number;
34
+ /** 0 = regular square lattice, 1 = fully scattered seeds */
35
+ u_jitter: number;
36
+ /** how far the seeds wander over time; 0 freezes the lattice */
37
+ u_drift: number;
38
+ }
39
+ declare module '@react-three/fiber' {
40
+ interface ThreeElements {
41
+ voronoiGridMaterial: ThreeElements['shaderMaterial'] & Partial<VoronoiGridMaterialUniforms>;
42
+ }
43
+ }
44
+ export declare const voronoiGridMaterialDefaults: VoronoiGridMaterialUniforms;
45
+ export declare const VoronoiGridMaterial: import("@react-three/fiber").ConstructorRepresentation<THREE.ShaderMaterial & {
46
+ u_time: number;
47
+ u_cellSize: number;
48
+ u_lineWidth: number;
49
+ u_sectionSize: number;
50
+ u_sectionWidth: number;
51
+ u_lineColor: THREE.Color;
52
+ u_sectionColor: THREE.Color;
53
+ u_cellColor: THREE.Color;
54
+ u_glowColor: THREE.Color;
55
+ u_bgColor: THREE.Color;
56
+ u_bgOpacity: number;
57
+ u_lineMode: number;
58
+ u_cellMode: number;
59
+ u_animSpeed: number;
60
+ u_animScale: number;
61
+ u_animIntensity: number;
62
+ u_fadeDistance: number;
63
+ u_fadeStrength: number;
64
+ u_focus: THREE.Vector2;
65
+ u_mouse: THREE.Vector2;
66
+ u_displace: number;
67
+ u_reveal: number;
68
+ u_jitter: number;
69
+ u_drift: number;
70
+ }> & {
71
+ key: string;
72
+ };
73
+ //# sourceMappingURL=VoronoiGridMaterial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VoronoiGridMaterial.d.ts","sourceRoot":"","sources":["../../src/shaders/VoronoiGridMaterial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;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 @@
1
+ import * as THREE from 'three';
2
+ import { shaderMaterial } from '@react-three/drei';
3
+ import { extend } from '@react-three/fiber';
4
+ export const voronoiGridMaterialDefaults = {
5
+ u_time: 0,
6
+ u_cellSize: 2.0,
7
+ u_lineWidth: 1.4,
8
+ u_sectionSize: 4.0,
9
+ u_sectionWidth: 1.0,
10
+ u_lineColor: new THREE.Color(0.35, 0.2, 0.62),
11
+ u_sectionColor: new THREE.Color(0.85, 0.6, 1.0),
12
+ u_cellColor: new THREE.Color(0.12, 0.05, 0.28),
13
+ u_glowColor: new THREE.Color(0.7, 0.4, 1.0),
14
+ u_bgColor: new THREE.Color(0.02, 0.01, 0.05),
15
+ u_bgOpacity: 0.0,
16
+ u_lineMode: 1,
17
+ u_cellMode: 2,
18
+ u_animSpeed: 1.0,
19
+ u_animScale: 0.5,
20
+ u_animIntensity: 1.0,
21
+ u_fadeDistance: 25.0,
22
+ u_fadeStrength: 0.7,
23
+ u_focus: new THREE.Vector2(0, 0),
24
+ u_mouse: new THREE.Vector2(0, 0),
25
+ u_displace: 0.0,
26
+ u_reveal: 1.0,
27
+ u_jitter: 0.9,
28
+ u_drift: 0.5,
29
+ };
30
+ /**
31
+ * Shared by both stages.
32
+ *
33
+ * One 3x3 pass yields both the nearest seed distance (F1) and the runner-up
34
+ * (F2). `F2 - F1` goes to zero exactly on a cell boundary, which is the edge
35
+ * field — cheaper than a second pass and stable under animation, since it never
36
+ * has to decide which of two equidistant seeds "won".
37
+ */
38
+ const voronoiCommon = /*glsl*/ `
39
+ const float TAU = 6.28318530718;
40
+
41
+ vec2 hash22(vec2 p){
42
+ p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));
43
+ return fract(sin(p) * 43758.5453123);
44
+ }
45
+
46
+ /** x = F1, y = F2, zw = the winning cell's id */
47
+ vec4 voronoi(vec2 x, float jitter, float drift, float t){
48
+ vec2 n = floor(x);
49
+ vec2 f = x - n;
50
+ float f1 = 8.0;
51
+ float f2 = 8.0;
52
+ vec2 winner = n;
53
+
54
+ for (int j = -1; j <= 1; j++){
55
+ for (int i = -1; i <= 1; i++){
56
+ vec2 g = vec2(float(i), float(j));
57
+ vec2 h = hash22(n + g);
58
+ vec2 off = (h - 0.5) * clamp(jitter, 0.0, 1.0);
59
+ if (drift > 0.0){
60
+ off += drift * 0.22 * vec2(
61
+ sin(t * (0.4 + h.x * 0.8) + h.y * TAU),
62
+ cos(t * (0.4 + h.y * 0.8) + h.x * TAU)
63
+ );
64
+ }
65
+ // Keeping every seed inside its own cell is what makes the 3x3
66
+ // neighbourhood sufficient — without the clamp, jitter plus drift can
67
+ // push a seed far enough out that the true nearest one is never tested.
68
+ vec2 o = vec2(0.5) + clamp(off, vec2(-0.49), vec2(0.49));
69
+ vec2 r = g + o - f;
70
+ float d = dot(r, r);
71
+ if (d < f1){ f2 = f1; f1 = d; winner = n + g; }
72
+ else if (d < f2){ f2 = d; }
73
+ }
74
+ }
75
+ return vec4(sqrt(f1), sqrt(f2), winner);
76
+ }
77
+ `;
78
+ const vertex = /*glsl*/ `
79
+ uniform float u_time;
80
+ uniform float u_cellSize;
81
+ uniform float u_displace;
82
+ uniform float u_animSpeed;
83
+ uniform float u_animScale;
84
+ uniform float u_jitter;
85
+ uniform float u_drift;
86
+
87
+ varying vec2 vGridPos;
88
+
89
+ ${voronoiCommon}
90
+
91
+ void main(){
92
+ vGridPos = position.xy;
93
+ vec3 pos = position;
94
+ if (u_displace > 0.0){
95
+ float t = u_time * u_animSpeed;
96
+ vec2 coord = position.xy / max(u_cellSize, 1e-4);
97
+ vec4 v = voronoi(coord, u_jitter, u_drift, t);
98
+ vec2 h = hash22(v.zw);
99
+ // One height per cell, so the surface breaks into irregular plates. The
100
+ // height rides a smooth field with only a hashed nudge per cell —
101
+ // uncorrelated neighbours would shred the mesh — and the plate ramps back
102
+ // to that field near the membrane, so the walls bevel instead of
103
+ // sawtoothing across whatever triangles straddle the boundary.
104
+ float smoothLift = 0.5 + 0.5 * sin(length(coord) * u_animScale - t);
105
+ float plate = clamp(smoothLift + (h.x - 0.5) * 0.5, 0.0, 1.0);
106
+ float flatness = smoothstep(0.0, 0.3, v.y - v.x);
107
+ pos.z += mix(smoothLift, plate, flatness) * u_displace;
108
+ }
109
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);
110
+ }
111
+ `;
112
+ const fragment = /*glsl*/ `
113
+ precision highp float;
114
+
115
+ uniform float u_time;
116
+ uniform float u_cellSize;
117
+ uniform float u_lineWidth;
118
+ uniform float u_sectionSize;
119
+ uniform float u_sectionWidth;
120
+ uniform vec3 u_lineColor;
121
+ uniform vec3 u_sectionColor;
122
+ uniform vec3 u_cellColor;
123
+ uniform vec3 u_glowColor;
124
+ uniform vec3 u_bgColor;
125
+ uniform float u_bgOpacity;
126
+ uniform float u_lineMode;
127
+ uniform float u_cellMode;
128
+ uniform float u_animSpeed;
129
+ uniform float u_animScale;
130
+ uniform float u_animIntensity;
131
+ uniform float u_fadeDistance;
132
+ uniform float u_fadeStrength;
133
+ uniform vec2 u_focus;
134
+ uniform float u_reveal;
135
+ uniform float u_jitter;
136
+ uniform float u_drift;
137
+
138
+ varying vec2 vGridPos;
139
+
140
+ ${voronoiCommon}
141
+
142
+ void main(){
143
+ vec2 coord = vGridPos / max(u_cellSize, 1e-4);
144
+ vec2 focus = u_focus / max(u_cellSize, 1e-4);
145
+ float t = u_time * u_animSpeed;
146
+ float px = max(length(fwidth(coord)), 1e-6);
147
+
148
+ vec4 v = voronoi(coord, u_jitter, u_drift, t);
149
+ float f1 = v.x;
150
+ float f2 = v.y;
151
+ vec2 id = v.zw;
152
+ vec2 h = hash22(id);
153
+
154
+ // membrane between cells
155
+ float edge = 1.0 - smoothstep(0.0, px * max(u_lineWidth, 0.05) * 2.0, f2 - f1);
156
+
157
+ // accent membranes: whole clusters of cells share one group id
158
+ float group = 0.0;
159
+ if (u_sectionSize > 0.0){
160
+ vec2 gid = floor(id / u_sectionSize);
161
+ group = step(0.5, hash22(gid).x);
162
+ }
163
+
164
+ // ---- membrane animation ---------------------------------------------
165
+ float lineAnim = 1.0;
166
+ if (u_lineMode > 0.5 && u_lineMode < 1.5){
167
+ lineAnim = 0.5 + 0.5 * sin(length(id + 0.5 - focus) * u_animScale - t);
168
+ } else if (u_lineMode < 2.5){
169
+ // charge running along the membranes
170
+ lineAnim = 0.35 + 0.65 * pow(fract(dot(coord, vec2(0.35, 0.2)) * u_animScale - t * 0.25), 6.0);
171
+ } else if (u_lineMode < 3.5){
172
+ float s = fract((coord.x + coord.y) * 0.05 * u_animScale - t * 0.15);
173
+ lineAnim = 0.25 + smoothstep(0.0, 0.15, s) * (1.0 - smoothstep(0.15, 0.35, s));
174
+ } else if (u_lineMode < 4.5){
175
+ lineAnim = 0.5 + 0.5 * sin(t);
176
+ }
177
+ lineAnim = mix(1.0, lineAnim, u_animIntensity);
178
+
179
+ // ---- cell fill ------------------------------------------------------
180
+ float cell = 0.0;
181
+ if (u_cellMode > 0.5 && u_cellMode < 1.5){
182
+ cell = 0.5 + 0.5 * sin(dot(id, vec2(0.7, 0.3)) * u_animScale - t);
183
+ } else if (u_cellMode < 2.5){
184
+ cell = 0.5 + 0.5 * sin(t * (0.6 + h.x) + h.y * TAU);
185
+ } else if (u_cellMode < 3.5){
186
+ // cells fire in rings out from the focus, like a signal propagating
187
+ cell = smoothstep(0.6, 1.0, sin(length(id + 0.5 - focus) * u_animScale - t));
188
+ } else if (u_cellMode < 4.5){
189
+ cell = step(0.5, h.x) * (0.5 + 0.5 * sin(t));
190
+ }
191
+ cell *= u_animIntensity;
192
+ // brighten the fill toward the nucleus, so each cell reads as a volume
193
+ // rather than a flat patch
194
+ cell *= mix(0.45, 1.0, 1.0 - smoothstep(0.0, 0.7, f1));
195
+
196
+ // ---- nuclei ---------------------------------------------------------
197
+ float nucleus = 0.0;
198
+ if (u_sectionWidth > 0.0){
199
+ float nr = 0.05 * u_sectionWidth;
200
+ nucleus = 1.0 - smoothstep(nr, nr + px * 2.0, f1);
201
+ }
202
+
203
+ float r = length(vGridPos) / max(u_fadeDistance, 1e-4);
204
+ float fade = 1.0 - smoothstep(1.0 - u_fadeStrength, 1.0, r);
205
+
206
+ vec3 col = u_bgColor * u_bgOpacity;
207
+ float a = u_bgOpacity;
208
+
209
+ col += u_cellColor * cell; a = max(a, cell * 0.9);
210
+ float edgeI = edge * lineAnim;
211
+ col += mix(u_lineColor, u_sectionColor, group) * edgeI;
212
+ a = max(a, edgeI);
213
+ float nucI = nucleus * (0.4 + 0.6 * cell + 0.4 * lineAnim);
214
+ col += u_sectionColor * nucI; a = max(a, nucI);
215
+ col += u_glowColor * (edgeI * 0.25 + nucI * 0.8 + cell * 0.2) * u_animIntensity;
216
+
217
+ col *= fade;
218
+ a *= fade;
219
+
220
+ // ---- reveal ----------------------------------------------------------
221
+ // The build boundary sweeps outward from the focus point. Its leading band
222
+ // mostly brightens whatever is already there rather than painting a solid
223
+ // disc, so the grid reads as assembling itself rather than fading in.
224
+ if (u_reveal < 0.999){
225
+ float rd = length(vGridPos - u_focus) / max(u_fadeDistance, 1e-4);
226
+ // 1.1, not 1.25: the boundary has to clear the fade radius by just the
227
+ // width of its own soft edge. Overshooting further finishes the build
228
+ // before reveal reaches 1 and leaves the tail of the range doing nothing.
229
+ float edge = u_reveal * 1.1;
230
+ float mask = 1.0 - smoothstep(edge - 0.05, edge, rd);
231
+ float front = mask * smoothstep(edge - 0.22, edge - 0.05, rd);
232
+ col = col * mask + u_glowColor * front * (a * 1.8 + 0.08);
233
+ a = max(a * mask, front * 0.10);
234
+ }
235
+
236
+ if (a < 0.002) discard;
237
+ gl_FragColor = vec4(col, a);
238
+ }
239
+ `;
240
+ export const VoronoiGridMaterial = shaderMaterial({
241
+ u_time: voronoiGridMaterialDefaults.u_time,
242
+ u_cellSize: voronoiGridMaterialDefaults.u_cellSize,
243
+ u_lineWidth: voronoiGridMaterialDefaults.u_lineWidth,
244
+ u_sectionSize: voronoiGridMaterialDefaults.u_sectionSize,
245
+ u_sectionWidth: voronoiGridMaterialDefaults.u_sectionWidth,
246
+ u_lineColor: voronoiGridMaterialDefaults.u_lineColor.clone(),
247
+ u_sectionColor: voronoiGridMaterialDefaults.u_sectionColor.clone(),
248
+ u_cellColor: voronoiGridMaterialDefaults.u_cellColor.clone(),
249
+ u_glowColor: voronoiGridMaterialDefaults.u_glowColor.clone(),
250
+ u_bgColor: voronoiGridMaterialDefaults.u_bgColor.clone(),
251
+ u_bgOpacity: voronoiGridMaterialDefaults.u_bgOpacity,
252
+ u_lineMode: voronoiGridMaterialDefaults.u_lineMode,
253
+ u_cellMode: voronoiGridMaterialDefaults.u_cellMode,
254
+ u_animSpeed: voronoiGridMaterialDefaults.u_animSpeed,
255
+ u_animScale: voronoiGridMaterialDefaults.u_animScale,
256
+ u_animIntensity: voronoiGridMaterialDefaults.u_animIntensity,
257
+ u_fadeDistance: voronoiGridMaterialDefaults.u_fadeDistance,
258
+ u_fadeStrength: voronoiGridMaterialDefaults.u_fadeStrength,
259
+ u_focus: voronoiGridMaterialDefaults.u_focus.clone(),
260
+ u_mouse: voronoiGridMaterialDefaults.u_mouse.clone(),
261
+ u_displace: voronoiGridMaterialDefaults.u_displace,
262
+ u_reveal: voronoiGridMaterialDefaults.u_reveal,
263
+ u_jitter: voronoiGridMaterialDefaults.u_jitter,
264
+ u_drift: voronoiGridMaterialDefaults.u_drift,
265
+ }, vertex, fragment);
266
+ extend({ VoronoiGridMaterial });
@@ -48,4 +48,15 @@ export * from './FireShellMaterial';
48
48
  export * from './SmokeRibbonMaterial';
49
49
  export * from './MyGridMaterial';
50
50
  export { NOISE_GLSL } from './sunNoise';
51
+ export * from './CircuitGridMaterial';
52
+ export * from './ContourGridMaterial';
53
+ export * from './FractalGridMaterial';
54
+ export * from './GlowMaterial';
55
+ export * from './HexGridMaterial';
56
+ export * from './MoireGridMaterial';
57
+ export * from './QuasiGridMaterial';
58
+ export * from './RadarGridMaterial';
59
+ export * from './SandMaterial';
60
+ export * from './SmokeMaterial';
61
+ export * from './VoronoiGridMaterial';
51
62
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shaders/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AA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CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC"}
@@ -48,3 +48,14 @@ export * from './FireShellMaterial.js';
48
48
  export * from './SmokeRibbonMaterial.js';
49
49
  export * from './MyGridMaterial.js';
50
50
  export { NOISE_GLSL } from './sunNoise.js';
51
+ export * from './CircuitGridMaterial.js';
52
+ export * from './ContourGridMaterial.js';
53
+ export * from './FractalGridMaterial.js';
54
+ export * from './GlowMaterial.js';
55
+ export * from './HexGridMaterial.js';
56
+ export * from './MoireGridMaterial.js';
57
+ export * from './QuasiGridMaterial.js';
58
+ export * from './RadarGridMaterial.js';
59
+ export * from './SandMaterial.js';
60
+ export * from './SmokeMaterial.js';
61
+ export * from './VoronoiGridMaterial.js';
@@ -42,6 +42,18 @@ export interface MyGridConfig {
42
42
  bgColor: string;
43
43
  bgOpacity: number;
44
44
  followMouse: boolean;
45
+ /**
46
+ * 0..1 assemble amount. The build boundary sweeps outward from the focus
47
+ * point with a bright leading edge. Defaults to 1 (fully built); animate it
48
+ * down to 0 to dissolve.
49
+ */
50
+ reveal?: number;
51
+ /**
52
+ * Seconds to travel the full 0..1 reveal range. Defaults to 0, which
53
+ * applies `reveal` immediately — a grid does not animate itself in unless
54
+ * asked. Set ~1.2 for a build-in on mount.
55
+ */
56
+ revealDuration?: number;
45
57
  }
46
58
  export {};
47
59
  //# sourceMappingURL=objectsConfigs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"objectsConfigs.d.ts","sourceRoot":"","sources":["../../src/types/objectsConfigs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5D,MAAM,WAAW,WAAW;IACxB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,kBAAkB,EAAE,mBAAmB,CAAC;IACxC,uBAAuB,EAAE,mBAAmB,CAAC;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,QAAQ,CA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,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAGD,OAAO,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3driseai/3drise-core",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",