@woosh/meep-engine 2.164.0 → 2.165.1
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/README.md +137 -108
- package/build/bundle-worker-image-decoder.js +1 -1
- package/build/bundle-worker-terrain.js +1 -1
- package/package.json +1 -1
- package/samples/generation/SampleGenerator0.js +3 -3
- package/samples/generation/filters/SampleGroundMoistureFilter.js +63 -56
- package/samples/generation/filters/SampleNoise20_0.js +6 -1
- package/samples/generation/themes/SampleTheme0.js +47 -47
- package/src/core/binary/BitImage2.d.ts +91 -0
- package/src/core/binary/BitImage2.d.ts.map +1 -0
- package/src/core/binary/BitImage2.js +242 -0
- package/src/core/color/YCoCg/rgb_to_ycocg.d.ts +17 -0
- package/src/core/color/YCoCg/rgb_to_ycocg.d.ts.map +1 -0
- package/src/core/color/YCoCg/rgb_to_ycocg.js +20 -0
- package/src/core/color/YCoCg/ycocg_to_rgb.d.ts +14 -0
- package/src/core/color/YCoCg/ycocg_to_rgb.d.ts.map +1 -0
- package/src/core/color/YCoCg/ycocg_to_rgb.js +17 -0
- package/src/core/geom/2d/oriented-box/min_area_rect_2d.d.ts +22 -0
- package/src/core/geom/2d/oriented-box/min_area_rect_2d.d.ts.map +1 -0
- package/src/core/geom/2d/oriented-box/min_area_rect_2d.js +69 -0
- package/src/core/geom/2d/packing/skyline.d.ts +116 -0
- package/src/core/geom/2d/packing/skyline.d.ts.map +1 -0
- package/src/core/geom/2d/packing/skyline.js +258 -0
- package/src/core/geom/2d/triangle/tri2_rasterize_conservative.d.ts +18 -0
- package/src/core/geom/2d/triangle/tri2_rasterize_conservative.d.ts.map +1 -0
- package/src/core/geom/2d/triangle/tri2_rasterize_conservative.js +86 -0
- package/src/core/geom/3d/atlas/ATLAS_PORT_PLAN.md +486 -0
- package/src/core/geom/3d/atlas/BFF_PLAN.md +174 -0
- package/src/core/geom/3d/atlas/Chart.d.ts +58 -0
- package/src/core/geom/3d/atlas/Chart.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/Chart.js +77 -0
- package/src/core/geom/3d/atlas/REVIEW_02.md +392 -0
- package/src/core/geom/3d/atlas/atlas_bench_lib.d.ts +73 -0
- package/src/core/geom/3d/atlas/atlas_bench_lib.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_bench_lib.js +315 -0
- package/src/core/geom/3d/atlas/atlas_chart_type.d.ts +17 -0
- package/src/core/geom/3d/atlas/atlas_chart_type.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_chart_type.js +16 -0
- package/src/core/geom/3d/atlas/atlas_compute_charts.d.ts +25 -0
- package/src/core/geom/3d/atlas/atlas_compute_charts.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_compute_charts.js +188 -0
- package/src/core/geom/3d/atlas/atlas_extract_chart.d.ts +17 -0
- package/src/core/geom/3d/atlas/atlas_extract_chart.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_extract_chart.js +107 -0
- package/src/core/geom/3d/atlas/atlas_generate.d.ts +39 -0
- package/src/core/geom/3d/atlas/atlas_generate.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_generate.js +43 -0
- package/src/core/geom/3d/atlas/atlas_test_fixtures.d.ts +84 -0
- package/src/core/geom/3d/atlas/atlas_test_fixtures.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_test_fixtures.js +266 -0
- package/src/core/geom/3d/atlas/atlas_write_chart_uvs.d.ts +25 -0
- package/src/core/geom/3d/atlas/atlas_write_chart_uvs.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_write_chart_uvs.js +36 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_dihedrals.d.ts +22 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_dihedrals.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_dihedrals.js +62 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_lengths.d.ts +9 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_lengths.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_lengths.js +33 -0
- package/src/core/geom/3d/atlas/data/atlas_build_face_areas.d.ts +9 -0
- package/src/core/geom/3d/atlas/data/atlas_build_face_areas.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/data/atlas_build_face_areas.js +50 -0
- package/src/core/geom/3d/atlas/io/atlas_mesh_weld_colocals.d.ts +27 -0
- package/src/core/geom/3d/atlas/io/atlas_mesh_weld_colocals.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/io/atlas_mesh_weld_colocals.js +39 -0
- package/src/core/geom/3d/atlas/io/bt_loop_uv.d.ts +22 -0
- package/src/core/geom/3d/atlas/io/bt_loop_uv.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/io/bt_loop_uv.js +57 -0
- package/src/core/geom/3d/atlas/pack/ChartPlacement.d.ts +36 -0
- package/src/core/geom/3d/atlas/pack/ChartPlacement.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/pack/ChartPlacement.js +46 -0
- package/src/core/geom/3d/atlas/pack/atlas_pack_charts.d.ts +62 -0
- package/src/core/geom/3d/atlas/pack/atlas_pack_charts.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/pack/atlas_pack_charts.js +551 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_param_validity.d.ts +22 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_param_validity.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_param_validity.js +73 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_bff.d.ts +37 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_bff.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_bff.js +270 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_lscm.d.ts +23 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_lscm.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_lscm.js +224 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_ortho.d.ts +14 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_ortho.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_ortho.js +38 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_stretch_metric.d.ts +22 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_stretch_metric.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_stretch_metric.js +86 -0
- package/src/core/geom/3d/atlas/param/atlas_piecewise_resegment.d.ts +20 -0
- package/src/core/geom/3d/atlas/param/atlas_piecewise_resegment.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_piecewise_resegment.js +183 -0
- package/src/core/geom/3d/atlas/param/fit_plane_basis.d.ts +27 -0
- package/src/core/geom/3d/atlas/param/fit_plane_basis.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/fit_plane_basis.js +66 -0
- package/src/core/geom/3d/atlas/segment/RegionGraph.d.ts +31 -0
- package/src/core/geom/3d/atlas/segment/RegionGraph.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/RegionGraph.js +40 -0
- package/src/core/geom/3d/atlas/segment/atlas_build_region_graph.d.ts +23 -0
- package/src/core/geom/3d/atlas/segment/atlas_build_region_graph.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/atlas_build_region_graph.js +136 -0
- package/src/core/geom/3d/atlas/segment/atlas_compute_planar_regions.d.ts +24 -0
- package/src/core/geom/3d/atlas/segment/atlas_compute_planar_regions.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/atlas_compute_planar_regions.js +77 -0
- package/src/core/geom/3d/atlas/segment/atlas_merge_charts.d.ts +27 -0
- package/src/core/geom/3d/atlas/segment/atlas_merge_charts.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/atlas_merge_charts.js +113 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts.d.ts +44 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts.js +275 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.d.ts +22 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.js +199 -0
- package/src/core/geom/3d/line/line3_compute_point_segment_point_distance_unfolded.d.ts +32 -0
- package/src/core/geom/3d/line/line3_compute_point_segment_point_distance_unfolded.d.ts.map +1 -0
- package/src/core/geom/3d/line/line3_compute_point_segment_point_distance_unfolded.js +64 -0
- package/src/core/geom/3d/mat4/m4_from_rotation_translation_scale.d.ts +20 -0
- package/src/core/geom/3d/mat4/m4_from_rotation_translation_scale.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/m4_from_rotation_translation_scale.js +66 -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 +13 -11
- package/src/core/geom/3d/sphere/sphere_compute_bounding_of_2_spheres.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/sphere_compute_bounding_of_2_spheres.js +4 -3
- package/src/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.d.ts.map +1 -1
- package/src/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.js +4 -3
- package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.d.ts.map +1 -1
- package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.js +4 -3
- package/src/core/geom/3d/topology/simplify/quadratic/apply_border_penalty_to_vertex_quadrics.d.ts.map +1 -1
- package/src/core/geom/3d/topology/simplify/quadratic/apply_border_penalty_to_vertex_quadrics.js +10 -6
- package/src/core/geom/3d/topology/struct/TopoMesh.js +2 -2
- package/src/core/geom/3d/topology/struct/TopoTriangle.d.ts +0 -2
- package/src/core/geom/3d/topology/struct/TopoTriangle.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/TopoTriangle.js +2 -2
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_find_path_polyanya.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_find_path_polyanya.js +8 -27
- package/src/core/geom/vec3/v3_cotangent.d.ts +20 -0
- package/src/core/geom/vec3/v3_cotangent.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_cotangent.js +29 -0
- package/src/core/geom/vec3/v3_matrix3_multiply.d.ts +19 -0
- package/src/core/geom/vec3/v3_matrix3_multiply.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_matrix3_multiply.js +30 -0
- package/src/core/geom/vec3/v3_multiply.d.ts +16 -0
- package/src/core/geom/vec3/v3_multiply.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_multiply.js +19 -0
- package/src/core/math/linalg/cg/cg_solve.d.ts +24 -0
- package/src/core/math/linalg/cg/cg_solve.d.ts.map +1 -0
- package/src/core/math/linalg/cg/cg_solve.js +106 -0
- package/src/core/math/linalg/cg/cg_solve_normal_equations.d.ts +21 -0
- package/src/core/math/linalg/cg/cg_solve_normal_equations.d.ts.map +1 -0
- package/src/core/math/linalg/cg/cg_solve_normal_equations.js +59 -0
- package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.d.ts +19 -0
- package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.d.ts.map +1 -0
- package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.js +117 -0
- package/src/core/math/linalg/sparse/SparseMatrixCSR.d.ts +50 -0
- package/src/core/math/linalg/sparse/SparseMatrixCSR.d.ts.map +1 -0
- package/src/core/math/linalg/sparse/SparseMatrixCSR.js +88 -0
- package/src/core/math/linalg/sparse/spm_matvec.d.ts +9 -0
- package/src/core/math/linalg/sparse/spm_matvec.d.ts.map +1 -0
- package/src/core/math/linalg/sparse/spm_matvec.js +22 -0
- package/src/core/math/linalg/sparse/spm_matvec_transpose.d.ts +12 -0
- package/src/core/math/linalg/sparse/spm_matvec_transpose.d.ts.map +1 -0
- package/src/core/math/linalg/sparse/spm_matvec_transpose.js +29 -0
- package/src/core/math/physics/mie/MIE_PARTICLES_STANDARD_PRECOMPUTED.d.ts +39 -0
- package/src/core/math/physics/mie/MIE_PARTICLES_STANDARD_PRECOMPUTED.js +22 -1
- package/src/core/math/physics/mie/compute_mie_particle_properties_rgb.d.ts.map +1 -1
- package/src/core/math/physics/mie/compute_mie_particle_properties_rgb.js +32 -9
- package/src/core/math/physics/mie/compute_mie_phase.d.ts +2 -3
- package/src/core/math/physics/mie/compute_mie_phase.d.ts.map +1 -1
- package/src/core/math/physics/mie/compute_mie_phase.js +1 -3
- package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts +0 -1
- package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts.map +1 -1
- package/src/core/math/physics/mie/lorenz_mie_coefs.js +0 -7
- package/src/engine/REVIEW_2026_07_03.md +211 -0
- package/src/engine/animation/curve/actionProcessorOperations/curveActions.d.ts.map +1 -1
- package/src/engine/animation/curve/actionProcessorOperations/curveActions.js +3 -2
- package/src/engine/animation/curve/compression/sample_animation_curve_to_float_array.js +1 -1
- package/src/engine/animation/keyed2/AnimationTrackPlayback.d.ts.map +1 -1
- package/src/engine/animation/keyed2/AnimationTrackPlayback.js +3 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.js +2 -2
- package/src/engine/asset/preloader/AssetPreloader.d.ts.map +1 -1
- package/src/engine/asset/preloader/AssetPreloader.js +6 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts.map +1 -1
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.js +5 -2
- package/src/engine/ecs/Entity.js +1 -1
- package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
- package/src/engine/ecs/EntityComponentDataset.js +1 -0
- package/src/engine/ecs/EntityManager.js +1 -1
- package/src/engine/ecs/EntityObserver.js +1 -1
- package/src/engine/ecs/animation/AnimationClip.js +1 -1
- package/src/engine/ecs/attachment/AttachmentSystem.js +2 -2
- package/src/engine/ecs/attachment/TransformAttachmentBinding.d.ts.map +1 -1
- package/src/engine/ecs/attachment/TransformAttachmentBinding.js +14 -3
- package/src/engine/ecs/fow/FogOfWar.js +2 -2
- package/src/engine/ecs/fow/shader/screenSpaceFogOfWarShader.d.ts.map +1 -1
- package/src/engine/ecs/fow/shader/screenSpaceFogOfWarShader.js +8 -0
- package/src/engine/ecs/gui/hud/HeadsUpDisplaySystem.js +3 -3
- package/src/engine/ecs/gui/position/ViewportPosition.d.ts +3 -1
- package/src/engine/ecs/gui/position/ViewportPosition.d.ts.map +1 -1
- package/src/engine/ecs/gui/position/ViewportPosition.js +4 -1
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts +10 -0
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts.map +1 -1
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.js +43 -0
- package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.d.ts +93 -0
- package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.d.ts.map +1 -0
- package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.js +315 -0
- package/src/engine/ecs/storage/binary/object-v2/BinaryObjectSerializer.d.ts +48 -0
- package/src/engine/ecs/storage/binary/object-v2/BinaryObjectSerializer.d.ts.map +1 -0
- package/src/engine/ecs/storage/binary/object-v2/BinaryObjectSerializer.js +331 -0
- package/src/engine/ecs/storage/binary/object-v2/DESIGN.md +199 -0
- package/src/engine/ecs/storage/binary/object-v2/ObjectBinaryFormat.d.ts +53 -0
- package/src/engine/ecs/storage/binary/object-v2/ObjectBinaryFormat.d.ts.map +1 -0
- package/src/engine/ecs/storage/binary/object-v2/ObjectBinaryFormat.js +57 -0
- package/src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.d.ts +53 -0
- package/src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.d.ts.map +1 -0
- package/src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.js +56 -0
- package/src/engine/ecs/storage/binary/object-v2/README.md +110 -0
- package/src/engine/ecs/storage/binary/object-v2/objectStringCodec.d.ts +13 -0
- package/src/engine/ecs/storage/binary/object-v2/objectStringCodec.d.ts.map +1 -0
- package/src/engine/ecs/storage/binary/object-v2/objectStringCodec.js +48 -0
- package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts +29 -0
- package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts.map +1 -0
- package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.js +44 -0
- package/src/engine/ecs/terrain/ecs/Terrain.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/Terrain.js +4 -3
- package/src/engine/ecs/terrain/tiles/TerrainTile.js +2 -2
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts.map +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.js +9 -8
- package/src/engine/graphics/GraphicsEngine.d.ts.map +1 -1
- package/src/engine/graphics/GraphicsEngine.js +2 -1
- package/src/engine/graphics/camera/makeScreenScissorFrustum.d.ts.map +1 -1
- package/src/engine/graphics/camera/makeScreenScissorFrustum.js +11 -10
- package/src/engine/graphics/canvas/canvas2d_draw_linear_scale.d.ts.map +1 -1
- package/src/engine/graphics/canvas/canvas2d_draw_linear_scale.js +3 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.d.ts +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/writeAnimationGraphDefinitionToJSON.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/writeAnimationGraphDefinitionToJSON.js +2 -0
- package/src/engine/graphics/ecs/camera/Camera.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/Camera.js +4 -0
- package/src/engine/graphics/ecs/camera/auto_set_camera_clipping_planes.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/auto_set_camera_clipping_planes.js +7 -2
- package/src/engine/graphics/ecs/camera/set_camera_aspect_ratio.js +1 -1
- package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.js +2 -2
- package/src/engine/graphics/ecs/decal/v2/prototypeDecalSystem.js +2 -2
- package/src/engine/graphics/ecs/highlight/system/ShadedGeometryHighlightSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/highlight/system/ShadedGeometryHighlightSystem.js +4 -1
- package/src/engine/graphics/ecs/light/binding/LightBinding.js +2 -2
- package/src/engine/graphics/ecs/mesh/MeshSystem.js +1 -1
- package/src/engine/graphics/ecs/mesh/SkeletonUtils.js +1 -1
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +2 -2
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +0 -1
- package/src/engine/graphics/ecs/mesh-v2/sg_hierarchy_compute_bounding_box_via_parent_entity.js +1 -1
- package/src/engine/graphics/ecs/path/tube/build/computeFrenetFrames.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/tube/build/computeFrenetFrames.js +8 -7
- package/src/engine/graphics/ecs/water/WaterSystem.d.ts +6 -0
- package/src/engine/graphics/ecs/water/WaterSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/water/WaterSystem.js +12 -1
- package/src/engine/graphics/geometry/MikkT/AvgTSpace.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/AvgTSpace.js +11 -6
- package/src/engine/graphics/geometry/MikkT/BuildNeighborsFast.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/BuildNeighborsFast.js +2 -3
- package/src/engine/graphics/geometry/MikkT/CalcTexArea.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/CalcTexArea.js +3 -4
- package/src/engine/graphics/geometry/MikkT/DegenEpilogue.js +4 -4
- package/src/engine/graphics/geometry/MikkT/EvalTspace.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/EvalTspace.js +11 -8
- package/src/engine/graphics/geometry/MikkT/GenerateSharedVerticesIndexList.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/GenerateSharedVerticesIndexList.js +7 -8
- package/src/engine/graphics/geometry/MikkT/GenerateTSpaces.js +8 -8
- package/src/engine/graphics/geometry/MikkT/InitTriInfo.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/InitTriInfo.js +30 -25
- package/src/engine/graphics/geometry/MikkT/MikkTSpace.js +7 -7
- package/src/engine/graphics/geometry/MikkT/NormalizeSafe.d.ts +0 -1
- package/src/engine/graphics/geometry/MikkT/NormalizeSafe.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/NormalizeSafe.js +6 -4
- package/src/engine/graphics/geometry/MikkT/STSpace.d.ts +0 -2
- package/src/engine/graphics/geometry/MikkT/STSpace.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/STSpace.js +3 -3
- package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.d.ts +0 -2
- package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.js +0 -1
- package/src/engine/graphics/geometry/buffered/ensureGeometryBoundingSphere.js +1 -1
- package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_nearest.d.ts.map +1 -1
- package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_nearest.js +0 -15
- package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.js +10 -10
- package/src/engine/graphics/geometry/optimization/merge/merge_geometry_hierarchy.js +1 -1
- package/src/engine/graphics/impostors/octahedral/ImpostorBaker.d.ts +0 -2
- package/src/engine/graphics/impostors/octahedral/ImpostorBaker.d.ts.map +1 -1
- package/src/engine/graphics/impostors/octahedral/ImpostorBaker.js +4 -3
- package/src/engine/graphics/impostors/octahedral/grid/HemiOctahedralUvEncoder.js +2 -2
- package/src/engine/graphics/impostors/octahedral/grid/UvEncoder.d.ts +17 -7
- package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.js +2 -2
- package/src/engine/graphics/material/SplatMaterial.js +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +3 -2
- package/src/engine/graphics/particles/particular/engine/emitter/ParticlePool.js +1 -1
- package/src/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.js +3 -3
- package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +4 -3
- package/src/engine/graphics/particles/particular/group/ParticleGroup.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/group/ParticleGroup.js +3 -2
- package/src/engine/graphics/render/forward_plus/LightManager.js +2 -2
- package/src/engine/graphics/render/forward_plus/model/Decal.d.ts +0 -2
- package/src/engine/graphics/render/forward_plus/model/Decal.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/model/Decal.js +3 -3
- package/src/engine/graphics/render/forward_plus/plugin/ForwardPlusRenderingPlugin.js +1 -1
- package/src/engine/graphics/render/forward_plus/prototype/prototypeLightManager.js +4 -3
- package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +6 -4
- package/src/engine/graphics/sh3/gi/material/MaterialTransformer.d.ts +1 -8
- package/src/engine/graphics/sh3/gi/material/MaterialTransformer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/gi/material/MaterialTransformer.js +2 -14
- package/src/engine/graphics/sh3/gi/material/ProbeResolutionStage.d.ts +9 -0
- package/src/engine/graphics/sh3/gi/material/ProbeResolutionStage.d.ts.map +1 -0
- package/src/engine/graphics/sh3/gi/material/ProbeResolutionStage.js +14 -0
- package/src/engine/graphics/sh3/lightmap/ARTIFACTS_PLAN.md +146 -0
- package/src/engine/graphics/sh3/lightmap/CODE_REVIEW.md +121 -0
- package/src/engine/graphics/sh3/lightmap/LIGHTMAPPER_REVIEW.md +183 -0
- package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.d.ts +90 -0
- package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.js +681 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_build_geometry.d.ts +32 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_build_geometry.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_build_geometry.js +155 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_denoise.d.ts +49 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_denoise.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_denoise.js +136 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_dilate.d.ts +19 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_dilate.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_dilate.js +89 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_gather.d.ts +54 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_gather.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_gather.js +168 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_rasterize_triangle.d.ts +30 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_rasterize_triangle.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_rasterize_triangle.js +145 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_seam_fix.d.ts +38 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_seam_fix.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_seam_fix.js +152 -0
- package/src/engine/graphics/sh3/lightmap/prototypeLightmapBaker.d.ts +2 -0
- package/src/engine/graphics/sh3/lightmap/prototypeLightmapBaker.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/prototypeLightmapBaker.js +186 -0
- package/src/engine/graphics/sh3/lpg/LightProbeGrid.d.ts +69 -0
- package/src/engine/graphics/sh3/lpg/LightProbeGrid.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/LightProbeGrid.js +173 -0
- package/src/engine/graphics/sh3/lpg/LightProbeGridBaker.d.ts +24 -0
- package/src/engine/graphics/sh3/lpg/LightProbeGridBaker.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/LightProbeGridBaker.js +88 -0
- package/src/engine/graphics/sh3/lpg/build_light_probe_grid_for_scene.d.ts +20 -0
- package/src/engine/graphics/sh3/lpg/build_light_probe_grid_for_scene.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/build_light_probe_grid_for_scene.js +79 -0
- package/src/engine/graphics/sh3/lpg/light_probe_grid_obtain_storage_cached.d.ts +11 -0
- package/src/engine/graphics/sh3/lpg/light_probe_grid_obtain_storage_cached.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/light_probe_grid_obtain_storage_cached.js +84 -0
- package/src/engine/graphics/sh3/lpg/light_probe_grid_textures.d.ts +29 -0
- package/src/engine/graphics/sh3/lpg/light_probe_grid_textures.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/light_probe_grid_textures.js +160 -0
- package/src/engine/graphics/sh3/lpg/material/LightProbeGridMaterialTransformer.d.ts +23 -0
- package/src/engine/graphics/sh3/lpg/material/LightProbeGridMaterialTransformer.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/LightProbeGridMaterialTransformer.js +228 -0
- package/src/engine/graphics/sh3/lpg/material/chunk_lpg_get_irradiance_at.d.ts +2 -0
- package/src/engine/graphics/sh3/lpg/material/chunk_lpg_get_irradiance_at.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/chunk_lpg_get_irradiance_at.js +24 -0
- package/src/engine/graphics/sh3/lpg/material/common.d.ts +3 -0
- package/src/engine/graphics/sh3/lpg/material/common.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/common.js +73 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/build_fragment_shader.d.ts +6 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/build_fragment_shader.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/build_fragment_shader.js +42 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.d.ts +6 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.js +49 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.d.ts +9 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.js +12 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.d.ts +6 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.js +30 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.d.ts +6 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.js +41 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.d.ts +3 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.js +15 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.d.ts +3 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.js +9 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.d.ts +9 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.js +12 -0
- package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.d.ts +20 -0
- package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.js +59 -0
- package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.js +2 -2
- package/src/engine/graphics/sh3/path_tracer/PathTracer.js +2 -2
- package/src/engine/graphics/sh3/path_tracer/material/MaterialConverter.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/material/MaterialConverter.js +8 -0
- package/src/engine/graphics/sh3/path_tracer/prepare_scene_gltf.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/prepare_scene_gltf.js +6 -4
- package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +3 -3
- 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 +5 -4
- package/src/engine/graphics/sh3/prototypeLightProbeGrid.d.ts +2 -0
- package/src/engine/graphics/sh3/prototypeLightProbeGrid.d.ts.map +1 -0
- package/src/engine/graphics/sh3/prototypeLightProbeGrid.js +170 -0
- package/src/engine/graphics/sh3/sky/hosek/prototype_hosek.js +2 -2
- package/src/engine/graphics/texture/atlas/AtlasLookupTexture.js +1 -1
- package/src/engine/graphics/texture/atlas/CachingTextureAtlas.js +1 -1
- package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_lanczos.js +1 -1
- package/src/engine/graphics/texture/sampler/sampler2d_copy_with_margins.js +3 -3
- package/src/engine/graphics/util/build_max_height_pyramid.d.ts.map +1 -1
- package/src/engine/graphics/util/build_max_height_pyramid.js +5 -2
- package/src/engine/grid/transform2grid/Transform2GridPositionSystem.js +1 -1
- package/src/engine/input/devices/KeyboardDevice.d.ts +61 -14
- package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
- package/src/engine/input/devices/KeyboardDevice.js +41 -15
- package/src/engine/input/devices/isHTMLElementFocusable.d.ts.map +1 -1
- package/src/engine/input/devices/isHTMLElementFocusable.js +2 -9
- package/src/engine/input/ecs/components/InputBinding.d.ts +7 -1
- package/src/engine/input/ecs/components/InputBinding.d.ts.map +1 -1
- package/src/engine/input/ecs/components/InputBinding.js +8 -1
- package/src/engine/input/ecs/systems/InputControllerSystem.js +1 -1
- package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts +2 -1
- package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.js +6 -2
- package/src/engine/intelligence/behavior/selector/WeightedElement.js +1 -1
- package/src/engine/knowledge/database/StaticKnowledgeDatabase.d.ts.map +1 -1
- package/src/engine/knowledge/database/StaticKnowledgeDatabase.js +2 -4
- package/src/engine/logging/elastic/ElasticSearchLogger.d.ts +1 -2
- package/src/engine/logging/elastic/ElasticSearchLogger.d.ts.map +1 -1
- package/src/engine/logging/elastic/ElasticSearchLogger.js +14 -10
- package/src/engine/navigation/ecs/path_following/PathFollower.js +1 -1
- package/src/engine/navigation/grid/find_path_on_grid_astar.d.ts.map +1 -1
- package/src/engine/navigation/grid/find_path_on_grid_astar.js +5 -2
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +17 -0
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +3 -3
- package/src/engine/scene/SceneManager.d.ts.map +1 -1
- package/src/engine/scene/SceneManager.js +4 -2
- package/src/engine/simulation/Ticker.d.ts.map +1 -1
- package/src/engine/simulation/Ticker.js +9 -0
- package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundEmitterSystem.js +6 -1
- package/src/engine/sound/material/concrete/json/serializeSoundMaterialToJSON.js +1 -1
- package/src/engine/sound/simulation/prototypeAcousticSolver.js +261 -143
- package/src/generation/theme/ThemeEngine.d.ts +9 -0
- package/src/generation/theme/ThemeEngine.d.ts.map +1 -1
- package/src/generation/theme/ThemeEngine.js +37 -2
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { insert_after } from "../../../../../../core/primitives/strings/insert_after.js";
|
|
2
|
+
import PREAMBLE_COMMON from "../common.js";
|
|
3
|
+
|
|
4
|
+
//language=GLSL
|
|
5
|
+
const PREAMBLE = `
|
|
6
|
+
#ifndef LPG_SHADER_CHUNK_PREAMBLE_FRAGMENT
|
|
7
|
+
#define LPG_SHADER_CHUNK_PREAMBLE_FRAGMENT
|
|
8
|
+
|
|
9
|
+
varying vec3 lpg_v_world_position;
|
|
10
|
+
|
|
11
|
+
uniform float lpg_f_intensity;
|
|
12
|
+
|
|
13
|
+
#endif
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
//language=GLSL
|
|
17
|
+
const ACCUMULATION = `
|
|
18
|
+
{
|
|
19
|
+
|
|
20
|
+
vec3 lpg_world_normal = normalize( inverseTransformDirection( geometry.normal, viewMatrix ) );
|
|
21
|
+
|
|
22
|
+
irradiance += lpg_sample_irradiance( lpg_v_world_position, lpg_world_normal ) * lpg_f_intensity;
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @param {string} source
|
|
30
|
+
*/
|
|
31
|
+
export function build_fragment_shader(source) {
|
|
32
|
+
|
|
33
|
+
let result = PREAMBLE + PREAMBLE_COMMON + source;
|
|
34
|
+
|
|
35
|
+
result = insert_after(
|
|
36
|
+
result,
|
|
37
|
+
'#include <lights_fragment_begin>',
|
|
38
|
+
ACCUMULATION
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build_vertex_shader.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.js"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,4CAFW,MAAM,UAahB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { insert_after } from "../../../../../../core/primitives/strings/insert_after.js";
|
|
2
|
+
|
|
3
|
+
//language=GLSL
|
|
4
|
+
const PREAMBLE = `
|
|
5
|
+
#ifndef LPG_SHADER_CHUNK_PREAMBLE_VERTEX
|
|
6
|
+
#define LPG_SHADER_CHUNK_PREAMBLE_VERTEX
|
|
7
|
+
|
|
8
|
+
varying vec3 lpg_v_world_position;
|
|
9
|
+
|
|
10
|
+
#endif
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
World position is computed from the raw 'position' attribute rather than three's 'worldPosition' (only declared
|
|
15
|
+
when shadow maps / env maps / transmission are enabled) or 'transformed' (only declared once <begin_vertex> has
|
|
16
|
+
run). 'position' is present on every non-raw shader that exposes the <fog_vertex> anchor. Probe GI is
|
|
17
|
+
low-frequency, so skipping morph/skin displacement in the lookup position is inconsequential.
|
|
18
|
+
*/
|
|
19
|
+
//language=GLSL
|
|
20
|
+
const CAPTURE_WORLD_POSITION = `
|
|
21
|
+
{
|
|
22
|
+
vec4 lpg_world_position = vec4( position, 1.0 );
|
|
23
|
+
|
|
24
|
+
#ifdef USE_INSTANCING
|
|
25
|
+
lpg_world_position = instanceMatrix * lpg_world_position;
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
lpg_world_position = modelMatrix * lpg_world_position;
|
|
29
|
+
|
|
30
|
+
lpg_v_world_position = lpg_world_position.xyz;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @param {string} source
|
|
37
|
+
*/
|
|
38
|
+
export function build_vertex_shader(source) {
|
|
39
|
+
|
|
40
|
+
let result = PREAMBLE + source;
|
|
41
|
+
|
|
42
|
+
result = insert_after(
|
|
43
|
+
result,
|
|
44
|
+
'#include <fog_vertex>',
|
|
45
|
+
CAPTURE_WORLD_POSITION
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
return result;
|
|
49
|
+
}
|
package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Probe field is sampled per-fragment
|
|
3
|
+
* @param {{vertexShader, fragmentShader}} shader
|
|
4
|
+
*/
|
|
5
|
+
export function space_fragment_transform_shader(shader: {
|
|
6
|
+
vertexShader;
|
|
7
|
+
fragmentShader;
|
|
8
|
+
}): void;
|
|
9
|
+
//# sourceMappingURL=space_fragment_transform_shader.d.ts.map
|
package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space_fragment_transform_shader.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wDAFW;IAAC,YAAY,CAAC;IAAC,cAAc,CAAA;CAAC,QAMxC"}
|
package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { build_fragment_shader } from "./build_fragment_shader.js";
|
|
2
|
+
import { build_vertex_shader } from "./build_vertex_shader.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Probe field is sampled per-fragment
|
|
6
|
+
* @param {{vertexShader, fragmentShader}} shader
|
|
7
|
+
*/
|
|
8
|
+
export function space_fragment_transform_shader(shader) {
|
|
9
|
+
|
|
10
|
+
shader.vertexShader = build_vertex_shader(shader.vertexShader);
|
|
11
|
+
shader.fragmentShader = build_fragment_shader(shader.fragmentShader);
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build_fragment_shader.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.js"],"names":[],"mappings":"AAcA;;;GAGG;AACH,8CAFW,MAAM,UAahB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { insert_after } from "../../../../../../core/primitives/strings/insert_after.js";
|
|
2
|
+
import PREAMBLE from "./preamble.frag.js";
|
|
3
|
+
|
|
4
|
+
//language=GLSL
|
|
5
|
+
const ACCUMULATION = `
|
|
6
|
+
{
|
|
7
|
+
|
|
8
|
+
vec3 lpg_world_normal = normalize( inverseTransformDirection( geometry.normal, viewMatrix ) );
|
|
9
|
+
|
|
10
|
+
irradiance += lpg_get_irradiance_at( lpg_world_normal, lpg_values ) * lpg_f_intensity;
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param {string} source
|
|
18
|
+
*/
|
|
19
|
+
export function build_fragment_shader(source) {
|
|
20
|
+
|
|
21
|
+
let result = PREAMBLE + source;
|
|
22
|
+
|
|
23
|
+
result = insert_after(
|
|
24
|
+
result,
|
|
25
|
+
'#include <lights_fragment_begin>',
|
|
26
|
+
ACCUMULATION
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build_vertex_shader.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.js"],"names":[],"mappings":"AAyBA;;;GAGG;AACH,4CAFW,MAAM,UAahB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { insert_after } from "../../../../../../core/primitives/strings/insert_after.js";
|
|
2
|
+
import PREAMBLE_COMMON from "../common.js";
|
|
3
|
+
import PREAMBLE from "./preamble.vert.js";
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
World position is computed from the raw 'position' attribute rather than three's 'worldPosition' (only declared
|
|
7
|
+
when shadow maps / env maps / transmission are enabled) or 'transformed' (only declared once <begin_vertex> has
|
|
8
|
+
run). 'position' is present on every non-raw shader that exposes the <fog_vertex> anchor. Probe GI is
|
|
9
|
+
low-frequency, so skipping morph/skin displacement in the lookup position is inconsequential.
|
|
10
|
+
*/
|
|
11
|
+
//language=GLSL
|
|
12
|
+
const SHADER_CHUNK_ACCUMULATION = `
|
|
13
|
+
{
|
|
14
|
+
vec4 lpg_world_position = vec4( position, 1.0 );
|
|
15
|
+
|
|
16
|
+
#ifdef USE_INSTANCING
|
|
17
|
+
lpg_world_position = instanceMatrix * lpg_world_position;
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
lpg_world_position = modelMatrix * lpg_world_position;
|
|
21
|
+
|
|
22
|
+
lpg_values = lpg_fetch_sh( lpg_world_position.xyz );
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @param {string} source
|
|
29
|
+
*/
|
|
30
|
+
export function build_vertex_shader(source) {
|
|
31
|
+
|
|
32
|
+
let result = PREAMBLE + PREAMBLE_COMMON + source;
|
|
33
|
+
|
|
34
|
+
result = insert_after(
|
|
35
|
+
result,
|
|
36
|
+
'#include <fog_vertex>',
|
|
37
|
+
SHADER_CHUNK_ACCUMULATION
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: "\n#ifndef LPG_SHADER_CHUNK_PREAMBLE_FRAGMENT\n#define LPG_SHADER_CHUNK_PREAMBLE_FRAGMENT\n\nuniform float lpg_f_intensity;\n\nvarying vec3[4] lpg_values;\n\n\n#ifndef LPG_CHUNK_GET_IRRADIANCE_AT\n#define LPG_CHUNK_GET_IRRADIANCE_AT\n\nvec3 lpg_get_irradiance_at(in vec3 normal, in vec3 shCoefficients[4]) {\n // normal is assumed to have unit length\n\n // band 0\n vec3 result = shCoefficients[0] * 0.8862269254527579;\n\n // band 1\n result += shCoefficients[1] * 1.0233267079464885 * normal.y;\n result += shCoefficients[2] * 1.0233267079464885 * normal.z;\n result += shCoefficients[3] * 1.0233267079464885 * normal.x;\n\n return result;\n}\n\n#endif\n\n\n#endif\n";
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=preamble.frag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preamble.frag.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { chunk_lpg_get_irradiance_at } from "../chunk_lpg_get_irradiance_at.js";
|
|
2
|
+
|
|
3
|
+
//language=GLSL
|
|
4
|
+
export default `
|
|
5
|
+
#ifndef LPG_SHADER_CHUNK_PREAMBLE_FRAGMENT
|
|
6
|
+
#define LPG_SHADER_CHUNK_PREAMBLE_FRAGMENT
|
|
7
|
+
|
|
8
|
+
uniform float lpg_f_intensity;
|
|
9
|
+
|
|
10
|
+
varying vec3[4] lpg_values;
|
|
11
|
+
|
|
12
|
+
${ chunk_lpg_get_irradiance_at }
|
|
13
|
+
|
|
14
|
+
#endif
|
|
15
|
+
`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preamble.vert.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Probe field is sampled per-vertex, interpolated SH coefficients are evaluated against the per-fragment normal
|
|
3
|
+
* @param {{vertexShader, fragmentShader}} shader
|
|
4
|
+
*/
|
|
5
|
+
export function space_vertex_transform_shader(shader: {
|
|
6
|
+
vertexShader;
|
|
7
|
+
fragmentShader;
|
|
8
|
+
}): void;
|
|
9
|
+
//# sourceMappingURL=space_vertex_transform_shader.d.ts.map
|
package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space_vertex_transform_shader.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,sDAFW;IAAC,YAAY,CAAC;IAAC,cAAc,CAAA;CAAC,QAMxC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { build_fragment_shader } from "./build_fragment_shader.js";
|
|
2
|
+
import { build_vertex_shader } from "./build_vertex_shader.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Probe field is sampled per-vertex, interpolated SH coefficients are evaluated against the per-fragment normal
|
|
6
|
+
* @param {{vertexShader, fragmentShader}} shader
|
|
7
|
+
*/
|
|
8
|
+
export function space_vertex_transform_shader(shader) {
|
|
9
|
+
|
|
10
|
+
shader.vertexShader = build_vertex_shader(shader.vertexShader);
|
|
11
|
+
shader.fragmentShader = build_fragment_shader(shader.fragmentShader);
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class LightProbeGridSerializationAdapter extends BinaryClassSerializationAdapter<any> {
|
|
2
|
+
constructor();
|
|
3
|
+
klass: typeof LightProbeGrid;
|
|
4
|
+
version: number;
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param buffer
|
|
8
|
+
* @param {LightProbeGrid} value must be built, see {@link LightProbeGrid#build}
|
|
9
|
+
*/
|
|
10
|
+
serialize(buffer: any, value: LightProbeGrid): void;
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param buffer
|
|
14
|
+
* @param {LightProbeGrid} value
|
|
15
|
+
*/
|
|
16
|
+
deserialize(buffer: any, value: LightProbeGrid): void;
|
|
17
|
+
}
|
|
18
|
+
import { BinaryClassSerializationAdapter } from "../../../../ecs/storage/binary/BinaryClassSerializationAdapter.js";
|
|
19
|
+
import { LightProbeGrid } from "../LightProbeGrid.js";
|
|
20
|
+
//# sourceMappingURL=LightProbeGridSerializationAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LightProbeGridSerializationAdapter.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.js"],"names":[],"mappings":"AAMA;;IAEI,6BAAsB;IACtB,gBAAW;IAEX;;;;OAIG;IACH,8BAFW,cAAc,QAiBxB;IAED;;;;OAIG;IACH,gCAFW,cAAc,QAqBxB;CACJ;gDAzD+C,mEAAmE;+BACpF,sBAAsB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { AABB3 } from "../../../../../core/geom/3d/aabb/AABB3.js";
|
|
2
|
+
import { BinaryClassSerializationAdapter } from "../../../../ecs/storage/binary/BinaryClassSerializationAdapter.js";
|
|
3
|
+
import { LightProbeGrid } from "../LightProbeGrid.js";
|
|
4
|
+
|
|
5
|
+
const __bounds = new AABB3(0, 0, 0, 0, 0, 0);
|
|
6
|
+
|
|
7
|
+
export class LightProbeGridSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
8
|
+
|
|
9
|
+
klass = LightProbeGrid
|
|
10
|
+
version = 0
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @param buffer
|
|
15
|
+
* @param {LightProbeGrid} value must be built, see {@link LightProbeGrid#build}
|
|
16
|
+
*/
|
|
17
|
+
serialize(buffer, value) {
|
|
18
|
+
const bounds = value.bounds;
|
|
19
|
+
|
|
20
|
+
buffer.writeFloat64(bounds.x0);
|
|
21
|
+
buffer.writeFloat64(bounds.y0);
|
|
22
|
+
buffer.writeFloat64(bounds.z0);
|
|
23
|
+
buffer.writeFloat64(bounds.x1);
|
|
24
|
+
buffer.writeFloat64(bounds.y1);
|
|
25
|
+
buffer.writeFloat64(bounds.z1);
|
|
26
|
+
|
|
27
|
+
buffer.writeUint32(value.resolution_x);
|
|
28
|
+
buffer.writeUint32(value.resolution_y);
|
|
29
|
+
buffer.writeUint32(value.resolution_z);
|
|
30
|
+
|
|
31
|
+
buffer.writeFloat32Array(value.harmonics, 0, value.count * 12);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @param buffer
|
|
37
|
+
* @param {LightProbeGrid} value
|
|
38
|
+
*/
|
|
39
|
+
deserialize(buffer, value) {
|
|
40
|
+
const x0 = buffer.readFloat64();
|
|
41
|
+
const y0 = buffer.readFloat64();
|
|
42
|
+
const z0 = buffer.readFloat64();
|
|
43
|
+
const x1 = buffer.readFloat64();
|
|
44
|
+
const y1 = buffer.readFloat64();
|
|
45
|
+
const z1 = buffer.readFloat64();
|
|
46
|
+
|
|
47
|
+
__bounds.setBounds(x0, y0, z0, x1, y1, z1);
|
|
48
|
+
|
|
49
|
+
const resolution_x = buffer.readUint32();
|
|
50
|
+
const resolution_y = buffer.readUint32();
|
|
51
|
+
const resolution_z = buffer.readUint32();
|
|
52
|
+
|
|
53
|
+
value.build(__bounds, resolution_x, resolution_y, resolution_z);
|
|
54
|
+
|
|
55
|
+
buffer.readFloat32Array(value.harmonics, 0, value.count * 12);
|
|
56
|
+
|
|
57
|
+
value.incrementVersion();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathTracedMesh.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/PathTracedMesh.js"],"names":[],"mappings":"AAgBA;IACI;;;OAGG;IACH,IAFU,MAAM,CAEO;IAEvB;;;OAGG;IACH,MAFU,KAAK,CAEI;IAEnB;;;OAGG;IACH,KAFU,sBAAoB,IAAI,CAEvB;IAGX;;;OAGG;IACH,UAFU,MAAM,cAAc,GAAC,IAAI,CAEnB;IAEhB;;;OAGG;IACH,UAFU,mBAAiB,IAAI,CAEf;IAYhB,sCAEC;IAED,kCAEC;IAED,2BAqBC;IAED,sBAGC;IAED,iCAUC;IAED,8BAEC;IAED;;;;OAIG;IACH,cAHW,IAAI,GACF,OAAO,CAWnB;IAED;;;;;;OAMG;IACH,SALW,MAAM,EAAE,OACR,MAAM,EAAE,GAAC,IAAI,aACb,MAAM,GACJ,MAAM,CA4BlB;;CACJ;
|
|
1
|
+
{"version":3,"file":"PathTracedMesh.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/PathTracedMesh.js"],"names":[],"mappings":"AAgBA;IACI;;;OAGG;IACH,IAFU,MAAM,CAEO;IAEvB;;;OAGG;IACH,MAFU,KAAK,CAEI;IAEnB;;;OAGG;IACH,KAFU,sBAAoB,IAAI,CAEvB;IAGX;;;OAGG;IACH,UAFU,MAAM,cAAc,GAAC,IAAI,CAEnB;IAEhB;;;OAGG;IACH,UAFU,mBAAiB,IAAI,CAEf;IAYhB,sCAEC;IAED,kCAEC;IAED,2BAqBC;IAED,sBAGC;IAED,iCAUC;IAED,8BAEC;IAED;;;;OAIG;IACH,cAHW,IAAI,GACF,OAAO,CAWnB;IAED;;;;;;OAMG;IACH,SALW,MAAM,EAAE,OACR,MAAM,EAAE,GAAC,IAAI,aACb,MAAM,GACJ,MAAM,CA4BlB;;CACJ;sBA/JqB,wCAAwC;qBAMzC,sCAAsC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { mat4 } from "gl-matrix";
|
|
2
1
|
import { array_copy } from "../../../../core/collection/array/array_copy.js";
|
|
3
2
|
import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
|
|
4
3
|
import { aabb3_from_v3_array_transformed } from "../../../../core/geom/3d/aabb/aabb3_from_v3_array_transformed.js";
|
|
5
4
|
import { m4_allocate } from "../../../../core/geom/3d/mat4/m4_allocate.js";
|
|
6
5
|
import { m4_decompose } from "../../../../core/geom/3d/mat4/m4_decompose.js";
|
|
7
6
|
import { m4_normal_matrix3 } from "../../../../core/geom/3d/mat4/m4_normal_matrix3.js";
|
|
7
|
+
import { m4_invert } from "../../../../core/geom/3d/mat4/m4_invert.js";
|
|
8
8
|
import { Ray3 } from "../../../../core/geom/3d/ray/Ray3.js";
|
|
9
9
|
import Quaternion from "../../../../core/geom/Quaternion.js";
|
|
10
10
|
import { v3_distance } from "../../../../core/geom/vec3/v3_distance.js";
|
|
@@ -95,7 +95,7 @@ export class PathTracedMesh {
|
|
|
95
95
|
set transform(m) {
|
|
96
96
|
array_copy(m, 0, this.#transform, 0, 16);
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
m4_invert(this.#transform_inverse, m);
|
|
99
99
|
|
|
100
100
|
m4_normal_matrix3(this.#normal_matrix, this.#transform);
|
|
101
101
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { vec3 } from "gl-matrix";
|
|
2
1
|
import { array_copy } from "../../../../core/collection/array/array_copy.js";
|
|
2
|
+
import { v3_multiply } from "../../../../core/geom/vec3/v3_multiply.js";
|
|
3
3
|
import { Ray3 } from "../../../../core/geom/3d/ray/Ray3.js";
|
|
4
4
|
import { getBiasedNormalSample } from "./sampling/getBiasedNormalSample.js";
|
|
5
5
|
|
|
@@ -112,7 +112,7 @@ export class PathTracer {
|
|
|
112
112
|
irradiance[2] += color_mask[2] * tmp_0[8];
|
|
113
113
|
|
|
114
114
|
// fold the surface albedo into the path throughput
|
|
115
|
-
|
|
115
|
+
v3_multiply(color_mask, 0, color_mask[0], color_mask[1], color_mask[2], tmp_0[0], tmp_0[1], tmp_0[2]);
|
|
116
116
|
|
|
117
117
|
// construct new ray, aligned on the normal of the contact
|
|
118
118
|
array_copy(tmp_0, 3, _ray_0, 3, 3); // copy surface normal into the direction slot (read by sample_lights)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialConverter.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/sh3/path_tracer/material/MaterialConverter.js"],"names":[],"mappings":"AA+BA;
|
|
1
|
+
{"version":3,"file":"MaterialConverter.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/sh3/path_tracer/material/MaterialConverter.js"],"names":[],"mappings":"AA+BA;IAuCI;;;;OAIG;IACH,kBAHW,MAAM,QAAQ,GACZ,gBAAgB,CA6C5B;;CAEJ;iCAnHgC,uBAAuB"}
|
|
@@ -52,6 +52,14 @@ export class MaterialConverter {
|
|
|
52
52
|
|
|
53
53
|
const st = StandardTexture.from(sampler2D);
|
|
54
54
|
|
|
55
|
+
// carry the source texture's addressing/filtering across; the TextureWrapping
|
|
56
|
+
// and TextureFilter enums mirror three's constant values, so otherwise tiled
|
|
57
|
+
// (RepeatWrapping) surfaces would be sampled as ClampToEdge and stretch a
|
|
58
|
+
// single edge texel across the whole surface.
|
|
59
|
+
st.wrapS = texture.wrapS;
|
|
60
|
+
st.wrapT = texture.wrapT;
|
|
61
|
+
st.magFilter = texture.magFilter;
|
|
62
|
+
|
|
55
63
|
// base-color/emissive maps are sRGB-authored and must be decoded to linear at sample time
|
|
56
64
|
st.decode_sRGB = texture.encoding === sRGBEncoding;
|
|
57
65
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare_scene_gltf.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/prepare_scene_gltf.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prepare_scene_gltf.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/prepare_scene_gltf.js"],"names":[],"mappings":"AAeA;;;;;qBAyBC;AAaD;;;;;;;;;;GAUG;AACH,mHAFY,QAAQ,IAAI,CAAC,CA8CxB;oBAnGmB,kCAAkC;iCAErB,qDAAqD"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { vec3 } from "gl-matrix";
|
|
2
1
|
import { Box3, MeshStandardMaterial, PlaneBufferGeometry, Sphere } from "three";
|
|
2
|
+
import { v3_length } from "../../../../core/geom/vec3/v3_length.js";
|
|
3
|
+
import { v3_scale } from "../../../../core/geom/vec3/v3_scale.js";
|
|
3
4
|
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
4
5
|
import { Color } from "../../../../core/color/Color.js";
|
|
5
6
|
import { kelvin_to_rgb } from "../../../../core/color/kelvin/kelvin_to_rgb.js";
|
|
6
7
|
import { noop } from "../../../../core/function/noop.js";
|
|
8
|
+
import { v3_multiply } from "../../../../core/geom/vec3/v3_multiply.js";
|
|
7
9
|
import Quaternion from "../../../../core/geom/Quaternion.js";
|
|
8
10
|
import Vector3 from "../../../../core/geom/Vector3.js";
|
|
9
11
|
import { Transform } from "../../../ecs/transform/Transform.js";
|
|
@@ -25,10 +27,10 @@ export function make_sun({
|
|
|
25
27
|
const light = new DirectionalLight();
|
|
26
28
|
|
|
27
29
|
light.color.parse(color);
|
|
28
|
-
|
|
30
|
+
v3_multiply(light.color, 0, light.color[0], light.color[1], light.color[2], temp_c[0], temp_c[1], temp_c[2]);
|
|
29
31
|
|
|
30
|
-
const n =
|
|
31
|
-
|
|
32
|
+
const n = v3_length(light.color[0], light.color[1], light.color[2]);
|
|
33
|
+
v3_scale(light.color, 0, light.color[0], light.color[1], light.color[2], 1 / n); // normalize color vector
|
|
32
34
|
|
|
33
35
|
light.intensity.set(intensity * n);
|
|
34
36
|
light.direction.copy(direction);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m4_from_rotation_translation_scale } from "../../../../core/geom/3d/mat4/m4_from_rotation_translation_scale.js";
|
|
2
2
|
import { MeshStandardMaterial, OctahedronBufferGeometry, PerspectiveCamera, PlaneBufferGeometry } from "three";
|
|
3
3
|
import { PLYLoader } from "three/examples/jsm/loaders/PLYLoader.js";
|
|
4
4
|
|
|
@@ -313,7 +313,7 @@ async function prepare_scene_rtiow(pt, camera) {
|
|
|
313
313
|
function add_sphere(center, radius, material) {
|
|
314
314
|
|
|
315
315
|
const mat = new Float32Array(16);
|
|
316
|
-
|
|
316
|
+
m4_from_rotation_translation_scale(mat, [0, 0, 0, 1], center, [radius, radius, radius])
|
|
317
317
|
|
|
318
318
|
scene.createMesh(sphere_geo, material, mat);
|
|
319
319
|
|
|
@@ -357,7 +357,7 @@ async function prepare_scene_rtiow(pt, camera) {
|
|
|
357
357
|
|
|
358
358
|
|
|
359
359
|
const mat = new Float32Array(16);
|
|
360
|
-
|
|
360
|
+
m4_from_rotation_translation_scale(mat, [0, 0, 0, 1], center, [radius, radius, radius])
|
|
361
361
|
|
|
362
362
|
const material = new MeshStandardMaterial({
|
|
363
363
|
color: Color.fromHSV(random(), 0.9, 0.9).toHex()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sample_material.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/sh3/path_tracer/texture/sample_material.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sample_material.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/sh3/path_tracer/texture/sample_material.js"],"names":[],"mappings":"AA8CA;;;;;;;GAOG;AACH,qCANW,MAAM,EAAE,sCAER,MAAM,KACN,MAAM,KACN,MAAM,QA4FhB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { vec3 } from "gl-matrix";
|
|
2
1
|
import { compute_binary_data_type_from_typed_array } from "../../../../../core/collection/array/typed/compute_binary_data_type_from_typed_array.js";
|
|
3
2
|
import { v3_distance_sqr } from "../../../../../core/geom/vec3/v3_distance_sqr.js";
|
|
3
|
+
import { v3_multiply } from "../../../../../core/geom/vec3/v3_multiply.js";
|
|
4
|
+
import { v3_normalize_array } from "../../../../../core/geom/vec3/v3_normalize_array.js";
|
|
4
5
|
import { v3_matrix3_rotate } from "../../../../../core/geom/vec3/v3_matrix3_rotate.js";
|
|
5
6
|
import { decode_attribute_value } from "../../../geometry/decode_attribute_value.js";
|
|
6
7
|
import { geometry_construct_triangle_normal } from "../../../geometry/geometry_construct_triangle_normal.js";
|
|
@@ -111,7 +112,7 @@ export function sample_material(
|
|
|
111
112
|
normal[1] = normal[1] * 2 - 1;
|
|
112
113
|
normal[2] = normal[2] * 2 - 1;
|
|
113
114
|
|
|
114
|
-
|
|
115
|
+
v3_normalize_array(normal, 0, normal, 0);
|
|
115
116
|
|
|
116
117
|
// needs transform
|
|
117
118
|
v3_orthonormal_matrix_from_normal(scratch_m3, 0, out[3], out[4], out[5]);
|
|
@@ -126,13 +127,13 @@ export function sample_material(
|
|
|
126
127
|
if (color_attribute !== undefined) {
|
|
127
128
|
sample_color_attribute(color, color_attribute, index_0, index_1, index_2, u, v);
|
|
128
129
|
|
|
129
|
-
|
|
130
|
+
v3_multiply(out, 0, out[0], out[1], out[2], color[0], color[1], color[2]);
|
|
130
131
|
}
|
|
131
132
|
|
|
132
133
|
|
|
133
134
|
material.diffuse.sample(color, texture_uv[0], texture_uv[1]);
|
|
134
135
|
|
|
135
|
-
|
|
136
|
+
v3_multiply(out, 0, out[0], out[1], out[2], color[0], color[1], color[2]);
|
|
136
137
|
|
|
137
138
|
// emissive radiance emitted by this surface
|
|
138
139
|
material.emissive.sample(emissive, texture_uv[0], texture_uv[1]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prototypeLightProbeGrid.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/sh3/prototypeLightProbeGrid.js"],"names":[],"mappings":""}
|