@needle-tools/three-mesh-effects 0.2.3 → 0.3.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/CHANGELOG.md +34 -8
- package/README.md +86 -3
- package/SKILL.md +14 -4
- package/build/box-impostor-runtime.js +1423 -0
- package/build/box-impostor-runtime.js.map +7 -0
- package/build/deformation-runtime.js +30 -19
- package/build/deformation-runtime.js.map +3 -3
- package/build/hull-effects.js +60 -28
- package/build/hull-effects.js.map +3 -3
- package/build/impostor-runtime.js +264 -133
- package/build/impostor-runtime.js.map +4 -4
- package/build/index.js +8 -0
- package/build/index.js.map +2 -2
- package/build/internal/box-impostor/box-impostor-display-settings.js +50 -0
- package/build/internal/box-impostor/box-impostor-display-settings.js.map +7 -0
- package/build/internal/box-impostor/box-impostor-display.js +1102 -0
- package/build/internal/box-impostor/box-impostor-display.js.map +7 -0
- package/build/internal/box-impostor/box-impostor-face-axes.js +15 -0
- package/build/internal/box-impostor/box-impostor-face-axes.js.map +7 -0
- package/build/internal/box-impostor/box-impostor-faces.js +125 -0
- package/build/internal/box-impostor/box-impostor-faces.js.map +7 -0
- package/build/internal/box-impostor/box-impostor-geometry.js +230 -0
- package/build/internal/box-impostor/box-impostor-geometry.js.map +7 -0
- package/build/internal/box-impostor/box-impostor-material.js +1056 -0
- package/build/internal/box-impostor/box-impostor-material.js.map +7 -0
- package/build/internal/box-impostor/box-impostor-metadata.js +108 -0
- package/build/internal/box-impostor/box-impostor-metadata.js.map +7 -0
- package/build/internal/box-impostor/box-impostor-projection.js +276 -0
- package/build/internal/box-impostor/box-impostor-projection.js.map +7 -0
- package/build/internal/box-impostor/box-impostor-runtime.js +1369 -0
- package/build/internal/box-impostor/box-impostor-runtime.js.map +7 -0
- package/build/internal/box-impostor/box-impostor-surface-search.js +21 -0
- package/build/internal/box-impostor/box-impostor-surface-search.js.map +7 -0
- package/build/internal/deformation/cloth-surface.js +23 -17
- package/build/internal/deformation/cloth-surface.js.map +3 -3
- package/build/internal/deformation/pin-cloth.js +7 -2
- package/build/internal/deformation/pin-cloth.js.map +2 -2
- package/build/internal/deformation/rig-runtime.js +30 -19
- package/build/internal/deformation/rig-runtime.js.map +3 -3
- package/build/internal/impostor/impostor-node-material.js +264 -133
- package/build/internal/impostor/impostor-node-material.js.map +4 -4
- package/build/internal/pixel-impostor/pixel-impostor-display.js +84 -38
- package/build/internal/pixel-impostor/pixel-impostor-display.js.map +4 -4
- package/build/internal/rendering/captured-surface-depth.js +35 -0
- package/build/internal/rendering/captured-surface-depth.js.map +7 -0
- package/build/internal/rendering/captured-surface-material.js +28 -0
- package/build/internal/rendering/captured-surface-material.js.map +7 -0
- package/build/internal/rendering/hull-effect-runtime.js +59 -27
- package/build/internal/rendering/hull-effect-runtime.js.map +3 -3
- package/build/internal/rendering/renderer-support.js +31 -0
- package/build/internal/rendering/renderer-support.js.map +7 -0
- package/build/internal/rendering/wireframe.js +41 -9
- package/build/internal/rendering/wireframe.js.map +2 -2
- package/build/internal/rendering/wrap-preview.js +59 -27
- package/build/internal/rendering/wrap-preview.js.map +3 -3
- package/build/pixel-impostor-runtime.js +84 -38
- package/build/pixel-impostor-runtime.js.map +4 -4
- package/build/types/box-impostor/box-impostor-display-settings.d.ts +30 -0
- package/build/types/box-impostor/box-impostor-display-settings.js +1 -0
- package/build/types/box-impostor/box-impostor-display.d.ts +13 -0
- package/build/types/box-impostor/box-impostor-display.js +1 -0
- package/build/types/box-impostor/box-impostor-face-axes.d.ts +5 -0
- package/build/types/box-impostor/box-impostor-face-axes.js +1 -0
- package/build/types/box-impostor/box-impostor-faces.d.ts +11 -0
- package/build/types/box-impostor/box-impostor-faces.js +1 -0
- package/build/types/box-impostor/box-impostor-geometry.d.ts +5 -0
- package/build/types/box-impostor/box-impostor-geometry.js +1 -0
- package/build/types/box-impostor/box-impostor-material.d.ts +14 -0
- package/build/types/box-impostor/box-impostor-material.js +1 -0
- package/build/types/box-impostor/box-impostor-metadata.d.ts +31 -0
- package/build/types/box-impostor/box-impostor-metadata.js +1 -0
- package/build/types/box-impostor/box-impostor-projection.d.ts +19 -0
- package/build/types/box-impostor/box-impostor-projection.js +1 -0
- package/build/types/box-impostor/box-impostor-runtime.d.ts +19 -0
- package/build/types/box-impostor/box-impostor-runtime.js +1 -0
- package/build/types/box-impostor/box-impostor-surface-search.d.ts +13 -0
- package/build/types/box-impostor/box-impostor-surface-search.js +1 -0
- package/build/types/deformation/cloth-surface.d.ts +1 -0
- package/build/types/deformation/pin-cloth.d.ts +1 -0
- package/build/types/impostor/impostor-node-material.d.ts +2 -15
- package/build/types/public/box-impostor-runtime.d.ts +6 -0
- package/build/types/public/box-impostor-runtime.js +1 -0
- package/build/types/public/hull-effects.d.ts +1 -0
- package/build/types/public/index.d.ts +1 -1
- package/build/types/rendering/captured-surface-depth.d.ts +5 -0
- package/build/types/rendering/captured-surface-depth.js +1 -0
- package/build/types/rendering/captured-surface-material.d.ts +8 -0
- package/build/types/rendering/captured-surface-material.js +1 -0
- package/build/types/rendering/renderer-support.d.ts +27 -0
- package/build/types/rendering/renderer-support.js +1 -0
- package/build/types/rendering/wireframe.d.ts +2 -2
- package/package.json +29 -8
- package/src/box-impostor/box-impostor-display-settings.js +54 -0
- package/src/box-impostor/box-impostor-display.js +50 -0
- package/src/box-impostor/box-impostor-face-axes.js +11 -0
- package/src/box-impostor/box-impostor-faces.js +118 -0
- package/src/box-impostor/box-impostor-geometry.js +140 -0
- package/src/box-impostor/box-impostor-material.js +771 -0
- package/src/box-impostor/box-impostor-metadata.js +122 -0
- package/src/box-impostor/box-impostor-projection.js +276 -0
- package/src/box-impostor/box-impostor-runtime.js +124 -0
- package/src/box-impostor/box-impostor-surface-search.js +11 -0
- package/src/deformation/cloth-surface.ts +28 -17
- package/src/deformation/pin-cloth.ts +9 -3
- package/src/impostor/impostor-node-material.js +188 -157
- package/src/pixel-impostor/pixel-impostor-display.js +5 -13
- package/src/public/box-impostor-runtime.js +14 -0
- package/src/public/hull-effects.js +1 -0
- package/src/public/index.js +10 -1
- package/src/rendering/captured-surface-depth.js +55 -0
- package/src/rendering/captured-surface-material.js +27 -0
- package/src/rendering/renderer-support.js +50 -0
- package/src/rendering/wireframe.js +51 -13
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/rendering/captured-surface-depth.js", "../../../src/box-impostor/box-impostor-projection.js", "../../../src/box-impostor/box-impostor-face-axes.js", "../../../src/box-impostor/box-impostor-metadata.js"],
|
|
4
|
+
"sourcesContent": ["// @ts-check\nimport {\n Fn,\n cameraFar,\n cameraNear,\n cameraProjectionMatrix,\n modelViewMatrix,\n vec4,\n viewZToLogarithmicDepth,\n viewZToOrthographicDepth,\n viewZToPerspectiveDepth,\n viewZToReversedOrthographicDepth,\n viewZToReversedPerspectiveDepth,\n} from 'three/tsl';\n\n/** Match the renderer's depth convention after reconstructing a local hit.\n * @param {import('three/webgpu').Node<'vec3'>} position\n * @param {number} [shadowBias]\n */\nexport function capturedSurfaceDepth(position, shadowBias = 0) {\n return Fn(\n (\n /** @type {unknown} */ _,\n /** @type {import('three/webgpu').NodeBuilder} */ builder,\n ) => {\n // Resolve the shared hit before either projection branch consumes it.\n const z = modelViewMatrix\n .mul(vec4(position, 1))\n .z.toVar('capturedSurfaceViewZ');\n const reversed = builder.renderer.reversedDepthBuffer === true;\n // One material can alternate between a perspective view and orthographic\n // shadow cameras without a new pipeline; select using the active projection.\n const perspective = cameraProjectionMatrix\n .mul(vec4(0, 0, 0, 1))\n .w.equal(0);\n const perspectiveDepth =\n builder.renderer.logarithmicDepthBuffer === true\n ? viewZToLogarithmicDepth(z, cameraNear, cameraFar)\n : (reversed\n ? viewZToReversedPerspectiveDepth\n : viewZToPerspectiveDepth)(z, cameraNear, cameraFar);\n const result = perspective.select(\n perspectiveDepth,\n (reversed\n ? viewZToReversedOrthographicDepth\n : viewZToOrthographicDepth)(z, cameraNear, cameraFar),\n );\n return shadowBias &&\n 'isShadowPassMaterial' in builder.material &&\n builder.material.isShadowPassMaterial\n ? result.add(reversed ? -shadowBias : shadowBias).clamp(0, 1)\n : result;\n },\n )();\n}\n", "// TSL struct member types are verified by rendered GPU regressions.\n// @ts-nocheck\nimport { capturedSurfaceDepth } from '../rendering/captured-surface-depth.js';\nimport { DataTexture, FloatType, RGBAFormat, NearestFilter } from 'three';\nimport {\n Fn,\n If,\n vec2,\n vec3,\n vec4,\n float,\n int,\n ivec2,\n dot,\n abs,\n max,\n sign,\n normalize,\n texture,\n textureLoad,\n attribute,\n struct,\n modelWorldMatrix,\n transformNormalToView,\n} from 'three/tsl';\nimport { BOX_FACE_AXES } from './box-impostor-metadata.js';\n\n/** A ray/plane division supplies each UV directly. This graph deliberately has\n * no depth search, refinement or depth-consistency texture fetches. */\nexport function applyBoxProjection({\n material,\n descriptor,\n maps,\n settings,\n transparency,\n alphaCutoff,\n rects,\n center,\n half,\n toBox,\n fromBox,\n eye,\n viewAxis,\n perspective,\n raster,\n}) {\n const data = new Float32Array(descriptor.boxes.length * 24);\n descriptor.boxes.forEach((box, i) => {\n for (let face = 0; face < 6; face++)\n data[(i * 6 + face) * 4] = box.planes?.[face] ?? 0.5;\n });\n const planes = new DataTexture(\n data,\n 6,\n descriptor.boxes.length,\n RGBAFormat,\n FloatType,\n );\n planes.minFilter = planes.magFilter = NearestFilter;\n planes.needsUpdate = true;\n material.addEventListener('dispose', () => planes.dispose());\n const Surface = struct(\n {\n color: 'vec3',\n alpha: 'float',\n orm: 'vec3',\n emission: 'vec3',\n normal: 'vec3',\n position: 'vec3',\n },\n 'BoxProjectedSurface',\n );\n const readNormal = (uv, right, up, n) => {\n const packed = textureLoad(\n maps.normalDepth,\n ivec2(uv.mul(descriptor.atlasResolution)),\n )\n .rg.mul(2)\n .sub(1);\n const decoded = vec3(\n packed,\n float(1).sub(abs(packed.x)).sub(abs(packed.y)),\n ).toVar();\n If(decoded.z.lessThan(0), () => {\n decoded.xy.assign(\n vec2(1)\n .sub(abs(decoded.yx))\n .mul(sign(decoded.xy.add(1e-20))),\n );\n });\n return fromBox(\n right.mul(decoded.x).add(up.mul(decoded.y)).add(n.mul(decoded.z)),\n ).normalize();\n };\n const surface = Fn(() => {\n const ray = perspective.select(\n normalize(raster.sub(eye)),\n viewAxis.negate(),\n );\n const origin = perspective.select(\n eye,\n raster.sub(ray.mul(half.length().mul(4))),\n );\n const o = toBox(origin.sub(center)).div(half),\n r = toBox(ray).div(half);\n const look = normalize(toBox(ray).negate()),\n angles = abs(look);\n const positions = vec3(0).toVar();\n const selectedUv = vec2(0).toVar(),\n selectedRight = vec3(1, 0, 0).toVar(),\n selectedUp = vec3(0, 1, 0).toVar(),\n selectedNormal = vec3(0, 0, 1).toVar();\n const nearest = float(1e20).toVar('boxPlaneDistance');\n const opacity = float(0).toVar();\n const candidates = [];\n for (let axis = 0; axis < 3; axis++) {\n const angle = angles.element(axis);\n const positive = look.element(axis).greaterThanEqual(0),\n a = BOX_FACE_AXES[axis * 2],\n b = BOX_FACE_AXES[axis * 2 + 1];\n const n = positive.select(vec3(...a.normal), vec3(...b.normal)),\n right = positive.select(vec3(...a.right), vec3(...b.right)),\n up = positive.select(vec3(...a.up), vec3(...b.up));\n const weight =\n settings.interpolation === 'smooth' ? angle.mul(angle) : angle;\n const candidate =\n settings.interpolation === 'none'\n ? null\n : {\n uv: vec2(0).toVar(),\n base: vec4(0).toVar(),\n orm: vec4(0).toVar(),\n t: float(1e20).toVar(),\n tolerance: float(0).toVar(),\n right,\n up,\n n,\n weight,\n };\n if (candidate) candidates.push(candidate);\n If(angle.greaterThan(0.0001), () => {\n const face = positive.select(int(axis * 2), int(axis * 2 + 1)),\n id = int(attribute('boxId', 'float'));\n const plane = float(1).sub(\n textureLoad(planes, ivec2(face, id)).r.mul(2),\n );\n const divisor = dot(r, n),\n safe = sign(divisor.add(1e-20)).mul(max(abs(divisor), 1e-10));\n const t = plane.sub(dot(o, n)).div(safe),\n point = o.add(r.mul(t));\n const xy = vec2(dot(point, right), dot(point, up)).mul(0.5).add(0.5);\n // Clamping an unsupported plane to its edge would extrude its last texel.\n let supported = t\n .greaterThanEqual(0)\n .and(xy.x.greaterThanEqual(0))\n .and(xy.y.greaterThanEqual(0))\n .and(xy.x.lessThanEqual(1))\n .and(xy.y.lessThanEqual(1));\n if (!candidate) supported = supported.and(t.lessThan(nearest));\n If(supported, () => {\n const rect = textureLoad(rects, ivec2(face, id)),\n uv = rect.xy.add(xy.mul(rect.zw));\n const base = texture(maps.baseColor, uv).level(0),\n orm = texture(maps.orm, uv).level(0);\n const alpha = base.a.clamp(0, 1);\n If(\n alpha\n .greaterThanEqual(\n transparency === 'cutout' ? alphaCutoff : float(1 / 255),\n )\n .and(orm.a.greaterThan(0)),\n () => {\n If(t.lessThan(nearest), () => {\n nearest.assign(t);\n selectedUv.assign(uv);\n opacity.assign(alpha);\n selectedRight.assign(right);\n selectedUp.assign(up);\n selectedNormal.assign(n);\n positions.assign(center.add(fromBox(point.mul(half))));\n });\n if (candidate) {\n candidate.uv.assign(uv);\n candidate.base.assign(base);\n candidate.orm.assign(orm);\n candidate.t.assign(t);\n candidate.tolerance.assign(\n max(\n dot(abs(right), half).div(\n rect.z.mul(descriptor.atlasResolution),\n ),\n dot(abs(up), half).div(\n rect.w.mul(descriptor.atlasResolution),\n ),\n )\n .mul(4)\n .div(max(angle, 0.1)),\n );\n }\n },\n );\n });\n });\n }\n if (settings.interpolation === 'none') {\n // Select coordinates first, then shade one winning view.\n const base = texture(maps.baseColor, selectedUv).level(0),\n orm = texture(maps.orm, selectedUv).level(0);\n const coverage = max(orm.a, 1e-10);\n return Surface(\n base.rgb.div(coverage),\n opacity,\n orm.rgb.div(coverage),\n texture(maps.emissive, selectedUv).level(0).rgb.div(coverage),\n readNormal(selectedUv, selectedRight, selectedUp, selectedNormal),\n positions,\n );\n }\n const colors = vec3(0).toVar(),\n orms = vec3(0).toVar(),\n emissions = vec3(0).toVar(),\n normals = vec3(0).toVar();\n const weights = float(0).toVar(),\n support = float(0).toVar(),\n alpha = float(0).toVar();\n // Resolve every candidate against the final nearest surface, so the blend\n // cannot retain a farther plane because it happened to be visited first.\n for (const c of candidates) {\n If(\n c.base.a\n .greaterThan(0)\n .and(c.t.lessThanEqual(nearest.add(c.tolerance))),\n () => {\n const coverage = max(c.orm.a, 1e-10),\n w = c.base.a.mul(c.weight);\n weights.addAssign(c.weight.mul(coverage));\n support.assign(max(support, coverage));\n colors.addAssign(c.base.rgb.div(coverage).mul(w));\n orms.addAssign(c.orm.rgb.div(coverage).mul(w));\n emissions.addAssign(\n texture(maps.emissive, c.uv).level(0).rgb.div(coverage).mul(w),\n );\n normals.addAssign(readNormal(c.uv, c.right, c.up, c.n).mul(w));\n alpha.addAssign(w);\n },\n );\n }\n const divisor = max(alpha, 1e-10);\n return Surface(\n colors.div(divisor),\n alpha.div(max(weights, 1e-10)).mul(support),\n orms.div(divisor),\n emissions.div(divisor),\n normals.div(max(normals.length(), 1e-10)),\n positions,\n );\n })().toVar('boxProjectedSurface');\n material.capturedPositionNode = surface.get('position');\n material.colorNode = surface.get('color');\n material.normalNode = transformNormalToView(surface.get('normal'));\n material.roughnessNode = surface.get('orm').g;\n material.metalnessNode = surface.get('orm').b;\n material.aoNode = surface.get('orm').r;\n material.emissiveNode = surface.get('emission');\n material.maskNode = surface\n .get('alpha')\n .greaterThanEqual(transparency === 'cutout' ? alphaCutoff : float(1 / 255));\n material.maskShadowNode = material.maskNode;\n if (transparency !== 'cutout') material.opacityNode = surface.get('alpha');\n material.depthNode = capturedSurfaceDepth(surface.get('position'));\n material.receivedShadowPositionNode = modelWorldMatrix.mul(\n vec4(surface.get('position'), 1),\n ).xyz;\n material.userData.boxImpostor = { descriptor, maps, alphaCutoff };\n return material;\n}\n", "// @ts-check\n// Shared capture coordinates; keep this module free of renderer dependencies so\n// standalone bundles can use the same convention without importing an engine.\nexport const BOX_FACE_AXES = Object.freeze([\n { normal: [1, 0, 0], right: [0, 0, -1], up: [0, 1, 0] },\n { normal: [-1, 0, 0], right: [0, 0, 1], up: [0, 1, 0] },\n { normal: [0, 1, 0], right: [1, 0, 0], up: [0, 0, -1] },\n { normal: [0, -1, 0], right: [1, 0, 0], up: [0, 0, 1] },\n { normal: [0, 0, 1], right: [1, 0, 0], up: [0, 1, 0] },\n { normal: [0, 0, -1], right: [-1, 0, 0], up: [0, 1, 0] },\n]);\n", "// @ts-check\nimport { normalizeBoxImpostorDisplay } from \"./box-impostor-display-settings.js\";\nexport const NEEDLE_BOX_IMPOSTOR = \"NEEDLE_box_impostor\";\nexport const BOX_OCCUPANCY_RESOLUTION = 8;\nexport const BOX_OCCUPANCY_WORDS = BOX_OCCUPANCY_RESOLUTION ** 3 / 32;\nexport { BOX_FACE_AXES } from \"./box-impostor-face-axes.js\";\n/** @typedef {{center:number[],axes:number[][],halfSize:number[],views:number[][],planes?:number[],planeErrors?:number[],depthBounds?:number[],occupancy?:number[]}} ImpostorBox */\n/** @typedef {{version:1,depthMode?:'auto'|'projection'|'depth',alphaMode?:'opaque'|'mask'|'blend',interpolation?:'none'|'linear'|'smooth',transparency?:'auto'|'cutout'|'dithered'|'blended',mode:'basic'|'cards'|'fitted',atlasResolution:number,padding:number,raySteps:8|16|32,alphaCutoff:number,boxes:ImpostorBox[]}} BoxImpostorDescriptor */\n/** @param {unknown} raw @returns {BoxImpostorDescriptor} */\nexport function parseBoxImpostorDescriptor(raw) {\n const d = /** @type {BoxImpostorDescriptor} */ (raw);\n const fail = () => {\n throw new Error(\"Invalid NEEDLE_box_impostor descriptor.\");\n };\n const vector = (/** @type {unknown} */ v) =>\n Array.isArray(v) && v.length === 3 && v.every(Number.isFinite);\n if (\n !d ||\n d.version !== 1 ||\n ![\"basic\", \"cards\", \"fitted\"].includes(d.mode) ||\n ![8, 16, 32].includes(d.raySteps) ||\n !Number.isInteger(d.atlasResolution) ||\n d.atlasResolution < 32 ||\n d.atlasResolution > 8192 ||\n !Number.isInteger(d.padding) ||\n d.padding < 1 ||\n d.padding > 16 ||\n !Number.isFinite(d.alphaCutoff) ||\n d.alphaCutoff <= 0 ||\n d.alphaCutoff >= 1 ||\n !Array.isArray(d.boxes) ||\n !d.boxes.length ||\n d.boxes.length > 64\n )\n fail();\n if (\n d.alphaMode !== undefined &&\n ![\"opaque\", \"mask\", \"blend\"].includes(d.alphaMode)\n )\n fail();\n if (d.mode === \"basic\" && d.boxes.length !== 1) fail();\n for (const b of d.boxes) {\n if (\n b.occupancy !== undefined &&\n (!Array.isArray(b.occupancy) ||\n b.occupancy.length !== BOX_OCCUPANCY_WORDS ||\n !b.occupancy.every(\n (v) => Number.isInteger(v) && v >= 0 && v <= 0xffffffff,\n ))\n )\n fail();\n if (\n b.depthBounds !== undefined &&\n (!Array.isArray(b.depthBounds) ||\n b.depthBounds.length !== 12 ||\n !b.depthBounds.every(\n (v) => Number.isInteger(v) && v >= 0 && v <= 65535,\n ))\n )\n fail();\n if (\n b.planeErrors !== undefined &&\n (!Array.isArray(b.planeErrors) ||\n b.planeErrors.length !== 6 ||\n !b.planeErrors.every((v) => Number.isFinite(v) && v >= 0 && v <= 1))\n )\n fail();\n if (\n b.planes !== undefined &&\n (!Array.isArray(b.planes) ||\n b.planes.length !== 6 ||\n !b.planes.every((v) => Number.isFinite(v) && v >= 0 && v <= 1))\n )\n fail();\n if (\n !vector(b.center) ||\n !vector(b.halfSize) ||\n b.halfSize.some((v) => v <= 0) ||\n !Array.isArray(b.axes) ||\n b.axes.length !== 3 ||\n !b.axes.every(vector) ||\n !Array.isArray(b.views) ||\n b.views.length !== 6\n )\n fail();\n for (let i = 0; i < 3; i++)\n for (let j = 0; j < 3; j++) {\n const dot = b.axes[i].reduce((s, v, k) => s + v * b.axes[j][k], 0);\n if (Math.abs(dot - (i === j ? 1 : 0)) > 1e-4) fail();\n }\n const [x, y, z] = b.axes;\n if (\n (x[1] * y[2] - x[2] * y[1]) * z[0] +\n (x[2] * y[0] - x[0] * y[2]) * z[1] +\n (x[0] * y[1] - x[1] * y[0]) * z[2] <\n 0.999\n )\n fail();\n for (const r of b.views)\n if (\n !Array.isArray(r) ||\n r.length !== 4 ||\n !r.every(Number.isInteger) ||\n r[0] < 0 ||\n r[1] < 0 ||\n r[2] <= d.padding * 2 ||\n r[3] <= d.padding * 2 ||\n r[0] + r[2] > d.atlasResolution ||\n r[1] + r[3] > d.atlasResolution\n )\n fail();\n }\n return {\n version: d.version,\n mode: d.mode,\n atlasResolution: d.atlasResolution,\n padding: d.padding,\n boxes: d.boxes,\n ...(d.alphaMode ? { alphaMode: d.alphaMode } : {}),\n ...normalizeBoxImpostorDisplay(d),\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMA,SAAS,qBAAqB,UAAU,aAAa,GAAG;AAC7D,SAAO;AAAA,IACL,CACyB,GAC2B,YAC/C;AAEH,YAAM,IAAI,gBACP,IAAI,KAAK,UAAU,CAAC,CAAC,EACrB,EAAE,MAAM,sBAAsB;AACjC,YAAM,WAAW,QAAQ,SAAS,wBAAwB;AAG1D,YAAM,cAAc,uBACjB,IAAI,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC,EACpB,EAAE,MAAM,CAAC;AACZ,YAAM,mBACJ,QAAQ,SAAS,2BAA2B,OACxC,wBAAwB,GAAG,YAAY,SAAS,KAC/C,WACG,kCACA,yBAAyB,GAAG,YAAY,SAAS;AAC3D,YAAM,SAAS,YAAY;AAAA,QACzB;AAAA,SACC,WACG,mCACA,0BAA0B,GAAG,YAAY,SAAS;AAAA,MACxD;AACA,aAAO,cACL,0BAA0B,QAAQ,YAClC,QAAQ,SAAS,uBACf,OAAO,IAAI,WAAW,CAAC,aAAa,UAAU,EAAE,MAAM,GAAG,CAAC,IAC1D;AAAA,IACN;AAAA,EACF,EAAE;AACJ;;;ACnDA,SAAS,aAAa,WAAW,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