@woosh/meep-engine 2.108.4 → 2.109.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/build/meep.cjs +73 -48
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +73 -48
- package/package.json +1 -1
- package/src/core/assert.d.ts +2 -2
- package/src/core/assert.d.ts.map +1 -1
- package/src/core/assert.js +1 -1
- package/src/core/binary/align_4.spec.d.ts +2 -0
- package/src/core/binary/align_4.spec.d.ts.map +1 -0
- package/src/core/binary/align_4.spec.js +20 -0
- package/src/core/binary/{de_interleave_bits_by_2.d.ts → de_interleave_2_bits.d.ts} +1 -1
- package/src/core/binary/de_interleave_2_bits.d.ts.map +1 -0
- package/src/core/binary/de_interleave_2_bits.spec.js +1 -1
- package/src/core/binary/hex2dec.spec.d.ts +2 -0
- package/src/core/binary/hex2dec.spec.d.ts.map +1 -0
- package/src/core/binary/hex2dec.spec.js +22 -0
- package/src/core/binary/split_by_2.spec.d.ts +2 -0
- package/src/core/binary/split_by_2.spec.d.ts.map +1 -0
- package/src/core/binary/split_by_2.spec.js +22 -0
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.d.ts +4 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js +16 -7
- package/src/core/bvh2/bvh3/ebvh_build_hierarchy.js +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray.js +12 -7
- package/src/core/geom/2d/circle/circle_circumference.d.ts +7 -0
- package/src/core/geom/2d/circle/circle_circumference.d.ts.map +1 -0
- package/src/core/geom/2d/circle/circle_circumference.js +12 -0
- package/src/core/geom/2d/compute_polygon_area_2d.d.ts.map +1 -1
- package/src/core/geom/2d/compute_polygon_area_2d.js +6 -4
- package/src/core/geom/2d/lt-grid/LooseTightGrid.js +1 -1
- package/src/core/geom/2d/triangle2d_get_barycentric.d.ts +2 -2
- package/src/core/geom/2d/triangle2d_get_barycentric.js +2 -2
- package/src/core/geom/3d/Ray3.d.ts +19 -0
- package/src/core/geom/3d/Ray3.d.ts.map +1 -0
- package/src/core/geom/3d/Ray3.js +27 -0
- package/src/core/geom/3d/ray/ray3_shift_origin_along_direction.d.ts +10 -0
- package/src/core/geom/3d/ray/ray3_shift_origin_along_direction.d.ts.map +1 -0
- package/src/core/geom/3d/ray/ray3_shift_origin_along_direction.js +35 -0
- package/src/core/geom/3d/sphere/harmonics/compute_legendre_polynomial.d.ts +1 -0
- package/src/core/geom/3d/sphere/harmonics/compute_legendre_polynomial.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/compute_legendre_polynomial.js +0 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_convolve_with_cosine_kernel.d.ts +9 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_convolve_with_cosine_kernel.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_convolve_with_cosine_kernel.js +25 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js +2 -4
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate_bl.d.ts +8 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate_bl.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate_bl.js +94 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate_filament.d.ts +8 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate_filament.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/{sh3_rotate.js → sh3_rotate_filament.js} +5 -2
- package/src/core/geom/3d/sphere/harmonics/sh_compute_K.d.ts +3 -3
- package/src/core/geom/3d/sphere/harmonics/sh_compute_K.js +3 -3
- package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.js +29 -14
- package/src/core/geom/Quaternion.js +1 -1
- package/src/core/geom/vec3/v3_matrix4_multiply.d.ts +10 -0
- package/src/core/geom/vec3/v3_matrix4_multiply.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_matrix4_multiply.js +27 -0
- package/src/core/geom/vec3/v3_shift_along_direction.d.ts +14 -0
- package/src/core/geom/vec3/v3_shift_along_direction.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_shift_along_direction.js +23 -0
- package/src/core/math/compute_legendre_polynomial.d.ts +10 -0
- package/src/core/math/compute_legendre_polynomial.d.ts.map +1 -0
- package/src/core/math/compute_legendre_polynomial.js +46 -0
- package/src/core/math/statistics/softmax.d.ts +11 -0
- package/src/core/math/statistics/softmax.d.ts.map +1 -0
- package/src/core/math/statistics/softmax.js +24 -0
- package/src/core/math/statistics/softmax.spec.d.ts +2 -0
- package/src/core/math/statistics/softmax.spec.d.ts.map +1 -0
- package/src/core/math/statistics/softmax.spec.js +9 -0
- package/src/engine/ecs/transform/Transform.d.ts.map +1 -1
- package/src/engine/ecs/transform/Transform.js +19 -4
- package/src/engine/graphics/ecs/camera/CameraSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/CameraSystem.js +25 -13
- package/src/engine/graphics/geometry/decode_attribute_value.d.ts +10 -0
- package/src/engine/graphics/geometry/decode_attribute_value.d.ts.map +1 -0
- package/src/engine/graphics/geometry/decode_attribute_value.js +28 -0
- package/src/engine/graphics/geometry/geometry_construct_triangle_normal.d.ts +11 -0
- package/src/engine/graphics/geometry/geometry_construct_triangle_normal.d.ts.map +1 -0
- package/src/engine/graphics/geometry/geometry_construct_triangle_normal.js +31 -0
- package/src/engine/graphics/sh3/lpv/LightProbeVolume.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/LightProbeVolume.js +0 -86
- package/src/engine/graphics/sh3/lpv/WebGLCubeProbeRenderer.d.ts +1 -0
- package/src/engine/graphics/sh3/lpv/WebGLCubeProbeRenderer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/WebGLCubeProbeRenderer.js +6 -2
- package/src/engine/graphics/sh3/path_tracer/{GeometryBVHBatched.d.ts → BufferedGeometryBVH.d.ts} +9 -2
- package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/{GeometryBVHBatched.js → BufferedGeometryBVH.js} +84 -5
- package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.d.ts +6 -4
- package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.js +54 -8
- package/src/engine/graphics/sh3/path_tracer/PathTracedScene.d.ts +6 -10
- package/src/engine/graphics/sh3/path_tracer/PathTracedScene.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/PathTracedScene.js +41 -47
- package/src/engine/graphics/sh3/path_tracer/material/MaterialConverter.d.ts +11 -0
- package/src/engine/graphics/sh3/path_tracer/material/MaterialConverter.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/material/MaterialConverter.js +102 -0
- package/src/engine/graphics/sh3/path_tracer/material/StandardMaterial.d.ts +9 -0
- package/src/engine/graphics/sh3/path_tracer/material/StandardMaterial.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/material/StandardMaterial.js +17 -0
- package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.d.ts +31 -0
- package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.js +85 -0
- package/src/engine/graphics/sh3/path_tracer/material/TextureFilter.d.ts +14 -0
- package/src/engine/graphics/sh3/path_tracer/material/TextureFilter.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/material/TextureFilter.js +17 -0
- package/src/engine/graphics/sh3/path_tracer/material/TextureWrapping.d.ts +7 -0
- package/src/engine/graphics/sh3/path_tracer/material/TextureWrapping.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/material/TextureWrapping.js +9 -0
- package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +104 -9
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.d.ts +1 -2
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.js +50 -23
- package/src/engine/graphics/sh3/prototypeSH3Probe.js +62 -28
- package/src/engine/graphics/texture/sampler/one_pixel_sampler_uint8.d.ts +8 -0
- package/src/engine/graphics/texture/sampler/one_pixel_sampler_uint8.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/one_pixel_sampler_uint8.js +10 -0
- package/src/engine/graphics/texture/sampler/sampler_multiply_vector.d.ts +8 -0
- package/src/engine/graphics/texture/sampler/sampler_multiply_vector.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/sampler_multiply_vector.js +23 -0
- package/src/core/binary/de_interleave_bits_by_2.d.ts.map +0 -1
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate.d.ts +0 -8
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate.d.ts.map +0 -1
- package/src/engine/graphics/sh3/path_tracer/GeometryBVHBatched.d.ts.map +0 -1
- /package/src/core/binary/{de_interleave_bits_by_2.js → de_interleave_2_bits.js} +0 -0
|
@@ -5,6 +5,7 @@ import { ResourceAccessKind } from "../../../../core/model/ResourceAccessKind.js
|
|
|
5
5
|
import { ResourceAccessSpecification } from "../../../../core/model/ResourceAccessSpecification.js";
|
|
6
6
|
import { System } from '../../../ecs/System.js';
|
|
7
7
|
import { Transform } from '../../../ecs/transform/Transform.js';
|
|
8
|
+
import { threeUpdateTransform } from "../../util/threeUpdateTransform.js";
|
|
8
9
|
import { auto_set_camera_clipping_planes } from "./auto_set_camera_clipping_planes.js";
|
|
9
10
|
import { build_three_camera_object } from "./build_three_camera_object.js";
|
|
10
11
|
import { Camera } from './Camera.js';
|
|
@@ -13,6 +14,29 @@ import { invertQuaternionOrientation } from "./InvertQuaternionOrientation.js";
|
|
|
13
14
|
import { set_camera_aspect_ratio } from "./set_camera_aspect_ratio.js";
|
|
14
15
|
import { update_camera_transform } from "./update_camera_transform.js";
|
|
15
16
|
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param {THREE.Camera} object
|
|
20
|
+
* @param {Quaternion} rotation
|
|
21
|
+
*/
|
|
22
|
+
export function three_camera_set_transform_rotation(object, rotation) {
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
NOTE: I'm not sure why, but three.js camera points in the opposite direction to normal objects
|
|
26
|
+
See: https://github.com/mrdoob/three.js/blob/412b99a7f26e117ea97f40eb53d010ab81aa3279/src/core/Object3D.js#L282
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
invertQuaternionOrientation(object.quaternion, rotation);
|
|
30
|
+
|
|
31
|
+
object.rotation.setFromQuaternion(object.quaternion);
|
|
32
|
+
|
|
33
|
+
// rotation.__setThreeEuler(camera.object.rotation); // seems unnecessary, based on Object3D.lookAt implementation
|
|
34
|
+
// camera.object.quaternion.set(rotation.x, rotation.y, rotation.z, rotation.w);
|
|
35
|
+
|
|
36
|
+
object.updateProjectionMatrix();
|
|
37
|
+
threeUpdateTransform(object);
|
|
38
|
+
}
|
|
39
|
+
|
|
16
40
|
export class CameraSystem extends System {
|
|
17
41
|
/**
|
|
18
42
|
*
|
|
@@ -104,19 +128,7 @@ export class CameraSystem extends System {
|
|
|
104
128
|
function synchronizeRotation() {
|
|
105
129
|
const rotation = transform.rotation;
|
|
106
130
|
|
|
107
|
-
|
|
108
|
-
NOTE: I'm not sure why, but three.js camera points in the opposite direction to normal objects
|
|
109
|
-
See: https://github.com/mrdoob/three.js/blob/412b99a7f26e117ea97f40eb53d010ab81aa3279/src/core/Object3D.js#L282
|
|
110
|
-
*/
|
|
111
|
-
|
|
112
|
-
invertQuaternionOrientation(camera.object.quaternion, rotation);
|
|
113
|
-
|
|
114
|
-
camera.object.rotation.setFromQuaternion(camera.object.quaternion);
|
|
115
|
-
|
|
116
|
-
// rotation.__setThreeEuler(camera.object.rotation); // seems unnecessary, based on Object3D.lookAt implementation
|
|
117
|
-
// camera.object.quaternion.set(rotation.x, rotation.y, rotation.z, rotation.w);
|
|
118
|
-
|
|
119
|
-
update_camera_transform(camera);
|
|
131
|
+
three_camera_set_transform_rotation(camera.object, rotation);
|
|
120
132
|
}
|
|
121
133
|
|
|
122
134
|
function rebuild() {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number} input
|
|
4
|
+
* @param {BinaryDataType} raw_type
|
|
5
|
+
* @param {boolean} normalized
|
|
6
|
+
* @returns {number}
|
|
7
|
+
*/
|
|
8
|
+
export function decode_attribute_value(input: number, raw_type: BinaryDataType, normalized: boolean): number;
|
|
9
|
+
import { BinaryDataType } from "../../../core/binary/type/BinaryDataType.js";
|
|
10
|
+
//# sourceMappingURL=decode_attribute_value.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode_attribute_value.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/geometry/decode_attribute_value.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,8CALW,MAAM,YACN,cAAc,cACd,OAAO,GACL,MAAM,CAkBlB;+BA3B8B,6CAA6C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BinaryDataType } from "../../../core/binary/type/BinaryDataType.js";
|
|
2
|
+
import { UINT16_MAX } from "../../../core/binary/UINT16_MAX.js";
|
|
3
|
+
import { UINT32_MAX } from "../../../core/binary/UINT32_MAX.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param {number} input
|
|
8
|
+
* @param {BinaryDataType} raw_type
|
|
9
|
+
* @param {boolean} normalized
|
|
10
|
+
* @returns {number}
|
|
11
|
+
*/
|
|
12
|
+
export function decode_attribute_value(input, raw_type, normalized) {
|
|
13
|
+
if (!normalized) {
|
|
14
|
+
return input;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
switch (raw_type) {
|
|
18
|
+
case BinaryDataType.Float32:
|
|
19
|
+
case BinaryDataType.Float64:
|
|
20
|
+
return input;
|
|
21
|
+
case BinaryDataType.Uint16:
|
|
22
|
+
return input / UINT16_MAX;
|
|
23
|
+
case BinaryDataType.Uint32:
|
|
24
|
+
return input / UINT32_MAX;
|
|
25
|
+
default:
|
|
26
|
+
throw new Error(`Unsupported data type ${raw_type}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number[]|Float32Array} out
|
|
4
|
+
* @param {number} out_offset
|
|
5
|
+
* @param {number} a
|
|
6
|
+
* @param {number} b
|
|
7
|
+
* @param {number} c
|
|
8
|
+
* @param {number[]|Float32Array} positions
|
|
9
|
+
*/
|
|
10
|
+
export function geometry_construct_triangle_normal(out: number[] | Float32Array, out_offset: number, a: number, b: number, c: number, positions: number[] | Float32Array): void;
|
|
11
|
+
//# sourceMappingURL=geometry_construct_triangle_normal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry_construct_triangle_normal.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/geometry/geometry_construct_triangle_normal.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wDAPW,MAAM,EAAE,GAAC,YAAY,cACrB,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,aACN,MAAM,EAAE,GAAC,YAAY,QAqB/B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { v3_compute_triangle_normal } from "../../../core/geom/3d/v3_compute_triangle_normal.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {number[]|Float32Array} out
|
|
6
|
+
* @param {number} out_offset
|
|
7
|
+
* @param {number} a
|
|
8
|
+
* @param {number} b
|
|
9
|
+
* @param {number} c
|
|
10
|
+
* @param {number[]|Float32Array} positions
|
|
11
|
+
*/
|
|
12
|
+
export function geometry_construct_triangle_normal(out, out_offset, a, b, c, positions) {
|
|
13
|
+
|
|
14
|
+
const a_address = a * 3;
|
|
15
|
+
const b_address = b * 3;
|
|
16
|
+
const c_address = c * 3;
|
|
17
|
+
|
|
18
|
+
const ax = positions[a_address];
|
|
19
|
+
const ay = positions[a_address + 1];
|
|
20
|
+
const az = positions[a_address + 2];
|
|
21
|
+
|
|
22
|
+
const bx = positions[b_address];
|
|
23
|
+
const by = positions[b_address + 1];
|
|
24
|
+
const bz = positions[b_address + 2];
|
|
25
|
+
|
|
26
|
+
const cx = positions[c_address];
|
|
27
|
+
const cy = positions[c_address + 1];
|
|
28
|
+
const cz = positions[c_address + 2];
|
|
29
|
+
|
|
30
|
+
v3_compute_triangle_normal(out, out_offset, ax, ay, az, bx, by, bz, cx, cy, cz);
|
|
31
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LightProbeVolume.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/lpv/LightProbeVolume.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LightProbeVolume.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/lpv/LightProbeVolume.js"],"names":[],"mappings":"AA4DA;IAGI,sBAEC;IAGG,mBAAqB;IAErB,wBAAmC;IAEnC,oBAAsB;IAEtB,iBAAiB;IAGrB,cAQC;IAED;;;OAGG;IACH,4BAEC;IAED,oBAEC;IAED,uBAEC;IAMD,uBAEC;IAND,oBAEC;IAMD;;;;;OAKG;IACH,aAJW,MAAM,KACN,MAAM,KACN,MAAM,QAchB;IAED;;;;;OAKG;IACH,mBAJW,MAAM,UACN,MAAM,EAAE,iBACR,MAAM,QAIhB;IAED;;OAEG;IACH,mBAaC;IAGD;;;;OAIG;IACH,mCAHa,SAAS,CA8CrB;IAED;;;;;OAKG;IACH,sEAWC;IAED;;;;;OAKG;IACH,sEAkBC;IAED;;;;OAIG;IACH,oCAFa,SAAS,CAKrB;;CACJ;gCAhQ+B,wDAAwD;sBAClE,4CAA4C"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LineBasicMaterial } from "three";
|
|
2
2
|
import { array_copy } from "../../../../core/collection/array/array_copy.js";
|
|
3
|
-
import { SurfacePoint3 } from "../../../../core/geom/3d/SurfacePoint3.js";
|
|
4
3
|
import {
|
|
5
4
|
build_tetrahedral_mesh_buffer_geometry
|
|
6
5
|
} from "../../../../core/geom/3d/tetrahedra/build_tetrahedral_mesh_buffer_geometry.js";
|
|
@@ -20,99 +19,14 @@ import { ShadedGeometryFlags } from "../../ecs/mesh-v2/ShadedGeometryFlags.js";
|
|
|
20
19
|
import { visualise_spherical_harmonic_sphere } from "../visualise_spherical_harmonic_sphere.js";
|
|
21
20
|
import { PathTracerProbeRenderer } from "./PathTracerProbeRenderer.js";
|
|
22
21
|
|
|
23
|
-
const TEMP_CONTACT = new SurfacePoint3();
|
|
24
|
-
|
|
25
22
|
|
|
26
23
|
class Baker {
|
|
27
24
|
constructor() {
|
|
28
|
-
/**
|
|
29
|
-
*
|
|
30
|
-
* @type {EntityComponentDataset|null}
|
|
31
|
-
* @private
|
|
32
|
-
*/
|
|
33
|
-
this.__ecd = null;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
* @type {BVH|null}
|
|
38
|
-
* @private
|
|
39
|
-
*/
|
|
40
|
-
this.__bvh = null;
|
|
41
|
-
|
|
42
|
-
this.__min_bounce_count = 3;
|
|
43
|
-
this.__max_bounce_count = 100;
|
|
44
25
|
|
|
45
26
|
// this._ren = new WebGLCubeProbeRenderer();
|
|
46
27
|
this._ren = new PathTracerProbeRenderer();
|
|
47
28
|
}
|
|
48
29
|
|
|
49
|
-
/**
|
|
50
|
-
* @param {BVH} bvh
|
|
51
|
-
*/
|
|
52
|
-
set_bvh(bvh) {
|
|
53
|
-
this.__bvh = bvh;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
build_spatial() {
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
*
|
|
62
|
-
* @param {number[]} irradiance RGB irradiance result is written here
|
|
63
|
-
* @param {number} bounce_count number of reflections before this trace
|
|
64
|
-
* @param {number} origin_x
|
|
65
|
-
* @param {number} origin_y
|
|
66
|
-
* @param {number} origin_z
|
|
67
|
-
* @param {number} direction_x
|
|
68
|
-
* @param {number} direction_y
|
|
69
|
-
* @param {number} direction_z
|
|
70
|
-
*/
|
|
71
|
-
trace_ray(irradiance, bounce_count,
|
|
72
|
-
origin_x, origin_y, origin_z,
|
|
73
|
-
direction_x, direction_y, direction_z) {
|
|
74
|
-
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
if (!this.ray_cast(TEMP_CONTACT, origin_x, origin_y, origin_z, direction_x, direction_y, direction_z)) {
|
|
78
|
-
// no hit, assume irradiance is zeroed - black
|
|
79
|
-
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// record irradiance
|
|
84
|
-
|
|
85
|
-
// reflect ray around normal
|
|
86
|
-
// TODO apply BDRF to compute reflected ray
|
|
87
|
-
|
|
88
|
-
if (bounce_count > this.__max_bounce_count) {
|
|
89
|
-
// terminate
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
*
|
|
96
|
-
* @param contact
|
|
97
|
-
* @param origin_x
|
|
98
|
-
* @param origin_y
|
|
99
|
-
* @param origin_z
|
|
100
|
-
* @param direction_x
|
|
101
|
-
* @param direction_y
|
|
102
|
-
* @param direction_z
|
|
103
|
-
* @returns {boolean}
|
|
104
|
-
*/
|
|
105
|
-
ray_cast(contact,
|
|
106
|
-
origin_x, origin_y, origin_z,
|
|
107
|
-
direction_x, direction_y, direction_z
|
|
108
|
-
) {
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
prepare_scene() {
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
30
|
/**
|
|
117
31
|
*
|
|
118
32
|
* @param {number[]} position
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebGLCubeProbeRenderer.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/lpv/WebGLCubeProbeRenderer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WebGLCubeProbeRenderer.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/lpv/WebGLCubeProbeRenderer.js"],"names":[],"mappings":"AAwBA;IACI,iCA0CC;IApCG;;;;OAIG;IACH,mBAAsB;IAEtB,qCASE;IAEF;;;;OAIG;IACH,wBAA8F;IAG9F,0BAAiE;IAEjE;;;;OAIG;IACH,gBAA0B;IA8C9B,mBAMC;CA6CJ;8BA3I6B,oBAAoB;sCAb3C,OAAO;2BAAP,OAAO"}
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
VSMShadowMap,
|
|
9
9
|
WebGLCubeRenderTarget
|
|
10
10
|
} from "three";
|
|
11
|
+
import { assert } from "../../../../core/assert.js";
|
|
11
12
|
import { array_copy } from "../../../../core/collection/array/array_copy.js";
|
|
12
13
|
import { Transform } from "../../../ecs/transform/Transform.js";
|
|
13
14
|
import { three_set_shadow_resolution } from "../../ecs/light/binding/three/ThreeLightBinding.js";
|
|
@@ -22,9 +23,12 @@ import { fromCubeRenderTarget } from "../fromCubeRenderTarget.js";
|
|
|
22
23
|
import { ProbeRenderer } from "./ProbeRenderer.js";
|
|
23
24
|
|
|
24
25
|
export class WebGLCubeProbeRenderer extends ProbeRenderer {
|
|
25
|
-
constructor() {
|
|
26
|
+
constructor(resolution = 32) {
|
|
26
27
|
|
|
27
28
|
super();
|
|
29
|
+
|
|
30
|
+
assert.isNonNegativeInteger(resolution, 'resolution');
|
|
31
|
+
|
|
28
32
|
/**
|
|
29
33
|
*
|
|
30
34
|
* @type {THREE.WebGLRenderer|null}
|
|
@@ -32,7 +36,7 @@ export class WebGLCubeProbeRenderer extends ProbeRenderer {
|
|
|
32
36
|
*/
|
|
33
37
|
this.__renderer = null;
|
|
34
38
|
|
|
35
|
-
this.render_target = new WebGLCubeRenderTarget(
|
|
39
|
+
this.render_target = new WebGLCubeRenderTarget(resolution, {
|
|
36
40
|
format: RGBAFormat,
|
|
37
41
|
minFilter: LinearFilter,
|
|
38
42
|
magFilter: LinearFilter,
|
package/src/engine/graphics/sh3/path_tracer/{GeometryBVHBatched.d.ts → BufferedGeometryBVH.d.ts}
RENAMED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
export class
|
|
1
|
+
export class BufferedGeometryBVH {
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param {AABB3|number[]} out
|
|
5
|
+
*/
|
|
6
|
+
getBounds(out: AABB3 | number[]): void;
|
|
2
7
|
/**
|
|
3
8
|
*
|
|
4
9
|
* @type {BVH}
|
|
@@ -43,5 +48,7 @@ export class GeometryBVHBatched {
|
|
|
43
48
|
* @returns {number} distance along the ray, negative if no hit
|
|
44
49
|
*/
|
|
45
50
|
raycast(output: number[], ray: number[], min_distance: number, max_distance: number): number;
|
|
51
|
+
#private;
|
|
46
52
|
}
|
|
47
|
-
|
|
53
|
+
import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
|
|
54
|
+
//# sourceMappingURL=BufferedGeometryBVH.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BufferedGeometryBVH.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.js"],"names":[],"mappings":"AA8IA;IAQI;;;OAGG;IACH,eAFW,KAAK,GAAC,MAAM,EAAE,QAIxB;IAGG;;;;OAIG;IACH,cAAsB;IAEtB;;;;OAIG;IACH,mBAAsB;IAEtB;;;;OAIG;IACH,yBAA4B;IAE5B;;;;OAIG;IACH,6BAAgC;IAGhC;;;;OAIG;IACH,yBAAyB;IAG7B;;;OAGG;IACH,gBAFW,MAAM,cAAc,QAiC9B;IAGD;;;;;;;OAOG;IACH,gBANW,MAAM,EAAE,OACR,MAAM,EAAE,gBACR,MAAM,gBACN,MAAM,GACJ,MAAM,CA8ElB;;CACJ;sBAzTqB,wCAAwC"}
|
package/src/engine/graphics/sh3/path_tracer/{GeometryBVHBatched.js → BufferedGeometryBVH.js}
RENAMED
|
@@ -1,22 +1,72 @@
|
|
|
1
|
+
import { split_by_3 } from "../../../../core/binary/split_by_3.js";
|
|
1
2
|
import { BVH } from "../../../../core/bvh2/bvh3/BVH.js";
|
|
2
3
|
import { ebvh_build_for_geometry_morton } from "../../../../core/bvh2/bvh3/ebvh_build_for_geometry_morton.js";
|
|
3
4
|
import { bvh_query_user_data_ray } from "../../../../core/bvh2/bvh3/query/bvh_query_user_data_ray.js";
|
|
5
|
+
import { array_copy } from "../../../../core/collection/array/array_copy.js";
|
|
6
|
+
import { array_quick_sort_by_comparator } from "../../../../core/collection/array/array_quick_sort_by_comparator.js";
|
|
7
|
+
import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
|
|
4
8
|
|
|
5
9
|
import {
|
|
6
10
|
computeTriangleRayIntersectionBarycentricGeometry
|
|
7
11
|
} from "../../../../core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricGeometry.js";
|
|
12
|
+
import { v3_distance_sqr } from "../../../../core/geom/vec3/v3_distance_sqr.js";
|
|
8
13
|
|
|
9
14
|
/**
|
|
10
15
|
*
|
|
11
|
-
* @type {number[]}
|
|
16
|
+
* @type {number[]|Uint32Array}
|
|
12
17
|
*/
|
|
13
|
-
const scratch_uint32_array =
|
|
18
|
+
const scratch_uint32_array = new Uint32Array(4096);
|
|
14
19
|
/**
|
|
15
20
|
*
|
|
16
21
|
* @type {number[]}
|
|
17
22
|
*/
|
|
18
23
|
const v3_scratch_0 = [];
|
|
19
24
|
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param {number[]} triangles
|
|
28
|
+
* @param {number} offset
|
|
29
|
+
* @param {number} count
|
|
30
|
+
* @param {number} point_x
|
|
31
|
+
* @param {number} point_y
|
|
32
|
+
* @param {number} point_z
|
|
33
|
+
* @param morton_codes
|
|
34
|
+
* @param bounds
|
|
35
|
+
*/
|
|
36
|
+
function sort_triangles_by_distance_to_point(
|
|
37
|
+
triangles, offset, count,
|
|
38
|
+
morton_codes, bounds,
|
|
39
|
+
point_x, point_y, point_z,
|
|
40
|
+
) {
|
|
41
|
+
const bounds_x0 = bounds.x0;
|
|
42
|
+
const bounds_y0 = bounds.y0;
|
|
43
|
+
const bounds_z0 = bounds.z0;
|
|
44
|
+
|
|
45
|
+
const bounds_scale_x = bounds.getExtentsX() / 1023;
|
|
46
|
+
const bounds_scale_y = bounds.getExtentsY() / 1023;
|
|
47
|
+
const bounds_scale_z = bounds.getExtentsZ() / 1023;
|
|
48
|
+
|
|
49
|
+
array_quick_sort_by_comparator(scratch_uint32_array, (a, b) => {
|
|
50
|
+
|
|
51
|
+
const morton_a = morton_codes[a];
|
|
52
|
+
const morton_b = morton_codes[b];
|
|
53
|
+
|
|
54
|
+
const ax = bounds_x0 + bounds_scale_x * split_by_3(morton_a);
|
|
55
|
+
const ay = bounds_y0 + bounds_scale_y * split_by_3(morton_a >>> 1);
|
|
56
|
+
const az = bounds_z0 + bounds_scale_z * split_by_3(morton_a >>> 2);
|
|
57
|
+
|
|
58
|
+
const bx = bounds_x0 + bounds_scale_x * split_by_3(morton_b);
|
|
59
|
+
const by = bounds_y0 + bounds_scale_y * split_by_3(morton_b >>> 1);
|
|
60
|
+
const bz = bounds_z0 + bounds_scale_z * split_by_3(morton_b >>> 2);
|
|
61
|
+
|
|
62
|
+
const delta_a = v3_distance_sqr(ax, ay, az, point_x, point_y, point_z);
|
|
63
|
+
const delta_b = v3_distance_sqr(bx, by, bz, point_x, point_y, point_z);
|
|
64
|
+
|
|
65
|
+
return delta_b - delta_a;
|
|
66
|
+
}, undefined, offset, count - 1);
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
|
|
20
70
|
/**
|
|
21
71
|
*
|
|
22
72
|
* @param {number[]} output
|
|
@@ -90,7 +140,22 @@ function construct_ray_hit(
|
|
|
90
140
|
output[9] = face_index;
|
|
91
141
|
}
|
|
92
142
|
|
|
93
|
-
export class
|
|
143
|
+
export class BufferedGeometryBVH {
|
|
144
|
+
/**
|
|
145
|
+
* @type {Uint32Array}
|
|
146
|
+
*/
|
|
147
|
+
#morton_codes
|
|
148
|
+
|
|
149
|
+
#bounds = new AABB3()
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
*
|
|
153
|
+
* @param {AABB3|number[]} out
|
|
154
|
+
*/
|
|
155
|
+
getBounds(out) {
|
|
156
|
+
array_copy(this.#bounds, 0, out, 0, 6);
|
|
157
|
+
}
|
|
158
|
+
|
|
94
159
|
constructor() {
|
|
95
160
|
/**
|
|
96
161
|
*
|
|
@@ -148,9 +213,17 @@ export class GeometryBVHBatched {
|
|
|
148
213
|
|
|
149
214
|
this.__triangle_count = index_array.length / 3;
|
|
150
215
|
|
|
216
|
+
this.#morton_codes = new Uint32Array(this.__triangle_count);
|
|
217
|
+
|
|
151
218
|
const bvh = this.__bvh;
|
|
152
219
|
|
|
153
|
-
ebvh_build_for_geometry_morton(
|
|
220
|
+
ebvh_build_for_geometry_morton(
|
|
221
|
+
bvh,
|
|
222
|
+
index_array,
|
|
223
|
+
array_positions,
|
|
224
|
+
this.#morton_codes,
|
|
225
|
+
this.#bounds
|
|
226
|
+
);
|
|
154
227
|
//
|
|
155
228
|
// ebvh_build_for_geometry_incremental(bvh, index_array, array_positions, 1);
|
|
156
229
|
|
|
@@ -201,6 +274,13 @@ export class GeometryBVHBatched {
|
|
|
201
274
|
let best_u = 0;
|
|
202
275
|
let best_v = 0;
|
|
203
276
|
|
|
277
|
+
// sort triangles by distance to origin
|
|
278
|
+
if (count > 64) {
|
|
279
|
+
// encode
|
|
280
|
+
sort_triangles_by_distance_to_point(scratch_uint32_array, 0, count, this.#morton_codes, this.#bounds, origin_x, origin_y, origin_z);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
|
|
204
284
|
// check triangles found via BVH
|
|
205
285
|
for (let i = 0; i < count; i++) {
|
|
206
286
|
const triangle_index = scratch_uint32_array[i];
|
|
@@ -225,7 +305,6 @@ export class GeometryBVHBatched {
|
|
|
225
305
|
best_index = triangle_index;
|
|
226
306
|
best_u = v3_scratch_0[1];
|
|
227
307
|
best_v = v3_scratch_0[2];
|
|
228
|
-
|
|
229
308
|
}
|
|
230
309
|
}
|
|
231
310
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export class PathTracedMesh {
|
|
2
|
+
aabb: AABB3;
|
|
2
3
|
/**
|
|
3
4
|
*
|
|
4
|
-
* @type {
|
|
5
|
+
* @type {BufferedGeometryBVH|null}
|
|
5
6
|
*/
|
|
6
|
-
geo_bvh:
|
|
7
|
+
geo_bvh: BufferedGeometryBVH | null;
|
|
7
8
|
/**
|
|
8
9
|
*
|
|
9
10
|
* @type {THREE.BufferGeometry|null}
|
|
@@ -11,9 +12,9 @@ export class PathTracedMesh {
|
|
|
11
12
|
geometry: THREE.BufferGeometry | null;
|
|
12
13
|
/**
|
|
13
14
|
*
|
|
14
|
-
* @type {
|
|
15
|
+
* @type {StandardMaterial|null}
|
|
15
16
|
*/
|
|
16
|
-
material:
|
|
17
|
+
material: StandardMaterial | null;
|
|
17
18
|
__transform_inverse: Float32Array;
|
|
18
19
|
__transform: Float32Array;
|
|
19
20
|
__local_scale_inverse: number;
|
|
@@ -34,4 +35,5 @@ export class PathTracedMesh {
|
|
|
34
35
|
*/
|
|
35
36
|
hit(out: number[], ray: number[], min_distance: number, max_distance: number): number;
|
|
36
37
|
}
|
|
38
|
+
import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
|
|
37
39
|
//# sourceMappingURL=PathTracedMesh.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathTracedMesh.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/PathTracedMesh.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PathTracedMesh.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/PathTracedMesh.js"],"names":[],"mappings":"AAcA;IACI,YAAmB;IAIf;;;OAGG;IACH,SAFU,sBAAoB,IAAI,CAEf;IAEnB;;;OAGG;IACH,UAFU,MAAM,cAAc,GAAC,IAAI,CAEf;IAEpB;;;OAGG;IACH,UAFU,mBAAiB,IAAI,CAEX;IAIpB,kCAA0D;IAC1D,0BAAuD;IACvD,8BAA8B;IAE9B;;;OAGG;IACH,IAFU,MAAM,CAEW;IAG/B,iCAgBC;IAED,8BAEC;IAED;;;;;;;OAOG;IACH,SANW,MAAM,EAAE,OACR,MAAM,EAAE,gBACR,MAAM,gBACN,MAAM,GACJ,MAAM,CAuDlB;CACJ;sBApIqB,wCAAwC"}
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import { array_copy } from "../../../../core/collection/array/array_copy.js";
|
|
2
1
|
import { mat4 } from "gl-matrix";
|
|
2
|
+
import { array_copy } from "../../../../core/collection/array/array_copy.js";
|
|
3
|
+
import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
|
|
3
4
|
import { ray3_array_apply_matrix4 } from "../../../../core/geom/3d/ray/ray3_array_apply_matrix4.js";
|
|
5
|
+
import { ray3_shift_origin_along_direction } from "../../../../core/geom/3d/ray/ray3_shift_origin_along_direction.js";
|
|
6
|
+
import { v3_distance } from "../../../../core/geom/vec3/v3_distance.js";
|
|
7
|
+
import { v3_matrix4_multiply } from "../../../../core/geom/vec3/v3_matrix4_multiply.js";
|
|
8
|
+
import { v3_shift_along_direction } from "../../../../core/geom/vec3/v3_shift_along_direction.js";
|
|
4
9
|
import { ray_hit_apply_transform } from "./ray_hit_apply_transform.js";
|
|
5
10
|
|
|
6
11
|
const local_ray = new Float32Array(6);
|
|
12
|
+
const scratch_v3 = new Float32Array(3);
|
|
7
13
|
let mesh_id_counter = 0;
|
|
8
14
|
|
|
9
15
|
export class PathTracedMesh {
|
|
16
|
+
aabb = new AABB3();
|
|
17
|
+
|
|
10
18
|
constructor() {
|
|
11
19
|
|
|
12
20
|
/**
|
|
13
21
|
*
|
|
14
|
-
* @type {
|
|
22
|
+
* @type {BufferedGeometryBVH|null}
|
|
15
23
|
*/
|
|
16
24
|
this.geo_bvh = null;
|
|
17
25
|
|
|
@@ -23,7 +31,7 @@ export class PathTracedMesh {
|
|
|
23
31
|
|
|
24
32
|
/**
|
|
25
33
|
*
|
|
26
|
-
* @type {
|
|
34
|
+
* @type {StandardMaterial|null}
|
|
27
35
|
*/
|
|
28
36
|
this.material = null;
|
|
29
37
|
|
|
@@ -51,7 +59,11 @@ export class PathTracedMesh {
|
|
|
51
59
|
const scale_y = Math.hypot(m4[4], m4[5], m4[6]);
|
|
52
60
|
const scale_z = Math.hypot(m4[8], m4[9], m4[10]);
|
|
53
61
|
|
|
54
|
-
this.__local_scale_inverse = Math.
|
|
62
|
+
this.__local_scale_inverse = Math.max(scale_x, scale_y, scale_z);
|
|
63
|
+
|
|
64
|
+
// get bounds
|
|
65
|
+
this.geo_bvh.getBounds(this.aabb);
|
|
66
|
+
this.aabb.applyMatrix4(m);
|
|
55
67
|
}
|
|
56
68
|
|
|
57
69
|
get transform() {
|
|
@@ -69,11 +81,37 @@ export class PathTracedMesh {
|
|
|
69
81
|
hit(out, ray, min_distance, max_distance) {
|
|
70
82
|
//transform ray
|
|
71
83
|
const m4 = this.__transform_inverse;
|
|
72
|
-
ray3_array_apply_matrix4(local_ray,0, ray,0, m4);
|
|
73
84
|
|
|
74
|
-
const scale_d = this.__local_scale_inverse;
|
|
75
85
|
|
|
76
|
-
|
|
86
|
+
// shift ray forward by "min distance"
|
|
87
|
+
ray3_shift_origin_along_direction(local_ray, 0, ray, 0, min_distance);
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
ray3_array_apply_matrix4(local_ray, 0, local_ray, 0, m4);
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
let max_distance_local = Infinity;
|
|
94
|
+
|
|
95
|
+
if (max_distance !== Infinity) {
|
|
96
|
+
// compute position of point at max_distance along the ray
|
|
97
|
+
v3_shift_along_direction(
|
|
98
|
+
scratch_v3, 0,
|
|
99
|
+
ray[0], ray[1], ray[2],
|
|
100
|
+
ray[3], ray[4], ray[5],
|
|
101
|
+
max_distance
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
// move far point into local coordinate space
|
|
105
|
+
v3_matrix4_multiply(scratch_v3, 0, scratch_v3, 0, m4);
|
|
106
|
+
|
|
107
|
+
// compute far distance in local space
|
|
108
|
+
max_distance_local = v3_distance(
|
|
109
|
+
local_ray[0], local_ray[1], local_ray[2],
|
|
110
|
+
scratch_v3[0], scratch_v3[1], scratch_v3[2]
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
let distance_to_hit = this.geo_bvh.raycast(out, local_ray, 0, max_distance_local);
|
|
77
115
|
|
|
78
116
|
if (distance_to_hit >= 0) {
|
|
79
117
|
// transform output
|
|
@@ -81,9 +119,17 @@ export class PathTracedMesh {
|
|
|
81
119
|
|
|
82
120
|
out[10] = this.id;
|
|
83
121
|
|
|
84
|
-
distance_to_hit
|
|
122
|
+
distance_to_hit = v3_distance(
|
|
123
|
+
ray[0], ray[1], ray[2],
|
|
124
|
+
out[0], out[1], out[2]
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
if (distance_to_hit > max_distance) {
|
|
128
|
+
return -1;
|
|
129
|
+
}
|
|
85
130
|
}
|
|
86
131
|
|
|
132
|
+
|
|
87
133
|
return distance_to_hit;
|
|
88
134
|
}
|
|
89
135
|
}
|
|
@@ -16,14 +16,9 @@ export class PathTracedScene {
|
|
|
16
16
|
__lights: AbstractLight[];
|
|
17
17
|
/**
|
|
18
18
|
*
|
|
19
|
-
* @type {Map<THREE.BufferGeometry,
|
|
19
|
+
* @type {Map<THREE.BufferGeometry, BufferedGeometryBVH>}
|
|
20
20
|
*/
|
|
21
|
-
geo_cache: Map<THREE.BufferGeometry,
|
|
22
|
-
/**
|
|
23
|
-
* Maps {@link Texture.id} to relevant sampler
|
|
24
|
-
* @type {Map<number, Sampler2D>}
|
|
25
|
-
*/
|
|
26
|
-
textures: Map<number, Sampler2D>;
|
|
21
|
+
geo_cache: Map<THREE.BufferGeometry, BufferedGeometryBVH>;
|
|
27
22
|
/**
|
|
28
23
|
*
|
|
29
24
|
* @type {function}
|
|
@@ -35,9 +30,9 @@ export class PathTracedScene {
|
|
|
35
30
|
/**
|
|
36
31
|
*
|
|
37
32
|
* @param {THREE.BufferGeometry} geo
|
|
38
|
-
* @return {
|
|
33
|
+
* @return {BufferedGeometryBVH}
|
|
39
34
|
*/
|
|
40
|
-
obtainGeometryBVH(geo: THREE.BufferGeometry):
|
|
35
|
+
obtainGeometryBVH(geo: THREE.BufferGeometry): BufferedGeometryBVH;
|
|
41
36
|
/**
|
|
42
37
|
*
|
|
43
38
|
* @param {AbstractLight} light
|
|
@@ -82,9 +77,10 @@ export class PathTracedScene {
|
|
|
82
77
|
* @returns {boolean}
|
|
83
78
|
*/
|
|
84
79
|
sample_lights(out: number[], out_offset: number, ray: number[], ray_address: number): boolean;
|
|
80
|
+
#private;
|
|
85
81
|
}
|
|
86
82
|
import { BVH } from "../../../../core/bvh2/bvh3/BVH.js";
|
|
87
83
|
import { PathTracedMesh } from "./PathTracedMesh.js";
|
|
88
84
|
import { AbstractLight } from "../../render/forward_plus/model/AbstractLight.js";
|
|
89
|
-
import {
|
|
85
|
+
import { BufferedGeometryBVH } from "./BufferedGeometryBVH.js";
|
|
90
86
|
//# sourceMappingURL=PathTracedScene.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathTracedScene.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/PathTracedScene.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PathTracedScene.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/PathTracedScene.js"],"names":[],"mappings":"AA8BA;IAGI;;;OAGG;IACH,eAFU,GAAG,CAEa;IAE1B;;;OAGG;IACH,QAFU,IAAI,MAAM,EAAE,cAAc,CAAC,CAElB;IAEnB;;;OAGG;IACH,UAFU,aAAa,EAAE,CAEX;IAEd;;;OAGG;IACH,WAFU,IAAI,MAAM,cAAc,EAAE,mBAAmB,CAAC,CAElC;IAatB;;;;OAIG;IACH,6BAA6C;IAE7C,iBAGC;IAED,uBAMC;IAED;;;;OAIG;IACH,uBAHW,MAAM,cAAc,GACnB,mBAAmB,CAmB9B;IAED;;;OAGG;IACH,gBAFW,aAAa,QAMvB;IAED;;;;;OAKG;IACH,aAJW,MAAM,cAAc,YACpB,MAAM,QAAQ,aACd,OAAK,MAAM,EAAE,QA8CvB;IAED;;;;OAIG;IACH,qBAHW,MAAM,EAAE,OACR,MAAM,EAAE,QAyBlB;IAED;;;;;;;OAOG;IACH,WANW,MAAM,EAAE,OACR,MAAM,EAAE,gBACR,MAAM,gBACN,MAAM,GACL,MAAM,CAqDjB;IAED;;;;;;OAMG;IACH,uBALW,MAAM,EAAE,cACR,MAAM,aACN,MAAM,EAAE,oBACR,MAAM,QAIhB;IAED;;;;;;;OAOG;IACH,mBANW,MAAM,EAAE,cACR,MAAM,OACN,MAAM,EAAE,eACR,MAAM,GACJ,OAAO,CAmEnB;;CACJ;oBA7VmB,mCAAmC;+BAkBxB,qBAAqB;8BALtB,kDAAkD;oCAE5C,0BAA0B"}
|