@kruschdev/pascal-plugin-mit-assets 0.0.0-stage → 0.1.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/ASSETS.md +298 -0
- package/LICENSE +21 -0
- package/README.md +71 -2
- package/dist/agent-operations.d.ts +8 -0
- package/dist/agent-operations.js +305 -0
- package/dist/agent-tools.d.ts +7 -0
- package/dist/agent-tools.js +128 -0
- package/dist/audit.d.ts +78 -0
- package/dist/bin/pascal-mit-assets.js +5238 -0
- package/dist/bom.d.ts +123 -0
- package/dist/cad/appliance-mep-builders.d.ts +7 -0
- package/dist/cad/furniture-builders.d.ts +9 -0
- package/dist/cad/index.d.ts +48 -0
- package/dist/cad/index.js +23 -0
- package/dist/cad/kitchen-bath-builders.d.ts +9 -0
- package/dist/cad/outdoor-fenestration-builders.d.ts +8 -0
- package/dist/cad/primitives.d.ts +56 -0
- package/dist/cad/props-vehicles-builders.d.ts +8 -0
- package/dist/chunk-2qgndrap.js +5200 -0
- package/dist/chunk-6hzyh6qv.js +346 -0
- package/dist/chunk-f72r2bmp.js +84 -0
- package/dist/chunk-hqgm57dv.js +310 -0
- package/dist/chunk-kgwk6kan.js +150 -0
- package/dist/chunk-raafkn3w.js +286 -0
- package/dist/chunk-vzmjt9dz.js +4380 -0
- package/dist/chunk-xhkwv6t4.js +5080 -0
- package/dist/hdri/index.d.ts +1 -0
- package/dist/hdri/index.js +322 -0
- package/dist/hdri/sky.d.ts +26 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +198 -0
- package/dist/manifest.d.ts +46 -0
- package/dist/materials/index.d.ts +10 -0
- package/dist/materials/index.js +1464 -0
- package/dist/materials/ktx2.d.ts +10 -0
- package/dist/materials/noise.d.ts +89 -0
- package/dist/materials/patterns.d.ts +15 -0
- package/dist/nodes/mit-item.d.ts +76 -0
- package/dist/render.d.ts +10 -0
- package/dist/render.js +24 -0
- package/dist/scripts/build-assets.js +17129 -0
- package/dist/sfx/index.d.ts +1 -0
- package/dist/sfx/index.js +1223 -0
- package/dist/sfx/synth.d.ts +25 -0
- package/dist/sku-crosswalk.d.ts +46 -0
- package/dist/ui/chat-card.d.ts +7 -0
- package/dist/ui/host-panel.d.ts +1 -0
- package/dist/ui/inspector-card.d.ts +4 -0
- package/dist/ui/schedule-view.d.ts +1 -0
- package/package.json +135 -4
- package/src/agent-operations.ts +373 -0
- package/src/agent-tools.ts +136 -0
- package/src/audit.ts +356 -0
- package/src/bom.ts +512 -0
- package/src/cad/appliance-mep-builders.ts +1336 -0
- package/src/cad/furniture-builders.ts +1622 -0
- package/src/cad/index.ts +993 -0
- package/src/cad/kitchen-bath-builders.ts +1189 -0
- package/src/cad/outdoor-fenestration-builders.ts +1499 -0
- package/src/cad/primitives.ts +286 -0
- package/src/cad/props-vehicles-builders.ts +1065 -0
- package/src/hdri/index.ts +5 -0
- package/src/hdri/sky.ts +481 -0
- package/src/index.ts +127 -0
- package/src/manifest.ts +5296 -0
- package/src/materials/index.ts +56 -0
- package/src/materials/ktx2.ts +138 -0
- package/src/materials/noise.ts +417 -0
- package/src/materials/patterns.ts +1507 -0
- package/src/nodes/mit-item.ts +163 -0
- package/src/render.ts +25 -0
- package/src/sfx/index.ts +6 -0
- package/src/sfx/synth.ts +1495 -0
- package/src/sku-crosswalk.ts +3868 -0
- package/src/ui/chat-card.tsx +93 -0
- package/src/ui/host-panel.tsx +330 -0
- package/src/ui/inspector-card.tsx +213 -0
- package/src/ui/schedule-view.tsx +188 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { encodeRadianceRgbe, synthesizeSunsetHdri, type SynthesizedHdri, } from './sky';
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
// src/hdri/sky.ts
|
|
2
|
+
var TWO_PI = Math.PI * 2;
|
|
3
|
+
var DEG_TO_RAD = Math.PI / 180;
|
|
4
|
+
function clamp(v, lo, hi) {
|
|
5
|
+
return v < lo ? lo : v > hi ? hi : v;
|
|
6
|
+
}
|
|
7
|
+
function lerp(a, b, t) {
|
|
8
|
+
return a + (b - a) * t;
|
|
9
|
+
}
|
|
10
|
+
function smoothstep(edge0, edge1, x) {
|
|
11
|
+
const t = clamp((x - edge0) / (edge1 - edge0), 0, 1);
|
|
12
|
+
return t * t * (3 - 2 * t);
|
|
13
|
+
}
|
|
14
|
+
function hash3(ix, iy, iz) {
|
|
15
|
+
let h = Math.imul(ix, 374761393) + Math.imul(iy, 668265263) + Math.imul(iz, 2147483647);
|
|
16
|
+
h = (h ^ h >>> 13) >>> 0;
|
|
17
|
+
h = Math.imul(h, 1274126177) >>> 0;
|
|
18
|
+
return ((h ^ h >>> 16) >>> 0) / 4294967296;
|
|
19
|
+
}
|
|
20
|
+
function quintic(t) {
|
|
21
|
+
return t * t * t * (t * (t * 6 - 15) + 10);
|
|
22
|
+
}
|
|
23
|
+
function valueNoise3D(x, y, z) {
|
|
24
|
+
const ix = Math.floor(x);
|
|
25
|
+
const iy = Math.floor(y);
|
|
26
|
+
const iz = Math.floor(z);
|
|
27
|
+
const fx = quintic(x - ix);
|
|
28
|
+
const fy = quintic(y - iy);
|
|
29
|
+
const fz = quintic(z - iz);
|
|
30
|
+
const n000 = hash3(ix, iy, iz);
|
|
31
|
+
const n100 = hash3(ix + 1, iy, iz);
|
|
32
|
+
const n010 = hash3(ix, iy + 1, iz);
|
|
33
|
+
const n110 = hash3(ix + 1, iy + 1, iz);
|
|
34
|
+
const n001 = hash3(ix, iy, iz + 1);
|
|
35
|
+
const n101 = hash3(ix + 1, iy, iz + 1);
|
|
36
|
+
const n011 = hash3(ix, iy + 1, iz + 1);
|
|
37
|
+
const n111 = hash3(ix + 1, iy + 1, iz + 1);
|
|
38
|
+
const x00 = lerp(n000, n100, fx);
|
|
39
|
+
const x10 = lerp(n010, n110, fx);
|
|
40
|
+
const x01 = lerp(n001, n101, fx);
|
|
41
|
+
const x11 = lerp(n011, n111, fx);
|
|
42
|
+
const y0 = lerp(x00, x10, fy);
|
|
43
|
+
const y1 = lerp(x01, x11, fy);
|
|
44
|
+
return lerp(y0, y1, fz);
|
|
45
|
+
}
|
|
46
|
+
function fbm3D(x, y, z, octaves = 4) {
|
|
47
|
+
let sum = 0;
|
|
48
|
+
let amp = 0.5;
|
|
49
|
+
let freq = 1;
|
|
50
|
+
let norm = 0;
|
|
51
|
+
for (let o = 0;o < octaves; o++) {
|
|
52
|
+
sum += amp * valueNoise3D(x * freq + o * 17.3, y * freq - o * 9.1, z * freq + o * 23.7);
|
|
53
|
+
norm += amp;
|
|
54
|
+
amp *= 0.5;
|
|
55
|
+
freq *= 2.04;
|
|
56
|
+
}
|
|
57
|
+
return norm > 0 ? sum / norm : 0;
|
|
58
|
+
}
|
|
59
|
+
function henyeyGreenstein(cosTheta, g) {
|
|
60
|
+
const g2 = g * g;
|
|
61
|
+
const denom = Math.max(0.0001, 1 + g2 - 2 * g * cosTheta);
|
|
62
|
+
return (1 - g2) / (4 * Math.PI * denom * Math.sqrt(denom));
|
|
63
|
+
}
|
|
64
|
+
function synthesizeSunsetHdri(width = 1024, height = 512) {
|
|
65
|
+
if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {
|
|
66
|
+
throw new RangeError(`Invalid HDRI dimensions: ${width}x${height}`);
|
|
67
|
+
}
|
|
68
|
+
const rgb = new Float32Array(width * height * 3);
|
|
69
|
+
const sunElevRad = 10 * DEG_TO_RAD;
|
|
70
|
+
const sunAzimRad = 215 * DEG_TO_RAD;
|
|
71
|
+
const sunCosEl = Math.cos(sunElevRad);
|
|
72
|
+
const sunX = sunCosEl * Math.cos(sunAzimRad);
|
|
73
|
+
const sunY = Math.sin(sunElevRad);
|
|
74
|
+
const sunZ = sunCosEl * Math.sin(sunAzimRad);
|
|
75
|
+
const sunHorizX = Math.cos(sunAzimRad);
|
|
76
|
+
const sunHorizZ = Math.sin(sunAzimRad);
|
|
77
|
+
const cosPhi = new Float64Array(width);
|
|
78
|
+
const sinPhi = new Float64Array(width);
|
|
79
|
+
for (let x = 0;x < width; x++) {
|
|
80
|
+
const phi = x / width * TWO_PI;
|
|
81
|
+
cosPhi[x] = Math.cos(phi);
|
|
82
|
+
sinPhi[x] = Math.sin(phi);
|
|
83
|
+
}
|
|
84
|
+
for (let y = 0;y < height; y++) {
|
|
85
|
+
const theta = (y + 0.5) / height * Math.PI;
|
|
86
|
+
const dy = Math.cos(theta);
|
|
87
|
+
const cosLat = Math.sin(theta);
|
|
88
|
+
const rowBase = y * width * 3;
|
|
89
|
+
for (let x = 0;x < width; x++) {
|
|
90
|
+
const cPhi = cosPhi[x] ?? 1;
|
|
91
|
+
const sPhi = sinPhi[x] ?? 0;
|
|
92
|
+
const dx = cosLat * cPhi;
|
|
93
|
+
const dz = cosLat * sPhi;
|
|
94
|
+
const cosGamma = clamp(dx * sunX + dy * sunY + dz * sunZ, -1, 1);
|
|
95
|
+
const sunAngle = Math.acos(cosGamma);
|
|
96
|
+
const horizDot = cPhi * sunHorizX + sPhi * sunHorizZ;
|
|
97
|
+
const sunSide = 0.5 + 0.5 * horizDot;
|
|
98
|
+
let r = 0;
|
|
99
|
+
let g = 0;
|
|
100
|
+
let b = 0;
|
|
101
|
+
const elev = Math.max(0, dy);
|
|
102
|
+
const zenithR = 0.055;
|
|
103
|
+
const zenithG = 0.11;
|
|
104
|
+
const zenithB = 0.31;
|
|
105
|
+
const midR = lerp(0.22, 0.38, sunSide);
|
|
106
|
+
const midG = lerp(0.2, 0.25, sunSide);
|
|
107
|
+
const midB = lerp(0.38, 0.44, sunSide);
|
|
108
|
+
const peachR = lerp(0.55, 1.08, sunSide);
|
|
109
|
+
const peachG = lerp(0.34, 0.52, sunSide);
|
|
110
|
+
const peachB = lerp(0.42, 0.31, sunSide);
|
|
111
|
+
const horizR = lerp(0.72, 1.72, sunSide);
|
|
112
|
+
const horizG = lerp(0.42, 0.84, sunSide);
|
|
113
|
+
const horizB = lerp(0.44, 0.32, sunSide);
|
|
114
|
+
const tLow = smoothstep(0, 0.14, elev);
|
|
115
|
+
const tMid = smoothstep(0.1, 0.42, elev);
|
|
116
|
+
const tTop = smoothstep(0.34, 0.92, elev);
|
|
117
|
+
let skyR = lerp(horizR, peachR, tLow);
|
|
118
|
+
let skyG = lerp(horizG, peachG, tLow);
|
|
119
|
+
let skyB = lerp(horizB, peachB, tLow);
|
|
120
|
+
skyR = lerp(skyR, midR, tMid);
|
|
121
|
+
skyG = lerp(skyG, midG, tMid);
|
|
122
|
+
skyB = lerp(skyB, midB, tMid);
|
|
123
|
+
skyR = lerp(skyR, zenithR, tTop);
|
|
124
|
+
skyG = lerp(skyG, zenithG, tTop);
|
|
125
|
+
skyB = lerp(skyB, zenithB, tTop);
|
|
126
|
+
const airMass = 1 / (elev + 0.16);
|
|
127
|
+
const mieWide = henyeyGreenstein(cosGamma, 0.68) * clamp(airMass * 0.28, 0.18, 1.15);
|
|
128
|
+
const mieTight = henyeyGreenstein(cosGamma, 0.9) * 0.14;
|
|
129
|
+
const corona = Math.exp(-Math.pow(sunAngle / 0.14, 2)) * 1.9;
|
|
130
|
+
skyR += mieWide * 2.2 + mieTight * 1.55 + corona * 1.05;
|
|
131
|
+
skyG += mieWide * 1.25 + mieTight * 0.98 + corona * 0.72;
|
|
132
|
+
skyB += mieWide * 0.48 + mieTight * 0.42 + corona * 0.34;
|
|
133
|
+
if (dy > -0.02) {
|
|
134
|
+
const cloudMask = smoothstep(0.03, 0.14, elev) * (1 - smoothstep(0.58, 0.92, elev));
|
|
135
|
+
if (cloudMask > 0.0001) {
|
|
136
|
+
const invProj = 1.65 / (elev + 0.34);
|
|
137
|
+
const cx = dx * invProj;
|
|
138
|
+
const cy = elev * 2.2;
|
|
139
|
+
const cz = dz * invProj;
|
|
140
|
+
const warp = fbm3D(cx * 0.55 + 3.1, cy * 0.8, cz * 0.55 - 1.7, 3);
|
|
141
|
+
const densityRaw = fbm3D(cx * 1.1 + warp * 0.9, cy * 1.35, cz * 1.1 - warp * 0.7, 4);
|
|
142
|
+
const cloudCoverage = smoothstep(0.49, 0.76, densityRaw) * cloudMask * 0.58;
|
|
143
|
+
if (cloudCoverage > 0.0001) {
|
|
144
|
+
const rimLight = Math.pow(Math.max(0, cosGamma), 5);
|
|
145
|
+
const cloudLit = clamp(sunSide * 0.75 + rimLight * 0.6, 0, 1.3);
|
|
146
|
+
const cR = lerp(0.28, 1.55, Math.min(1, cloudLit)) + rimLight * 1.35;
|
|
147
|
+
const cG = lerp(0.21, 0.76, Math.min(1, cloudLit)) + rimLight * 0.78;
|
|
148
|
+
const cB = lerp(0.32, 0.42, Math.min(1, cloudLit)) + rimLight * 0.32;
|
|
149
|
+
skyR = lerp(skyR, cR, cloudCoverage);
|
|
150
|
+
skyG = lerp(skyG, cG, cloudCoverage);
|
|
151
|
+
skyB = lerp(skyB, cB, cloudCoverage);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (dy > -0.04) {
|
|
156
|
+
const sunFadeBelowHorizon = smoothstep(-0.025, 0.015, dy);
|
|
157
|
+
const disc = Math.exp(-Math.pow(sunAngle / 0.038, 2)) * sunFadeBelowHorizon;
|
|
158
|
+
const discCore = Math.exp(-Math.pow(sunAngle / 0.019, 2)) * sunFadeBelowHorizon;
|
|
159
|
+
const sunEnergy = disc * 10.5 + discCore * 3.8;
|
|
160
|
+
skyR += sunEnergy * 1.05;
|
|
161
|
+
skyG += sunEnergy * 0.82;
|
|
162
|
+
skyB += sunEnergy * 0.48;
|
|
163
|
+
}
|
|
164
|
+
if (dy >= 0) {
|
|
165
|
+
r = skyR;
|
|
166
|
+
g = skyG;
|
|
167
|
+
b = skyB;
|
|
168
|
+
} else {
|
|
169
|
+
const depth = clamp(-dy, 0, 1);
|
|
170
|
+
const groundNoise = (fbm3D(dx * 2.4, dy * 2.4, dz * 2.4, 3) - 0.5) * 0.14;
|
|
171
|
+
const bounceMod = 1 + groundNoise;
|
|
172
|
+
const nearR = lerp(0.38, 0.62, sunSide);
|
|
173
|
+
const nearG = lerp(0.27, 0.4, sunSide);
|
|
174
|
+
const nearB = lerp(0.22, 0.25, sunSide);
|
|
175
|
+
const midGR = lerp(0.22, 0.31, sunSide);
|
|
176
|
+
const midGG = lerp(0.17, 0.22, sunSide);
|
|
177
|
+
const midGB = lerp(0.14, 0.16, sunSide);
|
|
178
|
+
const nadirR = 0.13;
|
|
179
|
+
const nadirG = 0.105;
|
|
180
|
+
const nadirB = 0.092;
|
|
181
|
+
const tG1 = smoothstep(0, 0.35, depth);
|
|
182
|
+
const tG2 = smoothstep(0.28, 1, depth);
|
|
183
|
+
let gR = lerp(nearR, midGR, tG1);
|
|
184
|
+
let gG = lerp(nearG, midGG, tG1);
|
|
185
|
+
let gB = lerp(nearB, midGB, tG1);
|
|
186
|
+
gR = lerp(gR, nadirR, tG2) * bounceMod;
|
|
187
|
+
gG = lerp(gG, nadirG, tG2) * bounceMod;
|
|
188
|
+
gB = lerp(gB, nadirB, tG2) * bounceMod;
|
|
189
|
+
const horizonBlend = smoothstep(0, 0.055, depth);
|
|
190
|
+
r = lerp(skyR * 0.72, gR, horizonBlend);
|
|
191
|
+
g = lerp(skyG * 0.72, gG, horizonBlend);
|
|
192
|
+
b = lerp(skyB * 0.72, gB, horizonBlend);
|
|
193
|
+
}
|
|
194
|
+
const idx = rowBase + x * 3;
|
|
195
|
+
rgb[idx] = r > 0 && Number.isFinite(r) ? r : 0;
|
|
196
|
+
rgb[idx + 1] = g > 0 && Number.isFinite(g) ? g : 0;
|
|
197
|
+
rgb[idx + 2] = b > 0 && Number.isFinite(b) ? b : 0;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return { width, height, rgb };
|
|
201
|
+
}
|
|
202
|
+
function floatRgbToRgbe(rRaw, gRaw, bRaw, outR, outG, outB, outE, x) {
|
|
203
|
+
const r = Number.isFinite(rRaw) && rRaw > 0 ? rRaw : 0;
|
|
204
|
+
const g = Number.isFinite(gRaw) && gRaw > 0 ? gRaw : 0;
|
|
205
|
+
const b = Number.isFinite(bRaw) && bRaw > 0 ? bRaw : 0;
|
|
206
|
+
const maxVal = r >= g ? r >= b ? r : b : g >= b ? g : b;
|
|
207
|
+
if (maxVal < 0.00000000000000000000000000000001) {
|
|
208
|
+
outR[x] = 0;
|
|
209
|
+
outG[x] = 0;
|
|
210
|
+
outB[x] = 0;
|
|
211
|
+
outE[x] = 0;
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const exp = Math.floor(Math.log2(maxVal)) + 1;
|
|
215
|
+
const eByte = clamp(exp + 128, 1, 255);
|
|
216
|
+
const scale = Math.pow(2, 8 - (eByte - 128));
|
|
217
|
+
outR[x] = clamp(Math.floor(r * scale), 0, 255);
|
|
218
|
+
outG[x] = clamp(Math.floor(g * scale), 0, 255);
|
|
219
|
+
outB[x] = clamp(Math.floor(b * scale), 0, 255);
|
|
220
|
+
outE[x] = eByte;
|
|
221
|
+
}
|
|
222
|
+
function encodeRleChannel(chan, width, dst, startPos) {
|
|
223
|
+
let pos = startPos;
|
|
224
|
+
let i = 0;
|
|
225
|
+
while (i < width) {
|
|
226
|
+
const val = chan[i] ?? 0;
|
|
227
|
+
let runLen = 1;
|
|
228
|
+
while (i + runLen < width && runLen < 127 && (chan[i + runLen] ?? 0) === val) {
|
|
229
|
+
runLen++;
|
|
230
|
+
}
|
|
231
|
+
if (runLen >= 4) {
|
|
232
|
+
dst[pos++] = 128 + runLen;
|
|
233
|
+
dst[pos++] = val;
|
|
234
|
+
i += runLen;
|
|
235
|
+
} else {
|
|
236
|
+
const litStart = i;
|
|
237
|
+
let litLen = 0;
|
|
238
|
+
while (i < width && litLen < 127) {
|
|
239
|
+
if (litLen > 0 && i + 3 < width && (chan[i] ?? 0) === (chan[i + 1] ?? 0) && (chan[i] ?? 0) === (chan[i + 2] ?? 0) && (chan[i] ?? 0) === (chan[i + 3] ?? 0)) {
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
i++;
|
|
243
|
+
litLen++;
|
|
244
|
+
}
|
|
245
|
+
dst[pos++] = litLen;
|
|
246
|
+
for (let k = litStart;k < litStart + litLen; k++) {
|
|
247
|
+
dst[pos++] = chan[k] ?? 0;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return pos;
|
|
252
|
+
}
|
|
253
|
+
function encodeRadianceRgbe(rgb, width, height) {
|
|
254
|
+
if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {
|
|
255
|
+
throw new RangeError(`Invalid HDRI dimensions: ${width}x${height}`);
|
|
256
|
+
}
|
|
257
|
+
if (rgb.length < width * height * 3) {
|
|
258
|
+
throw new RangeError(`RGB buffer too small: got ${rgb.length}, expected >= ${width * height * 3}`);
|
|
259
|
+
}
|
|
260
|
+
const headerStr = `#?RADIANCE
|
|
261
|
+
` + `FORMAT=32-bit_rle_rgbe
|
|
262
|
+
` + `SOFTWARE=@kruschdev/pascal-plugin-mit-assets (MIT)
|
|
263
|
+
` + `GAMMA=1.0
|
|
264
|
+
` + `EXPOSURE=1.0
|
|
265
|
+
` + `
|
|
266
|
+
` + `-Y ${height} +X ${width}
|
|
267
|
+
`;
|
|
268
|
+
const headerLen = headerStr.length;
|
|
269
|
+
const useRle = width >= 8 && width <= 32767;
|
|
270
|
+
const rowR = new Uint8Array(width);
|
|
271
|
+
const rowG = new Uint8Array(width);
|
|
272
|
+
const rowB = new Uint8Array(width);
|
|
273
|
+
const rowE = new Uint8Array(width);
|
|
274
|
+
if (!useRle) {
|
|
275
|
+
const out = new Uint8Array(headerLen + width * height * 4);
|
|
276
|
+
for (let i = 0;i < headerLen; i++) {
|
|
277
|
+
out[i] = headerStr.charCodeAt(i) & 127;
|
|
278
|
+
}
|
|
279
|
+
let pos = headerLen;
|
|
280
|
+
for (let y = 0;y < height; y++) {
|
|
281
|
+
const rowOffset = y * width * 3;
|
|
282
|
+
for (let x = 0;x < width; x++) {
|
|
283
|
+
const idx = rowOffset + x * 3;
|
|
284
|
+
floatRgbToRgbe(rgb[idx] ?? 0, rgb[idx + 1] ?? 0, rgb[idx + 2] ?? 0, rowR, rowG, rowB, rowE, x);
|
|
285
|
+
out[pos++] = rowR[x] ?? 0;
|
|
286
|
+
out[pos++] = rowG[x] ?? 0;
|
|
287
|
+
out[pos++] = rowB[x] ?? 0;
|
|
288
|
+
out[pos++] = rowE[x] ?? 0;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return out;
|
|
292
|
+
}
|
|
293
|
+
const maxBytesPerChannel = width + Math.ceil(width / 127) + 2;
|
|
294
|
+
const maxTotalBytes = headerLen + height * (4 + 4 * maxBytesPerChannel);
|
|
295
|
+
const buf = new Uint8Array(maxTotalBytes);
|
|
296
|
+
for (let i = 0;i < headerLen; i++) {
|
|
297
|
+
buf[i] = headerStr.charCodeAt(i) & 127;
|
|
298
|
+
}
|
|
299
|
+
let pos = headerLen;
|
|
300
|
+
const widthHi = width >> 8 & 255;
|
|
301
|
+
const widthLo = width & 255;
|
|
302
|
+
for (let y = 0;y < height; y++) {
|
|
303
|
+
const rowOffset = y * width * 3;
|
|
304
|
+
for (let x = 0;x < width; x++) {
|
|
305
|
+
const idx = rowOffset + x * 3;
|
|
306
|
+
floatRgbToRgbe(rgb[idx] ?? 0, rgb[idx + 1] ?? 0, rgb[idx + 2] ?? 0, rowR, rowG, rowB, rowE, x);
|
|
307
|
+
}
|
|
308
|
+
buf[pos++] = 2;
|
|
309
|
+
buf[pos++] = 2;
|
|
310
|
+
buf[pos++] = widthHi;
|
|
311
|
+
buf[pos++] = widthLo;
|
|
312
|
+
pos = encodeRleChannel(rowR, width, buf, pos);
|
|
313
|
+
pos = encodeRleChannel(rowG, width, buf, pos);
|
|
314
|
+
pos = encodeRleChannel(rowB, width, buf, pos);
|
|
315
|
+
pos = encodeRleChannel(rowE, width, buf, pos);
|
|
316
|
+
}
|
|
317
|
+
return buf.slice(0, pos);
|
|
318
|
+
}
|
|
319
|
+
export {
|
|
320
|
+
encodeRadianceRgbe,
|
|
321
|
+
synthesizeSunsetHdri
|
|
322
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clean-room MIT procedural equirectangular golden-hour sunset HDRI synthesizer
|
|
3
|
+
* and Radiance RGBE (`.hdr`) encoder.
|
|
4
|
+
*
|
|
5
|
+
* Purity invariant: ZERO imports from react, three, @pascal-app/*, next, or node:*.
|
|
6
|
+
* Pure deterministic TypeScript math and typed arrays.
|
|
7
|
+
*/
|
|
8
|
+
export type SynthesizedHdri = {
|
|
9
|
+
readonly width: number;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
readonly rgb: Float32Array;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Synthesize a seamless equirectangular warm golden-hour sunset HDRI dome.
|
|
15
|
+
*
|
|
16
|
+
* Orientation matches Radiance `-Y <height> +X <width>` (row 0 = zenith `+Y`,
|
|
17
|
+
* row `height / 2` = horizon `0`, row `height - 1` = nadir `-Y`), matching
|
|
18
|
+
* Three.js `HDRLoader` (`flipY: true`) and `EquirectangularReflectionMapping`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function synthesizeSunsetHdri(width?: number, height?: number): SynthesizedHdri;
|
|
21
|
+
/**
|
|
22
|
+
* Encode linear float32 RGB pixels (`width * height * 3`) into a standard
|
|
23
|
+
* Radiance RGBE `.hdr` file compatible with Three.js `HDRLoader` / `RGBELoader`,
|
|
24
|
+
* Radiance tools, Blender, and ImageMagick.
|
|
25
|
+
*/
|
|
26
|
+
export declare function encodeRadianceRgbe(rgb: Float32Array, width: number, height: number): Uint8Array;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main browser entry (`@kruschdev/pascal-plugin-mit-assets`).
|
|
3
|
+
*
|
|
4
|
+
* Clean-room MIT asset replacement plugin & static `public/` asset pack companion
|
|
5
|
+
* solving `pascalorg/editor#1327` with full real-world SKU & `pascal-bom/1.1` pricing integration:
|
|
6
|
+
* - `mitAssetsPlugin`: Core `Plugin` (`apiVersion: 1`, `mit-assets:item` + InspectorExtension)
|
|
7
|
+
* - `mitAssetsHostPanel`: Left-rail `EditorHostPanel` (155 MIT items, 68 PBR materials, 38 SFX)
|
|
8
|
+
* - `mitAssetsScheduleView`: Full-pane `EditorHostView` (MIT Provenance & Commercial Readiness Audit)
|
|
9
|
+
* - `mitAssetsChatExtension`: `PluginChatExtension` (`/mit-audit`, `/mit-place`, `/mit-bom`)
|
|
10
|
+
* - `configureMitAssetsViewer(baseUrl)`: Point `@pascal-app/viewer` at self-hosted MIT assets
|
|
11
|
+
*/
|
|
12
|
+
import type { AnyNodeDefinition, InspectorExtension, Plugin } from '@pascal-app/core';
|
|
13
|
+
import type { EditorHostPanel, EditorHostView, PluginChatExtension } from '@pascal-app/editor';
|
|
14
|
+
export declare const mitAssetsInspectorExtensions: InspectorExtension[];
|
|
15
|
+
export declare const mitAssetsItemDefinition: AnyNodeDefinition;
|
|
16
|
+
export declare const mitAssetsPlugin: Plugin;
|
|
17
|
+
export declare const mitAssetsHostPanel: EditorHostPanel;
|
|
18
|
+
export declare const mitAssetsScheduleView: EditorHostView;
|
|
19
|
+
export declare const mitAssetsChatExtension: PluginChatExtension;
|
|
20
|
+
/**
|
|
21
|
+
* Configure `@pascal-app/viewer` to resolve all materials, SFX, and static assets
|
|
22
|
+
* from a self-hosted drop-in MIT `public/` directory (e.g. `""` for local `/public` or a CDN URL).
|
|
23
|
+
*/
|
|
24
|
+
export declare function configureMitAssetsViewer(baseUrl?: string): void;
|
|
25
|
+
export default mitAssetsPlugin;
|
|
26
|
+
export * from './render';
|
|
27
|
+
export * from './manifest';
|
|
28
|
+
export * from './audit';
|
|
29
|
+
export * from './sku-crosswalk';
|
|
30
|
+
export * from './bom';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MIT_HDRI_SPEC2,
|
|
3
|
+
MIT_ITEM_SPECS2,
|
|
4
|
+
MIT_MATERIAL_SPECS2,
|
|
5
|
+
MIT_SFX_SPECS2,
|
|
6
|
+
getMitItemSpec2,
|
|
7
|
+
getMitMaterialSpec2
|
|
8
|
+
} from "./chunk-2qgndrap.js";
|
|
9
|
+
import {
|
|
10
|
+
normalizeBaseUrl2,
|
|
11
|
+
resolveMitItemUrl2,
|
|
12
|
+
resolveMitThumbnailUrl2,
|
|
13
|
+
resolveMitFloorPlanUrl2,
|
|
14
|
+
buildMitCatalogItems2,
|
|
15
|
+
searchMitItems2,
|
|
16
|
+
auditSceneMitProvenance2,
|
|
17
|
+
getMitAssetInventorySummary2,
|
|
18
|
+
MIT_ITEM_SKU_CROSSWALK2,
|
|
19
|
+
MIT_MATERIAL_SKU_CROSSWALK2,
|
|
20
|
+
getMitItemSku2,
|
|
21
|
+
getMitMaterialSku2,
|
|
22
|
+
getSkuCrosswalkStats2,
|
|
23
|
+
buildMitAssetsBom2,
|
|
24
|
+
toMitAssetsPascalBom2,
|
|
25
|
+
buildMitAssetsPascalBom2,
|
|
26
|
+
formatMitAssetsBomCsv2
|
|
27
|
+
} from "./chunk-vzmjt9dz.js";
|
|
28
|
+
import"./chunk-xhkwv6t4.js";
|
|
29
|
+
import {
|
|
30
|
+
MitAssetsItemNode2,
|
|
31
|
+
getMitAssetsItemPorts2,
|
|
32
|
+
buildMitAssetsItemGeometry2,
|
|
33
|
+
buildMitAssetsItemFloorplan2,
|
|
34
|
+
mitAssetsItemRenderDefinition2,
|
|
35
|
+
MIT_ASSETS_PLUGIN_ID2,
|
|
36
|
+
MIT_ASSETS_SCHEDULE_VIEW_ID2,
|
|
37
|
+
mitAssetsRenderPlugin2
|
|
38
|
+
} from "./chunk-kgwk6kan.js";
|
|
39
|
+
var __chunkGraphs;
|
|
40
|
+
var __chunkSeen;
|
|
41
|
+
var __chunkNonce;
|
|
42
|
+
var __preload = (id, seenOnly) => {
|
|
43
|
+
for (var [base, graph, ids] of __chunkGraphs || [])
|
|
44
|
+
for (var stack = [id], g = globalThis, d = g.document, head, j, node, k, link;j = stack.pop(); )
|
|
45
|
+
if (!__chunkSeen[j] && (node = graph[j])) {
|
|
46
|
+
__chunkSeen[j] = 1;
|
|
47
|
+
for (k = 1;k < node.length; k++)
|
|
48
|
+
stack.push(ids[node[k]]);
|
|
49
|
+
if (!seenOnly && j !== id && (head = d && d.head)) {
|
|
50
|
+
if (__chunkNonce === undefined)
|
|
51
|
+
__chunkNonce = (k = d.querySelector("meta[property=csp-nonce]")) && (k.nonce || k.getAttribute("nonce")) || "";
|
|
52
|
+
link = d.createElement("link");
|
|
53
|
+
link.rel = "modulepreload";
|
|
54
|
+
link.crossOrigin = "";
|
|
55
|
+
if (__chunkNonce)
|
|
56
|
+
link.nonce = __chunkNonce;
|
|
57
|
+
link.href = new g.URL(node[0], base);
|
|
58
|
+
head.appendChild(link);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var __chunks = (base, ids, nodes, entry) => {
|
|
63
|
+
for (var graph = {}, i = 0;i < ids.length; i++)
|
|
64
|
+
graph[ids[i]] = nodes[i];
|
|
65
|
+
(__chunkGraphs ||= []).push([base, graph, ids]);
|
|
66
|
+
__chunkSeen ||= {};
|
|
67
|
+
__preload(ids[entry], 1);
|
|
68
|
+
};
|
|
69
|
+
__chunks(import.meta.url,["8fqdp6nr","raafkn3w","hqgm57dv","6hzyh6qv","f72r2bmp","2qgndrap","vzmjt9dz","xhkwv6t4","kgwk6kan"],[["./index.js",5,6,7,8],["./chunk-raafkn3w.js",5,6],["./chunk-hqgm57dv.js",5,6,7,8],["./chunk-6hzyh6qv.js",5,6],["./chunk-f72r2bmp.js",5,7,8],["./chunk-2qgndrap.js"],["./chunk-vzmjt9dz.js",5],["./chunk-xhkwv6t4.js",5],["./chunk-kgwk6kan.js",5,7]],0);
|
|
70
|
+
|
|
71
|
+
// src/index.ts
|
|
72
|
+
import { configureViewer } from "@pascal-app/viewer";
|
|
73
|
+
var mitAssetsInspectorExtensions = [
|
|
74
|
+
{
|
|
75
|
+
id: `${MIT_ASSETS_PLUGIN_ID2}:item-inspector`,
|
|
76
|
+
pluginId: MIT_ASSETS_PLUGIN_ID2,
|
|
77
|
+
kinds: ["mit-assets:item"],
|
|
78
|
+
icon: { kind: "iconify", name: "lucide:shield-check" },
|
|
79
|
+
title: "MIT Asset & Real-SKU Pricing",
|
|
80
|
+
component: () => (__preload("raafkn3w"), import("./chunk-raafkn3w.js")),
|
|
81
|
+
primaryWhen: () => true
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
var mitAssetsItemDefinition = {
|
|
85
|
+
...mitAssetsItemRenderDefinition2
|
|
86
|
+
};
|
|
87
|
+
var mitAssetsPlugin = {
|
|
88
|
+
...mitAssetsRenderPlugin2,
|
|
89
|
+
nodes: [mitAssetsItemDefinition],
|
|
90
|
+
inspectorExtensions: mitAssetsInspectorExtensions
|
|
91
|
+
};
|
|
92
|
+
var mitAssetsHostPanel = {
|
|
93
|
+
id: `${MIT_ASSETS_PLUGIN_ID2}:panel`,
|
|
94
|
+
pluginId: MIT_ASSETS_PLUGIN_ID2,
|
|
95
|
+
kinds: ["mit-assets:item"],
|
|
96
|
+
label: "MIT Assets (#1327)",
|
|
97
|
+
summary: "155 clean-room MIT 3D items, 68 procedural PBR material packs, 38 DSP SFX cues & sunset HDRI with real-world SKU pricing.",
|
|
98
|
+
description: "100% clean-room MIT replacement for all bundled Pascal Editor assets (items/, material/, audios/sfx/, hdri/venice_sunset_1k.hdr) plus real-world SKU crosswalk and pascal-bom/1.1 procurement pricing.",
|
|
99
|
+
category: "Assets & Licensing",
|
|
100
|
+
creator: {
|
|
101
|
+
name: "@kruschdev",
|
|
102
|
+
url: "https://github.com/kruschdev"
|
|
103
|
+
},
|
|
104
|
+
pluginUrl: "https://github.com/kruschdev/pascal-plugin-mit-assets",
|
|
105
|
+
icon: { kind: "iconify", name: "lucide:shield-check" },
|
|
106
|
+
component: () => (__preload("hqgm57dv"), import("./chunk-hqgm57dv.js")),
|
|
107
|
+
defaultInstalled: false
|
|
108
|
+
};
|
|
109
|
+
var mitAssetsScheduleView = {
|
|
110
|
+
id: MIT_ASSETS_SCHEDULE_VIEW_ID2,
|
|
111
|
+
pluginId: MIT_ASSETS_PLUGIN_ID2,
|
|
112
|
+
label: "MIT Asset Audit & BOM",
|
|
113
|
+
description: "Audit active scenes for external Supabase / unattributed bundled assets and inspect 1:1 MIT replacements & real-world SKU pricing.",
|
|
114
|
+
icon: { kind: "iconify", name: "lucide:file-check-2" },
|
|
115
|
+
component: () => (__preload("6hzyh6qv"), import("./chunk-6hzyh6qv.js")),
|
|
116
|
+
workspaces: ["edit"],
|
|
117
|
+
defaultPinned: false
|
|
118
|
+
};
|
|
119
|
+
var mitAssetsChatExtension = {
|
|
120
|
+
pluginId: MIT_ASSETS_PLUGIN_ID2,
|
|
121
|
+
cards: {
|
|
122
|
+
mit_search_items: () => (__preload("f72r2bmp"), import("./chunk-f72r2bmp.js")),
|
|
123
|
+
mit_list_materials: () => (__preload("f72r2bmp"), import("./chunk-f72r2bmp.js")),
|
|
124
|
+
mit_audit_scene: () => (__preload("f72r2bmp"), import("./chunk-f72r2bmp.js")),
|
|
125
|
+
mit_place_item: () => (__preload("f72r2bmp"), import("./chunk-f72r2bmp.js")),
|
|
126
|
+
mit_replace_scene_items: () => (__preload("f72r2bmp"), import("./chunk-f72r2bmp.js")),
|
|
127
|
+
mit_schedule_bom: () => (__preload("f72r2bmp"), import("./chunk-f72r2bmp.js"))
|
|
128
|
+
},
|
|
129
|
+
actions: [
|
|
130
|
+
{
|
|
131
|
+
id: "mit-audit",
|
|
132
|
+
label: "Audit Scene MIT Readiness",
|
|
133
|
+
hint: "Check for non-MIT Supabase or bundled assets and list 1:1 clean-room MIT replacements",
|
|
134
|
+
prompt: "Run mit_audit_scene to check commercial MIT license readiness across all nodes."
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: "mit-replace",
|
|
138
|
+
label: "Migrate Scene Items to MIT",
|
|
139
|
+
hint: "Replace non-MIT Pascal item nodes with clean-room MIT procedural mit-assets:item nodes",
|
|
140
|
+
prompt: "Run mit_replace_scene_items to migrate replaceable scene items to clean-room MIT nodes."
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: "mit-bom",
|
|
144
|
+
label: "MIT Real-SKU Priced BOM",
|
|
145
|
+
hint: "Generate a CSI MasterFormat priced procurement BOM & CSV for all placed MIT assets",
|
|
146
|
+
prompt: "Run mit_schedule_bom to compile real-world manufacturer SKUs, pricing, and CSV."
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
};
|
|
150
|
+
function configureMitAssetsViewer(baseUrl = "") {
|
|
151
|
+
const base = normalizeBaseUrl2(baseUrl);
|
|
152
|
+
configureViewer({
|
|
153
|
+
assetsBaseUrl: base,
|
|
154
|
+
sfxBaseUrl: `${base}/audios/sfx`
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
var src_default = mitAssetsPlugin;
|
|
158
|
+
export {
|
|
159
|
+
MIT_ASSETS_PLUGIN_ID2 as MIT_ASSETS_PLUGIN_ID,
|
|
160
|
+
MIT_ASSETS_SCHEDULE_VIEW_ID2 as MIT_ASSETS_SCHEDULE_VIEW_ID,
|
|
161
|
+
MIT_HDRI_SPEC2 as MIT_HDRI_SPEC,
|
|
162
|
+
MIT_ITEM_SKU_CROSSWALK2 as MIT_ITEM_SKU_CROSSWALK,
|
|
163
|
+
MIT_ITEM_SPECS2 as MIT_ITEM_SPECS,
|
|
164
|
+
MIT_MATERIAL_SKU_CROSSWALK2 as MIT_MATERIAL_SKU_CROSSWALK,
|
|
165
|
+
MIT_MATERIAL_SPECS2 as MIT_MATERIAL_SPECS,
|
|
166
|
+
MIT_SFX_SPECS2 as MIT_SFX_SPECS,
|
|
167
|
+
MitAssetsItemNode2 as MitAssetsItemNode,
|
|
168
|
+
auditSceneMitProvenance2 as auditSceneMitProvenance,
|
|
169
|
+
buildMitAssetsBom2 as buildMitAssetsBom,
|
|
170
|
+
buildMitAssetsItemFloorplan2 as buildMitAssetsItemFloorplan,
|
|
171
|
+
buildMitAssetsItemGeometry2 as buildMitAssetsItemGeometry,
|
|
172
|
+
buildMitAssetsPascalBom2 as buildMitAssetsPascalBom,
|
|
173
|
+
buildMitCatalogItems2 as buildMitCatalogItems,
|
|
174
|
+
configureMitAssetsViewer,
|
|
175
|
+
src_default as default,
|
|
176
|
+
formatMitAssetsBomCsv2 as formatMitAssetsBomCsv,
|
|
177
|
+
getMitAssetInventorySummary2 as getMitAssetInventorySummary,
|
|
178
|
+
getMitAssetsItemPorts2 as getMitAssetsItemPorts,
|
|
179
|
+
getMitItemSku2 as getMitItemSku,
|
|
180
|
+
getMitItemSpec2 as getMitItemSpec,
|
|
181
|
+
getMitMaterialSku2 as getMitMaterialSku,
|
|
182
|
+
getMitMaterialSpec2 as getMitMaterialSpec,
|
|
183
|
+
getSkuCrosswalkStats2 as getSkuCrosswalkStats,
|
|
184
|
+
mitAssetsChatExtension,
|
|
185
|
+
mitAssetsHostPanel,
|
|
186
|
+
mitAssetsInspectorExtensions,
|
|
187
|
+
mitAssetsItemDefinition,
|
|
188
|
+
mitAssetsItemRenderDefinition2 as mitAssetsItemRenderDefinition,
|
|
189
|
+
mitAssetsPlugin,
|
|
190
|
+
mitAssetsRenderPlugin2 as mitAssetsRenderPlugin,
|
|
191
|
+
mitAssetsScheduleView,
|
|
192
|
+
normalizeBaseUrl2 as normalizeBaseUrl,
|
|
193
|
+
resolveMitFloorPlanUrl2 as resolveMitFloorPlanUrl,
|
|
194
|
+
resolveMitItemUrl2 as resolveMitItemUrl,
|
|
195
|
+
resolveMitThumbnailUrl2 as resolveMitThumbnailUrl,
|
|
196
|
+
searchMitItems2 as searchMitItems,
|
|
197
|
+
toMitAssetsPascalBom2 as toMitAssetsPascalBom
|
|
198
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type MitItemCategory = 'furniture' | 'appliance' | 'bathroom' | 'kitchen' | 'outdoor' | 'architectural';
|
|
2
|
+
export type MitItemSpec = {
|
|
3
|
+
readonly slug: string;
|
|
4
|
+
readonly catalogId: string;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly category: MitItemCategory;
|
|
7
|
+
readonly dimensions: readonly [number, number, number];
|
|
8
|
+
readonly attachTo?: 'wall' | 'wall-side' | 'ceiling';
|
|
9
|
+
readonly hasSurface: boolean;
|
|
10
|
+
readonly surfaceHeight?: number;
|
|
11
|
+
readonly inPublicItems: boolean;
|
|
12
|
+
readonly inCatalogItems: boolean;
|
|
13
|
+
readonly tags: readonly string[];
|
|
14
|
+
};
|
|
15
|
+
export type MitMaterialCategory = 'concrete' | 'fabric' | 'flooring' | 'leather' | 'metal' | 'roofing' | 'siding' | 'wood';
|
|
16
|
+
export type MitMaterialPattern = 'concrete-plate' | 'concrete-polished' | 'concrete-raw' | 'plaster' | 'drywall' | 'stucco' | 'cotton' | 'linen' | 'velvet' | 'suede' | 'wool' | 'boucle' | 'leather' | 'copper' | 'polished-metal' | 'brushed-metal' | 'roof-shingles' | 'roof-tiles' | 'board-batten' | 'lap-siding' | 'wood-fine' | 'wood-plank' | 'wood-parquet' | 'wood-chevron' | 'wood-square-parquet' | 'brick' | 'stone-wall' | 'terrazzo' | 'marble-stone' | 'mosaic-tile' | 'pool-tile' | 'checker-tile' | 'garage-panel' | 'earth' | 'terracotta-tile' | 'ceramic-tile';
|
|
17
|
+
export type MitMaterialSpec = {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly category: MitMaterialCategory;
|
|
20
|
+
readonly pack: string;
|
|
21
|
+
readonly previewColor: string;
|
|
22
|
+
readonly pattern: MitMaterialPattern;
|
|
23
|
+
readonly ktx2Files: readonly string[];
|
|
24
|
+
readonly webpFiles: readonly string[];
|
|
25
|
+
readonly thumbFile: string;
|
|
26
|
+
};
|
|
27
|
+
export type MitSfxGroup = 'ui' | 'editor' | 'architectural' | 'terrain' | 'status';
|
|
28
|
+
export type MitSfxSpec = {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
readonly file: string;
|
|
31
|
+
readonly path: string;
|
|
32
|
+
readonly group: MitSfxGroup;
|
|
33
|
+
readonly loop: boolean;
|
|
34
|
+
};
|
|
35
|
+
export declare const MIT_HDRI_SPEC: {
|
|
36
|
+
readonly id: "venice_sunset_1k";
|
|
37
|
+
readonly path: "/hdri/venice_sunset_1k.hdr";
|
|
38
|
+
readonly width: 1024;
|
|
39
|
+
readonly height: 512;
|
|
40
|
+
readonly description: "Clean-room procedural Preetham-style warm sunset sky dome (Radiance RGBE .hdr)";
|
|
41
|
+
};
|
|
42
|
+
export declare const MIT_ITEM_SPECS: readonly MitItemSpec[];
|
|
43
|
+
export declare const MIT_MATERIAL_SPECS: readonly MitMaterialSpec[];
|
|
44
|
+
export declare const MIT_SFX_SPECS: readonly MitSfxSpec[];
|
|
45
|
+
export declare function getMitItemSpec(slugOrId: string): MitItemSpec | undefined;
|
|
46
|
+
export declare function getMitMaterialSpec(id: string): MitMaterialSpec | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { clamp, clampByte, createSeededRng, fnv1a32, fract, hash2D, hash2DVec, hexToRgb, hsvToRgb, lerp, mixRgb, modulateRgb, mulberry32, periodicDomainWarpFbm2D, periodicFbm2D, periodicRidgedFbm2D, periodicValueNoise2D, periodicVoronoi2D, quintic, rgbToHsv, scaleRgb, smoothstep, wrapInt, type HsvTuple, type RgbModulation, type RgbTuple, type VoronoiSample, } from './noise';
|
|
2
|
+
export { synthesizeMaterialPack, type SynthesizedMaterialMaps } from './patterns';
|
|
3
|
+
export { encodeKtx2Rgba8, KTX2_WRITER_ID, type ZstdCompressor } from './ktx2';
|
|
4
|
+
export type MaterialChannel = 'albedo' | 'normal' | 'roughness' | 'ao' | 'metallic' | 'thumb';
|
|
5
|
+
/**
|
|
6
|
+
* Infers the PBR texture channel (or thumbnail role) from a material asset path or filename.
|
|
7
|
+
* Matches Pascal's `.ktx2` and `.webp` naming conventions (`basecolor`, `diffuse`, `normal`,
|
|
8
|
+
* `roughness`, `specular`, `specularLevel`, `ao`, `ambientOcclusion`, `metallic`, `thumb`).
|
|
9
|
+
*/
|
|
10
|
+
export declare function inferChannelFromFilename(filename: string): MaterialChannel;
|