@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
|
@@ -12,23 +12,21 @@ import '../../../../../../../css/game.scss';
|
|
|
12
12
|
import { BinaryBuffer } from "../../../core/binary/BinaryBuffer.js";
|
|
13
13
|
import { array_copy } from "../../../core/collection/array/array_copy.js";
|
|
14
14
|
import { is_typed_array_equals } from "../../../core/collection/array/typed/is_typed_array_equals.js";
|
|
15
|
-
import {
|
|
16
|
-
import { make_justified_point_grid } from "../../../core/geom/3d/util/make_justified_point_grid.js";
|
|
17
|
-
import Vector2 from "../../../core/geom/Vector2.js";
|
|
15
|
+
import { Color } from "../../../core/color/Color.js";
|
|
18
16
|
import Vector3 from "../../../core/geom/Vector3.js";
|
|
19
17
|
import { randomFloatBetween } from "../../../core/math/random/randomFloatBetween.js";
|
|
20
18
|
import { seededRandom } from "../../../core/math/random/seededRandom.js";
|
|
19
|
+
import { number_pretty_print } from "../../../core/primitives/numbers/number_pretty_print.js";
|
|
21
20
|
import { delay } from "../../../core/process/delay.js";
|
|
21
|
+
import ButtonView from "../../../view/elements/button/ButtonView.js";
|
|
22
22
|
import { GLTFAssetLoader } from "../../asset/loaders/GLTFAssetLoader.js";
|
|
23
23
|
import Entity from "../../ecs/Entity.js";
|
|
24
24
|
import GUIElement from "../../ecs/gui/GUIElement.js";
|
|
25
25
|
import GUIElementSystem from "../../ecs/gui/GUIElementSystem.js";
|
|
26
|
-
import ViewportPosition from "../../ecs/gui/position/ViewportPosition.js";
|
|
27
26
|
import ViewportPositionSystem from "../../ecs/gui/position/ViewportPositionSystem.js";
|
|
28
27
|
import { TransformAttachmentSystem } from "../../ecs/transform-attachment/TransformAttachmentSystem.js";
|
|
29
28
|
import { Transform } from "../../ecs/transform/Transform.js";
|
|
30
29
|
import { EngineHarness } from "../../EngineHarness.js";
|
|
31
|
-
import { makeSimpleTaskProgressView } from "../../makeSimpleTaskProgressView.js";
|
|
32
30
|
import { Light } from "../ecs/light/Light.js";
|
|
33
31
|
import LightSystem from "../ecs/light/LightSystem.js";
|
|
34
32
|
import { LightType } from "../ecs/light/LightType.js";
|
|
@@ -39,7 +37,10 @@ import { ShadedGeometryFlags } from "../ecs/mesh-v2/ShadedGeometryFlags.js";
|
|
|
39
37
|
import { ShadedGeometrySystem } from "../ecs/mesh-v2/ShadedGeometrySystem.js";
|
|
40
38
|
import { three_object_to_entity_composition } from "../ecs/mesh-v2/three_object_to_entity_composition.js";
|
|
41
39
|
import { GizmoRenderingPlugin } from "../render/gizmo/GizmoRenderingPlugin.js";
|
|
42
|
-
import {
|
|
40
|
+
import { build_probes_for_scene } from "./lpv/build_probes_for_scene.js";
|
|
41
|
+
import { LightProbeVolume } from "./lpv/LightProbeVolume.js";
|
|
42
|
+
import { LightProbeVolumeSerializationAdapter } from "./lpv/LightProbeVolumeSerializationAdapter.js";
|
|
43
|
+
import { probe_volume_to_textures } from "./lpv/probe_volume_to_textures.js";
|
|
43
44
|
|
|
44
45
|
/**
|
|
45
46
|
*
|
|
@@ -146,12 +147,14 @@ function make_cornel_box(ecd) {
|
|
|
146
147
|
direction: Vector3.forward,
|
|
147
148
|
material: new MeshBasicMaterial({ color: 0xFF0000 })
|
|
148
149
|
}).build(ecd);
|
|
150
|
+
|
|
149
151
|
make_plane({
|
|
150
152
|
scale: 20,
|
|
151
|
-
offset: new Vector3(
|
|
153
|
+
offset: new Vector3(20, 10, 10),
|
|
152
154
|
direction: Vector3.left,
|
|
153
155
|
material: new MeshBasicMaterial({ color: 0x00FF00 })
|
|
154
156
|
}).build(ecd);
|
|
157
|
+
|
|
155
158
|
make_plane({
|
|
156
159
|
scale: 20,
|
|
157
160
|
offset: new Vector3(0, 10, 10),
|
|
@@ -185,113 +188,50 @@ function make_test_texture(t = 1) {
|
|
|
185
188
|
/**
|
|
186
189
|
*
|
|
187
190
|
* @param {Engine} engine
|
|
188
|
-
* @param {
|
|
189
|
-
* @
|
|
191
|
+
* @param {string} path
|
|
192
|
+
* @return {Promise<LightProbeVolume>}
|
|
190
193
|
*/
|
|
191
|
-
async function
|
|
192
|
-
|
|
193
|
-
const lpv = new LightProbeVolume();
|
|
194
|
+
async function getVolume({ engine, path }) {
|
|
194
195
|
|
|
195
|
-
|
|
196
|
+
const key = `lpv:${path}`;
|
|
196
197
|
|
|
197
|
-
const
|
|
198
|
+
const adapter = new LightProbeVolumeSerializationAdapter();
|
|
198
199
|
|
|
200
|
+
if (await engine.storage.promiseContains(key)) {
|
|
201
|
+
const volume = new LightProbeVolume();
|
|
199
202
|
|
|
200
|
-
|
|
201
|
-
const probe_grid_spacing_dense = Math.min(bounds.getExtentsX(), bounds.getExtentsY(), bounds.getExtentsZ()) / desired_density;
|
|
202
|
-
const probe_grid_spacing_sparse = Math.max(bounds.getExtentsX(), bounds.getExtentsY(), bounds.getExtentsZ()) / desired_density;
|
|
203
|
-
|
|
204
|
-
const probe_grid_spacing = (probe_grid_spacing_sparse / probe_grid_spacing_dense) < 2 ? probe_grid_spacing_dense : probe_grid_spacing_sparse * 0.5;
|
|
205
|
-
//
|
|
206
|
-
// const probe_grid_spacing =desired_density/ (mesh_asset.boundingBox.getExtentsX()* mesh_asset.boundingBox.getExtentsY()* mesh_asset.boundingBox.getExtentsZ());
|
|
207
|
-
|
|
208
|
-
const model_bounds = new AABB3(-10, 0.5, -10, 10, 11, 10);
|
|
209
|
-
model_bounds.copy(bounds);
|
|
210
|
-
// model_bounds._translate(composition.transform.position.x, composition.transform.position.y, composition.transform.position.z);
|
|
211
|
-
model_bounds.grow(probe_grid_spacing * 1.1);
|
|
203
|
+
const data = await engine.storage.promiseLoadBinary(key);
|
|
212
204
|
|
|
205
|
+
console.log(`LPV data size ${number_pretty_print(data.byteLength)} bytes`);
|
|
213
206
|
|
|
214
|
-
|
|
207
|
+
const buffer = BinaryBuffer.fromArrayBuffer(data);
|
|
215
208
|
|
|
216
|
-
|
|
217
|
-
// lpv.add_point(
|
|
218
|
-
// randomFloatBetween(random, light_volume_bounds.x0, light_volume_bounds.x1),
|
|
219
|
-
// randomFloatBetween(random, light_volume_bounds.y0, light_volume_bounds.y1),
|
|
220
|
-
// randomFloatBetween(random, light_volume_bounds.z0, light_volume_bounds.z1),
|
|
221
|
-
// );
|
|
222
|
-
// }
|
|
209
|
+
adapter.deserialize(buffer, volume);
|
|
223
210
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
// lpv.add_point(10, 1, -10);
|
|
211
|
+
return volume;
|
|
212
|
+
}
|
|
229
213
|
|
|
230
|
-
await
|
|
214
|
+
const mesh_asset = await engine.assetManager.promise(path, 'model/gltf+json');
|
|
215
|
+
const mesh_bounds = mesh_asset.boundingBox;
|
|
231
216
|
|
|
232
|
-
|
|
233
|
-
// console.profile('lpv build');
|
|
234
|
-
//
|
|
235
|
-
const task = lpv.build(engine);
|
|
236
|
-
// console.profileEnd('lpv build');
|
|
217
|
+
const ecd = engine.entityManager.dataset;
|
|
237
218
|
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
219
|
+
const volume = await build_probes_for_scene({
|
|
220
|
+
engine,
|
|
221
|
+
ecd,
|
|
222
|
+
bounds: mesh_bounds,
|
|
223
|
+
density: 10000
|
|
242
224
|
});
|
|
243
225
|
|
|
244
|
-
const
|
|
245
|
-
progress_entity
|
|
246
|
-
.add(GUIElement.fromView(progress))
|
|
247
|
-
.add(ViewportPosition.fromJSON({
|
|
248
|
-
position: new Vector2(0, 1),
|
|
249
|
-
anchor: new Vector2(0, 1),
|
|
250
|
-
offset: new Vector2(16, -16)
|
|
251
|
-
}))
|
|
252
|
-
.build(ecd);
|
|
253
|
-
|
|
254
|
-
task.promise().finally(() => progress_entity.destroy())
|
|
255
|
-
|
|
256
|
-
engine.executor.runGroup(task);
|
|
257
|
-
|
|
258
|
-
// fill probes with random data
|
|
259
|
-
// for (let i = 0; i < lpv.__length * 27; i++) {
|
|
260
|
-
// lpv.__probe_data[i] = random();
|
|
261
|
-
// }
|
|
262
|
-
|
|
263
|
-
// for (let i = 0; i < lpv.__length; i++) {
|
|
264
|
-
//
|
|
265
|
-
// for (let j = 0; j < 9; j++) {
|
|
266
|
-
// lpv.__probe_data[(i * 9 + j) * 3] = max2(0, (lpv.__positions[i * 3] + 10) / 20);
|
|
267
|
-
// lpv.__probe_data[(i * 9 + j) * 3 + 1] = max2(0, (lpv.__positions[i * 3 + 1] - 0.5) / 10.5);
|
|
268
|
-
// lpv.__probe_data[(i * 9 + j) * 3 + 2] = max2(0, (lpv.__positions[i * 3 + 2] + 10) / 20);
|
|
269
|
-
// }
|
|
270
|
-
// }
|
|
271
|
-
|
|
272
|
-
// lpv.white_probe(0, [
|
|
273
|
-
// 0.7953949, 0.4405923, 0.5459412,
|
|
274
|
-
// 0.3981450, 0.3526911, 0.6097158,
|
|
275
|
-
// -0.3424573, -0.1838151, -0.2715583,
|
|
276
|
-
//
|
|
277
|
-
// -0.2944621, -0.0560606, 0.0095193,
|
|
278
|
-
// -0.1123051, -0.0513088, -0.1232869,
|
|
279
|
-
// -0.2645007, -0.2257996, -0.4785847,
|
|
280
|
-
//
|
|
281
|
-
// -0.1569444, -0.0954703, -0.1485053,
|
|
282
|
-
// 0.5646247, 0.2161586, 0.1402643,
|
|
283
|
-
// 0.2137442, -0.0547578, -0.3061700], 0);
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
// lpv.visualize_mesh({ ecd: ecd });
|
|
226
|
+
const buffer = new BinaryBuffer();
|
|
287
227
|
|
|
288
|
-
|
|
228
|
+
adapter.serialize(buffer, volume);
|
|
289
229
|
|
|
290
|
-
|
|
230
|
+
buffer.trim();
|
|
291
231
|
|
|
292
|
-
|
|
232
|
+
engine.storage.promiseStoreBinary(key, buffer.data)
|
|
293
233
|
|
|
294
|
-
|
|
234
|
+
return volume;
|
|
295
235
|
}
|
|
296
236
|
|
|
297
237
|
/**
|
|
@@ -304,8 +244,8 @@ async function main(engine) {
|
|
|
304
244
|
engine,
|
|
305
245
|
enableWater: false,
|
|
306
246
|
enableTerrain: false,
|
|
307
|
-
|
|
308
|
-
enableLights: true,
|
|
247
|
+
enableLights: false,
|
|
248
|
+
// enableLights: true,
|
|
309
249
|
cameraFarDistance: 200,
|
|
310
250
|
focus: { x: 0, y: 0, z: 0 },
|
|
311
251
|
pitch: 1,
|
|
@@ -314,6 +254,15 @@ async function main(engine) {
|
|
|
314
254
|
// shadowmapResolution: 4096
|
|
315
255
|
});
|
|
316
256
|
|
|
257
|
+
await EngineHarness.buildLights({
|
|
258
|
+
engine,
|
|
259
|
+
shadowmapResolution: 4096,
|
|
260
|
+
ambientIntensity: 0.03,
|
|
261
|
+
sun: Color.white,
|
|
262
|
+
sunIntensity: 17,
|
|
263
|
+
sunDirection: new Vector3(0.5, -1, 0.3)
|
|
264
|
+
})
|
|
265
|
+
|
|
317
266
|
engine.graphics.getRenderer().setClearColor('#1e3441', 1);
|
|
318
267
|
|
|
319
268
|
// load_and_set_cubemap_v0(engine.graphics, 'data/textures/cubemaps/hip_miramar/32/', '.png');
|
|
@@ -323,14 +272,17 @@ async function main(engine) {
|
|
|
323
272
|
|
|
324
273
|
// const path = 'data/models/LowPolyTownshipSet/Small_house/Small_house.gltf';
|
|
325
274
|
// const path = 'data/models/sibenik/2/model.gltf';
|
|
326
|
-
const path = 'data/models/
|
|
327
|
-
// const path = 'data/models/
|
|
275
|
+
// const path = 'data/models/sibenik/3-window-less/model.gltf';
|
|
276
|
+
// const path = 'data/models/vokselia_spawn/model.gltf';
|
|
277
|
+
const path = 'data/models/sponza-pbr/gltf/sponza.glb';
|
|
328
278
|
// const path = 'data/models/LowPolyTownshipSet/Town_Hall/model.gltf';
|
|
329
279
|
// const path = 'data/models/Slaughter Mech/Slaugter Mech.gltf';
|
|
280
|
+
// const path = 'data/models/pica_pica/pica_pica.gltf';
|
|
330
281
|
|
|
331
282
|
const mesh_asset = await engine.assetManager.promise(path, 'model/gltf+json');
|
|
332
283
|
const gltf = mesh_asset.gltf;
|
|
333
284
|
|
|
285
|
+
// make_cornel_box(ecd);
|
|
334
286
|
|
|
335
287
|
const mesh_entity = new Entity();
|
|
336
288
|
mesh_entity
|
|
@@ -349,103 +301,21 @@ async function main(engine) {
|
|
|
349
301
|
const sg = n.entity.getComponent(ShadedGeometry);
|
|
350
302
|
|
|
351
303
|
if (sg !== null) {
|
|
352
|
-
sg.writeFlag(ShadedGeometryFlags.CastShadow,
|
|
353
|
-
sg.writeFlag(ShadedGeometryFlags.ReceiveShadow,
|
|
304
|
+
sg.writeFlag(ShadedGeometryFlags.CastShadow, true);
|
|
305
|
+
sg.writeFlag(ShadedGeometryFlags.ReceiveShadow, true);
|
|
354
306
|
}
|
|
355
307
|
});
|
|
356
308
|
|
|
357
|
-
|
|
358
|
-
// model_bounds.setNegativelyInfiniteBounds();
|
|
359
|
-
// composition.traverse((n) => {
|
|
360
|
-
//
|
|
361
|
-
// /**
|
|
362
|
-
// * @type {ShadedGeometry}
|
|
363
|
-
// */
|
|
364
|
-
// const sg = n.entity.getComponent(ShadedGeometry);
|
|
365
|
-
//
|
|
366
|
-
// if (sg !== null) {
|
|
367
|
-
// const aabb3 = new AABB3();
|
|
368
|
-
// sg.getBoundingBox(aabb3);
|
|
369
|
-
//
|
|
370
|
-
// model_bounds.expandToFit(aabb3);
|
|
371
|
-
// }
|
|
372
|
-
// })
|
|
373
|
-
|
|
374
309
|
composition.transform.scale.setScalar(1);
|
|
375
|
-
// composition.transform.position.set(0, -mesh_asset.boundingBox.y0, 0);
|
|
376
310
|
|
|
377
311
|
composition.build(ecd);
|
|
378
312
|
|
|
379
|
-
const model_footprint = Math.hypot(mesh_asset.boundingBox.getExtentsX(), mesh_asset.boundingBox.getExtentsY(), mesh_asset.boundingBox.getExtentsZ());
|
|
380
313
|
|
|
314
|
+
const mesh_bounds = mesh_asset.boundingBox;
|
|
315
|
+
// const mesh_bounds = new AABB3(0, 0, 0, 20, 20, 20);
|
|
381
316
|
|
|
382
|
-
|
|
383
|
-
// engine,
|
|
384
|
-
// scale: 2 * model_footprint,
|
|
385
|
-
// offset: new Vector3(0, 0, 0),
|
|
386
|
-
// direction: Vector3.up,
|
|
387
|
-
// up: Vector3.forward,
|
|
388
|
-
// material: new MeshStandardMaterial({
|
|
389
|
-
// color: 0x111111,
|
|
390
|
-
// map: make_test_texture(),
|
|
391
|
-
// }),
|
|
392
|
-
// shadow: true,
|
|
393
|
-
// }).build(ecd);
|
|
317
|
+
const model_footprint = Math.hypot(mesh_bounds.getExtentsX(), mesh_bounds.getExtentsY(), mesh_bounds.getExtentsZ());
|
|
394
318
|
|
|
395
|
-
//
|
|
396
|
-
// make_plane({
|
|
397
|
-
// scale: 3 * model_footprint,
|
|
398
|
-
// offset: new Vector3(0, mesh_asset.boundingBox.y1 + 2, 0),
|
|
399
|
-
// direction: Vector3.down,
|
|
400
|
-
// up: Vector3.forward,
|
|
401
|
-
// shadow: false,
|
|
402
|
-
// material: new MeshStandardMaterial({ color: '#c6f5ff' })
|
|
403
|
-
// }).build(ecd);
|
|
404
|
-
|
|
405
|
-
const points = [
|
|
406
|
-
0, 0, 0,
|
|
407
|
-
10, 0, 0,
|
|
408
|
-
10, 0, 10,
|
|
409
|
-
0, 0, 10,
|
|
410
|
-
|
|
411
|
-
0, 10, 0,
|
|
412
|
-
10, 10, 0,
|
|
413
|
-
10, 10, 10,
|
|
414
|
-
0, 10, 10,
|
|
415
|
-
];
|
|
416
|
-
|
|
417
|
-
//
|
|
418
|
-
// new Entity()
|
|
419
|
-
// .add(Transform.fromJSON({
|
|
420
|
-
// position: {
|
|
421
|
-
// x: mesh_asset.boundingBox.x0,
|
|
422
|
-
// y: mesh_asset.boundingBox.getCenterY(),
|
|
423
|
-
// z: mesh_asset.boundingBox.getCenterZ()
|
|
424
|
-
// }
|
|
425
|
-
// }))
|
|
426
|
-
// .add(Light.fromJSON({
|
|
427
|
-
// distance: model_footprint * 2,
|
|
428
|
-
// type: LightType.POINT,
|
|
429
|
-
// intensity: 10,
|
|
430
|
-
// color: 0xFF0000
|
|
431
|
-
// }))
|
|
432
|
-
// .build(ecd);
|
|
433
|
-
//
|
|
434
|
-
// new Entity()
|
|
435
|
-
// .add(Transform.fromJSON({
|
|
436
|
-
// position: {
|
|
437
|
-
// x: mesh_asset.boundingBox.x1,
|
|
438
|
-
// y: mesh_asset.boundingBox.getCenterY(),
|
|
439
|
-
// z: mesh_asset.boundingBox.getCenterZ()
|
|
440
|
-
// }
|
|
441
|
-
// }))
|
|
442
|
-
// .add(Light.fromJSON({
|
|
443
|
-
// distance: model_footprint * 2,
|
|
444
|
-
// type: LightType.POINT,
|
|
445
|
-
// intensity: 10,
|
|
446
|
-
// color: '#00f7ff'
|
|
447
|
-
// }))
|
|
448
|
-
// .build(ecd);
|
|
449
319
|
|
|
450
320
|
const random = seededRandom();
|
|
451
321
|
|
|
@@ -454,9 +324,9 @@ async function main(engine) {
|
|
|
454
324
|
new Entity()
|
|
455
325
|
.add(Transform.fromJSON({
|
|
456
326
|
position: {
|
|
457
|
-
x: randomFloatBetween(random,
|
|
458
|
-
y: randomFloatBetween(random,
|
|
459
|
-
z: randomFloatBetween(random,
|
|
327
|
+
x: randomFloatBetween(random, mesh_bounds.x0, mesh_bounds.x1),
|
|
328
|
+
y: randomFloatBetween(random, mesh_bounds.y0, mesh_bounds.y1),
|
|
329
|
+
z: randomFloatBetween(random, mesh_bounds.z0, mesh_bounds.z1),
|
|
460
330
|
}
|
|
461
331
|
}))
|
|
462
332
|
.add(Light.fromJSON({
|
|
@@ -468,12 +338,34 @@ async function main(engine) {
|
|
|
468
338
|
.build(ecd);
|
|
469
339
|
}
|
|
470
340
|
|
|
471
|
-
|
|
341
|
+
new Entity()
|
|
342
|
+
.add(GUIElement.fromView(new ButtonView({
|
|
343
|
+
name: "Toggle Model",
|
|
344
|
+
action() {
|
|
345
|
+
composition.isBuilt ? composition.destroy() : composition.build(ecd)
|
|
346
|
+
}
|
|
347
|
+
})))
|
|
348
|
+
.build(ecd);
|
|
472
349
|
|
|
473
|
-
|
|
474
|
-
|
|
350
|
+
await delay(200);
|
|
351
|
+
|
|
352
|
+
console.time('getVolume');
|
|
353
|
+
// console.profile('getVolume');
|
|
354
|
+
const volume = await getVolume({ engine, path });
|
|
355
|
+
// console.profileEnd('getVolume');
|
|
356
|
+
console.timeEnd('getVolume');
|
|
357
|
+
|
|
358
|
+
console.log('LPV:', volume);
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
volume.visualize_probes({ ecd, size: model_footprint * 0.002 });
|
|
362
|
+
// volume.visualize_mesh({ ecd , opacity: 0.2});
|
|
363
|
+
|
|
364
|
+
console.time('prepareTextures');
|
|
365
|
+
const textures = probe_volume_to_textures(volume);
|
|
366
|
+
console.timeEnd('prepareTextures');
|
|
475
367
|
|
|
476
|
-
|
|
368
|
+
console.log(textures);
|
|
477
369
|
|
|
478
370
|
// mesh_entity.addEventListener(SGMeshEvents.AssetLoaded, build);
|
|
479
371
|
//
|
|
@@ -485,7 +377,7 @@ new EngineHarness().initialize({
|
|
|
485
377
|
config.addSystem(new ShadedGeometrySystem(engine));
|
|
486
378
|
config.addSystem(new TransformAttachmentSystem());
|
|
487
379
|
config.addSystem(new LightSystem(engine, {
|
|
488
|
-
shadowResolution:
|
|
380
|
+
shadowResolution: 8192
|
|
489
381
|
}));
|
|
490
382
|
config.addSystem(new SGMeshSystem(engine));
|
|
491
383
|
config.addSystem(new GUIElementSystem(engine.gui.view, engine));
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
export function sky_hosek_precompute(mCoeffsXYZ: number[], mRadXYZ: number[], sun_direction: vec3, turbidity: number, rgbAlbedo: vec3, overcast: number): void;
|
|
12
12
|
/**
|
|
13
13
|
*
|
|
14
|
-
* @param {number[]} out vec3 in RGB color space
|
|
15
|
-
* @param {number[]} mCoeffsXYZ float[3][9]
|
|
16
|
-
* @param {number[]} mRadXYZ vec3
|
|
17
|
-
* @param {number[]} mToSun vec3
|
|
14
|
+
* @param {number[]|Float32Array} out vec3 in RGB color space
|
|
15
|
+
* @param {number[]|Float32Array} mCoeffsXYZ float[3][9]
|
|
16
|
+
* @param {number[]|Float32Array} mRadXYZ vec3
|
|
17
|
+
* @param {number[]|Float32Array} mToSun vec3
|
|
18
18
|
* @param {number} direction_x
|
|
19
19
|
* @param {number} direction_y
|
|
20
20
|
* @param {number} direction_z
|
|
21
21
|
*/
|
|
22
|
-
export function sky_hosek_compute_irradiance_by_direction(out: number[], mCoeffsXYZ: number[], mRadXYZ: number[], mToSun: number[], direction_x: number, direction_y: number, direction_z: number): void;
|
|
22
|
+
export function sky_hosek_compute_irradiance_by_direction(out: number[] | Float32Array, mCoeffsXYZ: number[] | Float32Array, mRadXYZ: number[] | Float32Array, mToSun: number[] | Float32Array, direction_x: number, direction_y: number, direction_z: number): void;
|
|
23
23
|
import { vec3 } from "gl-matrix";
|
|
24
24
|
//# sourceMappingURL=sky_hosek_compute_irradiance_by_direction.d.ts.map
|
package/src/engine/graphics/sh3/sky/hosek/sky_hosek_compute_irradiance_by_direction.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sky_hosek_compute_irradiance_by_direction.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/sh3/sky/hosek/sky_hosek_compute_irradiance_by_direction.js"],"names":[],"mappings":";AA+NA;;;;;;;;GAQG;AACH,iDAPW,MAAM,EAAE,WACR,MAAM,EAAE,iBACR,IAAI,aACJ,MAAM,aACN,IAAI,YACJ,MAAM,QA4HhB;AAGD;;;;;;;;;GASG;AACH,+DARW,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"sky_hosek_compute_irradiance_by_direction.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/sh3/sky/hosek/sky_hosek_compute_irradiance_by_direction.js"],"names":[],"mappings":";AA+NA;;;;;;;;GAQG;AACH,iDAPW,MAAM,EAAE,WACR,MAAM,EAAE,iBACR,IAAI,aACJ,MAAM,aACN,IAAI,YACJ,MAAM,QA4HhB;AAGD;;;;;;;;;GASG;AACH,+DARW,MAAM,EAAE,GAAC,YAAY,cACrB,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,EAAE,GAAC,YAAY,UACrB,MAAM,EAAE,GAAC,YAAY,eACrB,MAAM,eACN,MAAM,eACN,MAAM,QA6BhB;qBAxYoB,WAAW"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// --- Mathematical constants -------------------------------------------------
|
|
2
2
|
|
|
3
|
-
import { clamp } from "../../../../../core/math/clamp.js";
|
|
4
3
|
import { vec3 } from "gl-matrix";
|
|
4
|
+
import { rgb_to_xyz } from "../../../../../core/color/xyz/rgb_to_xyz.js";
|
|
5
|
+
import { xyz_to_rgb } from "../../../../../core/color/xyz/xyz_to_rgb.js";
|
|
6
|
+
import { v3_dot } from "../../../../../core/geom/vec3/v3_dot.js";
|
|
7
|
+
import { clamp } from "../../../../../core/math/clamp.js";
|
|
5
8
|
import { clamp01 } from "../../../../../core/math/clamp01.js";
|
|
6
9
|
import { lerp } from "../../../../../core/math/lerp.js";
|
|
7
|
-
import { v3_dot } from "../../../../../core/geom/vec3/v3_dot.js";
|
|
8
10
|
import { kHosekCoeffsX, kHosekCoeffsY, kHosekCoeffsZ, kHosekRadX, kHosekRadY, kHosekRadZ } from "./data.js";
|
|
9
|
-
import { xyz_to_rgb } from "../../../../../core/color/xyz/xyz_to_rgb.js";
|
|
10
|
-
import { rgb_to_xyz } from "../../../../../core/color/xyz/rgb_to_xyz.js";
|
|
11
11
|
|
|
12
12
|
const vl_pi = (3.14159265358979323846);
|
|
13
13
|
const vl_halfPi = (vl_pi / 2.0);
|
|
@@ -357,10 +357,10 @@ export function sky_hosek_precompute(
|
|
|
357
357
|
|
|
358
358
|
/**
|
|
359
359
|
*
|
|
360
|
-
* @param {number[]} out vec3 in RGB color space
|
|
361
|
-
* @param {number[]} mCoeffsXYZ float[3][9]
|
|
362
|
-
* @param {number[]} mRadXYZ vec3
|
|
363
|
-
* @param {number[]} mToSun vec3
|
|
360
|
+
* @param {number[]|Float32Array} out vec3 in RGB color space
|
|
361
|
+
* @param {number[]|Float32Array} mCoeffsXYZ float[3][9]
|
|
362
|
+
* @param {number[]|Float32Array} mRadXYZ vec3
|
|
363
|
+
* @param {number[]|Float32Array} mToSun vec3
|
|
364
364
|
* @param {number} direction_x
|
|
365
365
|
* @param {number} direction_y
|
|
366
366
|
* @param {number} direction_z
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number} [size]
|
|
4
|
+
* @param {boolean} [shadow]
|
|
5
|
+
* @param position
|
|
6
|
+
* @param [position_offset]
|
|
7
|
+
* @param sh
|
|
8
|
+
* @param [sh_offset]
|
|
9
|
+
* @return {Entity}
|
|
10
|
+
*/
|
|
11
|
+
export function visualise_spherical_harmonic_sphere({ size, shadow, position, position_offset, sh, sh_offset }?: number): Entity;
|
|
12
|
+
import Entity from "../../ecs/Entity.js";
|
|
13
|
+
//# sourceMappingURL=visualise_spherical_harmonic_sphere.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visualise_spherical_harmonic_sphere.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/sh3/visualise_spherical_harmonic_sphere.js"],"names":[],"mappings":"AASA;;;;;;;;;GASG;AACH,iHARW,MAAM,GAML,MAAM,CAoCjB;mBApDkB,qBAAqB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { OctahedronBufferGeometry } from "three";
|
|
2
|
+
import Entity from "../../ecs/Entity.js";
|
|
3
|
+
import { Transform } from "../../ecs/transform/Transform.js";
|
|
4
|
+
import { ShadedGeometry } from "../ecs/mesh-v2/ShadedGeometry.js";
|
|
5
|
+
import { ShadedGeometryFlags } from "../ecs/mesh-v2/ShadedGeometryFlags.js";
|
|
6
|
+
import { SH3VisualisationMaterial } from "./SH3VisualisationMaterial.js";
|
|
7
|
+
|
|
8
|
+
const geometry = new OctahedronBufferGeometry(1, 5);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param {number} [size]
|
|
13
|
+
* @param {boolean} [shadow]
|
|
14
|
+
* @param position
|
|
15
|
+
* @param [position_offset]
|
|
16
|
+
* @param sh
|
|
17
|
+
* @param [sh_offset]
|
|
18
|
+
* @return {Entity}
|
|
19
|
+
*/
|
|
20
|
+
export function visualise_spherical_harmonic_sphere({
|
|
21
|
+
size = 1,
|
|
22
|
+
shadow = false,
|
|
23
|
+
position,
|
|
24
|
+
position_offset = 0,
|
|
25
|
+
sh,
|
|
26
|
+
sh_offset = 0
|
|
27
|
+
}) {
|
|
28
|
+
|
|
29
|
+
const mat = new SH3VisualisationMaterial();
|
|
30
|
+
|
|
31
|
+
const uniform_value = mat.uniforms.sh.value;
|
|
32
|
+
for (let i = 0; i < 9; i++) {
|
|
33
|
+
uniform_value[i].fromArray(sh, sh_offset + i * 3);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const shadedGeometry = ShadedGeometry.from(geometry, mat);
|
|
37
|
+
|
|
38
|
+
// prevent instanced rendering
|
|
39
|
+
shadedGeometry.setFlag(ShadedGeometryFlags.DrawMethodLocked);
|
|
40
|
+
|
|
41
|
+
shadedGeometry.writeFlag(ShadedGeometryFlags.ReceiveShadow, shadow);
|
|
42
|
+
shadedGeometry.writeFlag(ShadedGeometryFlags.CastShadow, shadow);
|
|
43
|
+
|
|
44
|
+
return new Entity()
|
|
45
|
+
.add(Transform.fromJSON({
|
|
46
|
+
position: {
|
|
47
|
+
x: position[position_offset],
|
|
48
|
+
y: position[position_offset + 1],
|
|
49
|
+
z: position[position_offset + 2],
|
|
50
|
+
},
|
|
51
|
+
scale: size
|
|
52
|
+
}))
|
|
53
|
+
.add(shadedGeometry);
|
|
54
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttributeDataTexture.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/texture/AttributeDataTexture.js"],"names":[],"mappings":"AAYA;IAwRI;;;;;;OAMG;IACH,+CAHW,MAAM,cACN,MAAM,GAHL,oBAAoB,CAO/B;IAhSD;;;;;OAKG;IACH,+CAHW,MAAM,cACN,MAAM,EA2ChB;IA/BG;;;;OAIG;IACH,eAAkB;IAElB,mBAAoB;IAEpB;;;;OAIG;IACH,uBAAkC;IAElC;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,qBAA8B;IAKlC;;;OAGG;IACH,0BAEC;IAED,cASC;IAED,0BAGC;IAED,2BAEC;IAED;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"AttributeDataTexture.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/texture/AttributeDataTexture.js"],"names":[],"mappings":"AAYA;IAwRI;;;;;;OAMG;IACH,+CAHW,MAAM,cACN,MAAM,GAHL,oBAAoB,CAO/B;IAhSD;;;;;OAKG;IACH,+CAHW,MAAM,cACN,MAAM,EA2ChB;IA/BG;;;;OAIG;IACH,eAAkB;IAElB,mBAAoB;IAEpB;;;;OAIG;IACH,uBAAkC;IAElC;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,qBAA8B;IAKlC;;;OAGG;IACH,0BAEC;IAED,cASC;IAED,0BAGC;IAED,2BAEC;IAED;;;OAGG;IACH,mBAFW,MAAM,QAwChB;IAED,cA4BC;IAED;;;;;;OAMG;IACH,yBALW,MAAM,WACN,MAAM,EAAE,UACR,MAAM,EAAE,GACN,OAAO,CAoCnB;IAED;;;;;OAKG;IACH,8BAJW,MAAM,WACN,MAAM,EAAE,UACR,MAAM,EAAE,QAmClB;IAED;;;OAGG;IACH,sBAFW,MAAM,QAgBhB;IAED;;;OAGG;IACH,sCAEC;IAED;;;OAGG;IACH,2BAEC;IAED;;;OAGG;IACH,oBAFY,MAAM,CAIjB;CAYJ;4BA9S0C,OAAO"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { DataTexture, NearestFilter } from "three";
|
|
1
2
|
import { assert } from "../../../core/assert.js";
|
|
3
|
+
import {
|
|
4
|
+
compute_typed_array_constructor_from_data_type
|
|
5
|
+
} from "../../../core/binary/type/DataType2TypedArrayConstructorMapping.js";
|
|
6
|
+
import { DataTypeByteSizes } from "../../../core/binary/type/DataTypeByteSizes.js";
|
|
2
7
|
import { typed_array_copy } from "../../../core/collection/array/typed/typed_array_copy.js";
|
|
3
8
|
import { channelCountToThreeTextureFormat } from "./channelCountToThreeTextureFormat.js";
|
|
4
|
-
import { DataTexture, NearestFilter } from "three";
|
|
5
|
-
import { computeThreeTextureTypeFromDataType } from "./computeThreeTextureTypeFromDataType.js";
|
|
6
9
|
import { computeThreeTextureInternalFormatFromDataType } from "./computeThreeTextureInternalFormatFromDataType.js";
|
|
7
|
-
import {
|
|
10
|
+
import { computeThreeTextureTypeFromDataType } from "./computeThreeTextureTypeFromDataType.js";
|
|
8
11
|
import { normalized_internal_format } from "./normalized_internal_format.js";
|
|
9
|
-
import {
|
|
10
|
-
compute_typed_array_constructor_from_data_type
|
|
11
|
-
} from "../../../core/binary/type/DataType2TypedArrayConstructorMapping.js";
|
|
12
12
|
|
|
13
13
|
export class AttributeDataTexture {
|
|
14
14
|
/**
|
|
@@ -90,12 +90,12 @@ export class AttributeDataTexture {
|
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
*
|
|
93
|
-
* @param {number}
|
|
93
|
+
* @param {number} slot_count
|
|
94
94
|
*/
|
|
95
|
-
resize(
|
|
96
|
-
assert.isNonNegativeInteger(
|
|
95
|
+
resize(slot_count) {
|
|
96
|
+
assert.isNonNegativeInteger(slot_count, 'slot_count');
|
|
97
97
|
|
|
98
|
-
this.__capacity =
|
|
98
|
+
this.__capacity = slot_count;
|
|
99
99
|
|
|
100
100
|
const spec = this.__spec;
|
|
101
101
|
|
|
@@ -113,7 +113,7 @@ export class AttributeDataTexture {
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
|
|
116
|
-
// console.log(`#AttributeDataTexture.resize(${
|
|
116
|
+
// console.log(`#AttributeDataTexture.resize(${slot_count})`); // DEBUG
|
|
117
117
|
|
|
118
118
|
const old_data = image.data;
|
|
119
119
|
|
|
@@ -192,7 +192,7 @@ class InputControllerSystem extends System {
|
|
|
192
192
|
|
|
193
193
|
this.devices = devices;
|
|
194
194
|
|
|
195
|
-
console.log("Input Controller System started. Devices: ", devices);
|
|
195
|
+
// console.log("Input Controller System started. Devices: ", devices);
|
|
196
196
|
|
|
197
197
|
const self = this;
|
|
198
198
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerView.d.ts","sourceRoot":"","sources":["../../../../src/view/elements/ColorPickerView.js"],"names":[],"mappings":"AAQA;CA+RC;
|
|
1
|
+
{"version":3,"file":"ColorPickerView.d.ts","sourceRoot":"","sources":["../../../../src/view/elements/ColorPickerView.js"],"names":[],"mappings":"AAQA;CA+RC;uBAlSsB,sCAAsC"}
|