diff --git a/assets/compute.worker-155b2df9.js b/assets/compute.worker-6164df76.js similarity index 97% rename from assets/compute.worker-155b2df9.js rename to assets/compute.worker-6164df76.js index 841876a..484f2d2 100644 --- a/assets/compute.worker-155b2df9.js +++ b/assets/compute.worker-6164df76.js @@ -5,7 +5,6 @@ var __publicField = (obj, key, value) => { return value; }; (function() { - var _a, _b; "use strict"; var EPSILON$1 = 1e-6; var ARRAY_TYPE = typeof Float32Array !== "undefined" ? Float32Array : Array; @@ -650,11 +649,7 @@ var __publicField = (obj, key, value) => { if (!rec.mat.scatter(ray, rec, attenuation, scattered)) { return emitted; } - return add( - create$2(), - emitted, - multiply$1(create$2(), attenuation, rayColor(scattered, background2, world2, depth - 1)) - ); + return add(create$2(), emitted, multiply$1(create$2(), attenuation, rayColor(scattered, background2, world2, depth - 1))); } const CLASSNAME_KEY = "__CLASSNAME__"; const _metaMap = /* @__PURE__ */ new Map(); @@ -925,16 +920,8 @@ var __publicField = (obj, key, value) => { // return true; // } static surroundingBox(box0, box1) { - const small = [ - Math.min(box0.min[0], box1.min[0]), - Math.min(box0.min[1], box1.min[1]), - Math.min(box0.min[2], box1.min[2]) - ]; - const big = [ - Math.max(box0.max[0], box1.max[0]), - Math.max(box0.max[1], box1.max[1]), - Math.max(box0.max[2], box1.max[2]) - ]; + const small = [Math.min(box0.min[0], box1.min[0]), Math.min(box0.min[1], box1.min[1]), Math.min(box0.min[2], box1.min[2])]; + const big = [Math.max(box0.max[0], box1.max[0]), Math.max(box0.max[1], box1.max[1]), Math.max(box0.max[2], box1.max[2])]; return new AABB(small, big); } }; @@ -1317,8 +1304,8 @@ var __publicField = (obj, key, value) => { const node = new BVHNode(); node.level = _level; const flatList = new HittableList(); - const fillFlatList = (list2) => { - for (const object of list2.objects) { + const fillFlatList = (l) => { + for (const object of l.objects) { if (object instanceof HittableList) { fillFlatList(object); } else { @@ -1540,6 +1527,7 @@ var __publicField = (obj, key, value) => { ], CheckerTexture); var __defProp$c = Object.defineProperty; var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor; + var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __decorateClass$c = (decorators, target, key, kind) => { var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target; for (var i = decorators.length - 1, decorator; i >= 0; i--) @@ -1549,7 +1537,11 @@ var __publicField = (obj, key, value) => { __defProp$c(target, key, result); return result; }; - let ImageTexture = (_a = class extends Texture { + var __publicField$1 = (obj, key, value) => { + __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; + }; + let ImageTexture = class extends Texture { constructor() { super(); __publicField(this, "_width", 0); @@ -1582,17 +1574,15 @@ var __publicField = (obj, key, value) => { v = 1 - clamp(v, 0, 1); let i = Math.trunc(u * this._width); let j = Math.trunc(v * this._height); - if (i >= this._width) + if (i >= this._width) { i = this._width - 1; - if (j >= this._height) + } + if (j >= this._height) { j = this._height - 1; + } const colorScale = 1 / 255; let pixelOffset = j * this._bytesPerScanLine + i * ImageTexture.BytesPerPixel; - return [ - this._data[pixelOffset++] * colorScale, - this._data[pixelOffset++] * colorScale, - this._data[pixelOffset++] * colorScale - ]; + return [this._data[pixelOffset++] * colorScale, this._data[pixelOffset++] * colorScale, this._data[pixelOffset++] * colorScale]; } get width() { return this._width; @@ -1606,7 +1596,8 @@ var __publicField = (obj, key, value) => { get url() { return this._url; } - }, __publicField(_a, "BytesPerPixel", 4), _a); + }; + __publicField$1(ImageTexture, "BytesPerPixel", 4); ImageTexture = __decorateClass$c([ serializable ], ImageTexture); @@ -1879,6 +1870,7 @@ var __publicField = (obj, key, value) => { } var __defProp$b = Object.defineProperty; var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor; + var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __decorateClass$b = (decorators, target, key, kind) => { var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target; for (var i = decorators.length - 1, decorator; i >= 0; i--) @@ -1888,7 +1880,11 @@ var __publicField = (obj, key, value) => { __defProp$b(target, key, result); return result; }; - let Perlin = (_b = class { + var __publicField2 = (obj, key, value) => { + __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; + }; + let Perlin = class { constructor() { __publicField(this, "_ranVecs"); __publicField(this, "_permX"); @@ -1916,10 +1912,13 @@ var __publicField = (obj, key, value) => { [[], []], [[], []] ]; - for (let di = 0; di < 2; di++) - for (let dj = 0; dj < 2; dj++) - for (let dk = 0; dk < 2; dk++) + for (let di = 0; di < 2; di++) { + for (let dj = 0; dj < 2; dj++) { + for (let dk = 0; dk < 2; dk++) { c[di][dj][dk] = this._ranVecs[this._permX[i + di & 255] ^ this._permY[j + dj & 255] ^ this._permZ[k + dk & 255]]; + } + } + } const noise = trilinearInterp(c, u, v, w); return noise; } @@ -1950,7 +1949,8 @@ var __publicField = (obj, key, value) => { array[target] = tmp; } } - }, __publicField(_b, "_pointCount", 256), _b); + }; + __publicField2(Perlin, "_pointCount", 256); Perlin = __decorateClass$b([ serializable ], Perlin); @@ -2140,11 +2140,9 @@ var __publicField = (obj, key, value) => { } scatter(r_in, rec, attenuation, scattered) { const refl = reflect(normalize$2(create$2(), r_in.direction), rec.normal); - new Ray( - rec.p, - add(create$2(), refl, scale(create$2(), randomInUnitSphere(), this._roughness)), - r_in.time - ).copyTo(scattered); + new Ray(rec.p, add(create$2(), refl, scale(create$2(), randomInUnitSphere(), this._roughness)), r_in.time).copyTo( + scattered + ); copy(attenuation, this._baseColor); return dot(scattered.direction, rec.normal) > 0; } @@ -2362,14 +2360,8 @@ var __publicField = (obj, key, value) => { const transformedCenterT0 = transformMat4(create$2(), this.center(t0), this.transform.objectToWorld); const transformedCenterT1 = transformMat4(create$2(), this.center(t1), this.transform.objectToWorld); const r = fromValues(this._radius, this._radius, this._radius); - const box0 = new AABB( - sub(create$2(), transformedCenterT0, r), - add(create$2(), transformedCenterT0, r) - ); - const box1 = new AABB( - sub(create$2(), transformedCenterT1, r), - add(create$2(), transformedCenterT1, r) - ); + const box0 = new AABB(sub(create$2(), transformedCenterT0, r), add(create$2(), transformedCenterT0, r)); + const box1 = new AABB(sub(create$2(), transformedCenterT1, r), add(create$2(), transformedCenterT1, r)); return AABB.surroundingBox(box0, box1); } }; @@ -2488,7 +2480,6 @@ var __publicField = (obj, key, value) => { __publicField(this, "uv2"); __publicField(this, "surfaceNormal"); __publicField(this, "transform", new Transform()); - __publicField(this, "material"); __publicField(this, "doubleSided", false); this.v0 = v0; this.v1 = v1; diff --git a/assets/controller.worker-62292851.js b/assets/controller.worker-62043791.js similarity index 97% rename from assets/controller.worker-62292851.js rename to assets/controller.worker-62043791.js index 50dd3be..80639ab 100644 --- a/assets/controller.worker-62292851.js +++ b/assets/controller.worker-62043791.js @@ -5,7 +5,6 @@ var __publicField = (obj, key, value) => { return value; }; (function() { - var _a, _b; "use strict"; const _metaMap = /* @__PURE__ */ new Map(); function addClassName(type) { @@ -642,16 +641,8 @@ var __publicField = (obj, key, value) => { // return true; // } static surroundingBox(box0, box1) { - const small = [ - Math.min(box0.min[0], box1.min[0]), - Math.min(box0.min[1], box1.min[1]), - Math.min(box0.min[2], box1.min[2]) - ]; - const big = [ - Math.max(box0.max[0], box1.max[0]), - Math.max(box0.max[1], box1.max[1]), - Math.max(box0.max[2], box1.max[2]) - ]; + const small = [Math.min(box0.min[0], box1.min[0]), Math.min(box0.min[1], box1.min[1]), Math.min(box0.min[2], box1.min[2])]; + const big = [Math.max(box0.max[0], box1.max[0]), Math.max(box0.max[1], box1.max[1]), Math.max(box0.max[2], box1.max[2])]; return new AABB(small, big); } }; @@ -1151,8 +1142,8 @@ var __publicField = (obj, key, value) => { const node = new BVHNode(); node.level = _level; const flatList = new HittableList(); - const fillFlatList = (list2) => { - for (const object of list2.objects) { + const fillFlatList = (l) => { + for (const object of l.objects) { if (object instanceof HittableList) { fillFlatList(object); } else { @@ -1374,6 +1365,7 @@ var __publicField = (obj, key, value) => { ], CheckerTexture); var __defProp$c = Object.defineProperty; var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor; + var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __decorateClass$c = (decorators, target, key, kind) => { var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target; for (var i = decorators.length - 1, decorator; i >= 0; i--) @@ -1383,7 +1375,11 @@ var __publicField = (obj, key, value) => { __defProp$c(target, key, result); return result; }; - let ImageTexture = (_a = class extends Texture { + var __publicField$1 = (obj, key, value) => { + __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; + }; + let ImageTexture = class extends Texture { constructor() { super(); __publicField(this, "_width", 0); @@ -1416,17 +1412,15 @@ var __publicField = (obj, key, value) => { v = 1 - clamp(v, 0, 1); let i = Math.trunc(u * this._width); let j = Math.trunc(v * this._height); - if (i >= this._width) + if (i >= this._width) { i = this._width - 1; - if (j >= this._height) + } + if (j >= this._height) { j = this._height - 1; + } const colorScale = 1 / 255; let pixelOffset = j * this._bytesPerScanLine + i * ImageTexture.BytesPerPixel; - return [ - this._data[pixelOffset++] * colorScale, - this._data[pixelOffset++] * colorScale, - this._data[pixelOffset++] * colorScale - ]; + return [this._data[pixelOffset++] * colorScale, this._data[pixelOffset++] * colorScale, this._data[pixelOffset++] * colorScale]; } get width() { return this._width; @@ -1440,7 +1434,8 @@ var __publicField = (obj, key, value) => { get url() { return this._url; } - }, __publicField(_a, "BytesPerPixel", 4), _a); + }; + __publicField$1(ImageTexture, "BytesPerPixel", 4); ImageTexture = __decorateClass$c([ serializable ], ImageTexture); @@ -1713,6 +1708,7 @@ var __publicField = (obj, key, value) => { } var __defProp$b = Object.defineProperty; var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor; + var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __decorateClass$b = (decorators, target, key, kind) => { var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target; for (var i = decorators.length - 1, decorator; i >= 0; i--) @@ -1722,7 +1718,11 @@ var __publicField = (obj, key, value) => { __defProp$b(target, key, result); return result; }; - let Perlin = (_b = class { + var __publicField2 = (obj, key, value) => { + __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; + }; + let Perlin = class { constructor() { __publicField(this, "_ranVecs"); __publicField(this, "_permX"); @@ -1750,10 +1750,13 @@ var __publicField = (obj, key, value) => { [[], []], [[], []] ]; - for (let di = 0; di < 2; di++) - for (let dj = 0; dj < 2; dj++) - for (let dk = 0; dk < 2; dk++) + for (let di = 0; di < 2; di++) { + for (let dj = 0; dj < 2; dj++) { + for (let dk = 0; dk < 2; dk++) { c[di][dj][dk] = this._ranVecs[this._permX[i + di & 255] ^ this._permY[j + dj & 255] ^ this._permZ[k + dk & 255]]; + } + } + } const noise = trilinearInterp(c, u, v, w); return noise; } @@ -1784,7 +1787,8 @@ var __publicField = (obj, key, value) => { array[target] = tmp; } } - }, __publicField(_b, "_pointCount", 256), _b); + }; + __publicField2(Perlin, "_pointCount", 256); Perlin = __decorateClass$b([ serializable ], Perlin); @@ -1974,11 +1978,9 @@ var __publicField = (obj, key, value) => { } scatter(r_in, rec, attenuation, scattered) { const refl = reflect(normalize$2(create$2(), r_in.direction), rec.normal); - new Ray( - rec.p, - add(create$2(), refl, scale(create$2(), randomInUnitSphere(), this._roughness)), - r_in.time - ).copyTo(scattered); + new Ray(rec.p, add(create$2(), refl, scale(create$2(), randomInUnitSphere(), this._roughness)), r_in.time).copyTo( + scattered + ); copy(attenuation, this._baseColor); return dot(scattered.direction, rec.normal) > 0; } @@ -2196,14 +2198,8 @@ var __publicField = (obj, key, value) => { const transformedCenterT0 = transformMat4(create$2(), this.center(t0), this.transform.objectToWorld); const transformedCenterT1 = transformMat4(create$2(), this.center(t1), this.transform.objectToWorld); const r = fromValues(this._radius, this._radius, this._radius); - const box0 = new AABB( - sub(create$2(), transformedCenterT0, r), - add(create$2(), transformedCenterT0, r) - ); - const box1 = new AABB( - sub(create$2(), transformedCenterT1, r), - add(create$2(), transformedCenterT1, r) - ); + const box0 = new AABB(sub(create$2(), transformedCenterT0, r), add(create$2(), transformedCenterT0, r)); + const box1 = new AABB(sub(create$2(), transformedCenterT1, r), add(create$2(), transformedCenterT1, r)); return AABB.surroundingBox(box0, box1); } }; @@ -2322,7 +2318,6 @@ var __publicField = (obj, key, value) => { __publicField(this, "uv2"); __publicField(this, "surfaceNormal"); __publicField(this, "transform", new Transform()); - __publicField(this, "material"); __publicField(this, "doubleSided", false); this.v0 = v0; this.v1 = v1; diff --git a/assets/index-236a3970.js b/assets/index-d0e3944f.js similarity index 99% rename from assets/index-236a3970.js rename to assets/index-d0e3944f.js index 8592e8e..d6b399b 100644 --- a/assets/index-236a3970.js +++ b/assets/index-d0e3944f.js @@ -4,7 +4,6 @@ var __publicField = (obj, key, value) => { __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; -var _a, _b; (function polyfill() { const relList = document.createElement("link").relList; if (relList && relList.supports && relList.supports("modulepreload")) { @@ -14139,16 +14138,8 @@ let AABB = class { // return true; // } static surroundingBox(box0, box1) { - const small = [ - Math.min(box0.min[0], box1.min[0]), - Math.min(box0.min[1], box1.min[1]), - Math.min(box0.min[2], box1.min[2]) - ]; - const big = [ - Math.max(box0.max[0], box1.max[0]), - Math.max(box0.max[1], box1.max[1]), - Math.max(box0.max[2], box1.max[2]) - ]; + const small = [Math.min(box0.min[0], box1.min[0]), Math.min(box0.min[1], box1.min[1]), Math.min(box0.min[2], box1.min[2])]; + const big = [Math.max(box0.max[0], box1.max[0]), Math.max(box0.max[1], box1.max[1]), Math.max(box0.max[2], box1.max[2])]; return new AABB(small, big); } }; @@ -14531,8 +14522,8 @@ let BVHNode = class extends Hittable { const node = new BVHNode(); node.level = _level; const flatList = new HittableList(); - const fillFlatList = (list2) => { - for (const object of list2.objects) { + const fillFlatList = (l2) => { + for (const object of l2.objects) { if (object instanceof HittableList) { fillFlatList(object); } else { @@ -14754,6 +14745,7 @@ CheckerTexture = __decorateClass$d([ ], CheckerTexture); var __defProp$c = Object.defineProperty; var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor; +var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __decorateClass$c = (decorators, target, key, kind) => { var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target; for (var i = decorators.length - 1, decorator; i >= 0; i--) @@ -14763,7 +14755,11 @@ var __decorateClass$c = (decorators, target, key, kind) => { __defProp$c(target, key, result); return result; }; -let ImageTexture = (_a = class extends Texture { +var __publicField$1 = (obj, key, value) => { + __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; +let ImageTexture = class extends Texture { constructor() { super(); __publicField(this, "_width", 0); @@ -14796,17 +14792,15 @@ let ImageTexture = (_a = class extends Texture { v2 = 1 - clamp(v2, 0, 1); let i = Math.trunc(u2 * this._width); let j = Math.trunc(v2 * this._height); - if (i >= this._width) + if (i >= this._width) { i = this._width - 1; - if (j >= this._height) + } + if (j >= this._height) { j = this._height - 1; + } const colorScale = 1 / 255; let pixelOffset = j * this._bytesPerScanLine + i * ImageTexture.BytesPerPixel; - return [ - this._data[pixelOffset++] * colorScale, - this._data[pixelOffset++] * colorScale, - this._data[pixelOffset++] * colorScale - ]; + return [this._data[pixelOffset++] * colorScale, this._data[pixelOffset++] * colorScale, this._data[pixelOffset++] * colorScale]; } get width() { return this._width; @@ -14820,7 +14814,8 @@ let ImageTexture = (_a = class extends Texture { get url() { return this._url; } -}, __publicField(_a, "BytesPerPixel", 4), _a); +}; +__publicField$1(ImageTexture, "BytesPerPixel", 4); ImageTexture = __decorateClass$c([ serializable ], ImageTexture); @@ -15089,6 +15084,7 @@ function buildPermutationTable(random2) { } var __defProp$b = Object.defineProperty; var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor; +var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __decorateClass$b = (decorators, target, key, kind) => { var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target; for (var i = decorators.length - 1, decorator; i >= 0; i--) @@ -15098,7 +15094,11 @@ var __decorateClass$b = (decorators, target, key, kind) => { __defProp$b(target, key, result); return result; }; -let Perlin = (_b = class { +var __publicField2 = (obj, key, value) => { + __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; +let Perlin = class { constructor() { __publicField(this, "_ranVecs"); __publicField(this, "_permX"); @@ -15126,10 +15126,13 @@ let Perlin = (_b = class { [[], []], [[], []] ]; - for (let di2 = 0; di2 < 2; di2++) - for (let dj2 = 0; dj2 < 2; dj2++) - for (let dk2 = 0; dk2 < 2; dk2++) + for (let di2 = 0; di2 < 2; di2++) { + for (let dj2 = 0; dj2 < 2; dj2++) { + for (let dk2 = 0; dk2 < 2; dk2++) { c[di2][dj2][dk2] = this._ranVecs[this._permX[i + di2 & 255] ^ this._permY[j + dj2 & 255] ^ this._permZ[k2 + dk2 & 255]]; + } + } + } const noise = trilinearInterp(c, u2, v2, w2); return noise; } @@ -15160,7 +15163,8 @@ let Perlin = (_b = class { array[target] = tmp; } } -}, __publicField(_b, "_pointCount", 256), _b); +}; +__publicField2(Perlin, "_pointCount", 256); Perlin = __decorateClass$b([ serializable ], Perlin); @@ -15350,11 +15354,9 @@ let MetalMaterial = class extends Material { } scatter(r_in, rec, attenuation, scattered) { const refl = reflect(normalize$2(create$2(), r_in.direction), rec.normal); - new Ray( - rec.p, - add(create$2(), refl, scale$1(create$2(), randomInUnitSphere(), this._roughness)), - r_in.time - ).copyTo(scattered); + new Ray(rec.p, add(create$2(), refl, scale$1(create$2(), randomInUnitSphere(), this._roughness)), r_in.time).copyTo( + scattered + ); copy(attenuation, this._baseColor); return dot(scattered.direction, rec.normal) > 0; } @@ -15572,14 +15574,8 @@ let MovingSphere = class extends Hittable { const transformedCenterT0 = transformMat4(create$2(), this.center(t0), this.transform.objectToWorld); const transformedCenterT1 = transformMat4(create$2(), this.center(t1), this.transform.objectToWorld); const r2 = fromValues$1(this._radius, this._radius, this._radius); - const box0 = new AABB( - sub(create$2(), transformedCenterT0, r2), - add(create$2(), transformedCenterT0, r2) - ); - const box1 = new AABB( - sub(create$2(), transformedCenterT1, r2), - add(create$2(), transformedCenterT1, r2) - ); + const box0 = new AABB(sub(create$2(), transformedCenterT0, r2), add(create$2(), transformedCenterT0, r2)); + const box1 = new AABB(sub(create$2(), transformedCenterT1, r2), add(create$2(), transformedCenterT1, r2)); return AABB.surroundingBox(box0, box1); } }; @@ -15698,7 +15694,6 @@ let Triangle = class extends Hittable { __publicField(this, "uv2"); __publicField(this, "surfaceNormal"); __publicField(this, "transform", new Transform()); - __publicField(this, "material"); __publicField(this, "doubleSided", false); this.v0 = v0; this.v1 = v1; @@ -16353,10 +16348,10 @@ function createComputeTiles(imageWidth, imageHeight, tileSize) { return computeTiles; } function WorkerWrapper$1() { - return new Worker("" + new URL("compute.worker-155b2df9.js", import.meta.url).href); + return new Worker("" + new URL("compute.worker-6164df76.js", import.meta.url).href); } function WorkerWrapper() { - return new Worker("" + new URL("controller.worker-62292851.js", import.meta.url).href); + return new Worker("" + new URL("controller.worker-62043791.js", import.meta.url).href); } var ControllerCommands = /* @__PURE__ */ ((ControllerCommands2) => { ControllerCommands2[ControllerCommands2["START"] = 0] = "START"; @@ -16385,10 +16380,7 @@ class RaytracerCPU extends RaytracerBase { this._rayTracerOptions = rayTracerCPUOptions; } updateImage() { - const imageData = this._context2D.createImageData( - this._rayTracerOptions.imageWidth, - this._rayTracerOptions.imageHeight - ); + const imageData = this._context2D.createImageData(this._rayTracerOptions.imageWidth, this._rayTracerOptions.imageHeight); let j = 0; for (let y2 = this._rayTracerOptions.imageHeight - 1; y2 >= 0; y2--) { for (let x2 = 0; x2 < this._rayTracerOptions.imageWidth; x2++) { @@ -16541,7 +16533,7 @@ class RaytracerCPU extends RaytracerBase { this._rayTracerOptions.numOfWorkers = numOfWorkers; } } -const _WebGPUContext = class { +const _WebGPUContext = class _WebGPUContext { static createContext(device, queue, context) { _WebGPUContext._device = device; _WebGPUContext._queue = queue; @@ -16557,10 +16549,10 @@ const _WebGPUContext = class { return _WebGPUContext._context; } }; +__publicField(_WebGPUContext, "_device"); +__publicField(_WebGPUContext, "_queue"); +__publicField(_WebGPUContext, "_context"); let WebGPUContext = _WebGPUContext; -__publicField(WebGPUContext, "_device"); -__publicField(WebGPUContext, "_queue"); -__publicField(WebGPUContext, "_context"); class WebGPUBuffer { constructor() { __publicField(this, "_gpuBuffer"); @@ -17101,10 +17093,7 @@ class WebGPUComputePipline extends WebGPUPipelineBase { this._pixelBuffer.create(pixelBufferSize, GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC); this._accumulationBuffer.create(pixelBufferSize, GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC); const uniformArray = this.getParamsArray(this._options.uniformParams); - this._computeParamsUniformBuffer.createWithArrayMapped( - uniformArray, - GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST - ); + this._computeParamsUniformBuffer.createWithArrayMapped(uniformArray, GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST); const cameraArray = this._options.camera.getUniformArray(); this._computeCameraUniformBuffer.createWithArrayMapped(cameraArray, GPUBufferUsage.UNIFORM); this.createObjects(); @@ -17796,17 +17785,7 @@ const NumberInput = (props) => { }; return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "input", children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { children: props.label }), - /* @__PURE__ */ jsxRuntimeExports.jsx( - "input", - { - type: "number", - size: props.size, - min: props.min, - max: props.max, - value: props.value, - onChange: onInputChange - } - ) + /* @__PURE__ */ jsxRuntimeExports.jsx("input", { type: "number", size: props.size, min: props.min, max: props.max, value: props.value, onChange: onInputChange }) ] }); }; const DropDown = (props) => { diff --git a/index.html b/index.html index 3a62070..d6345f6 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ TS Raytracer - +