@woosh/meep-engine 2.107.0 → 2.108.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/bundle-worker-image-decoder.js +1 -1
- package/build/meep.cjs +78 -46
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +78 -47
- package/package.json +1 -1
- package/src/core/binary/int32_to_binary_string.d.ts +3 -2
- package/src/core/binary/int32_to_binary_string.d.ts.map +1 -1
- package/src/core/binary/int32_to_binary_string.js +18 -14
- package/src/core/binary/split_by_3.spec.d.ts +2 -0
- package/src/core/binary/split_by_3.spec.d.ts.map +1 -0
- package/src/core/binary/split_by_3.spec.js +22 -0
- package/src/core/binary/to_half_float_uint16.d.ts.map +1 -1
- package/src/core/binary/to_half_float_uint16.js +7 -5
- package/src/core/collection/array/isArrayEqualStrict.d.ts.map +1 -1
- package/src/core/collection/array/isArrayEqualStrict.js +2 -2
- package/src/core/color/Color.d.ts.map +1 -1
- package/src/core/color/Color.js +7 -2
- package/src/core/color/hsv/rgb2hsv.d.ts +3 -3
- package/src/core/color/hsv/rgb2hsv.d.ts.map +1 -1
- package/src/core/color/hsv/rgb2hsv.js +11 -18
- package/src/core/color/rgb_to_luminance.d.ts +9 -0
- package/src/core/color/rgb_to_luminance.d.ts.map +1 -0
- package/src/core/color/rgb_to_luminance.js +10 -0
- package/src/core/geom/3d/sphere/harmonics/README.md +16 -2
- package/src/core/geom/3d/sphere/harmonics/SH3_COEFFICIENTS.d.ts +6 -0
- package/src/core/geom/3d/sphere/harmonics/SH3_COEFFICIENTS.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/SH3_COEFFICIENTS.js +15 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_basis_at.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/harmonics/sh3_basis_at.js +21 -9
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.d.ts +3 -3
- 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 +35 -206
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate.d.ts +8 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate.js +29 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_sample_by_direction.js +10 -10
- package/src/core/geom/3d/sphere/harmonics/sh_index.d.ts +8 -0
- package/src/core/geom/3d/sphere/harmonics/sh_index.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/sh_index.js +9 -0
- package/src/core/geom/3d/sphere/harmonics/sh_rotate_band1.d.ts +8 -0
- package/src/core/geom/3d/sphere/harmonics/sh_rotate_band1.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/sh_rotate_band1.js +44 -0
- package/src/core/geom/3d/sphere/harmonics/sh_rotate_band2.d.ts +8 -0
- package/src/core/geom/3d/sphere/harmonics/sh_rotate_band2.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/sh_rotate_band2.js +86 -0
- package/src/core/geom/3d/sphere/in_sphere3d_robust.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/in_sphere3d_robust.js +2 -1
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.d.ts +20 -1
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +53 -7
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.spec.js +2 -2
- package/src/core/geom/3d/tetrahedra/build_tetrahedral_mesh_buffer_geometry.d.ts +1 -1
- package/src/core/geom/3d/tetrahedra/build_tetrahedral_mesh_buffer_geometry.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/build_tetrahedral_mesh_buffer_geometry.js +12 -7
- package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.d.ts +13 -0
- package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.js +135 -0
- package/src/core/geom/3d/tetrahedra/prototypeTetrahedraBuilder.js +38 -24
- package/src/core/geom/3d/tetrahedra/{compute_circumsphere.d.ts → tetrahedron_compute_circumsphere.d.ts} +3 -5
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/{compute_circumsphere.js → tetrahedron_compute_circumsphere.js} +2 -4
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.js +3 -1
- package/src/core/geom/Vector3.d.ts.map +1 -1
- package/src/core/geom/Vector3.js +1 -0
- package/src/core/geom/mat3/m3_multiply_vec3.d.ts +8 -0
- package/src/core/geom/mat3/m3_multiply_vec3.d.ts.map +1 -0
- package/src/core/geom/mat3/m3_multiply_vec3.js +21 -0
- package/src/core/geom/vec2/v2_cross_product.d.ts +15 -0
- package/src/core/geom/vec2/v2_cross_product.d.ts.map +1 -0
- package/src/core/geom/vec2/v2_cross_product.js +21 -0
- package/src/core/geom/vec3/v3_slerp.d.ts +1 -0
- package/src/core/geom/vec3/v3_slerp.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_slerp.js +1 -0
- package/src/core/graph/MultiNode.d.ts +1 -1
- package/src/core/graph/MultiNode.js +1 -1
- package/src/core/graph/WeightedEdge.d.ts +6 -4
- package/src/core/graph/WeightedEdge.d.ts.map +1 -1
- package/src/core/graph/WeightedEdge.js +3 -0
- package/src/core/graph/coloring/colorizeGraph.js +19 -19
- package/src/core/graph/convert_graph_to_dot_string.d.ts +1 -1
- package/src/core/graph/convert_graph_to_dot_string.d.ts.map +1 -1
- package/src/core/graph/convert_graph_to_dot_string.js +10 -6
- package/src/core/graph/graph_compute_adjacency_matrix.d.ts +9 -0
- package/src/core/graph/graph_compute_adjacency_matrix.d.ts.map +1 -0
- package/src/core/graph/{graph_adjacency_matrix.js → graph_compute_adjacency_matrix.js} +1 -2
- package/src/core/graph/graph_compute_degree_matrix.d.ts +10 -0
- package/src/core/graph/graph_compute_degree_matrix.d.ts.map +1 -0
- package/src/core/graph/graph_compute_degree_matrix.js +23 -0
- package/src/core/graph/graph_compute_distance_matrix.d.ts +13 -0
- package/src/core/graph/graph_compute_distance_matrix.d.ts.map +1 -0
- package/src/core/graph/graph_compute_distance_matrix.js +103 -0
- package/src/core/graph/{graph_laplacian_matrix.d.ts → graph_compute_laplacian_matrix.d.ts} +2 -2
- package/src/core/graph/graph_compute_laplacian_matrix.d.ts.map +1 -0
- package/src/core/graph/{graph_laplacian_matrix.js → graph_compute_laplacian_matrix.js} +6 -6
- package/src/core/graph/graph_k_means_cluster.d.ts.map +1 -1
- package/src/core/graph/graph_k_means_cluster.js +4 -119
- package/src/core/graph/{coarsen_graph.d.ts → mn_graph_coarsen.d.ts} +2 -2
- package/src/core/graph/mn_graph_coarsen.d.ts.map +1 -0
- package/src/core/graph/{coarsen_graph.js → mn_graph_coarsen.js} +1 -1
- package/src/core/graph/mn_graph_coarsen.spec.d.ts +2 -0
- package/src/core/graph/mn_graph_coarsen.spec.d.ts.map +1 -0
- package/src/core/graph/{coarsen_graph.spec.js → mn_graph_coarsen.spec.js} +4 -4
- package/src/core/graph/mn_graph_collapse_weighted_edge.d.ts +1 -0
- package/src/core/graph/mn_graph_collapse_weighted_edge.d.ts.map +1 -1
- package/src/core/graph/mn_graph_collapse_weighted_edge.js +7 -1
- package/src/core/math/physics/brdf/brdf_burley.d.ts.map +1 -1
- package/src/core/math/physics/brdf/brdf_burley.js +9 -1
- package/src/core/math/physics/brdf/{D_GGX.d.ts → diffuse_GGX.d.ts} +2 -2
- package/src/core/math/physics/brdf/diffuse_GGX.d.ts.map +1 -0
- package/src/core/math/physics/brdf/{D_GGX.js → diffuse_GGX.js} +1 -1
- package/src/core/math/physics/brdf/fresnel_Schlick.d.ts +3 -0
- package/src/core/math/physics/brdf/fresnel_Schlick.d.ts.map +1 -0
- package/src/core/math/physics/brdf/fresnel_Schlick.js +3 -0
- package/src/core/math/physics/brdf/fresnel_Schlick_optimized.d.ts +9 -0
- package/src/core/math/physics/brdf/fresnel_Schlick_optimized.d.ts.map +1 -0
- package/src/core/math/physics/brdf/fresnel_Schlick_optimized.js +12 -0
- package/src/core/math/physics/brdf/fresnel_Schlick_original.d.ts +9 -0
- package/src/core/math/physics/brdf/fresnel_Schlick_original.d.ts.map +1 -0
- package/src/core/math/physics/brdf/fresnel_Schlick_original.js +10 -0
- package/src/core/math/physics/bsdf/bsdf_schlick.d.ts.map +1 -1
- package/src/core/math/physics/bsdf/bsdf_schlick.js +3 -11
- package/src/core/math/physics/ior_to_reflectivity.d.ts +7 -0
- package/src/core/math/physics/ior_to_reflectivity.d.ts.map +1 -0
- package/src/core/math/physics/ior_to_reflectivity.js +9 -0
- package/src/core/math/physics/pdf/README.md +1 -0
- package/src/core/math/physics/pdf/pdf_GGX.d.ts +16 -0
- package/src/core/math/physics/pdf/pdf_GGX.d.ts.map +1 -0
- package/src/core/math/physics/pdf/pdf_GGX.js +25 -0
- package/src/core/math/physics/reflectivity_to_ior.d.ts +7 -0
- package/src/core/math/physics/reflectivity_to_ior.d.ts.map +1 -0
- package/src/core/math/physics/reflectivity_to_ior.js +8 -0
- package/src/engine/EngineHarness.d.ts +10 -1
- package/src/engine/EngineHarness.d.ts.map +1 -1
- package/src/engine/EngineHarness.js +16 -11
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts +25 -11
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/PNGReader.js +38 -24
- package/src/engine/asset/loaders/material/TextureAttachmensByMaterialType.js +2 -0
- package/src/engine/graphics/GraphicsEngine.js +1 -1
- package/src/engine/graphics/ecs/light/LightSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/LightSystem.js +2 -3
- package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.d.ts +6 -0
- package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.js +22 -11
- package/src/engine/graphics/render/forward_plus/model/DirectionalLight.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/model/DirectionalLight.js +25 -25
- package/src/engine/graphics/sh3/fromCubeRenderTarget.d.ts +9 -0
- package/src/engine/graphics/sh3/fromCubeRenderTarget.d.ts.map +1 -0
- package/src/engine/graphics/sh3/fromCubeRenderTarget.js +145 -0
- package/src/engine/graphics/sh3/gi/tetrahedral_mesh_to_texture.d.ts +8 -0
- package/src/engine/graphics/sh3/gi/tetrahedral_mesh_to_texture.d.ts.map +1 -0
- package/src/engine/graphics/sh3/gi/tetrahedral_mesh_to_texture.js +51 -0
- package/src/engine/graphics/sh3/{LightProbeVolume.d.ts → lpv/LightProbeVolume.d.ts} +18 -7
- package/src/engine/graphics/sh3/lpv/LightProbeVolume.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/LightProbeVolume.js +340 -0
- package/src/engine/graphics/sh3/lpv/LightProbeVolumeSerializationAdapter.d.ts +18 -0
- package/src/engine/graphics/sh3/lpv/LightProbeVolumeSerializationAdapter.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/LightProbeVolumeSerializationAdapter.js +44 -0
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts +12 -0
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.js +123 -0
- package/src/engine/graphics/sh3/lpv/ProbeRenderer.d.ts +29 -0
- package/src/engine/graphics/sh3/lpv/ProbeRenderer.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/ProbeRenderer.js +35 -0
- package/src/engine/graphics/sh3/lpv/WebGLCubeProbeRenderer.d.ts +27 -0
- package/src/engine/graphics/sh3/lpv/WebGLCubeProbeRenderer.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/WebGLCubeProbeRenderer.js +158 -0
- package/src/engine/graphics/sh3/lpv/build_probes_for_scene.d.ts +11 -0
- package/src/engine/graphics/sh3/lpv/build_probes_for_scene.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/build_probes_for_scene.js +127 -0
- package/src/engine/graphics/sh3/lpv/probe_volume_to_textures.d.ts +12 -0
- package/src/engine/graphics/sh3/lpv/probe_volume_to_textures.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/probe_volume_to_textures.js +89 -0
- package/src/engine/graphics/sh3/path_tracer/PathTracedScene.d.ts +90 -0
- package/src/engine/graphics/sh3/path_tracer/PathTracedScene.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/PathTracedScene.js +352 -0
- package/src/engine/graphics/sh3/path_tracer/PathTracer.d.ts +5 -91
- package/src/engine/graphics/sh3/path_tracer/PathTracer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/PathTracer.js +41 -477
- package/src/engine/graphics/sh3/path_tracer/make_one_vector3.d.ts +1 -0
- package/src/engine/graphics/sh3/path_tracer/make_one_vector3.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/make_one_vector3.js +6 -3
- package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +26 -58
- package/src/engine/graphics/sh3/path_tracer/random_in_hemisphere.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/random_in_hemisphere.js +7 -1
- package/src/engine/graphics/sh3/path_tracer/sample_triangle_attribute.d.ts +2 -2
- package/src/engine/graphics/sh3/path_tracer/sample_triangle_attribute.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/sample_triangle_attribute.js +1 -1
- package/src/engine/graphics/sh3/path_tracer/texture/SoftwareTextureCache.d.ts +3 -0
- package/src/engine/graphics/sh3/path_tracer/texture/SoftwareTextureCache.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/texture/SoftwareTextureCache.js +3 -0
- package/src/engine/graphics/sh3/path_tracer/texture/apply_texture_clamping_to_coordinate.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/{apply_texture_clamping_to_coordinate.js → texture/apply_texture_clamping_to_coordinate.js} +2 -2
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.d.ts +11 -0
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.js +86 -0
- package/src/engine/graphics/sh3/path_tracer/texture/sample_texture.d.ts +10 -0
- package/src/engine/graphics/sh3/path_tracer/texture/sample_texture.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/texture/sample_texture.js +56 -0
- package/src/engine/graphics/sh3/prototypeSH3Probe.js +87 -195
- package/src/engine/graphics/sh3/sky/hosek/sky_hosek_compute_irradiance_by_direction.d.ts +5 -5
- package/src/engine/graphics/sh3/sky/hosek/sky_hosek_compute_irradiance_by_direction.d.ts.map +1 -1
- package/src/engine/graphics/sh3/sky/hosek/sky_hosek_compute_irradiance_by_direction.js +8 -8
- package/src/engine/graphics/sh3/visualise_spherical_harmonic_sphere.d.ts +13 -0
- package/src/engine/graphics/sh3/visualise_spherical_harmonic_sphere.d.ts.map +1 -0
- package/src/engine/graphics/sh3/visualise_spherical_harmonic_sphere.js +54 -0
- package/src/engine/graphics/texture/AttributeDataTexture.d.ts +2 -2
- package/src/engine/graphics/texture/AttributeDataTexture.d.ts.map +1 -1
- package/src/engine/graphics/texture/AttributeDataTexture.js +11 -11
- package/src/engine/input/ecs/systems/InputControllerSystem.js +1 -1
- package/src/view/elements/ColorPickerView.d.ts.map +1 -1
- package/src/view/elements/ColorPickerView.js +7 -7
- package/src/core/geom/3d/tetrahedra/compute_circumsphere.d.ts.map +0 -1
- package/src/core/graph/coarsen_graph.d.ts.map +0 -1
- package/src/core/graph/coarsen_graph.spec.d.ts +0 -2
- package/src/core/graph/coarsen_graph.spec.d.ts.map +0 -1
- package/src/core/graph/graph_adjacency_matrix.d.ts +0 -9
- package/src/core/graph/graph_adjacency_matrix.d.ts.map +0 -1
- package/src/core/graph/graph_degree_matrix.d.ts +0 -9
- package/src/core/graph/graph_degree_matrix.d.ts.map +0 -1
- package/src/core/graph/graph_degree_matrix.js +0 -18
- package/src/core/graph/graph_laplacian_matrix.d.ts.map +0 -1
- package/src/core/math/physics/brdf/D_GGX.d.ts.map +0 -1
- package/src/engine/graphics/sh3/LightProbeVolume.d.ts.map +0 -1
- package/src/engine/graphics/sh3/LightProbeVolume.js +0 -609
- package/src/engine/graphics/sh3/path_tracer/apply_texture_clamping_to_coordinate.d.ts.map +0 -1
- package/src/engine/graphics/sh3/visualise_probe.d.ts +0 -12
- package/src/engine/graphics/sh3/visualise_probe.d.ts.map +0 -1
- package/src/engine/graphics/sh3/visualise_probe.js +0 -40
- /package/src/engine/graphics/sh3/path_tracer/{apply_texture_clamping_to_coordinate.d.ts → texture/apply_texture_clamping_to_coordinate.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PNGReader.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/asset/loaders/image/png/PNGReader.js"],"names":[],"mappings":"AAsDA;;;;GAIG;AACH,iCAHW,WAAW,
|
|
1
|
+
{"version":3,"file":"PNGReader.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/asset/loaders/image/png/PNGReader.js"],"names":[],"mappings":"AAsDA;;;;GAIG;AACH,iCAHW,WAAW,QA0CrB;;IA5CD;;;;OAIG;IACH,mBAHW,WAAW,EA0CrB;IAtCG;;;OAGG;IACH,GAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,OAFU,UAAU,CAEc;IAElC;;;OAGG;IACH,KAFU,GAAG,CAEO;IAEpB,kBAAoB;IAEpB;;;OAGG;IACH,QAFU,YAAY,CAEU;IAGhC;;;OAGG;IACH,aAFU,OAAO,CAEO;IAExB;;;OAGG;IACH,QAFU,UAAU,CAEW;IAGnC;;;;OAIG;IACH,kBAHW,MAAM,GACL,UAAU,CAQrB;IAED;;OAEG;IACH,qBAkBC;IAED;;;;;;;;;OASG;IACH,eAFa,MAAM,CA4ElB;IAGD;;;OAGG;IACH,kBAFW,UAAU,QAOpB;IAED;;;OAGG;IACH,kBAFW,UAAU,QAapB;IAED;;;;OAIG;IACH,kBAFW,UAAU;;;;;MAiCpB;IAGD;;;;OAIG;IACH,kBAFW,UAAU;;;MA6BpB;IAED;;;OAGG;IACH,kBAFW,UAAU,QASpB;IACD;;;;OAIG;IACH,kBAFW,UAAU,QAqBpB;IAED;;;;;;;;;;;OAWG;IACH,6BAWC;IAED;;;OAGG;IACH,6BAEC;IAED;;OAEG;IACH,6BAGC;IAED;;;OAGG;IACH,kBAFW,UAAU,QAIpB;IAED;;OAEG;IACH,mBACC;IAED;;OAEG;IACH,qBAwBC;IAID;;OAEG;IACH,oBAFW,UAAU,QAyFpB;IAED;;;OAGG;IACH,qBAFW,UAAU,SAIpB;IAKD;;;;OAIG;IACH,oGAYC;IAED;;;;;OAKG;IACH,mGAYC;IAED;;;;OAIG;IACH,wGA+BC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,sGA8CC;IAED;;;OAGG;IACH,SAFa,GAAG,CAqBf;;oBAxsBmB,UAAU;6BAJD,4CAA4C"}
|
|
@@ -35,10 +35,10 @@ function inflate(encoded_chunk) {
|
|
|
35
35
|
* @return {number}
|
|
36
36
|
*/
|
|
37
37
|
function readUInt32(buffer, offset) {
|
|
38
|
-
return (buffer[offset] << 24)
|
|
39
|
-
(buffer[offset + 1] << 16)
|
|
40
|
-
(buffer[offset + 2] << 8)
|
|
41
|
-
(buffer[offset + 3]);
|
|
38
|
+
return (buffer[offset] << 24)
|
|
39
|
+
| (buffer[offset + 1] << 16)
|
|
40
|
+
| (buffer[offset + 2] << 8)
|
|
41
|
+
| (buffer[offset + 3]);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
|
|
@@ -58,15 +58,30 @@ function readUInt8(buffer, offset) {
|
|
|
58
58
|
* @constructor
|
|
59
59
|
*/
|
|
60
60
|
export function PNGReader(bytes) {
|
|
61
|
-
|
|
61
|
+
/**
|
|
62
|
+
* current pointer
|
|
63
|
+
* @type {number}
|
|
64
|
+
*/
|
|
62
65
|
this.i = 0;
|
|
63
|
-
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* bytes buffer
|
|
69
|
+
* @type {Uint8Array}
|
|
70
|
+
*/
|
|
64
71
|
this.bytes = new Uint8Array(bytes);
|
|
65
|
-
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Output object
|
|
75
|
+
* @type {PNG}
|
|
76
|
+
*/
|
|
66
77
|
this.png = new PNG();
|
|
67
78
|
|
|
68
79
|
this.dataChunks = [];
|
|
69
80
|
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
* @type {BinaryBuffer}
|
|
84
|
+
*/
|
|
70
85
|
this.buffer = new BinaryBuffer();
|
|
71
86
|
this.buffer.fromArrayBuffer(bytes);
|
|
72
87
|
|
|
@@ -75,6 +90,12 @@ export function PNGReader(bytes) {
|
|
|
75
90
|
* @type {boolean}
|
|
76
91
|
*/
|
|
77
92
|
this.crc_enabled = false;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
* @type {Uint8Array}
|
|
97
|
+
*/
|
|
98
|
+
this.header = new Uint8Array(8);
|
|
78
99
|
}
|
|
79
100
|
|
|
80
101
|
/**
|
|
@@ -101,7 +122,7 @@ PNGReader.prototype.decodeHeader = function () {
|
|
|
101
122
|
|
|
102
123
|
const buffer = this.buffer;
|
|
103
124
|
|
|
104
|
-
const header =
|
|
125
|
+
const header = this.header;
|
|
105
126
|
|
|
106
127
|
buffer.readBytes(header, 0, 8)
|
|
107
128
|
|
|
@@ -110,7 +131,6 @@ PNGReader.prototype.decodeHeader = function () {
|
|
|
110
131
|
throw new Error('invalid PNGReader file (bad signature)');
|
|
111
132
|
}
|
|
112
133
|
|
|
113
|
-
this.header = header;
|
|
114
134
|
|
|
115
135
|
};
|
|
116
136
|
|
|
@@ -426,6 +446,9 @@ PNGReader.prototype.decodePixels = function () {
|
|
|
426
446
|
|
|
427
447
|
// Different interlace methods
|
|
428
448
|
|
|
449
|
+
/**
|
|
450
|
+
* @param {Uint8Array} data
|
|
451
|
+
*/
|
|
429
452
|
PNGReader.prototype.interlaceNone = function (data) {
|
|
430
453
|
|
|
431
454
|
const png = this.png;
|
|
@@ -674,34 +697,25 @@ PNGReader.prototype.unFilterPaeth = function (scanline, scanline_offset, pixels,
|
|
|
674
697
|
|
|
675
698
|
/**
|
|
676
699
|
* Parse the PNG file
|
|
677
|
-
*
|
|
678
|
-
* reader.parse(options, callback)
|
|
679
|
-
* OR
|
|
680
|
-
* reader.parse(callback)
|
|
681
|
-
*
|
|
682
|
-
* OPTIONS:
|
|
683
|
-
* option | type | default
|
|
684
|
-
* ----------------------------
|
|
685
|
-
* data boolean true should it read the pixel data
|
|
686
700
|
* @returns {PNG}
|
|
687
701
|
*/
|
|
688
702
|
PNGReader.prototype.parse = function () {
|
|
689
703
|
|
|
690
704
|
this.decodeHeader();
|
|
691
705
|
|
|
692
|
-
|
|
706
|
+
for (; ;) {
|
|
707
|
+
|
|
693
708
|
const type = this.decodeChunk();
|
|
694
|
-
|
|
695
|
-
// if (type === 'IHDR' && options.data === false || type === 'IEND') break;
|
|
709
|
+
|
|
696
710
|
if (type === 'IEND') {
|
|
711
|
+
// reached the end
|
|
697
712
|
break;
|
|
698
713
|
}
|
|
699
|
-
}
|
|
700
714
|
|
|
701
|
-
|
|
715
|
+
}
|
|
702
716
|
|
|
703
717
|
this.decodePixels();
|
|
704
718
|
|
|
705
|
-
return png;
|
|
719
|
+
return this.png;
|
|
706
720
|
|
|
707
721
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LightSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/light/LightSystem.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"LightSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/light/LightSystem.js"],"names":[],"mappings":"AAuQA;;;;;GAKG;AACH,2DAHW,MAAM,SACN,KAAK,QAwCf;;uBA5SsB,qBAAqB;sBAGtB,YAAY;AAOlC;IACI;;;;;OAKG;IACH,2CAsFC;IA1EG,kDAAsC;IAGtC,6DAEC;IAGD,eAAoB;IACpB,WAA2B;IAC3B,aAAwB;IAExB;;;;OAIG;IACH,mBAA0B;IAE1B;;;;OAIG;IACH,wBAA2B;IAE3B,gBAAkB;IAElB;;;;OAIG;IACH,kBAAoC;IAGpC;;;;OAIG;IACH,2BAA8B;IAC9B;;;;OAIG;IACH,iBAAoB;IAGpB;;;;OAIG;IACH,4BAAgD;IAqBpD,mCAEC;IAED;;;;OAIG;IACH,uBAHW,MAAM,SACN,MAAM,GAAC,MAAM,GAAC,OAAO,QAkB/B;IAED;;;;OAIG;IACH,4BAHW,KAAK,UACL,MAAM,QAMhB;IAED,mFASC;IAED,2EAWC;IAGD,4CAOC;IAED;;;;;OAKG;IACH,wCAmCC;IAED;;;;;;OAMG;IACH,sCAwBC;CACJ;sCA/PqC,8CAA8C;0BAC1D,qCAAqC;4CAFnB,uDAAuD"}
|
|
@@ -215,7 +215,7 @@ class LightSystem extends AbstractContextSystem {
|
|
|
215
215
|
|
|
216
216
|
l.castShadow = true;
|
|
217
217
|
|
|
218
|
-
|
|
218
|
+
three_update_shadow_camera_extents(this.__camera_object, l, this.__graphics);
|
|
219
219
|
|
|
220
220
|
} else {
|
|
221
221
|
|
|
@@ -266,9 +266,8 @@ const scratch_aabb3 = new AABB3();
|
|
|
266
266
|
* @author Alex Goldring 02.06.2016 (Komrade)
|
|
267
267
|
* @param {Camera} camera
|
|
268
268
|
* @param {Light} light
|
|
269
|
-
* @param {GraphicsEngine} graphics
|
|
270
269
|
*/
|
|
271
|
-
function
|
|
270
|
+
export function three_update_shadow_camera_extents(camera, light) {
|
|
272
271
|
|
|
273
272
|
|
|
274
273
|
// Fit shadow camera's ortho frustum to camera frustum
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreeLightBinding.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.js"],"names":[],"mappings":"AAwEA;IAKQ;;;;OAIG;IACH,iBAAoB;IAEpB;;;;OAIG;IACH,qBAAwB;IAExB;;;;OAIG;IACH,qBAAiC;IAGrC,qBAYC;IAED,uBAcC;IAED;;;;OAIG;IACH,yBAEC;IAYD,+BAEC;IAUD,yBAuBC;IAED,2BAgBC;IAED,iCA0BC;IAGD,2BA0CC;IA8CD,
|
|
1
|
+
{"version":3,"file":"ThreeLightBinding.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.js"],"names":[],"mappings":"AAwEA;;;;GAIG;AACH,6EAFW,MAAM,QAgBhB;AAED;IAKQ;;;;OAIG;IACH,iBAAoB;IAEpB;;;;OAIG;IACH,qBAAwB;IAExB;;;;OAIG;IACH,qBAAiC;IAGrC,qBAYC;IAED,uBAcC;IAED;;;;OAIG;IACH,yBAEC;IAYD,+BAEC;IAUD,yBAuBC;IAED,2BAgBC;IAED,iCA0BC;IAGD,2BA0CC;IA8CD,mCAmBC;CAEJ;6BApW4B,oBAAoB"}
|
|
@@ -70,6 +70,27 @@ function scene_object_filter(object3D) {
|
|
|
70
70
|
return true;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @param {LightShadow} shadow
|
|
76
|
+
* @param {number} resolution
|
|
77
|
+
*/
|
|
78
|
+
export function three_set_shadow_resolution(shadow, resolution) {
|
|
79
|
+
const mapSize = shadow.mapSize;
|
|
80
|
+
|
|
81
|
+
if (mapSize.width !== resolution || mapSize.height !== resolution) {
|
|
82
|
+
|
|
83
|
+
mapSize.width = mapSize.height = resolution;
|
|
84
|
+
|
|
85
|
+
//destroy old map
|
|
86
|
+
if (shadow.map !== null) {
|
|
87
|
+
shadow.map.dispose(); // important
|
|
88
|
+
shadow.map = null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
73
94
|
export class ThreeLightBinding extends LightBinding {
|
|
74
95
|
|
|
75
96
|
constructor() {
|
|
@@ -334,17 +355,7 @@ export class ThreeLightBinding extends LightBinding {
|
|
|
334
355
|
shadow.radius = 1;
|
|
335
356
|
shadow.blurSamples = 8;
|
|
336
357
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
shadow.mapSize.width = shadow.mapSize.height = resolution;
|
|
340
|
-
|
|
341
|
-
//destroy old map
|
|
342
|
-
if (shadow.map !== null) {
|
|
343
|
-
shadow.map.dispose(); // important
|
|
344
|
-
shadow.map = null;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
}
|
|
358
|
+
three_set_shadow_resolution(shadow, resolution);
|
|
348
359
|
|
|
349
360
|
}
|
|
350
361
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DirectionalLight.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/forward_plus/model/DirectionalLight.js"],"names":[],"mappings":"AAKA;
|
|
1
|
+
{"version":3,"file":"DirectionalLight.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/forward_plus/model/DirectionalLight.js"],"names":[],"mappings":"AAKA;IAIQ;;;OAGG;IACH,UAFU,OAAO,CAEY;IAE7B;;;OAGG;IACH,WAFU,OAAO,CAEa;IAE9B;;;OAGG;IACH,gBAFU,KAAK,CAEgB;IAE/B;;;OAGG;IACH,WAFU,OAAO,CAEc;IAIvC;;;OAGG;IACH,6BAFU,OAAO,CAE4B;CAN5C;8BA9B6B,oBAAoB;oBAD9B,qCAAqC;sBAFnC,oCAAoC;oBACtC,qCAAqC"}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { AbstractLight } from "./AbstractLight.js";
|
|
2
|
-
import Vector3 from "../../../../../core/geom/Vector3.js";
|
|
3
1
|
import { Color } from "../../../../../core/color/Color.js";
|
|
4
2
|
import Vector1 from "../../../../../core/geom/Vector1.js";
|
|
3
|
+
import Vector3 from "../../../../../core/geom/Vector3.js";
|
|
4
|
+
import { AbstractLight } from "./AbstractLight.js";
|
|
5
5
|
|
|
6
6
|
export class DirectionalLight extends AbstractLight {
|
|
7
|
-
constructor() {
|
|
8
|
-
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @type {Vector3}
|
|
13
|
+
*/
|
|
14
|
+
this.position = new Vector3();
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @type {Vector3}
|
|
19
|
+
*/
|
|
20
|
+
this.direction = new Vector3();
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
/**
|
|
23
|
+
* @readonly
|
|
24
|
+
* @type {Color}
|
|
25
|
+
*/
|
|
26
|
+
this.color = new Color(1, 1, 1);
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {Vector1}
|
|
31
|
+
*/
|
|
32
|
+
this.intensity = new Vector1(1);
|
|
33
|
+
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {Uint8Array} data
|
|
4
|
+
* @param {THREE.WebGLRenderer} renderer
|
|
5
|
+
* @param {THREE.WebGLCubeRenderTarget} cubeRenderTarget
|
|
6
|
+
* @return {Float64Array}
|
|
7
|
+
*/
|
|
8
|
+
export function fromCubeRenderTarget(data: Uint8Array, renderer: THREE.WebGLRenderer, cubeRenderTarget: THREE.WebGLCubeRenderTarget): Float64Array;
|
|
9
|
+
//# sourceMappingURL=fromCubeRenderTarget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromCubeRenderTarget.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/sh3/fromCubeRenderTarget.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,2CALW,UAAU,YACV,MAAM,aAAa,oBACnB,MAAM,qBAAqB,GAC1B,YAAY,CAuIvB"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { sh3_basis_at } from "../../../core/geom/3d/sphere/harmonics/sh3_basis_at.js";
|
|
2
|
+
import { sh3_dering_optimize_positive } from "../../../core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js";
|
|
3
|
+
import { v3_length_sqr } from "../../../core/geom/vec3/v3_length_sqr.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param {Uint8Array} data
|
|
8
|
+
* @param {THREE.WebGLRenderer} renderer
|
|
9
|
+
* @param {THREE.WebGLCubeRenderTarget} cubeRenderTarget
|
|
10
|
+
* @return {Float64Array}
|
|
11
|
+
*/
|
|
12
|
+
export function fromCubeRenderTarget(
|
|
13
|
+
data,
|
|
14
|
+
renderer,
|
|
15
|
+
cubeRenderTarget
|
|
16
|
+
) {
|
|
17
|
+
|
|
18
|
+
// The renderTarget must be set to RGBA in order to make readRenderTargetPixels works
|
|
19
|
+
let total_weight = 0;
|
|
20
|
+
|
|
21
|
+
const __shared_buffer = new ArrayBuffer((27 + 9) * 8);
|
|
22
|
+
|
|
23
|
+
const sh_basis = new Float64Array(__shared_buffer, 0, 9);
|
|
24
|
+
const coefficients = new Float64Array(__shared_buffer, 9 * 8, 27);
|
|
25
|
+
|
|
26
|
+
const image_size = cubeRenderTarget.width;
|
|
27
|
+
|
|
28
|
+
const pixel_size = 2 / image_size;
|
|
29
|
+
|
|
30
|
+
let normal_x = 0, normal_y = 0, normal_z = 0;
|
|
31
|
+
|
|
32
|
+
for (let faceIndex = 0; faceIndex < 6; faceIndex++) {
|
|
33
|
+
|
|
34
|
+
renderer.readRenderTargetPixels(cubeRenderTarget, 0, 0, image_size, image_size, data, faceIndex);
|
|
35
|
+
|
|
36
|
+
// RGBA assumed
|
|
37
|
+
|
|
38
|
+
for (let i = 0, il = data.length; i < il; i += 4) {
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
// pixel coordinate on unit cube
|
|
42
|
+
|
|
43
|
+
const pixelIndex = i / 4;
|
|
44
|
+
|
|
45
|
+
const col = -1 + (pixelIndex % image_size + 0.5) * pixel_size;
|
|
46
|
+
|
|
47
|
+
const row = 1 - (Math.floor(pixelIndex / image_size) + 0.5) * pixel_size;
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
switch (faceIndex) {
|
|
51
|
+
|
|
52
|
+
case 0:
|
|
53
|
+
normal_x = 1;
|
|
54
|
+
normal_y = row;
|
|
55
|
+
normal_z = -col;
|
|
56
|
+
break;
|
|
57
|
+
|
|
58
|
+
case 1:
|
|
59
|
+
normal_x = -1;
|
|
60
|
+
normal_y = row;
|
|
61
|
+
normal_z = col;
|
|
62
|
+
break;
|
|
63
|
+
|
|
64
|
+
case 2:
|
|
65
|
+
normal_x = col;
|
|
66
|
+
normal_y = 1;
|
|
67
|
+
normal_z = -row;
|
|
68
|
+
break;
|
|
69
|
+
|
|
70
|
+
case 3:
|
|
71
|
+
normal_x = col;
|
|
72
|
+
normal_y = -1;
|
|
73
|
+
normal_z = row;
|
|
74
|
+
break;
|
|
75
|
+
|
|
76
|
+
case 4:
|
|
77
|
+
normal_x = col;
|
|
78
|
+
normal_y = row;
|
|
79
|
+
normal_z = 1;
|
|
80
|
+
break;
|
|
81
|
+
|
|
82
|
+
case 5:
|
|
83
|
+
normal_x = -col;
|
|
84
|
+
normal_y = row;
|
|
85
|
+
normal_z = -1;
|
|
86
|
+
break;
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// weight assigned to this pixel
|
|
91
|
+
|
|
92
|
+
const length_squared = v3_length_sqr(normal_x, normal_y, normal_z);
|
|
93
|
+
|
|
94
|
+
const length = Math.sqrt(length_squared);
|
|
95
|
+
|
|
96
|
+
const weight = 4 / (length * length_squared);
|
|
97
|
+
|
|
98
|
+
total_weight += weight;
|
|
99
|
+
|
|
100
|
+
// direction vector to this pixel
|
|
101
|
+
normal_x /= length;
|
|
102
|
+
normal_y /= length;
|
|
103
|
+
normal_z /= length;
|
|
104
|
+
|
|
105
|
+
// evaluate SH basis functions in direction dir
|
|
106
|
+
sh3_basis_at(normal_x, normal_y, normal_z, sh_basis);
|
|
107
|
+
|
|
108
|
+
// pixel color, already in linear space so no sRGB->Linear conversion necessary
|
|
109
|
+
|
|
110
|
+
// 0.003921 constant value is 1/255, a conversion value from UINT8 to normalized float
|
|
111
|
+
const weight_conv = weight * 0.00392156862745098;
|
|
112
|
+
|
|
113
|
+
const color_r = data[i] * weight_conv;
|
|
114
|
+
const color_g = data[i + 1] * weight_conv;
|
|
115
|
+
const color_b = data[i + 2] * weight_conv;
|
|
116
|
+
|
|
117
|
+
// accumulate
|
|
118
|
+
for (let j = 0; j < 9; j++) {
|
|
119
|
+
|
|
120
|
+
const j3 = j * 3;
|
|
121
|
+
|
|
122
|
+
coefficients[j3] += sh_basis[j] * color_r;
|
|
123
|
+
coefficients[j3 + 1] += sh_basis[j] * color_g;
|
|
124
|
+
coefficients[j3 + 2] += sh_basis[j] * color_b;
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// normalize
|
|
133
|
+
const norm = (4 * Math.PI) / total_weight;
|
|
134
|
+
|
|
135
|
+
for (let j = 0; j < 27; j++) {
|
|
136
|
+
|
|
137
|
+
coefficients[j] *= norm;
|
|
138
|
+
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
sh3_dering_optimize_positive(coefficients, 0, coefficients, 0, 3);
|
|
142
|
+
|
|
143
|
+
return coefficients;
|
|
144
|
+
|
|
145
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assumes that the mesh is compacted
|
|
3
|
+
* @param {AttributeDataTexture} vertices
|
|
4
|
+
* @param {AttributeDataTexture} neighbours
|
|
5
|
+
* @param {TetrahedralMesh} mesh
|
|
6
|
+
*/
|
|
7
|
+
export function tetrahedral_mesh_to_texture(vertices: AttributeDataTexture, neighbours: AttributeDataTexture, mesh: TetrahedralMesh): void;
|
|
8
|
+
//# sourceMappingURL=tetrahedral_mesh_to_texture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tetrahedral_mesh_to_texture.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/gi/tetrahedral_mesh_to_texture.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,2IA0CC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { assert } from "../../../../core/assert.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Assumes that the mesh is compacted
|
|
5
|
+
* @param {AttributeDataTexture} vertices
|
|
6
|
+
* @param {AttributeDataTexture} neighbours
|
|
7
|
+
* @param {TetrahedralMesh} mesh
|
|
8
|
+
*/
|
|
9
|
+
export function tetrahedral_mesh_to_texture(
|
|
10
|
+
vertices,
|
|
11
|
+
neighbours,
|
|
12
|
+
mesh
|
|
13
|
+
) {
|
|
14
|
+
|
|
15
|
+
assert.equal(mesh.isCompacted, true, 'mesh.isCompacted');
|
|
16
|
+
|
|
17
|
+
if (mesh.isCompacted !== true) {
|
|
18
|
+
throw new Error(`mesh is not compacted`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (vertices.spec.itemSize !== 4) {
|
|
22
|
+
throw new Error(`vertices texture spec must have itemSize of 4, instead was ${vertices.spec.itemSize}`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (neighbours.spec.itemSize !== 4) {
|
|
26
|
+
throw new Error(`neighbours texture spec must have itemSize of 4, instead was ${neighbours.spec.itemSize}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const tetrahedron_count = mesh.count;
|
|
30
|
+
|
|
31
|
+
vertices.resize(tetrahedron_count);
|
|
32
|
+
neighbours.resize(tetrahedron_count);
|
|
33
|
+
|
|
34
|
+
vertices.build()
|
|
35
|
+
neighbours.build();
|
|
36
|
+
|
|
37
|
+
const vertices_data = vertices.data;
|
|
38
|
+
const neighbours_data = neighbours.data;
|
|
39
|
+
|
|
40
|
+
for (let i = 0; i < tetrahedron_count; i++) {
|
|
41
|
+
|
|
42
|
+
const i4 = i * 4;
|
|
43
|
+
|
|
44
|
+
for (let j = 0; j < 4; j++) {
|
|
45
|
+
vertices_data[i4 + j] = mesh.getVertexIndex(i, j);
|
|
46
|
+
|
|
47
|
+
neighbours_data[i4 + j] = mesh.getNeighbour(i, j);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -3,6 +3,16 @@ export class LightProbeVolume {
|
|
|
3
3
|
__mesh: TetrahedralMesh;
|
|
4
4
|
__probe_data: any[];
|
|
5
5
|
__length: number;
|
|
6
|
+
clear(): void;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @return {TetrahedralMesh}
|
|
10
|
+
*/
|
|
11
|
+
get mesh(): TetrahedralMesh;
|
|
12
|
+
get points(): any[];
|
|
13
|
+
get harmonics(): any[];
|
|
14
|
+
set count(arg: number);
|
|
15
|
+
get count(): number;
|
|
6
16
|
/**
|
|
7
17
|
*
|
|
8
18
|
* @param {number} x
|
|
@@ -23,10 +33,10 @@ export class LightProbeVolume {
|
|
|
23
33
|
build_mesh(): void;
|
|
24
34
|
/**
|
|
25
35
|
* Bake light probes
|
|
26
|
-
* @param {Engine} engine
|
|
27
36
|
* @returns {TaskGroup}
|
|
37
|
+
* @param {EntityComponentDataset} ecd
|
|
28
38
|
*/
|
|
29
|
-
bake(
|
|
39
|
+
bake(ecd: EntityComponentDataset): TaskGroup;
|
|
30
40
|
/**
|
|
31
41
|
*
|
|
32
42
|
* @param {EntityComponentDataset} ecd
|
|
@@ -38,15 +48,16 @@ export class LightProbeVolume {
|
|
|
38
48
|
*
|
|
39
49
|
* @param {EntityComponentDataset} ecd
|
|
40
50
|
* @param {string|number} color CSS color definition
|
|
51
|
+
* @param {number} opacity
|
|
41
52
|
*/
|
|
42
|
-
visualize_mesh({ ecd, color }: EntityComponentDataset): void;
|
|
53
|
+
visualize_mesh({ ecd, color, opacity }: EntityComponentDataset): void;
|
|
43
54
|
/**
|
|
44
55
|
*
|
|
45
|
-
* @param {Engine} engine
|
|
46
56
|
* @returns {TaskGroup}
|
|
57
|
+
* @param {EntityComponentDataset} ecd
|
|
47
58
|
*/
|
|
48
|
-
build(
|
|
59
|
+
build(ecd: EntityComponentDataset): TaskGroup;
|
|
49
60
|
}
|
|
50
|
-
import { TetrahedralMesh } from "
|
|
51
|
-
import TaskGroup from "
|
|
61
|
+
import { TetrahedralMesh } from "../../../../core/geom/3d/tetrahedra/TetrahedralMesh.js";
|
|
62
|
+
import TaskGroup from "../../../../core/process/task/TaskGroup.js";
|
|
52
63
|
//# sourceMappingURL=LightProbeVolume.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LightProbeVolume.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/lpv/LightProbeVolume.js"],"names":[],"mappings":"AAiJA;IAEQ,mBAAqB;IAErB,wBAAmC;IAEnC,oBAAsB;IAEtB,iBAAiB;IAGrB,cAMC;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,CA4CrB;IAED;;;;;OAKG;IACH,sEAWC;IAED;;;;;OAKG;IACH,sEAkBC;IAED;;;;OAIG;IACH,oCAHa,SAAS,CAMrB;CACJ;gCA1U+B,wDAAwD;sBAClE,4CAA4C"}
|