@pinkaphant/kolmo 0.2.0 → 0.2.2
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 +3 -4
- package/dist/engine/kolmoActor.js +60 -59
- package/dist/engine/kolmoInput.d.ts +1 -1
- package/dist/engine/kolmoInput.js +53 -1
- package/dist/engine/kolmoLongDrive.js +52 -52
- package/dist/engine/kolmoVehicle.d.ts +1 -1
- package/dist/engine/kolmoVehicle.js +80 -79
- package/dist/engine/shiftedFixedBody.js +12 -28
- package/dist/importer/DomainWorkshopPanel.js +97 -98
- package/dist/importer/ImperativeVehicleRig.js +1 -3
- package/dist/importer/khrCompiler.js +0 -2
- package/dist/importer/universalGateBake.js +1 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +21 -24
- package/dist/junk/DestructibleTarget.js +1 -1
- package/dist/junk/targetHitLogic.js +0 -1
- package/dist/shaders/celestialBackdrop.d.ts +2 -2
- package/dist/shaders/celestialBackdrop.js +1 -1
- package/dist/shaders/plumeAndSparkle.d.ts +2 -2
- package/dist/shaders/plumeAndSparkle.js +4 -3
- package/dist/shaders/ps2RoadWebGL.js +1 -1
- package/dist/shaders/retroShader.d.ts +1 -1
- package/dist/shaders/retroShader.js +23 -31
- package/package.json +5 -9
- package/dist/body/HeldItem.d.ts +0 -22
- package/dist/body/HeldItem.js +0 -171
- package/dist/body/KhrBody.d.ts +0 -26
- package/dist/body/KhrBody.js +0 -171
- package/dist/body/bodySi.d.ts +0 -48
- package/dist/body/bodySi.js +0 -52
- package/dist/body/index.d.ts +0 -3
- package/dist/body/index.js +0 -4
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { planLauncher as u } from "@khr3/launchers";
|
|
1
|
+
import { LAUNCHER_RECIPES as e, buildLauncherSceneFromPlan as t } from "./launcherBake.js";
|
|
2
|
+
import { useState as n } from "react";
|
|
3
|
+
import * as r from "three";
|
|
4
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
import { DOOR_HINGE_SPEC as s } from "@khr3/c12";
|
|
6
|
+
import { VAULT_CATALOG as c } from "@khr3/assets";
|
|
7
|
+
import { planLauncher as l } from "@khr3/launchers";
|
|
9
8
|
// src/importer/DomainWorkshopPanel.tsx
|
|
10
|
-
var
|
|
9
|
+
var u = {
|
|
11
10
|
position: "absolute",
|
|
12
11
|
top: 52,
|
|
13
12
|
left: 12,
|
|
@@ -25,7 +24,7 @@ var d = {
|
|
|
25
24
|
display: "flex",
|
|
26
25
|
flexDirection: "column",
|
|
27
26
|
gap: 8
|
|
28
|
-
},
|
|
27
|
+
}, d = {
|
|
29
28
|
padding: "5px 8px",
|
|
30
29
|
background: "#11161C",
|
|
31
30
|
border: "1px solid #00E5FF",
|
|
@@ -36,24 +35,24 @@ var d = {
|
|
|
36
35
|
cursor: "pointer",
|
|
37
36
|
textAlign: "left"
|
|
38
37
|
};
|
|
39
|
-
function
|
|
38
|
+
function f(e) {
|
|
40
39
|
if (!e) return 0;
|
|
41
40
|
let t = 0;
|
|
42
41
|
return e.traverse((e) => {
|
|
43
42
|
let n = e;
|
|
44
43
|
if (n.isMesh && n.material) for (let e of Array.isArray(n.material) ? n.material : [n.material]) {
|
|
45
44
|
let n = e;
|
|
46
|
-
n.flatShading = !0, n.normalMap = null, n.bumpMap = null, n.map && (n.map.magFilter =
|
|
45
|
+
n.flatShading = !0, n.normalMap = null, n.bumpMap = null, n.map && (n.map.magFilter = r.NearestFilter, n.map.anisotropy = 1, n.map.needsUpdate = !0), n.needsUpdate = !0, t++;
|
|
47
46
|
}
|
|
48
47
|
}), t;
|
|
49
48
|
}
|
|
50
|
-
function
|
|
51
|
-
let [
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
-
style:
|
|
54
|
-
"aria-label": `${
|
|
49
|
+
function p({ domain: r, hasCustomFile: f = !1, targetMeters: p, onChangeTargetMeters: m, onSnapC12: h, onLoadVaultUrl: g, onForgeLauncherRecipe: _, onAddSocketPatch: v, onEnforceCrispyPerson: y, onUploadToVault: b }) {
|
|
50
|
+
let [x, S] = n(!1), [C, w] = n("cars"), [T, E] = n(""), [D, O] = n(null), k = Object.entries(c[C]);
|
|
51
|
+
return /* @__PURE__ */ o("aside", {
|
|
52
|
+
style: u,
|
|
53
|
+
"aria-label": `${r.toUpperCase()} Workshop`,
|
|
55
54
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ o("div", {
|
|
57
56
|
style: {
|
|
58
57
|
display: "flex",
|
|
59
58
|
justifyContent: "space-between",
|
|
@@ -61,99 +60,99 @@ function m({ domain: i, hasCustomFile: p = !1, targetMeters: m, onChangeTargetMe
|
|
|
61
60
|
color: "#FFB000",
|
|
62
61
|
fontWeight: 700
|
|
63
62
|
},
|
|
64
|
-
children: [/* @__PURE__ */
|
|
63
|
+
children: [/* @__PURE__ */ a("span", { children: `WORKSHOP :: ${r.toUpperCase()}` }), /* @__PURE__ */ a("button", {
|
|
65
64
|
type: "button",
|
|
66
65
|
style: {
|
|
67
|
-
...
|
|
66
|
+
...d,
|
|
68
67
|
padding: "2px 6px",
|
|
69
68
|
borderColor: "#10B981"
|
|
70
69
|
},
|
|
71
|
-
onClick: () =>
|
|
72
|
-
children:
|
|
70
|
+
onClick: () => S((e) => !e),
|
|
71
|
+
children: x ? "HIDE VAULT" : "R2 VAULT"
|
|
73
72
|
})]
|
|
74
73
|
}),
|
|
75
|
-
|
|
76
|
-
/* @__PURE__ */
|
|
74
|
+
r === "c12" && /* @__PURE__ */ o(i, { children: [
|
|
75
|
+
/* @__PURE__ */ a("div", {
|
|
77
76
|
style: { color: "#94A3B8" },
|
|
78
77
|
children: "Exact 3.0m / 0.25m C12 Cyclotomic Lattice & Openings"
|
|
79
78
|
}),
|
|
80
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ a("button", {
|
|
81
80
|
type: "button",
|
|
82
|
-
style:
|
|
81
|
+
style: d,
|
|
83
82
|
onClick: () => {
|
|
84
|
-
|
|
83
|
+
m(3), h(), O("Snapped to 3.00 m C12 module (12 steps).");
|
|
85
84
|
},
|
|
86
85
|
children: "[ SNAP TO 3.00M C12 MODULE ]"
|
|
87
86
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ a("button", {
|
|
89
88
|
type: "button",
|
|
90
|
-
style:
|
|
89
|
+
style: d,
|
|
91
90
|
onClick: () => {
|
|
92
|
-
|
|
91
|
+
v("Aperture_Doorway_900x2100", [
|
|
93
92
|
0,
|
|
94
|
-
|
|
93
|
+
s.openingHeightM * .5,
|
|
95
94
|
0
|
|
96
|
-
], "mount"),
|
|
95
|
+
], "mount"), v("Socket_DoorHinge", [...s.hingeOffsetLocal], "hinge"), O("Stamped 900x2100 doorway + KHR revolute hinge socket.");
|
|
97
96
|
},
|
|
98
97
|
children: "[ STAMP 0.9x2.1M HINGED DOORWAY ]"
|
|
99
98
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ a("button", {
|
|
101
100
|
type: "button",
|
|
102
|
-
style:
|
|
101
|
+
style: d,
|
|
103
102
|
onClick: () => {
|
|
104
|
-
|
|
103
|
+
v("Aperture_Window", [
|
|
105
104
|
0,
|
|
106
105
|
1.45,
|
|
107
106
|
0
|
|
108
|
-
], "mount"),
|
|
107
|
+
], "mount"), O("Stamped window opening anchor.");
|
|
109
108
|
},
|
|
110
109
|
children: "[ STAMP WINDOW APERTURE ]"
|
|
111
110
|
}),
|
|
112
|
-
!
|
|
111
|
+
!f && /* @__PURE__ */ a("button", {
|
|
113
112
|
type: "button",
|
|
114
|
-
style:
|
|
115
|
-
onClick: () => void
|
|
113
|
+
style: d,
|
|
114
|
+
onClick: () => void g(c.city.door_hinged_single, "door_hinged_900x2100"),
|
|
116
115
|
children: "[ LOAD VAULT: HINGED DOOR .GLB ]"
|
|
117
116
|
})
|
|
118
117
|
] }),
|
|
119
|
-
|
|
120
|
-
/* @__PURE__ */
|
|
118
|
+
r === "launcher" && /* @__PURE__ */ o(i, { children: [
|
|
119
|
+
/* @__PURE__ */ a("div", {
|
|
121
120
|
style: { color: "#94A3B8" },
|
|
122
121
|
children: "Articulated `@khr3/launchers` Calibration & Unified Sockets"
|
|
123
122
|
}),
|
|
124
|
-
!
|
|
123
|
+
!f && /* @__PURE__ */ a("div", {
|
|
125
124
|
style: {
|
|
126
125
|
display: "flex",
|
|
127
126
|
flexWrap: "wrap",
|
|
128
127
|
gap: 4
|
|
129
128
|
},
|
|
130
|
-
children:
|
|
129
|
+
children: e.map((e) => /* @__PURE__ */ a("button", {
|
|
131
130
|
type: "button",
|
|
132
131
|
style: {
|
|
133
|
-
...
|
|
132
|
+
...d,
|
|
134
133
|
borderColor: "#FFB000",
|
|
135
134
|
fontSize: 10
|
|
136
135
|
},
|
|
137
136
|
onClick: () => {
|
|
138
|
-
let
|
|
139
|
-
|
|
137
|
+
let n = l(e), r = Number((e.dims.receiverLength + e.dims.barrelLength + (e.dims.hasStock ? .22 : 0)).toFixed(2));
|
|
138
|
+
_?.(e.id, t(n), r), O(`Forged ${e.label} (${n.parts.length} parts, ${e.spec.magazineCapacity} rd, ${e.spec.fireRateHz} Hz)`);
|
|
140
139
|
},
|
|
141
140
|
children: `FORGE ${e.id.replace("kolmogorov_", "").toUpperCase()}`
|
|
142
141
|
}, e.id))
|
|
143
142
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ o("label", {
|
|
145
144
|
style: {
|
|
146
145
|
display: "flex",
|
|
147
146
|
justifyContent: "space-between",
|
|
148
147
|
alignItems: "center"
|
|
149
148
|
},
|
|
150
|
-
children: [/* @__PURE__ */
|
|
149
|
+
children: [/* @__PURE__ */ a("span", { children: "Length (m):" }), /* @__PURE__ */ a("input", {
|
|
151
150
|
type: "number",
|
|
152
151
|
step: .05,
|
|
153
152
|
min: .12,
|
|
154
153
|
max: 2.2,
|
|
155
|
-
value:
|
|
156
|
-
onChange: (e) =>
|
|
154
|
+
value: p,
|
|
155
|
+
onChange: (e) => m(Number(e.target.value) || .72),
|
|
157
156
|
style: {
|
|
158
157
|
width: 72,
|
|
159
158
|
background: "#0A0C0E",
|
|
@@ -196,7 +195,7 @@ function m({ domain: i, hasCustomFile: p = !1, targetMeters: m, onChangeTargetMe
|
|
|
196
195
|
[
|
|
197
196
|
0,
|
|
198
197
|
.04,
|
|
199
|
-
|
|
198
|
+
p * .5
|
|
200
199
|
],
|
|
201
200
|
"muzzle"
|
|
202
201
|
],
|
|
@@ -218,83 +217,83 @@ function m({ domain: i, hasCustomFile: p = !1, targetMeters: m, onChangeTargetMe
|
|
|
218
217
|
],
|
|
219
218
|
"optic"
|
|
220
219
|
]
|
|
221
|
-
].map(([e, t, n]) => /* @__PURE__ */
|
|
220
|
+
].map(([e, t, n]) => /* @__PURE__ */ a("button", {
|
|
222
221
|
type: "button",
|
|
223
|
-
style:
|
|
222
|
+
style: d,
|
|
224
223
|
onClick: () => {
|
|
225
|
-
|
|
224
|
+
v(e, [
|
|
226
225
|
t[0],
|
|
227
226
|
t[1],
|
|
228
227
|
t[2]
|
|
229
|
-
], n),
|
|
228
|
+
], n), O(`Stamped ${e} (${n})`);
|
|
230
229
|
},
|
|
231
230
|
children: `+ STAMP ${e}`
|
|
232
231
|
}, e))
|
|
233
232
|
] }),
|
|
234
|
-
|
|
235
|
-
/* @__PURE__ */
|
|
233
|
+
r === "person" && /* @__PURE__ */ o(i, { children: [
|
|
234
|
+
/* @__PURE__ */ a("div", {
|
|
236
235
|
style: { color: "#94A3B8" },
|
|
237
|
-
children: "SI 1.75m Capsule
|
|
236
|
+
children: "SI 1.75m Capsule & Contact / IK Sockets"
|
|
238
237
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ a("button", {
|
|
240
239
|
type: "button",
|
|
241
|
-
style:
|
|
240
|
+
style: d,
|
|
242
241
|
onClick: () => {
|
|
243
|
-
|
|
242
|
+
m(1.75), O("Scaled character to exact 1.75 m SI standing height.");
|
|
244
243
|
},
|
|
245
244
|
children: "[ LOCK 1.75M SI STANDING HEIGHT ]"
|
|
246
245
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ a("button", {
|
|
248
247
|
type: "button",
|
|
249
|
-
style:
|
|
248
|
+
style: d,
|
|
250
249
|
onClick: () => {
|
|
251
|
-
|
|
250
|
+
y(), O("Stripped normalMap/bumpMap + forced flatShading & NearestFilter.");
|
|
252
251
|
},
|
|
253
252
|
children: "[ ENFORCE FACETED RETRO SHADING ]"
|
|
254
253
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ a("button", {
|
|
256
255
|
type: "button",
|
|
257
|
-
style:
|
|
256
|
+
style: d,
|
|
258
257
|
onClick: () => {
|
|
259
|
-
|
|
258
|
+
v("Socket_Hand_R", [
|
|
260
259
|
.22,
|
|
261
260
|
1.12,
|
|
262
261
|
.28
|
|
263
|
-
], "mount"),
|
|
262
|
+
], "mount"), v("Socket_Hand_L", [
|
|
264
263
|
-.22,
|
|
265
264
|
1.12,
|
|
266
265
|
.28
|
|
267
|
-
], "mount"),
|
|
266
|
+
], "mount"), v("Socket_Back", [
|
|
268
267
|
0,
|
|
269
268
|
1.25,
|
|
270
269
|
-.18
|
|
271
|
-
], "mount"),
|
|
270
|
+
], "mount"), v("butt", [
|
|
272
271
|
0,
|
|
273
272
|
.88,
|
|
274
273
|
-.04
|
|
275
|
-
], "seat"),
|
|
274
|
+
], "seat"), v("foot_l", [
|
|
276
275
|
.11,
|
|
277
276
|
.02,
|
|
278
277
|
.04
|
|
279
|
-
], "contact"),
|
|
278
|
+
], "contact"), v("foot_r", [
|
|
280
279
|
-.11,
|
|
281
280
|
.02,
|
|
282
281
|
.04
|
|
283
|
-
], "contact"),
|
|
282
|
+
], "contact"), O("Stamped Hand, Back, Butt & Foot contact sockets.");
|
|
284
283
|
},
|
|
285
284
|
children: "[ STAMP HAND, BUTT & FOOT SOCKETS ]"
|
|
286
285
|
})
|
|
287
286
|
] }),
|
|
288
|
-
(
|
|
287
|
+
(r === "prop" || r === "junk") && !f && /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("div", {
|
|
289
288
|
style: { color: "#94A3B8" },
|
|
290
|
-
children:
|
|
291
|
-
}), /* @__PURE__ */
|
|
289
|
+
children: r === "junk" ? "BVH Shatter & Local Decal Target" : "KHR Convex/Box Prop"
|
|
290
|
+
}), /* @__PURE__ */ a("button", {
|
|
292
291
|
type: "button",
|
|
293
|
-
style:
|
|
294
|
-
onClick: () => void
|
|
292
|
+
style: d,
|
|
293
|
+
onClick: () => void g(c.city.prop_arcade_cabinet, "prop_arcade_cabinet"),
|
|
295
294
|
children: "[ LOAD VAULT: ARCADE CABINET ]"
|
|
296
295
|
})] }),
|
|
297
|
-
|
|
296
|
+
x && /* @__PURE__ */ o("div", {
|
|
298
297
|
style: {
|
|
299
298
|
borderTop: "1px solid #1C2229",
|
|
300
299
|
paddingTop: 8,
|
|
@@ -303,7 +302,7 @@ function m({ domain: i, hasCustomFile: p = !1, targetMeters: m, onChangeTargetMe
|
|
|
303
302
|
gap: 6
|
|
304
303
|
},
|
|
305
304
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ a("div", {
|
|
307
306
|
style: {
|
|
308
307
|
display: "flex",
|
|
309
308
|
gap: 4
|
|
@@ -312,17 +311,17 @@ function m({ domain: i, hasCustomFile: p = !1, targetMeters: m, onChangeTargetMe
|
|
|
312
311
|
"cars",
|
|
313
312
|
"weapons",
|
|
314
313
|
"city"
|
|
315
|
-
].map((e) => /* @__PURE__ */
|
|
314
|
+
].map((e) => /* @__PURE__ */ a("button", {
|
|
316
315
|
type: "button",
|
|
317
316
|
style: {
|
|
318
|
-
...
|
|
319
|
-
borderColor:
|
|
317
|
+
...d,
|
|
318
|
+
borderColor: C === e ? "#FFB000" : "#1C2229"
|
|
320
319
|
},
|
|
321
|
-
onClick: () =>
|
|
320
|
+
onClick: () => w(e),
|
|
322
321
|
children: e.toUpperCase()
|
|
323
322
|
}, e))
|
|
324
323
|
}),
|
|
325
|
-
!
|
|
324
|
+
!f && /* @__PURE__ */ a("div", {
|
|
326
325
|
style: {
|
|
327
326
|
maxHeight: 110,
|
|
328
327
|
overflowY: "auto",
|
|
@@ -330,26 +329,26 @@ function m({ domain: i, hasCustomFile: p = !1, targetMeters: m, onChangeTargetMe
|
|
|
330
329
|
flexDirection: "column",
|
|
331
330
|
gap: 3
|
|
332
331
|
},
|
|
333
|
-
children:
|
|
332
|
+
children: k.map(([e, t]) => /* @__PURE__ */ a("button", {
|
|
334
333
|
type: "button",
|
|
335
334
|
style: {
|
|
336
|
-
...
|
|
335
|
+
...d,
|
|
337
336
|
fontSize: 10
|
|
338
337
|
},
|
|
339
|
-
onClick: () => void
|
|
338
|
+
onClick: () => void g(t, e),
|
|
340
339
|
children: `-> ${e}`
|
|
341
340
|
}, e))
|
|
342
341
|
}),
|
|
343
|
-
|
|
342
|
+
b && /* @__PURE__ */ o("div", {
|
|
344
343
|
style: {
|
|
345
344
|
display: "flex",
|
|
346
345
|
gap: 4
|
|
347
346
|
},
|
|
348
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ a("input", {
|
|
349
348
|
type: "password",
|
|
350
349
|
placeholder: "VAULT_WRITE_TOKEN (or CF Access)",
|
|
351
|
-
value:
|
|
352
|
-
onChange: (e) =>
|
|
350
|
+
value: T,
|
|
351
|
+
onChange: (e) => E(e.target.value),
|
|
353
352
|
style: {
|
|
354
353
|
flex: 1,
|
|
355
354
|
background: "#0A0C0E",
|
|
@@ -358,28 +357,28 @@ function m({ domain: i, hasCustomFile: p = !1, targetMeters: m, onChangeTargetMe
|
|
|
358
357
|
padding: "3px 5px",
|
|
359
358
|
fontSize: 10
|
|
360
359
|
}
|
|
361
|
-
}), /* @__PURE__ */
|
|
360
|
+
}), /* @__PURE__ */ a("button", {
|
|
362
361
|
type: "button",
|
|
363
362
|
style: {
|
|
364
|
-
...
|
|
363
|
+
...d,
|
|
365
364
|
borderColor: "#10B981"
|
|
366
365
|
},
|
|
367
366
|
onClick: () => {
|
|
368
|
-
|
|
367
|
+
O(`Uploading to R2 (${C})…`), Promise.resolve(b(C, T)).then((e) => O(e ? `Uploaded -> ${e.key}` : "Uploaded to R2")).catch((e) => O(e instanceof Error ? e.message : "R2 upload failed"));
|
|
369
368
|
},
|
|
370
369
|
children: "PUT R2"
|
|
371
370
|
})]
|
|
372
371
|
})
|
|
373
372
|
]
|
|
374
373
|
}),
|
|
375
|
-
|
|
374
|
+
D && /* @__PURE__ */ a("div", {
|
|
376
375
|
style: {
|
|
377
376
|
color: "#10B981",
|
|
378
377
|
fontSize: 10
|
|
379
378
|
},
|
|
380
|
-
children:
|
|
379
|
+
children: D
|
|
381
380
|
})
|
|
382
381
|
]
|
|
383
382
|
});
|
|
384
383
|
}
|
|
385
|
-
export {
|
|
384
|
+
export { p as DomainWorkshopPanel, f as enforceRetroPersonMaterials };
|
|
@@ -222,9 +222,7 @@ function E({ assembly: c, importedRoot: h, chassisGroupRef: y }) {
|
|
|
222
222
|
1.4,
|
|
223
223
|
1
|
|
224
224
|
],
|
|
225
|
-
finalDriveRatio: 3.9
|
|
226
|
-
rollCenterHeight: .24,
|
|
227
|
-
antiRollStiffness: 2400
|
|
225
|
+
finalDriveRatio: 3.9
|
|
228
226
|
}), []);
|
|
229
227
|
return /* @__PURE__ */ f(u, { children: [
|
|
230
228
|
/* @__PURE__ */ f(_, {
|
|
@@ -292,8 +292,6 @@ async function S(n, o) {
|
|
|
292
292
|
finalDriveRatio: 3.58,
|
|
293
293
|
transmissionMode: "auto",
|
|
294
294
|
maxSteerAngle: .55,
|
|
295
|
-
rollCenterHeight: .12,
|
|
296
|
-
antiRollStiffness: 14e3,
|
|
297
295
|
engineTorqueCurveData: p.naScreamer,
|
|
298
296
|
steerAngleCurveData: m.driftCountersteer
|
|
299
297
|
} };
|
package/dist/index.d.ts
CHANGED
|
@@ -12,4 +12,3 @@ export { DEFAULT_VAULT_URL, KOLMO_ASSETS_URL, VAULT_CARS, VAULT_CATALOG, VAULT_C
|
|
|
12
12
|
export { DOOR_HINGE_SPEC, Ex, ROOT3, buildFootprint, canPlace, instanceBatches, latticePose, planSettlement, poseEq, poseFromJSON, poseToFloat, poseToJSON, snapPose, socketFor, triangleCorners, vToFloat, worldSockets, } from "@khr3/c12";
|
|
13
13
|
export { COUPE_2DOOR, FLEET, SEDAN_4DOOR, VEHICLE_DOMAINS, VEHICLE_DOMAIN_SPECS, carUrl, findCar, fleetByDomain, planCar, } from "@khr3/vehicles";
|
|
14
14
|
export { CARBINE_556, LAUNCHER_RECIPES, PISTOL_9MM, SHOTGUN_12G, attachModule, createLauncherState, detachModule, findLauncherRecipe, planLauncher, stepLauncher, } from "@khr3/launchers";
|
|
15
|
-
export * from "./body/index.js";
|
package/dist/index.js
CHANGED
|
@@ -35,8 +35,8 @@ import { disposeImportedRoot as vt, ensureMeshAttributes as yt } from "./junk/ju
|
|
|
35
35
|
import { applySegmentsToImportedRoot as bt, loadImportedGlbUrl as xt, parseImportedGlbBuffer as St } from "./junk/junkImporter.js";
|
|
36
36
|
import { getProceduralLabelTexture as Ct, loadCustomLabelTexture as wt } from "./junk/junkLabels.js";
|
|
37
37
|
import { DestructibleTarget as Tt } from "./junk/DestructibleTarget.js";
|
|
38
|
-
import { KolmoEmitterRig as X, PARTICLE_FRAG as Et, PARTICLE_VERT as
|
|
39
|
-
import { KOLMO_EXTENSION_NAME as
|
|
38
|
+
import { KolmoEmitterRig as X, PARTICLE_FRAG as Et, PARTICLE_VERT as Z, PLUME_FRAG as Dt, PLUME_VERT as Ot } from "./shaders/plumeAndSparkle.js";
|
|
39
|
+
import { KOLMO_EXTENSION_NAME as kt, createDefaultSignals as At, decodeKolmoRig as jt, inferKolmoSocketRole as Mt, stampKolmoNodesIntoGlb as Nt } from "./schema/kolmoSchema.js";
|
|
40
40
|
import { KolmoJunk as Q } from "./junk/KolmoJunk.js";
|
|
41
41
|
import { mountPS2WorldMeshes as Pt } from "./shaders/ps2MaterialsWebGL.js";
|
|
42
42
|
import { measureSelection as Ft, suggestCarAxles as It, toggleIslandSelection as Lt } from "./importer/wheelAxlePairing.js";
|
|
@@ -44,26 +44,23 @@ import { extractMeshIslands as Rt, normalizeSceneToSi as zt, separateVehicleMesh
|
|
|
44
44
|
import { CHOP_ROLES as Ht, buildSurfaceTopology as Ut, floodFillByCrease as Wt, getIslandTopology as Gt, mirrorTriangles as Kt } from "./importer/surfaceTopology.js";
|
|
45
45
|
import { buildSelectionOverlayGeometry as qt, createFleet12GonWheelGroup as Jt, findMirrorIslandId as Yt, peelIslandSelection as Xt, previewLoopPolyline as Zt, refineMeshAlongLoop as Qt, remapIslandIds as $t, selectFacesByClick as en, selectFacesByLoop as tn } from "./importer/surfaceCutter.js";
|
|
46
46
|
import { ChopShopPanel as nn } from "./importer/ChopShopPanel.js";
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import { VfxEmitterPool as Hn } from "./importer/VfxEmitterPool.js";
|
|
62
|
-
import { convertUsdToGlb as Un, isUsdFileName as Wn } from "./importer/usdToGlb.js";
|
|
63
|
-
import { bakeUniversalGateGlb as Gn } from "./importer/universalGateBake.js";
|
|
47
|
+
import { bakeArticulatedLauncherGlb as rn, buildLauncherSceneFromPlan as an } from "./importer/launcherBake.js";
|
|
48
|
+
import { DomainWorkshopPanel as on, enforceRetroPersonMaterials as sn } from "./importer/DomainWorkshopPanel.js";
|
|
49
|
+
import { DAMP_ZETA as cn, FREQ_HZ as ln, gateTelemetry as un, isGateStep1Unlocked as dn, useGateStore as fn } from "./importer/gateStore.js";
|
|
50
|
+
import { GateHudBar as pn } from "./importer/GateHudBar.js";
|
|
51
|
+
import { buildImporterWebMcpTools as mn, getNavigatorModelContext as hn, useImporterWebMcp as gn } from "./importer/importerWebMcp.js";
|
|
52
|
+
import { makeStarterDomainScene as _n } from "./importer/ImporterPlinthUikitTags.js";
|
|
53
|
+
import { compileKhrAssetGlb as vn } from "./importer/khrCompiler.js";
|
|
54
|
+
import { Step1CalibrationPlinth as yn } from "./importer/Step1CalibrationPlinth.js";
|
|
55
|
+
import { C12_TICK_M as bn, UNIFIED_ANCHOR_NAMES as xn, computeC12Metrics as Sn, defaultTargetMeters as Cn, detectSceneAnchors as wn, khrBoxToRapierHalfExtents as Tn, measureAssemblyCalibration as En, measureNormalizedSceneCalibration as Dn, snapMetersToC12 as On, wrapSingleMeshWithPaperShellProxy as kn } from "./importer/glbNormalizer.js";
|
|
56
|
+
import { ImperativeVehicleRig as An } from "./importer/ImperativeVehicleRig.js";
|
|
57
|
+
import { Step2UniversalPad as jn } from "./importer/Step2UniversalPad.js";
|
|
58
|
+
import { VfxEmitterPool as Mn } from "./importer/VfxEmitterPool.js";
|
|
59
|
+
import { convertUsdToGlb as Nn, isUsdFileName as Pn } from "./importer/usdToGlb.js";
|
|
60
|
+
import { bakeUniversalGateGlb as Fn } from "./importer/universalGateBake.js";
|
|
64
61
|
import { GlbImportGate as $ } from "./importer/GlbImportGate.js";
|
|
65
|
-
import { DOOR_HINGE_SPEC as
|
|
66
|
-
import { DEFAULT_VAULT_URL as
|
|
67
|
-
import { CARBINE_556 as
|
|
68
|
-
import { COUPE_2DOOR as
|
|
69
|
-
export { qe as ATMO_FRAG, Je as ATMO_VERT, z as Actor, w as ActorTrait,
|
|
62
|
+
import { DOOR_HINGE_SPEC as In, Ex as Ln, ROOT3 as Rn, buildFootprint as zn, canPlace as Bn, instanceBatches as Vn, latticePose as Hn, planSettlement as Un, poseEq as Wn, poseFromJSON as Gn, poseToFloat as Kn, poseToJSON as qn, snapPose as Jn, socketFor as Yn, triangleCorners as Xn, vToFloat as Zn, worldSockets as Qn } from "@khr3/c12";
|
|
63
|
+
import { DEFAULT_VAULT_URL as $n, KOLMO_ASSETS_URL as er, VAULT_CARS as tr, VAULT_CATALOG as nr, VAULT_CITY as rr, VAULT_WEAPONS as ir, createAssetVault as ar, inspectGlbBuffer as or, normalizeGlbBuffer as sr, vaultAssetUrl as cr } from "@khr3/assets";
|
|
64
|
+
import { CARBINE_556 as lr, LAUNCHER_RECIPES as ur, PISTOL_9MM as dr, SHOTGUN_12G as fr, attachModule as pr, createLauncherState as mr, detachModule as hr, findLauncherRecipe as gr, planLauncher as _r, stepLauncher as vr } from "@khr3/launchers";
|
|
65
|
+
import { COUPE_2DOOR as yr, FLEET as br, SEDAN_4DOOR as xr, VEHICLE_DOMAINS as Sr, VEHICLE_DOMAIN_SPECS as Cr, carUrl as wr, findCar as Tr, fleetByDomain as Er, planCar as Dr } from "@khr3/vehicles";
|
|
66
|
+
export { qe as ATMO_FRAG, Je as ATMO_VERT, z as Actor, w as ActorTrait, rt as BOTTLE_HEIGHT, Fe as C12TileKind, bn as C12_TICK_M, Ie as C12_TILE_M, it as CAN_LOD_THRESHOLD_M, lr as CARBINE_556, Ht as CHOP_ROLES, yr as COUPE_2DOOR, e as Canvas, nn as ChopShopPanel, cn as DAMP_ZETA, $n as DEFAULT_VAULT_URL, In as DOOR_HINGE_SPEC, Tt as DestructibleTarget, on as DomainWorkshopPanel, v as EMPTY_KOLMO_INPUT, X as EmitterRig, Ln as Ex, J as Exoplanet, br as FLEET, Le as FLOATING_ORIGIN_STEP_M, ln as FREQ_HZ, T as FloatingBodyTrait, ie as GLSL_BAYER_RGB555, ae as GLSL_RETRO_QUANTIZE, pn as GateHudBar, $ as GlbImportGate, An as ImperativeVehicleRig, $ as ImporterWorkbench, Ve as InfiniteLongDrivePlanner, E as InteractableTrait, K as Island, Q as Junk, Ye as KEY_SUN_DIRECTION, er as KOLMO_ASSETS_URL, kt as KOLMO_EXTENSION_NAME, y as KOLMO_KEY_MAP, z as KolmoActor, e as KolmoCanvas, X as KolmoEmitterRig, J as KolmoExoplanet, m as KolmoGravityContext, K as KolmoIsland, Q as KolmoJunk, q as KolmoLongDrive, h as KolmoPhysics, W as KolmoProp, Y as KolmoSkybox, G as KolmoSurface, R as KolmoVehicle, t as KolmoWorld, ur as LAUNCHER_RECIPES, q as LongDrive, Re as MACRO_SIZE_M, n as PALETTE_CRUNCHY_16, r as PALETTE_CRUNCHY_64, Et as PARTICLE_FRAG, Z as PARTICLE_VERT, dr as PISTOL_9MM, Dt as PLUME_FRAG, Ot as PLUME_VERT, oe as PS1_SNAP_RESOLUTION, h as Physics, D as PilotLink, W as Prop, i as RETRO_COLOR_MODES, se as RETRO_PRESETS, ce as RETRO_UNIFORMS, Xe as RING_MOONLET_COUNT, Rn as ROOT3, x as RetroViewportSync, S as RoomEnvRig, xr as SEDAN_4DOOR, fr as SHOTGUN_12G, Ce as SHOULDER_K, Qe as SPLAT_LAYER, ke as SeededSimplex2D, C as ShadowSnapRig, ht as ShardPieces, Ke as ShiftedFixedBody, Y as Skybox, Ae as SplitMix32, yn as Step1CalibrationPlinth, jn as Step2UniversalPad, G as Surface, ze as TILES_PER_MACRO, at as TIN_CAN_HEIGHT, ot as TIN_CAN_RADIUS, gt as TargetDecals, xn as UNIFIED_ANCHOR_NAMES, tr as VAULT_CARS, nr as VAULT_CATALOG, rr as VAULT_CITY, ir as VAULT_WEAPONS, Sr as VEHICLE_DOMAINS, Cr as VEHICLE_DOMAIN_SPECS, R as Vehicle, O as VehicleTrait, Mn as VfxEmitterPool, t as World, k as WorldSessionTrait, s as applyPs1Material, a as applyRetroFilteringToMaterial, c as applyRetroMaterial, o as applyRetroTextureFiltering, l as applySceneRetroMaterials, bt as applySegmentsToImportedRoot, pr as attachModule, rn as bakeArticulatedLauncherGlb, Fn as bakeUniversalGateGlb, je as bakeWorldSplatMaps, He as buildCarvedTerrainGeometry, Ne as buildDodecagonalCivicHub, zn as buildFootprint, st as buildGlassBottleGeometry, Ue as buildHighwayAsphaltTexture, mn as buildImporterWebMcpTools, an as buildLauncherSceneFromPlan, ee as buildPaletteLutData, B as buildPatchPreviewEmitters, We as buildRoadRibbonGeometry, qt as buildSelectionOverlayGeometry, Ut as buildSurfaceTopology, ct as buildTinCanGeometry, Bn as canPlace, wr as carUrl, me as childSeed, ye as closedRoadFromPoints, pt as collectValidTris, vn as compileKhrAssetGlb, Sn as computeC12Metrics, V as computeChopPartHinge, ue as computeIslandSpawnPose, fe as computeLongDriveBridgeheadSpawn, pe as computeLongDriveMainlandSpawn, te as computeRetroDpr, Nn as convertUsdToGlb, lt as countGeometryTriangles, ar as createAssetVault, At as createDefaultSignals, Jt as createFleet12GonWheelGroup, ut as createGlassBottleMaterial, mr as createLauncherState, tt as createPS2RoadMaterialWebGL, nt as createPS2TerrainMaterialWebGL, $e as createPS2WorldTextures, dt as createTinCanMaterials, H as createVehiclePanelAnimator, jt as decodeKolmoRig, Cn as defaultTargetMeters, hr as detachModule, wn as detectSceneAnchors, vt as disposeImportedRoot, sn as enforceRetroPersonMaterials, yt as ensureMeshAttributes, A as ensureWorldSession, Rt as extractMeshIslands, he as fbm2, Tr as findCar, gr as findLauncherRecipe, Yt as findMirrorIslandId, Er as fleetByDomain, Wt as floodFillByCrease, Ee as frontage, un as gateTelemetry, et as generatePS2DetailSlices, _t as getBulletHoleTexture, de as getCachedIslandPlan, ne as getColorQuantVector, Gt as getIslandTopology, hn as getNavigatorModelContext, re as getPaletteLutTexture, Ct as getProceduralLabelTexture, u as getRetroPreset, d as getRetroShaderUniforms, be as growRoad, Me as hashSeed, Mt as inferKolmoSocketRole, or as inspectGlbBuffer, Vn as instanceBatches, dn as isGateStep1Unlocked, Pn as isUsdFileName, Tn as khrBoxToRapierHalfExtents, j as kolmoActions, M as kolmoTelemetry, N as kolmoWorld, Hn as latticePose, wt as loadCustomLabelTexture, xt as loadImportedGlbUrl, De as makeIslandHeightfn, _n as makeStarterDomainScene, we as makeTerrain, xe as maxGrade, En as measureAssemblyCalibration, Dn as measureNormalizedSceneCalibration, Ft as measureSelection, Kt as mirrorTriangles, Pt as mountPS2WorldMeshes, ge as mulberry32, U as normalToMinusZQuaternion, sr as normalizeGlbBuffer, zt as normalizeSceneToSi, St as parseImportedGlbBuffer, Xt as peelIslandSelection, Dr as planCar, Ge as planDirtSpurs, Oe as planIslandWorld, _r as planLauncher, Un as planSettlement, Ze as populateMoonletMatrices, Wn as poseEq, Gn as poseFromJSON, Kn as poseToFloat, qn as poseToJSON, Zt as previewLoopPolyline, Be as quantizeFloatingOrigin192, P as readFloatingOriginAnchorXZ, Qt as refineMeshAlongLoop, $t as remapIslandIds, Se as roadFromPoints, Pe as routeMacroKnightAStar, Te as sampleHeightfield, _e as seedFrom, ft as selectCanLod, en as selectFacesByClick, tn as selectFacesByLoop, Bt as separateVehicleMeshes, F as shiftFloatingOriginEntities, Vt as sliceMeshTriangles, On as snapMetersToC12, Jn as snapPose, Yn as socketFor, mt as splitObjectIntoShards, Nt as stampKolmoNodesIntoGlb, vr as stepLauncher, It as suggestCarAxles, f as syncRetroUniforms, p as syncRetroViewport, Lt as toggleIslandSelection, le as togglePropJoint, Xn as triangleCorners, I as useActiveKolmoWorld, fn as useGateStore, gn as useImporterWebMcp, g as useIsKolmoCustomGravity, b as useKolmoInput, _ as useOptionalKootaWorld, L as useWorldTrait, Zn as vToFloat, ve as valueNoise2, cr as vaultAssetUrl, Qn as worldSockets, kn as wrapSingleMeshWithPaperShellProxy };
|
|
@@ -39,7 +39,7 @@ var x = new h.Vector3(), S = c(function({ spec: c, active: h = !0, importedAsset
|
|
|
39
39
|
applyHit: Z,
|
|
40
40
|
getSnapshot: X
|
|
41
41
|
}), [Z, X]);
|
|
42
|
-
d(ae, () => Q, [Q]), u(() => (Y.current.registerTarget?.(c.id, Q),
|
|
42
|
+
d(ae, () => Q, [Q]), u(() => (Y.current.registerTarget?.(c.id, Q), () => Y.current.registerTarget?.(c.id, null)), [c.id, Q]), u(() => {
|
|
43
43
|
Y.current.onStateChange?.(X());
|
|
44
44
|
}, [
|
|
45
45
|
X,
|
|
@@ -5,7 +5,6 @@ var a = new i.Vector3();
|
|
|
5
5
|
function o(o, s, c, l, u, d, f, p) {
|
|
6
6
|
let m;
|
|
7
7
|
if (c) {
|
|
8
|
-
c.recomputeMassPropertiesFromColliders?.();
|
|
9
8
|
let e = Math.max(.001, c.mass()) * 3.5, t = Math.hypot(p.impulse[0], p.impulse[1], p.impulse[2]), n = t > e && t > 1e-6 ? e / t : 1;
|
|
10
9
|
c.applyImpulseAtPoint({
|
|
11
10
|
x: p.impulse[0] * n,
|
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
import * as THREE from "three";
|
|
3
3
|
export declare const KEY_SUN_DIRECTION: THREE.Vector3;
|
|
4
4
|
export declare const RING_MOONLET_COUNT = 72;
|
|
5
|
-
export declare const ATMO_VERT = "\n uniform vec2 uPs1Grid; uniform float uSnapStrength; varying vec3 vNormalWorld, vWorldPos;\n void main() {\n vec4 wp = modelMatrix * vec4(position, 1.0); vWorldPos = wp.xyz; vNormalWorld = normalize(mat3(modelMatrix) * normal);\n vec4 clip = projectionMatrix * viewMatrix * wp;\n if (uSnapStrength > 0.001 && clip.w > 0.001) {\n vec4 snapped = clip; snapped.xyz = clip.xyz / clip.w
|
|
6
|
-
export declare const ATMO_FRAG = "\n uniform vec3 uSunDir, uColor; uniform float uDitherMix; varying vec3 vNormalWorld, vWorldPos;\n \nuniform float uDitherScale; uniform vec4 uColorQuant; uniform sampler2D uPaletteLut;\n\nvec3 ps1SrgbToLinear(vec3 s) { vec3 a = clamp(s, 0.0, 1.0); return a * (a * (a * 0.305306011 + 0.682171111) + 0.012522878); }\nvec3 ps1LinearToSrgb(vec3 l) { return max(1.055 * pow(clamp(l, 0.0, 1.0), vec3(0.416666667)) - 0.055, vec3(0.0)); }\nfloat ps1Bayer2(vec2 c) { return (c.y < 0.5) ? (c.x < 0.5 ? 0.0 : 2.0) : (c.x < 0.5 ? 3.0 : 1.0); }\nfloat ps1Bayer4x4(vec2 p) { vec2 f = floor(p); return (ps1Bayer2(mod(f, 2.0)) * 4.0 + ps1Bayer2(mod(floor(f * 0.5), 2.0)) + 0.5) / 16.0; }\nfloat ps1Bayer8x8(vec2 p) { vec2 f = floor(p); return (ps1Bayer2(mod(f, 2.0)) * 16.0 + ps1Bayer2(mod(floor(f * 0.5), 2.0)) * 4.0 + ps1Bayer2(mod(floor(f * 0.25), 2.0)) + 0.5) / 64.0; }\nvec3 ps1QuantizeRGB555Mix(vec3 col, vec2 fragCoord, float mixAmt) {\n if (mixAmt <= 0.001) return col;\n vec3 srgb = clamp(col, 0.0, 1.0); float bayer = ps1Bayer4x4(fragCoord * 0.5);\n vec3 c0 = floor(srgb * 31.0) / 31.0, c1 = min(c0 + 1.0 / 31.0, vec3(1.0));\n vec3 l0 = ps1SrgbToLinear(c0), l1 = ps1SrgbToLinear(c1);\n vec3 t = clamp((ps1SrgbToLinear(srgb) - l0) / max(l1 - l0, vec3(1e-5)), 0.0, 1.0);\n return mix(c0, c1, step(vec3(mix(0.5, bayer, clamp(mixAmt, 0.0, 1.0))), t));\n}\nvec3 ps1QuantizeRGB555(vec3 col, vec2 fragCoord) { return ps1QuantizeRGB555Mix(col, fragCoord, 1.0); }\n\nfloat ps1BayerDither(vec2 fragCoord) { return ps1Bayer4x4(fragCoord / max(uDitherScale, 0.5)); }\nvec3 ps1SamplePaletteLut(vec3 srgb) {\n vec3 c = clamp(srgb, 0.0, 1.0);\n return texture2D(uPaletteLut, vec2((floor(c.b * 31.0 + 0.5) * 32.0 + floor(c.r * 31.0 + 0.5) + 0.5) / 1024.0, (floor(c.g * 31.0 + 0.5) + 0.5) / 32.0)).rgb;\n}\nvec3 ps1QuantizeRetro(vec3 col, vec2 fragCoord, float ditherSpread) {\n if (uColorQuant.w < 0.5) return col;\n vec3 srgb = clamp(col, 0.0, 1.0); float bayer = ps1Bayer4x4(fragCoord / max(uDitherScale, 0.5)), spread = clamp(ditherSpread, 0.0, 1.0);\n if (uColorQuant.w > 1.5) return ps1SamplePaletteLut(ps1LinearToSrgb(clamp(ps1SrgbToLinear(srgb) + (bayer - 0.5) * (uColorQuant.y * spread), 0.0, 1.0)));\n vec3 levels = max(uColorQuant.rgb, vec3(1.0)), c0 = floor(srgb * levels) / levels, c1 = min(c0 + 1.0 / levels, vec3(1.0));\n vec3 l0 = ps1SrgbToLinear(c0), l1 = ps1SrgbToLinear(c1);\n vec3 t = clamp((ps1SrgbToLinear(srgb) - l0) / max(l1 - l0, vec3(1e-5)), 0.0, 1.0);\n return mix(c0, c1, step(vec3(mix(0.5, bayer, spread)), t));\n}\nvec4 ps1SampleN64ThreePoint(sampler2D tex, vec2 uv, float texSize, float mixStrength) {\n vec4 nearestSample = texture2D(tex, uv);\n if (mixStrength <= 0.001) return nearestSample;\n
|
|
5
|
+
export declare const ATMO_VERT = "\n uniform vec2 uPs1Grid; uniform float uSnapStrength; varying vec3 vNormalWorld, vWorldPos;\n void main() {\n vec4 wp = modelMatrix * vec4(position, 1.0); vWorldPos = wp.xyz; vNormalWorld = normalize(mat3(modelMatrix) * normal);\n vec4 clip = projectionMatrix * viewMatrix * wp;\n if (uSnapStrength > 0.001 && clip.w > 0.001) {\n vec4 snapped = clip; snapped.xyz = clip.xyz / clip.w;\n vec2 safeGrid = max(uPs1Grid * mix(2.5, 1.0, clamp(uSnapStrength, 0.0, 1.0)), vec2(1.0));\n snapped.xy = floor(safeGrid * snapped.xy + 0.5) / safeGrid; snapped.xyz *= clip.w; clip = snapped;\n }\n gl_Position = clip;\n }\n";
|
|
6
|
+
export declare const ATMO_FRAG = "\n uniform vec3 uSunDir, uColor; uniform float uDitherMix; varying vec3 vNormalWorld, vWorldPos;\n \nuniform float uDitherScale; uniform vec4 uColorQuant; uniform sampler2D uPaletteLut;\n\nvec3 ps1SrgbToLinear(vec3 s) { vec3 a = clamp(s, 0.0, 1.0); return a * (a * (a * 0.305306011 + 0.682171111) + 0.012522878); }\nvec3 ps1LinearToSrgb(vec3 l) { return max(1.055 * pow(clamp(l, 0.0, 1.0), vec3(0.416666667)) - 0.055, vec3(0.0)); }\nfloat ps1Bayer2(vec2 c) { return (c.y < 0.5) ? (c.x < 0.5 ? 0.0 : 2.0) : (c.x < 0.5 ? 3.0 : 1.0); }\nfloat ps1Bayer4x4(vec2 p) { vec2 f = floor(p); return (ps1Bayer2(mod(f, 2.0)) * 4.0 + ps1Bayer2(mod(floor(f * 0.5), 2.0)) + 0.5) / 16.0; }\nfloat ps1Bayer8x8(vec2 p) { vec2 f = floor(p); return (ps1Bayer2(mod(f, 2.0)) * 16.0 + ps1Bayer2(mod(floor(f * 0.5), 2.0)) * 4.0 + ps1Bayer2(mod(floor(f * 0.25), 2.0)) + 0.5) / 64.0; }\nvec3 ps1QuantizeRGB555Mix(vec3 col, vec2 fragCoord, float mixAmt) {\n if (mixAmt <= 0.001) return col;\n vec3 srgb = clamp(col, 0.0, 1.0); float bayer = ps1Bayer4x4(fragCoord * 0.5);\n vec3 c0 = floor(srgb * 31.0) / 31.0, c1 = min(c0 + 1.0 / 31.0, vec3(1.0));\n vec3 l0 = ps1SrgbToLinear(c0), l1 = ps1SrgbToLinear(c1);\n vec3 t = clamp((ps1SrgbToLinear(srgb) - l0) / max(l1 - l0, vec3(1e-5)), 0.0, 1.0);\n return mix(c0, c1, step(vec3(mix(0.5, bayer, clamp(mixAmt, 0.0, 1.0))), t));\n}\nvec3 ps1QuantizeRGB555(vec3 col, vec2 fragCoord) { return ps1QuantizeRGB555Mix(col, fragCoord, 1.0); }\n\nfloat ps1BayerDither(vec2 fragCoord) { return ps1Bayer4x4(fragCoord / max(uDitherScale, 0.5)); }\nvec3 ps1SamplePaletteLut(vec3 srgb) {\n vec3 c = clamp(srgb, 0.0, 1.0);\n return texture2D(uPaletteLut, vec2((floor(c.b * 31.0 + 0.5) * 32.0 + floor(c.r * 31.0 + 0.5) + 0.5) / 1024.0, (floor(c.g * 31.0 + 0.5) + 0.5) / 32.0)).rgb;\n}\nvec3 ps1QuantizeRetro(vec3 col, vec2 fragCoord, float ditherSpread) {\n if (uColorQuant.w < 0.5) return col;\n vec3 srgb = clamp(col, 0.0, 1.0); float bayer = ps1Bayer4x4(fragCoord / max(uDitherScale, 0.5)), spread = clamp(ditherSpread, 0.0, 1.0);\n if (uColorQuant.w > 1.5) return ps1SamplePaletteLut(ps1LinearToSrgb(clamp(ps1SrgbToLinear(srgb) + (bayer - 0.5) * (uColorQuant.y * spread), 0.0, 1.0)));\n vec3 levels = max(uColorQuant.rgb, vec3(1.0)), c0 = floor(srgb * levels) / levels, c1 = min(c0 + 1.0 / levels, vec3(1.0));\n vec3 l0 = ps1SrgbToLinear(c0), l1 = ps1SrgbToLinear(c1);\n vec3 t = clamp((ps1SrgbToLinear(srgb) - l0) / max(l1 - l0, vec3(1e-5)), 0.0, 1.0);\n return mix(c0, c1, step(vec3(mix(0.5, bayer, spread)), t));\n}\nvec4 ps1SampleN64ThreePoint(sampler2D tex, vec2 uv, float texSize, float mixStrength) {\n vec4 nearestSample = texture2D(tex, uv);\n if (mixStrength <= 0.001) return nearestSample;\n #if __VERSION__ >= 300\n vec2 ts = max(vec2(textureSize(tex, 0)), vec2(16.0));\n #else\n vec2 ts = vec2(max(16.0, texSize));\n #endif\n vec2 p = uv * ts - 0.5, i = floor(p), f = p - i, inv = 1.0 / ts;\n vec4 c10 = texture2D(tex, (i + vec2(1.5, 0.5)) * inv), c01 = texture2D(tex, (i + vec2(0.5, 1.5)) * inv);\n vec4 n64Col;\n if (f.x + f.y < 1.0) { vec4 c00 = texture2D(tex, (i + vec2(0.5, 0.5)) * inv); n64Col = c00 + f.x * (c10 - c00) + f.y * (c01 - c00); }\n else { vec4 c11 = texture2D(tex, (i + vec2(1.5, 1.5)) * inv); n64Col = c11 + (1.0 - f.y) * (c10 - c11) + (1.0 - f.x) * (c01 - c11); }\n return mix(nearestSample, n64Col, clamp(mixStrength, 0.0, 1.0));\n}\nfloat ps1ProcTexelHash(vec2 cell) { return fract(sin(dot(cell, vec2(127.1, 311.7))) * 43758.5453); }\nfloat ps1ProcN64ThreePoint(vec2 uv, float mixStrength) {\n vec2 p = uv * 8.0 - 0.5, i = floor(p), f = p - i;\n float nearestVal = ps1ProcTexelHash(floor(uv * 8.0));\n if (mixStrength <= 0.001) return nearestVal;\n float c10 = ps1ProcTexelHash(i + vec2(1.0, 0.0)), c01 = ps1ProcTexelHash(i + vec2(0.0, 1.0)), n64Val;\n if (f.x + f.y < 1.0) { float c00 = ps1ProcTexelHash(i); n64Val = c00 + f.x * (c10 - c00) + f.y * (c01 - c00); }\n else { float c11 = ps1ProcTexelHash(i + vec2(1.0, 1.0)); n64Val = c11 + (1.0 - f.y) * (c10 - c11) + (1.0 - f.x) * (c01 - c11); }\n return mix(nearestVal, n64Val, clamp(mixStrength, 0.0, 1.0));\n}\n\n void main() {\n vec3 viewDir = normalize(cameraPosition - vWorldPos);\n float rim = pow(1.0 - max(0.0, dot(viewDir, vNormalWorld)), 2.6), nl = dot(vNormalWorld, normalize(uSunDir));\n float sunLit = mix(smoothstep(-0.3, 0.7, nl), step(-0.25, nl), uDitherMix) * 0.72 + 0.28, alpha = rim * sunLit;\n if (alpha < (ps1BayerDither(gl_FragCoord.xy) * 0.65 + 0.14) * uDitherMix) discard;\n vec3 col = ps1QuantizeRetro(ps1LinearToSrgb(uColor * (0.8 + sunLit * 0.55)), gl_FragCoord.xy, uDitherMix);\n gl_FragColor = vec4(col, mix(alpha * 0.85, 0.75, uDitherMix));\n }\n";
|
|
7
7
|
export interface KolmoSkyboxProps {
|
|
8
8
|
sunDirection?: [number, number, number];
|
|
9
9
|
}
|
|
@@ -34,7 +34,7 @@ var h = new c.Vector3(-.62, .42, -.66).normalize(), g = 72, _ = "varying vec3 vD
|
|
|
34
34
|
if (s > 0.995) col += mix(vec3(0.74, 0.90, 1.0), vec3(1.0, 0.86, 0.68), step(0.5, fract(s * 91.3))) * 0.95;
|
|
35
35
|
gl_FragColor = vec4(ps1QuantizeRGB555Mix(col, gl_FragCoord.xy, uDitherMix), 1.0);
|
|
36
36
|
}
|
|
37
|
-
`, y = "\n uniform vec2 uPs1Grid; uniform float uSnapStrength; varying vec3 vNormalWorld, vWorldPos;\n void main() {\n vec4 wp = modelMatrix * vec4(position, 1.0); vWorldPos = wp.xyz; vNormalWorld = normalize(mat3(modelMatrix) * normal);\n vec4 clip = projectionMatrix * viewMatrix * wp;\n if (uSnapStrength > 0.001 && clip.w > 0.001) {\n vec4 snapped = clip; snapped.xyz = clip.xyz / clip.w
|
|
37
|
+
`, y = "\n uniform vec2 uPs1Grid; uniform float uSnapStrength; varying vec3 vNormalWorld, vWorldPos;\n void main() {\n vec4 wp = modelMatrix * vec4(position, 1.0); vWorldPos = wp.xyz; vNormalWorld = normalize(mat3(modelMatrix) * normal);\n vec4 clip = projectionMatrix * viewMatrix * wp;\n if (uSnapStrength > 0.001 && clip.w > 0.001) {\n vec4 snapped = clip; snapped.xyz = clip.xyz / clip.w;\n vec2 safeGrid = max(uPs1Grid * mix(2.5, 1.0, clamp(uSnapStrength, 0.0, 1.0)), vec2(1.0));\n snapped.xy = floor(safeGrid * snapped.xy + 0.5) / safeGrid; snapped.xyz *= clip.w; clip = snapped;\n }\n gl_Position = clip;\n }\n", b = `
|
|
38
38
|
uniform vec3 uSunDir, uColor; uniform float uDitherMix; varying vec3 vNormalWorld, vWorldPos;
|
|
39
39
|
${t}
|
|
40
40
|
void main() {
|