@woosh/meep-engine 3.2.0 → 3.3.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/package.json +1 -1
- package/src/avif/encoder_worker.js +5 -18
- package/src/core/color/PQ/PQ_constants.d.ts +43 -0
- package/src/core/color/PQ/PQ_constants.d.ts.map +1 -0
- package/src/core/color/PQ/PQ_constants.js +50 -0
- package/src/core/color/PQ/PQ_to_linear.d.ts +24 -0
- package/src/core/color/PQ/PQ_to_linear.d.ts.map +1 -0
- package/src/core/color/PQ/PQ_to_linear.js +35 -0
- package/src/core/color/PQ/linear_to_PQ.d.ts +27 -0
- package/src/core/color/PQ/linear_to_PQ.d.ts.map +1 -0
- package/src/core/color/PQ/linear_to_PQ.js +32 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_other_face.d.ts +32 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_other_face.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_other_face.js +59 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_third_vertex.d.ts +26 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_third_vertex.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_third_vertex.js +55 -0
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts.map +1 -1
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.js +269 -265
- package/src/engine/graphics3/VolumetricLightMap.d.ts +90 -0
- package/src/engine/graphics3/VolumetricLightMap.d.ts.map +1 -0
- package/src/engine/graphics3/VolumetricLightMap.js +160 -0
- package/src/engine/graphics3/VolumetricLightMapSerializationAdapter.d.ts +32 -0
- package/src/engine/graphics3/VolumetricLightMapSerializationAdapter.d.ts.map +1 -0
- package/src/engine/graphics3/VolumetricLightMapSerializationAdapter.js +67 -0
- package/src/engine/graphics3/VolumetricLightMapSystem3.d.ts +98 -0
- package/src/engine/graphics3/VolumetricLightMapSystem3.d.ts.map +1 -0
- package/src/engine/graphics3/VolumetricLightMapSystem3.js +261 -0
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/shade/renderer/global_illumination/brick4/cpu/brick4_empty_gpu_structure.d.ts +23 -0
- package/src/shade/renderer/global_illumination/brick4/cpu/brick4_empty_gpu_structure.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/brick4/cpu/brick4_empty_gpu_structure.js +34 -0
- package/src/shade/renderer/scene/optimization/geometry/internal/anchor_grow_topological.d.ts.map +1 -1
- package/src/shade/renderer/scene/optimization/geometry/internal/anchor_grow_topological.js +12 -3
- package/src/shade/renderer/scene/optimization/geometry/internal/match_validate_topology.js +3 -3
- package/src/shade/renderer/scene/optimization/geometry/internal/seed_correspondence_from_window.js +3 -3
- package/src/shade/renderer/scene/serialization/deserialize_scene.d.ts.map +1 -1
- package/src/shade/renderer/scene/serialization/deserialize_scene.js +0 -2
- package/src/shade/renderer/scene/optimization/geometry/internal/bt_face_loop_helpers.d.ts +0 -32
- package/src/shade/renderer/scene/optimization/geometry/internal/bt_face_loop_helpers.d.ts.map +0 -1
- package/src/shade/renderer/scene/optimization/geometry/internal/bt_face_loop_helpers.js +0 -77
- package/src/shade/renderer/scene/optimization/geometry/internal/bt_find_edge_between.d.ts +0 -12
- package/src/shade/renderer/scene/optimization/geometry/internal/bt_find_edge_between.d.ts.map +0 -1
- package/src/shade/renderer/scene/optimization/geometry/internal/bt_find_edge_between.js +0 -35
- package/src/shade/renderer/scene/serialization/linear_to_pq.d.ts +0 -2
- package/src/shade/renderer/scene/serialization/linear_to_pq.d.ts.map +0 -1
- package/src/shade/renderer/scene/serialization/linear_to_pq.js +0 -14
- package/src/shade/renderer/scene/serialization/pq_to_linear.d.ts +0 -9
- package/src/shade/renderer/scene/serialization/pq_to_linear.d.ts.map +0 -1
- package/src/shade/renderer/scene/serialization/pq_to_linear.js +0 -30
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A valid brick4 structure that lights nothing.
|
|
3
|
+
*
|
|
4
|
+
* There is no way to *un-upload* a lightmap: {@link Brick4LightMap} owns one buffer and the shader
|
|
5
|
+
* reads it unconditionally whenever the renderer is in Brick4 mode. So "no lightmap" has to be said
|
|
6
|
+
* in the format itself, and this is what says it — a root brick with no children whose every probe
|
|
7
|
+
* is zero. RGBE9995 zero decodes to a zero DC term, and `sh3_uncompress` scales every higher band by
|
|
8
|
+
* that DC, so all nine coefficients come back at zero: black indirect light, everywhere.
|
|
9
|
+
*
|
|
10
|
+
* **Built by the real encoder rather than written out here.** The layout — metadata, then nodes,
|
|
11
|
+
* then the probe section, with probe pointers resolved to absolute word addresses — belongs to
|
|
12
|
+
* {@link brick4_to_gpu_structure}, and a second hand-rolled copy of it would be free to drift.
|
|
13
|
+
*
|
|
14
|
+
* **The bounds are a unit box, not the zero box a fresh `AABB3` carries.** A zero-size volume makes
|
|
15
|
+
* the shader's `(position - min) / size` divide by zero, and the NaN that comes out of it survives
|
|
16
|
+
* into the trilinear weights — where `probe * weight` is `0 * NaN`, which is NaN rather than the
|
|
17
|
+
* black this is for. Any non-degenerate box does; where it sits does not matter, because traversal
|
|
18
|
+
* stops at the root and every probe in it reads the same zero.
|
|
19
|
+
*
|
|
20
|
+
* @returns {ArrayBuffer}
|
|
21
|
+
*/
|
|
22
|
+
export function brick4_empty_gpu_structure(): ArrayBuffer;
|
|
23
|
+
//# sourceMappingURL=brick4_empty_gpu_structure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brick4_empty_gpu_structure.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/brick4/cpu/brick4_empty_gpu_structure.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,8CAFa,WAAW,CAUvB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BRICK4_PROBE_ENCODED_SIZE } from "../BRICK4_PROBE_ENCODED_SIZE.js";
|
|
2
|
+
import { Brick4IntermediateNode } from "./Brick4IntermediateNode.js";
|
|
3
|
+
import { brick4_to_gpu_structure } from "./brick4_to_gpu_structure.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A valid brick4 structure that lights nothing.
|
|
7
|
+
*
|
|
8
|
+
* There is no way to *un-upload* a lightmap: {@link Brick4LightMap} owns one buffer and the shader
|
|
9
|
+
* reads it unconditionally whenever the renderer is in Brick4 mode. So "no lightmap" has to be said
|
|
10
|
+
* in the format itself, and this is what says it — a root brick with no children whose every probe
|
|
11
|
+
* is zero. RGBE9995 zero decodes to a zero DC term, and `sh3_uncompress` scales every higher band by
|
|
12
|
+
* that DC, so all nine coefficients come back at zero: black indirect light, everywhere.
|
|
13
|
+
*
|
|
14
|
+
* **Built by the real encoder rather than written out here.** The layout — metadata, then nodes,
|
|
15
|
+
* then the probe section, with probe pointers resolved to absolute word addresses — belongs to
|
|
16
|
+
* {@link brick4_to_gpu_structure}, and a second hand-rolled copy of it would be free to drift.
|
|
17
|
+
*
|
|
18
|
+
* **The bounds are a unit box, not the zero box a fresh `AABB3` carries.** A zero-size volume makes
|
|
19
|
+
* the shader's `(position - min) / size` divide by zero, and the NaN that comes out of it survives
|
|
20
|
+
* into the trilinear weights — where `probe * weight` is `0 * NaN`, which is NaN rather than the
|
|
21
|
+
* black this is for. Any non-degenerate box does; where it sits does not matter, because traversal
|
|
22
|
+
* stops at the root and every probe in it reads the same zero.
|
|
23
|
+
*
|
|
24
|
+
* @returns {ArrayBuffer}
|
|
25
|
+
*/
|
|
26
|
+
export function brick4_empty_gpu_structure() {
|
|
27
|
+
|
|
28
|
+
const root = new Brick4IntermediateNode();
|
|
29
|
+
|
|
30
|
+
root.bounds.setBounds(0, 0, 0, 1, 1, 1);
|
|
31
|
+
|
|
32
|
+
// every probe slot already indexes probe 0, and probe 0 is the one all-zero probe below
|
|
33
|
+
return brick4_to_gpu_structure(root, new Uint32Array(BRICK4_PROBE_ENCODED_SIZE));
|
|
34
|
+
}
|
package/src/shade/renderer/scene/optimization/geometry/internal/anchor_grow_topological.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor_grow_topological.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/scene/optimization/geometry/internal/anchor_grow_topological.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"anchor_grow_topological.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/scene/optimization/geometry/internal/anchor_grow_topological.js"],"names":[],"mappings":"AAYA;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAX0B,UAAU;IACV,UAAU;IACJ,UAAU;IACV,UAAU;IACL,6BAA6B,EAAvD,IAAI,MAAM,EAAE,MAAM,CAAC;IACN,WAAW,EAAxB,MAAM;IACO,WAAW,EAAxB,MAAM;IACO,gBAAgB,EAA7B,MAAM;IACQ,cAAc,GAA5B,MAAM;IACJ,UAAU,GAAG,IAAI,CA8I7B;;;;;;;;aAxKa,MAAM,EAAE;;;;aACR,MAAM,EAAE;;;;2BACR,IAAI,MAAM,EAAE,MAAM,CAAC;;;;yBACnB,IAAI,MAAM,EAAE,MAAM,CAAC;;;;eACnB,OAAO,qDAAqD,EAAE,SAAS"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { NULL_POINTER } from "../../../../../../core/geom/3d/topology/struct/binary/BinaryTopology.js";
|
|
2
|
+
import { bt_edge_get } from "../../../../../../core/geom/3d/topology/struct/binary/query/bt_edge_get.js";
|
|
3
|
+
import { bt_edge_other_face } from "../../../../../../core/geom/3d/topology/struct/binary/query/bt_edge_other_face.js";
|
|
4
|
+
import { bt_face_third_vertex } from "../../../../../../core/geom/3d/topology/struct/binary/query/bt_face_third_vertex.js";
|
|
2
5
|
import Vector3 from "../../../../../../core/geom/Vector3.js";
|
|
3
6
|
import { Transform } from "../../../../../../engine/ecs/transform/Transform.js";
|
|
4
7
|
import { StandardAttributes } from "../../../../geometry/StandardAttributes.js";
|
|
5
|
-
import { bt_edge_other_face, bt_face_third_vertex } from "./bt_face_loop_helpers.js";
|
|
6
|
-
import { bt_find_edge_between } from "./bt_find_edge_between.js";
|
|
7
8
|
import { apply_match_transform, match_solve_transform } from "./match_solve_transform.js";
|
|
8
9
|
import { vertex_attribute_pairs, vertex_attributes_match } from "./vertex_attributes_equal.js";
|
|
9
10
|
|
|
@@ -98,6 +99,14 @@ export function anchor_grow_topological(args) {
|
|
|
98
99
|
continue;
|
|
99
100
|
}
|
|
100
101
|
|
|
102
|
+
if (ev1_b === ev2_b) {
|
|
103
|
+
// Nothing constrains the correspondence to be injective, so an edge of A can arrive with
|
|
104
|
+
// both of its endpoints mapped onto a single vertex of B. There is no edge to cross
|
|
105
|
+
// there, and bt_edge_get asked for an edge between a vertex and itself answers with an
|
|
106
|
+
// arbitrary edge of that vertex's disk rather than with NULL_POINTER.
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
|
|
101
110
|
// Identify face_a' on the other side of edge_a from any matched face on this edge
|
|
102
111
|
// Find a matched face on this edge
|
|
103
112
|
const loop_a = topology_a.edge_read_loop(edge_a);
|
|
@@ -121,7 +130,7 @@ export function anchor_grow_topological(args) {
|
|
|
121
130
|
if (matched_faces_a.has(face_a_prime)) continue;
|
|
122
131
|
|
|
123
132
|
// Find edge_b connecting (ev1_b, ev2_b)
|
|
124
|
-
const edge_b =
|
|
133
|
+
const edge_b = bt_edge_get(topology_b, ev1_b, ev2_b);
|
|
125
134
|
if (edge_b === NULL_POINTER) continue;
|
|
126
135
|
|
|
127
136
|
const face_b_inside = f_b_for_a.get(any_matched_face_a);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bt_face_read_triangle_vertices } from "../../../../../../core/geom/3d/topology/struct/binary/query/bt_face_read_triangle.js";
|
|
2
2
|
|
|
3
3
|
const a_corners = [0, 0, 0];
|
|
4
4
|
const b_corners = [0, 0, 0];
|
|
@@ -29,8 +29,8 @@ export function match_validate_topology(
|
|
|
29
29
|
const face_b = face_b_for_a.get(face_a);
|
|
30
30
|
if (face_b === undefined) return false;
|
|
31
31
|
|
|
32
|
-
if (!
|
|
33
|
-
if (!
|
|
32
|
+
if (!bt_face_read_triangle_vertices(a_corners, topology_a, face_a)) return false;
|
|
33
|
+
if (!bt_face_read_triangle_vertices(b_corners, topology_b, face_b)) return false;
|
|
34
34
|
|
|
35
35
|
const exp0 = vertex_b_for_a.get(a_corners[0]);
|
|
36
36
|
const exp1 = vertex_b_for_a.get(a_corners[1]);
|
package/src/shade/renderer/scene/optimization/geometry/internal/seed_correspondence_from_window.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bt_face_read_triangle_vertices } from "../../../../../../core/geom/3d/topology/struct/binary/query/bt_face_read_triangle.js";
|
|
2
2
|
import { vertex_attribute_pairs, vertex_attributes_match } from "./vertex_attributes_equal.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -37,8 +37,8 @@ export function seed_correspondence_from_window(
|
|
|
37
37
|
const face_a = a_start + t;
|
|
38
38
|
const face_b = b_start + t;
|
|
39
39
|
|
|
40
|
-
if (!
|
|
41
|
-
if (!
|
|
40
|
+
if (!bt_face_read_triangle_vertices(a_corners, topology_a, face_a)) return null;
|
|
41
|
+
if (!bt_face_read_triangle_vertices(b_corners, topology_b, face_b)) return null;
|
|
42
42
|
|
|
43
43
|
const offset = find_matching_perm(va_to_vb, a_corners, b_corners, attrs);
|
|
44
44
|
if (offset === -1) return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deserialize_scene.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/scene/serialization/deserialize_scene.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deserialize_scene.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/scene/serialization/deserialize_scene.js"],"names":[],"mappings":"AAuMA;;;;;;GAMG;AACH,0CAJW,YAAY,iBAEV,cAAc,CA6R1B;AAED;;;;;;;GAOG;AACH,yCAJW,MAAM,iBAEJ,cAAc,CAuB1B;6BAvgB4B,yCAAyC"}
|
|
@@ -109,8 +109,6 @@ function is_avif_hdr(array_buffer) {
|
|
|
109
109
|
return false;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
// ─── PQ EOTF (inverse of the OETF used during serialization) ────────────────
|
|
113
|
-
|
|
114
112
|
/**
|
|
115
113
|
* @param {BinaryBuffer} buffer
|
|
116
114
|
* @param {ShadeTexture[]} textures indexed texture table
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Read the 3 corner vertex IDs of a triangular face into `out` (offset 0..2).
|
|
3
|
-
* Caller must ensure the face has exactly 3 loops.
|
|
4
|
-
*
|
|
5
|
-
* @param {BinaryTopology} mesh
|
|
6
|
-
* @param {number} face_id
|
|
7
|
-
* @param {number[]|Uint32Array} out length >= 3
|
|
8
|
-
* @returns {boolean} false if the face is degenerate (no loop)
|
|
9
|
-
*/
|
|
10
|
-
export function bt_face_read_triangle_corners(mesh: BinaryTopology, face_id: number, out: number[] | Uint32Array): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Given an edge incident to two faces and one of those faces, return the
|
|
13
|
-
* other face. Returns NULL_POINTER if the edge is a boundary (one face) or
|
|
14
|
-
* non-manifold in a way that doesn't match.
|
|
15
|
-
*
|
|
16
|
-
* @param {BinaryTopology} mesh
|
|
17
|
-
* @param {number} edge_id
|
|
18
|
-
* @param {number} face_id The known face on this edge
|
|
19
|
-
* @returns {number}
|
|
20
|
-
*/
|
|
21
|
-
export function bt_edge_other_face(mesh: BinaryTopology, edge_id: number, face_id: number): number;
|
|
22
|
-
/**
|
|
23
|
-
* Return the vertex of `face_id` that lies on neither end of `edge_id`. Caller
|
|
24
|
-
* is responsible for ensuring `edge_id` is actually one of the face's edges.
|
|
25
|
-
*
|
|
26
|
-
* @param {BinaryTopology} mesh
|
|
27
|
-
* @param {number} face_id
|
|
28
|
-
* @param {number} edge_id
|
|
29
|
-
* @returns {number} vertex ID, or NULL_POINTER if the edge is not part of the face
|
|
30
|
-
*/
|
|
31
|
-
export function bt_face_third_vertex(mesh: BinaryTopology, face_id: number, edge_id: number): number;
|
|
32
|
-
//# sourceMappingURL=bt_face_loop_helpers.d.ts.map
|
package/src/shade/renderer/scene/optimization/geometry/internal/bt_face_loop_helpers.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bt_face_loop_helpers.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/scene/optimization/geometry/internal/bt_face_loop_helpers.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,6EAJW,MAAM,OACN,MAAM,EAAE,GAAC,WAAW,GAClB,OAAO,CAYnB;AAED;;;;;;;;;GASG;AACH,kEAJW,MAAM,WACN,MAAM,GACJ,MAAM,CAiBlB;AAED;;;;;;;;GAQG;AACH,oEAJW,MAAM,WACN,MAAM,GACJ,MAAM,CAmBlB"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { NULL_POINTER } from "../../../../../../core/geom/3d/topology/struct/binary/BinaryTopology.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Read the 3 corner vertex IDs of a triangular face into `out` (offset 0..2).
|
|
5
|
-
* Caller must ensure the face has exactly 3 loops.
|
|
6
|
-
*
|
|
7
|
-
* @param {BinaryTopology} mesh
|
|
8
|
-
* @param {number} face_id
|
|
9
|
-
* @param {number[]|Uint32Array} out length >= 3
|
|
10
|
-
* @returns {boolean} false if the face is degenerate (no loop)
|
|
11
|
-
*/
|
|
12
|
-
export function bt_face_read_triangle_corners(mesh, face_id, out) {
|
|
13
|
-
const l0 = mesh.face_read_loop(face_id);
|
|
14
|
-
if (l0 === NULL_POINTER) return false;
|
|
15
|
-
const l1 = mesh.loop_read_next(l0);
|
|
16
|
-
const l2 = mesh.loop_read_next(l1);
|
|
17
|
-
|
|
18
|
-
out[0] = mesh.loop_read_vertex(l0);
|
|
19
|
-
out[1] = mesh.loop_read_vertex(l1);
|
|
20
|
-
out[2] = mesh.loop_read_vertex(l2);
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Given an edge incident to two faces and one of those faces, return the
|
|
26
|
-
* other face. Returns NULL_POINTER if the edge is a boundary (one face) or
|
|
27
|
-
* non-manifold in a way that doesn't match.
|
|
28
|
-
*
|
|
29
|
-
* @param {BinaryTopology} mesh
|
|
30
|
-
* @param {number} edge_id
|
|
31
|
-
* @param {number} face_id The known face on this edge
|
|
32
|
-
* @returns {number}
|
|
33
|
-
*/
|
|
34
|
-
export function bt_edge_other_face(mesh, edge_id, face_id) {
|
|
35
|
-
// walk radial cycle from any loop on the edge
|
|
36
|
-
const start = mesh.edge_read_loop(edge_id);
|
|
37
|
-
if (start === NULL_POINTER) return NULL_POINTER;
|
|
38
|
-
|
|
39
|
-
let loop = start;
|
|
40
|
-
do {
|
|
41
|
-
const f = mesh.loop_read_face(loop);
|
|
42
|
-
if (f !== face_id) {
|
|
43
|
-
return f;
|
|
44
|
-
}
|
|
45
|
-
loop = mesh.loop_read_radial_next(loop);
|
|
46
|
-
} while (loop !== start);
|
|
47
|
-
|
|
48
|
-
return NULL_POINTER;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Return the vertex of `face_id` that lies on neither end of `edge_id`. Caller
|
|
53
|
-
* is responsible for ensuring `edge_id` is actually one of the face's edges.
|
|
54
|
-
*
|
|
55
|
-
* @param {BinaryTopology} mesh
|
|
56
|
-
* @param {number} face_id
|
|
57
|
-
* @param {number} edge_id
|
|
58
|
-
* @returns {number} vertex ID, or NULL_POINTER if the edge is not part of the face
|
|
59
|
-
*/
|
|
60
|
-
export function bt_face_third_vertex(mesh, face_id, edge_id) {
|
|
61
|
-
const ev1 = mesh.edge_read_vertex1(edge_id);
|
|
62
|
-
const ev2 = mesh.edge_read_vertex2(edge_id);
|
|
63
|
-
|
|
64
|
-
const start = mesh.face_read_loop(face_id);
|
|
65
|
-
if (start === NULL_POINTER) return NULL_POINTER;
|
|
66
|
-
|
|
67
|
-
let loop = start;
|
|
68
|
-
do {
|
|
69
|
-
const v = mesh.loop_read_vertex(loop);
|
|
70
|
-
if (v !== ev1 && v !== ev2) {
|
|
71
|
-
return v;
|
|
72
|
-
}
|
|
73
|
-
loop = mesh.loop_read_next(loop);
|
|
74
|
-
} while (loop !== start);
|
|
75
|
-
|
|
76
|
-
return NULL_POINTER;
|
|
77
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Find the edge ID connecting two vertices in a BinaryTopology mesh, or
|
|
3
|
-
* NULL_POINTER if no such edge exists. Walks v1's disk cycle (typically very
|
|
4
|
-
* short for manifold meshes).
|
|
5
|
-
*
|
|
6
|
-
* @param {BinaryTopology} mesh
|
|
7
|
-
* @param {number} v1
|
|
8
|
-
* @param {number} v2
|
|
9
|
-
* @returns {number} edge ID or NULL_POINTER
|
|
10
|
-
*/
|
|
11
|
-
export function bt_find_edge_between(mesh: BinaryTopology, v1: number, v2: number): number;
|
|
12
|
-
//# sourceMappingURL=bt_find_edge_between.d.ts.map
|
package/src/shade/renderer/scene/optimization/geometry/internal/bt_find_edge_between.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bt_find_edge_between.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/scene/optimization/geometry/internal/bt_find_edge_between.js"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,+DAJW,MAAM,MACN,MAAM,GACJ,MAAM,CAwBlB"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { NULL_POINTER } from "../../../../../../core/geom/3d/topology/struct/binary/BinaryTopology.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Find the edge ID connecting two vertices in a BinaryTopology mesh, or
|
|
5
|
-
* NULL_POINTER if no such edge exists. Walks v1's disk cycle (typically very
|
|
6
|
-
* short for manifold meshes).
|
|
7
|
-
*
|
|
8
|
-
* @param {BinaryTopology} mesh
|
|
9
|
-
* @param {number} v1
|
|
10
|
-
* @param {number} v2
|
|
11
|
-
* @returns {number} edge ID or NULL_POINTER
|
|
12
|
-
*/
|
|
13
|
-
export function bt_find_edge_between(mesh, v1, v2) {
|
|
14
|
-
const start = mesh.vertex_read_edge(v1);
|
|
15
|
-
if (start === NULL_POINTER) {
|
|
16
|
-
return NULL_POINTER;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
let edge = start;
|
|
20
|
-
do {
|
|
21
|
-
const ev1 = mesh.edge_read_vertex1(edge);
|
|
22
|
-
const ev2 = mesh.edge_read_vertex2(edge);
|
|
23
|
-
|
|
24
|
-
const other = ev1 === v1 ? ev2 : ev1;
|
|
25
|
-
if (other === v2) {
|
|
26
|
-
return edge;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
edge = ev1 === v1
|
|
30
|
-
? mesh.edge_read_v1_disk_next(edge)
|
|
31
|
-
: mesh.edge_read_v2_disk_next(edge);
|
|
32
|
-
} while (edge !== start && edge !== NULL_POINTER);
|
|
33
|
-
|
|
34
|
-
return NULL_POINTER;
|
|
35
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"linear_to_pq.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/scene/serialization/linear_to_pq.js"],"names":[],"mappings":"AAAA,2CAaC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export function linearToPQ(x) {
|
|
2
|
-
|
|
3
|
-
// ─── PQ OETF (SMPTE ST 2084) ───────────────────────────────
|
|
4
|
-
// Input: linear light, normalized so 1.0 = 10000 nits
|
|
5
|
-
// Output: PQ signal in [0, 1]
|
|
6
|
-
const PQ_m1 = 0.1593017578125; // 2610 / 16384
|
|
7
|
-
const PQ_m2 = 78.84375; // 2523 / 32
|
|
8
|
-
const PQ_c1 = 0.8359375; // 3424 / 4096
|
|
9
|
-
const PQ_c2 = 18.8515625; // 2413 / 128
|
|
10
|
-
const PQ_c3 = 18.6875; // 2392 / 128
|
|
11
|
-
|
|
12
|
-
const xp = Math.pow(Math.max(x, 0), PQ_m1);
|
|
13
|
-
return Math.pow((PQ_c1 + PQ_c2 * xp) / (1.0 + PQ_c3 * xp), PQ_m2);
|
|
14
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Inverse PQ (ST 2084 EOTF): convert a PQ signal value back to linear light.
|
|
3
|
-
* Output is normalized so that 1.0 = SDR reference white (203 nits).
|
|
4
|
-
*
|
|
5
|
-
* @param {number} pq PQ signal in [0, 1]
|
|
6
|
-
* @returns {number} linear light (1.0 = SDR white)
|
|
7
|
-
*/
|
|
8
|
-
export function pqToLinear(pq: number): number;
|
|
9
|
-
//# sourceMappingURL=pq_to_linear.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pq_to_linear.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/scene/serialization/pq_to_linear.js"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH,+BAHW,MAAM,GACJ,MAAM,CAWlB"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const PQ_m1 = 0.1593017578125; // 2610 / 16384
|
|
2
|
-
const PQ_m2 = 78.84375; // 2523 / 32
|
|
3
|
-
const PQ_c1 = 0.8359375; // 3424 / 4096
|
|
4
|
-
const PQ_c2 = 18.8515625; // 2413 / 128
|
|
5
|
-
const PQ_c3 = 18.6875; // 2392 / 128
|
|
6
|
-
const SDR_WHITE_NITS = 203;
|
|
7
|
-
const PQ_MAX_NITS = 10000;
|
|
8
|
-
|
|
9
|
-
const PQ_NITS_RATIO = PQ_MAX_NITS / SDR_WHITE_NITS;
|
|
10
|
-
|
|
11
|
-
const PQ_m2_inv = 1.0 / PQ_m2;
|
|
12
|
-
const PQ_m1_inv = 1.0 / PQ_m1;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Inverse PQ (ST 2084 EOTF): convert a PQ signal value back to linear light.
|
|
16
|
-
* Output is normalized so that 1.0 = SDR reference white (203 nits).
|
|
17
|
-
*
|
|
18
|
-
* @param {number} pq PQ signal in [0, 1]
|
|
19
|
-
* @returns {number} linear light (1.0 = SDR white)
|
|
20
|
-
*/
|
|
21
|
-
export function pqToLinear(pq) {
|
|
22
|
-
const pqPow = Math.pow(pq, PQ_m2_inv);
|
|
23
|
-
const numerator = Math.max(pqPow - PQ_c1, 0);
|
|
24
|
-
const denominator = PQ_c2 - PQ_c3 * pqPow;
|
|
25
|
-
const linear_normalized = Math.pow(numerator / denominator, PQ_m1_inv);
|
|
26
|
-
|
|
27
|
-
// Undo the normalization: linear_normalized is in [0,1] where 1.0 = 10000 nits
|
|
28
|
-
// Engine convention: 1.0 = SDR white = 203 nits
|
|
29
|
-
return linear_normalized * PQ_NITS_RATIO;
|
|
30
|
-
}
|