@woosh/meep-engine 2.138.17 → 2.138.19
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 +2 -2
- package/build/bundle-worker-image-decoder.js +1 -1
- package/editor/actions/concrete/ActionUpdateTexture.d.ts +12 -0
- package/editor/actions/concrete/ActionUpdateTexture.d.ts.map +1 -0
- package/editor/actions/concrete/ArrayCopyAction.d.ts +20 -0
- package/editor/actions/concrete/ArrayCopyAction.d.ts.map +1 -0
- package/editor/actions/concrete/ComponentRemoveAction.d.ts +11 -0
- package/editor/actions/concrete/ComponentRemoveAction.d.ts.map +1 -0
- package/editor/actions/concrete/ModifyPatchSampler2DAction.d.ts +47 -0
- package/editor/actions/concrete/ModifyPatchSampler2DAction.d.ts.map +1 -0
- package/editor/actions/concrete/ModifyPatchTextureArray2DAction.d.ts +38 -0
- package/editor/actions/concrete/ModifyPatchTextureArray2DAction.d.ts.map +1 -0
- package/editor/actions/concrete/PaintTerrainOverlayAction.d.ts +23 -0
- package/editor/actions/concrete/PaintTerrainOverlayAction.d.ts.map +1 -0
- package/editor/actions/concrete/PatchTerrainHeightAction.d.ts +19 -0
- package/editor/actions/concrete/PatchTerrainHeightAction.d.ts.map +1 -0
- package/editor/actions/concrete/SelectionRemoveAction.d.ts +10 -0
- package/editor/actions/concrete/SelectionRemoveAction.d.ts.map +1 -0
- package/editor/actions/concrete/WriteGridValueAction.d.ts +15 -0
- package/editor/actions/concrete/WriteGridValueAction.d.ts.map +1 -0
- package/editor/ecs/component/FieldDescriptor.d.ts +27 -0
- package/editor/ecs/component/FieldDescriptor.d.ts.map +1 -0
- package/editor/ecs/component/FieldValueAdapter.d.ts +7 -0
- package/editor/ecs/component/FieldValueAdapter.d.ts.map +1 -0
- package/editor/ecs/component/createFieldEditor.d.ts +9 -0
- package/editor/ecs/component/createFieldEditor.d.ts.map +1 -0
- package/editor/ecs/component/createObjectEditor.d.ts +14 -0
- package/editor/ecs/component/createObjectEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/geom/QuaternionEditor.d.ts.map +1 -1
- package/editor/ecs/component/findNearestRegisteredType.d.ts +8 -0
- package/editor/ecs/component/findNearestRegisteredType.d.ts.map +1 -0
- package/editor/process/ObstacleGridDisplayProcess.d.ts.map +1 -1
- package/editor/process/symbolic/makeGridPositionSymbolDisplay.d.ts.map +1 -1
- package/editor/tools/GridPaintTool.d.ts +17 -0
- package/editor/tools/GridPaintTool.d.ts.map +1 -0
- package/editor/tools/SelectionTool.d.ts +27 -0
- package/editor/tools/SelectionTool.d.ts.map +1 -0
- package/editor/tools/TopDownCameraControlTool.d.ts +13 -0
- package/editor/tools/TopDownCameraControlTool.d.ts.map +1 -0
- package/editor/view/ecs/ComponentControlFactory.d.ts.map +1 -0
- package/editor/view/ecs/ComponentControlView.d.ts.map +1 -1
- package/editor/view/ecs/EntityEditor.d.ts.map +1 -0
- package/editor/view/ecs/EntityList.d.ts.map +1 -0
- package/editor/view/ecs/HierarchicalEntityListView.d.ts.map +1 -0
- package/editor/view/node-graph/NodeGraphEditorView.d.ts.map +1 -1
- package/editor/view/node-graph/NodeGraphView.d.ts.map +1 -1
- package/editor/view/node-graph/NodeView.d.ts.map +1 -1
- package/editor/view/node-graph/PortView.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/binary/BinaryBuffer.d.ts +1 -1
- package/src/core/binary/BinaryBuffer.js +1 -1
- package/src/core/binary/BitSet.d.ts +1 -1
- package/src/core/binary/BitSet.js +1 -1
- package/src/core/cache/Cache.js +1 -1
- package/src/core/cache/LoadingCache.js +1 -1
- package/src/core/collection/list/List.js +1 -1
- package/src/core/collection/map/HashMap.js +1 -1
- package/src/core/collection/table/RowFirstTable.d.ts +1 -1
- package/src/core/collection/table/RowFirstTable.js +1 -1
- package/src/core/collection/table/RowFirstTableSpec.d.ts +1 -1
- package/src/core/collection/table/RowFirstTableSpec.js +1 -1
- package/src/core/color/oklab/compute_max_saturation.d.ts +1 -1
- package/src/core/color/oklab/compute_max_saturation.js +1 -1
- package/src/core/color/oklab/find_cusp.d.ts +1 -1
- package/src/core/color/oklab/find_cusp.js +1 -1
- package/src/core/color/oklab/find_gamut_intersection.d.ts +1 -1
- package/src/core/color/oklab/find_gamut_intersection.js +1 -1
- package/src/core/color/oklab/okhsv_to_linear_srgb.d.ts +1 -1
- package/src/core/color/oklab/okhsv_to_linear_srgb.js +1 -1
- package/src/core/color/oklab/oklab_to_linear_srgb.d.ts +1 -1
- package/src/core/color/oklab/oklab_to_linear_srgb.js +1 -1
- package/src/core/color/oklab/oklab_to_xyz.d.ts +1 -1
- package/src/core/color/oklab/oklab_to_xyz.js +1 -1
- package/src/core/color/oklab/xyz_to_oklab.d.ts +1 -1
- package/src/core/color/oklab/xyz_to_oklab.js +1 -1
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.d.ts +1 -1
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.js +1 -1
- package/src/core/geom/3d/aabb/aabb3_nearest_point_on_surface.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_nearest_point_on_surface.js +57 -65
- package/src/core/geom/3d/octahedra/octahedral_uv_wrap.d.ts +1 -1
- package/src/core/geom/3d/octahedra/octahedral_uv_wrap.js +1 -1
- package/src/core/geom/3d/quaternion/quat_decode_from_uint32.d.ts +1 -1
- package/src/core/geom/3d/quaternion/quat_decode_from_uint32.js +1 -1
- package/src/core/geom/3d/quaternion/quat_encode_to_uint32.d.ts +1 -1
- package/src/core/geom/3d/quaternion/quat_encode_to_uint32.js +1 -1
- package/src/core/geom/3d/shape/AbstractShape3D.d.ts +74 -3
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts +37 -0
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/CapsuleShape3D.js +210 -0
- package/src/core/geom/3d/shape/PointShape3D.d.ts +5 -0
- package/src/core/geom/3d/shape/PointShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/PointShape3D.js +52 -14
- package/src/core/geom/3d/shape/TransformedShape3D.d.ts +75 -12
- package/src/core/geom/3d/shape/TransformedShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/TransformedShape3D.js +12 -3
- package/src/core/geom/3d/shape/UnionShape3D.d.ts +47 -5
- package/src/core/geom/3d/shape/UnionShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts +12 -5
- package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts +17 -5
- package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/json/shape_to_type.d.ts.map +1 -1
- package/src/core/geom/3d/shape/json/shape_to_type.js +4 -1
- package/src/core/geom/3d/shape/json/type_adapters.d.ts +17 -2
- package/src/core/geom/3d/shape/json/type_adapters.d.ts.map +1 -1
- package/src/core/geom/3d/shape/json/type_adapters.js +18 -2
- package/src/core/geom/3d/shape/util/compute_signed_distance_gradient_by_sampling.d.ts.map +1 -1
- package/src/core/geom/3d/shape/util/compute_signed_distance_gradient_by_sampling.js +51 -48
- package/src/core/geom/3d/tetrahedra/compute_bounding_simplex_3d.d.ts +1 -1
- package/src/core/geom/3d/tetrahedra/compute_bounding_simplex_3d.js +1 -1
- package/src/core/geom/ConicRay.d.ts +1 -1
- package/src/core/geom/ConicRay.js +1 -1
- package/src/core/geom/Quaternion.d.ts +2 -2
- package/src/core/geom/Quaternion.js +2 -2
- package/src/core/geom/Vector1.d.ts +1 -1
- package/src/core/geom/Vector1.js +1 -1
- package/src/core/geom/Vector2.d.ts +1 -1
- package/src/core/geom/Vector2.js +1 -1
- package/src/core/geom/Vector3.d.ts +1 -1
- package/src/core/geom/Vector3.js +1 -1
- package/src/core/geom/packing/miniball/Miniball.d.ts +1 -1
- package/src/core/geom/packing/miniball/Miniball.js +1 -1
- package/src/core/geom/vec3/serialization/v3_binary_equality_decode.d.ts +1 -1
- package/src/core/geom/vec3/serialization/v3_binary_equality_decode.js +1 -1
- package/src/core/geom/vec3/serialization/v3_binary_equality_encode.d.ts +1 -1
- package/src/core/geom/vec3/serialization/v3_binary_equality_encode.js +1 -1
- package/src/core/math/spline/spline3_hermite.d.ts +1 -1
- package/src/core/math/spline/spline3_hermite.js +1 -1
- package/src/core/math/spline/spline3_hermite_bounds.d.ts +1 -1
- package/src/core/math/spline/spline3_hermite_bounds.js +1 -1
- package/src/core/math/spline/spline3_hermite_bounds_t.d.ts +1 -1
- package/src/core/math/spline/spline3_hermite_bounds_t.js +1 -1
- package/src/core/math/spline/spline3_hermite_to_monomial.d.ts +1 -1
- package/src/core/math/spline/spline3_hermite_to_monomial.js +1 -1
- package/src/core/model/ObservedBoolean.d.ts +1 -1
- package/src/core/model/ObservedBoolean.js +1 -1
- package/src/core/model/ObservedString.d.ts +1 -1
- package/src/core/model/ObservedString.js +1 -1
- package/src/core/process/undo/Action.js +1 -1
- package/src/core/process/undo/ActionProcessor.js +1 -1
- package/src/engine/animation/curve/AnimationCurve.d.ts +1 -1
- package/src/engine/animation/curve/AnimationCurve.js +1 -1
- package/src/engine/animation/curve/Keyframe.d.ts +1 -1
- package/src/engine/animation/curve/Keyframe.js +1 -1
- package/src/engine/animation/curve/animation_curve_compute_aabb.d.ts +1 -1
- package/src/engine/animation/curve/animation_curve_compute_aabb.js +1 -1
- package/src/engine/animation/curve/animation_curve_optimize.d.ts +1 -1
- package/src/engine/animation/curve/animation_curve_optimize.js +2 -2
- package/src/engine/asset/loaders/image/jpeg/JpegImage.js +1 -1
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/PNGReader.js +27 -7
- package/src/engine/asset/loaders/image/png/crc32.d.ts +1 -1
- package/src/engine/asset/loaders/image/png/crc32.js +1 -1
- package/src/engine/control/first-person/DESIGN.md +616 -0
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +229 -0
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -0
- package/src/engine/control/first-person/FirstPersonPlayerController.js +176 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +251 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +205 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +151 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +799 -0
- package/src/engine/control/first-person/math/computeJumpFromApex.d.ts +23 -0
- package/src/engine/control/first-person/math/computeJumpFromApex.d.ts.map +1 -0
- package/src/engine/control/first-person/math/computeJumpFromApex.js +23 -0
- package/src/engine/control/first-person/math/criticallyDampedSpring.d.ts +23 -0
- package/src/engine/control/first-person/math/criticallyDampedSpring.d.ts.map +1 -0
- package/src/engine/control/first-person/math/criticallyDampedSpring.js +34 -0
- package/src/engine/control/first-person/math/dampedSpringStep.d.ts +23 -0
- package/src/engine/control/first-person/math/dampedSpringStep.d.ts.map +1 -0
- package/src/engine/control/first-person/math/dampedSpringStep.js +72 -0
- package/src/engine/control/first-person/math/stepTowards.d.ts +12 -0
- package/src/engine/control/first-person/math/stepTowards.d.ts.map +1 -0
- package/src/engine/control/first-person/math/stepTowards.js +20 -0
- package/src/engine/control/first-person/pose/FirstPersonPose.d.ts +69 -0
- package/src/engine/control/first-person/pose/FirstPersonPose.d.ts.map +1 -0
- package/src/engine/control/first-person/pose/FirstPersonPose.js +91 -0
- package/src/engine/control/first-person/prototype_first_person_controller.d.ts +2 -0
- package/src/engine/control/first-person/prototype_first_person_controller.d.ts.map +1 -0
- package/src/engine/control/first-person/prototype_first_person_controller.js +314 -0
- package/src/engine/ecs/Entity.js +1 -1
- package/src/engine/ecs/EntityComponentDataset.js +1 -1
- package/src/engine/ecs/EntityManager.d.ts +1 -1
- package/src/engine/ecs/EntityManager.js +1 -1
- package/src/engine/ecs/EntityObserver.js +1 -1
- package/src/engine/ecs/EntityReference.d.ts +1 -1
- package/src/engine/ecs/EntityReference.js +1 -1
- package/src/engine/ecs/System.js +1 -1
- package/src/engine/ecs/attachment/AttachmentSystem.d.ts +2 -2
- package/src/engine/ecs/attachment/AttachmentSystem.d.ts.map +1 -1
- package/src/engine/ecs/grid/HeightMap2AOMap.d.ts.map +1 -1
- package/src/engine/ecs/grid/HeightMap2AOMap.js +3 -2
- package/src/engine/ecs/guid/UUID.d.ts +1 -1
- package/src/engine/ecs/guid/UUID.js +1 -1
- package/src/engine/ecs/name/Name.d.ts +1 -1
- package/src/engine/ecs/name/Name.js +1 -1
- package/src/engine/ecs/parent/ParentEntity.js +1 -1
- package/src/engine/ecs/storage/BinaryBufferDeSerializer.d.ts +1 -1
- package/src/engine/ecs/storage/BinaryBufferDeSerializer.js +1 -1
- package/src/engine/ecs/storage/BinaryBufferSerializer.d.ts +1 -1
- package/src/engine/ecs/storage/BinaryBufferSerializer.js +1 -1
- package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.js +1 -1
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts +1 -1
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.js +1 -1
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.d.ts +1 -1
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.js +1 -1
- package/src/engine/ecs/transform/Transform.d.ts +1 -1
- package/src/engine/ecs/transform/Transform.js +1 -1
- package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts.map +1 -1
- package/src/engine/graphics/impostors/octahedral/ImpostorBaker.d.ts.map +1 -1
- package/src/engine/graphics/impostors/octahedral/ImpostorBaker.js +10 -1
- package/src/engine/graphics/impostors/voxel/README.md +149 -0
- package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.d.ts +91 -0
- package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.js +376 -0
- package/src/engine/graphics/impostors/voxel/VoxelImpostorDescription.d.ts +128 -0
- package/src/engine/graphics/impostors/voxel/VoxelImpostorDescription.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/VoxelImpostorDescription.js +141 -0
- package/src/engine/graphics/impostors/voxel/bake/read_atlas_to_samples.d.ts +38 -0
- package/src/engine/graphics/impostors/voxel/bake/read_atlas_to_samples.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/bake/read_atlas_to_samples.js +338 -0
- package/src/engine/graphics/impostors/voxel/bake/voxelize_samples.d.ts +43 -0
- package/src/engine/graphics/impostors/voxel/bake/voxelize_samples.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/bake/voxelize_samples.js +192 -0
- package/src/engine/graphics/impostors/voxel/prototype_voxel_impostors.d.ts +2 -0
- package/src/engine/graphics/impostors/voxel/prototype_voxel_impostors.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/prototype_voxel_impostors.js +343 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderDepthV0.d.ts +13 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderDepthV0.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderDepthV0.js +99 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderLitV0.d.ts +19 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderLitV0.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderLitV0.js +231 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderNormalsV0.d.ts +5 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderNormalsV0.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderNormalsV0.js +70 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderV0.d.ts +13 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderV0.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderV0.js +127 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderViewportDepthV0.d.ts +5 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderViewportDepthV0.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderViewportDepthV0.js +68 -0
- package/src/engine/graphics/impostors/voxel/util/make_voxel_impostor_geometry.d.ts +27 -0
- package/src/engine/graphics/impostors/voxel/util/make_voxel_impostor_geometry.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/util/make_voxel_impostor_geometry.js +96 -0
- package/src/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.d.ts +113 -29
- package/src/engine/graphics/render/forward_plus/SPECIFICATION.md +1 -1
- package/src/engine/graphics/shaders/AmbientOcclusionShader.d.ts.map +1 -1
- package/src/engine/graphics/shaders/AmbientOcclusionShader.js +20 -5
- package/src/engine/graphics/texture/sampler/Sampler2D.d.ts +1 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.js +1 -1
- package/src/engine/graphics/texture/sampler/distance/computeSignedDistanceField_NaiveFlood.d.ts +1 -1
- package/src/engine/graphics/texture/sampler/distance/computeSignedDistanceField_NaiveFlood.js +1 -1
- package/src/engine/graphics/util/build_max_height_pyramid.d.ts +21 -14
- package/src/engine/graphics/util/build_max_height_pyramid.d.ts.map +1 -1
- package/src/engine/graphics/util/build_max_height_pyramid.js +107 -70
- package/src/engine/input/devices/InputDeviceSwitch.js +1 -1
- package/src/engine/input/devices/KeyboardDevice.js +1 -1
- package/src/engine/input/devices/PointerDevice.js +1 -1
- package/src/engine/intelligence/behavior/Behavior.js +1 -1
- package/src/engine/intelligence/behavior/SelectorBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/SelectorBehavior.js +1 -1
- package/src/engine/intelligence/behavior/behavior_to_dot.d.ts +1 -1
- package/src/engine/intelligence/behavior/behavior_to_dot.js +1 -1
- package/src/engine/intelligence/behavior/composite/CompositeBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/composite/CompositeBehavior.js +1 -1
- package/src/engine/intelligence/behavior/composite/ParallelBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/composite/ParallelBehavior.js +1 -1
- package/src/engine/intelligence/behavior/composite/SequenceBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/composite/SequenceBehavior.js +1 -1
- package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.js +1 -1
- package/src/engine/intelligence/behavior/decorator/IgnoreFailureBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/decorator/IgnoreFailureBehavior.js +1 -1
- package/src/engine/intelligence/behavior/decorator/InvertStatusBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/decorator/InvertStatusBehavior.js +1 -1
- package/src/engine/intelligence/behavior/decorator/RepeatBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/decorator/RepeatBehavior.js +1 -1
- package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.js +1 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorComponent.d.ts +1 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorComponent.js +1 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorSystem.d.ts +1 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorSystem.js +1 -1
- package/src/engine/intelligence/behavior/ecs/DieBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/ecs/DieBehavior.js +1 -1
- package/src/engine/intelligence/behavior/ecs/EntityBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/ecs/EntityBehavior.js +1 -1
- package/src/engine/intelligence/behavior/ecs/KillBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/ecs/KillBehavior.js +1 -1
- package/src/engine/intelligence/behavior/ecs/SendEventBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/ecs/SendEventBehavior.js +1 -1
- package/src/engine/intelligence/behavior/ecs/WaitForEventBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/ecs/WaitForEventBehavior.js +1 -1
- package/src/engine/intelligence/behavior/primitive/ActionBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/primitive/ActionBehavior.js +1 -1
- package/src/engine/intelligence/behavior/primitive/FailingBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/primitive/FailingBehavior.js +1 -1
- package/src/engine/intelligence/behavior/primitive/PromiseBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/primitive/PromiseBehavior.js +1 -1
- package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.js +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedElement.d.ts +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedElement.js +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.js +1 -1
- package/src/engine/intelligence/behavior/util/BranchBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/util/BranchBehavior.js +1 -1
- package/src/engine/intelligence/behavior/util/DelayBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/util/DelayBehavior.js +1 -1
- package/src/engine/intelligence/behavior/util/LogMessageBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/util/LogMessageBehavior.js +1 -1
- package/src/engine/intelligence/behavior/util/RandomDelayBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/util/RandomDelayBehavior.js +1 -1
- package/src/engine/intelligence/blackboard/Blackboard.js +1 -1
- package/src/engine/intelligence/mcts/MonteCarlo.d.ts +1 -1
- package/src/engine/intelligence/mcts/MonteCarlo.js +1 -1
- package/src/engine/intelligence/mcts/MoveEdge.d.ts +1 -1
- package/src/engine/intelligence/mcts/MoveEdge.js +1 -1
- package/src/engine/intelligence/mcts/StateNode.d.ts +1 -1
- package/src/engine/intelligence/mcts/StateNode.js +1 -1
- package/src/engine/intelligence/resource/ActionSequence.d.ts +1 -1
- package/src/engine/intelligence/resource/ActionSequence.js +1 -1
- package/src/engine/intelligence/resource/Resource.d.ts +1 -1
- package/src/engine/intelligence/resource/Resource.js +1 -1
- package/src/engine/intelligence/resource/ResourceAllocation.d.ts +1 -1
- package/src/engine/intelligence/resource/ResourceAllocation.js +1 -1
- package/src/engine/intelligence/resource/ResourceAllocationBid.d.ts +1 -1
- package/src/engine/intelligence/resource/ResourceAllocationBid.js +1 -1
- package/src/engine/intelligence/resource/ResourceAllocationSolver.d.ts +1 -1
- package/src/engine/intelligence/resource/ResourceAllocationSolver.js +1 -1
- package/src/engine/intelligence/resource/StrategicResourceAllocator.d.ts +1 -1
- package/src/engine/intelligence/resource/StrategicResourceAllocator.js +1 -1
- package/src/engine/intelligence/resource/TacticalModule.d.ts +1 -1
- package/src/engine/intelligence/resource/TacticalModule.js +1 -1
- package/src/engine/network/NetworkSession.d.ts +1 -1
- package/src/engine/network/NetworkSession.js +1 -1
- package/src/engine/network/adapters/QuaternionInterpolationAdapter.d.ts +1 -1
- package/src/engine/network/adapters/QuaternionInterpolationAdapter.js +1 -1
- package/src/engine/network/adapters/TransformInterpolationAdapter.d.ts +1 -1
- package/src/engine/network/adapters/TransformInterpolationAdapter.js +1 -1
- package/src/engine/network/adapters/TransformReplicationAdapter.d.ts +1 -1
- package/src/engine/network/adapters/TransformReplicationAdapter.js +1 -1
- package/src/engine/network/adapters/Vector3InterpolationAdapter.d.ts +1 -1
- package/src/engine/network/adapters/Vector3InterpolationAdapter.js +1 -1
- package/src/engine/network/core/quantize/quantize_float.d.ts +1 -1
- package/src/engine/network/core/quantize/quantize_float.js +1 -1
- package/src/engine/network/core/quantize/quantize_position.d.ts +1 -1
- package/src/engine/network/core/quantize/quantize_position.js +1 -1
- package/src/engine/network/core/sequence/ack_bitfield.d.ts +1 -1
- package/src/engine/network/core/sequence/ack_bitfield.js +1 -1
- package/src/engine/network/core/sequence/seq16.d.ts +1 -1
- package/src/engine/network/core/sequence/seq16.js +1 -1
- package/src/engine/network/core/sequence/seq32.d.ts +1 -1
- package/src/engine/network/core/sequence/seq32.js +1 -1
- package/src/engine/network/diagnostics/BandwidthMeter.d.ts +1 -1
- package/src/engine/network/diagnostics/BandwidthMeter.js +1 -1
- package/src/engine/network/diagnostics/ReplayLog.d.ts +1 -1
- package/src/engine/network/diagnostics/ReplayLog.js +1 -1
- package/src/engine/network/diagnostics/SyncTest.d.ts +1 -1
- package/src/engine/network/diagnostics/SyncTest.js +1 -1
- package/src/engine/network/ecs/NetworkSystem.d.ts +1 -1
- package/src/engine/network/ecs/NetworkSystem.js +1 -1
- package/src/engine/network/ecs/components/NetworkIdentity.d.ts +1 -1
- package/src/engine/network/ecs/components/NetworkIdentity.js +1 -1
- package/src/engine/network/ecs/serialization/NetworkIdentitySerializationAdapter.d.ts +1 -1
- package/src/engine/network/ecs/serialization/NetworkIdentitySerializationAdapter.js +1 -1
- package/src/engine/network/orchestrator/NetworkPeer.d.ts +1 -1
- package/src/engine/network/orchestrator/NetworkPeer.js +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +1 -1
- package/src/engine/network/replication/Replicator.d.ts +1 -1
- package/src/engine/network/replication/Replicator.js +1 -1
- package/src/engine/network/replication/ScopeFilter.d.ts +2 -2
- package/src/engine/network/replication/ScopeFilter.js +2 -2
- package/src/engine/network/sim/ActionLog.d.ts +1 -1
- package/src/engine/network/sim/ActionLog.js +1 -1
- package/src/engine/network/sim/BinaryInterpolationAdapter.d.ts +1 -1
- package/src/engine/network/sim/BinaryInterpolationAdapter.js +1 -1
- package/src/engine/network/sim/InterpolationLog.d.ts +1 -1
- package/src/engine/network/sim/InterpolationLog.js +1 -1
- package/src/engine/network/sim/ReplicatedComponentRegistry.d.ts +1 -1
- package/src/engine/network/sim/ReplicatedComponentRegistry.js +1 -1
- package/src/engine/network/sim/RewindEngine.d.ts +1 -1
- package/src/engine/network/sim/RewindEngine.js +1 -1
- package/src/engine/network/sim/SimAction.d.ts +1 -1
- package/src/engine/network/sim/SimAction.js +1 -1
- package/src/engine/network/sim/SimActionExecutor.d.ts +1 -1
- package/src/engine/network/sim/SimActionExecutor.js +1 -1
- package/src/engine/network/sim/SimActionRegistry.d.ts +1 -1
- package/src/engine/network/sim/SimActionRegistry.js +1 -1
- package/src/engine/network/sim/SmoothingState.js +1 -1
- package/src/engine/network/sim/Snapshotter.d.ts +1 -1
- package/src/engine/network/sim/Snapshotter.js +1 -1
- package/src/engine/network/sim/SpeculationLog.d.ts +1 -1
- package/src/engine/network/sim/SpeculationLog.js +1 -1
- package/src/engine/network/state/Baseline.d.ts +1 -1
- package/src/engine/network/state/Baseline.js +1 -1
- package/src/engine/network/state/ChangedEntitySet.d.ts +1 -1
- package/src/engine/network/state/ChangedEntitySet.js +1 -1
- package/src/engine/network/state/InputRing.d.ts +1 -1
- package/src/engine/network/state/InputRing.js +1 -1
- package/src/engine/network/state/MutationLedger.d.ts +1 -1
- package/src/engine/network/state/MutationLedger.js +1 -1
- package/src/engine/network/state/PriorityAccumulator.d.ts +1 -1
- package/src/engine/network/state/PriorityAccumulator.js +1 -1
- package/src/engine/network/state/ReplicationSlotTable.d.ts +1 -1
- package/src/engine/network/state/ReplicationSlotTable.js +1 -1
- package/src/engine/network/time/AdaptiveRenderDelay.d.ts +1 -1
- package/src/engine/network/time/AdaptiveRenderDelay.js +1 -1
- package/src/engine/network/time/JitterBuffer.d.ts +1 -1
- package/src/engine/network/time/JitterBuffer.js +1 -1
- package/src/engine/network/time/TimeDilation.d.ts +1 -1
- package/src/engine/network/time/TimeDilation.js +1 -1
- package/src/engine/network/time/TimeSync.d.ts +1 -1
- package/src/engine/network/time/TimeSync.js +1 -1
- package/src/engine/network/transport/Channel.d.ts.map +1 -1
- package/src/engine/network/transport/Channel.js +3 -6
- package/src/engine/network/transport/LoopbackTransport.d.ts +1 -1
- package/src/engine/network/transport/LoopbackTransport.js +1 -1
- package/src/engine/network/transport/ReliableCommandPipeline.d.ts +1 -1
- package/src/engine/network/transport/ReliableCommandPipeline.js +1 -1
- package/src/engine/network/transport/Transport.d.ts +1 -1
- package/src/engine/network/transport/Transport.js +1 -1
- package/src/engine/network/transport/adapters/NodeUDPTransport.d.ts +1 -1
- package/src/engine/network/transport/adapters/NodeUDPTransport.js +2 -2
- package/src/engine/network/transport/adapters/SimulatedTransport.d.ts +1 -1
- package/src/engine/network/transport/adapters/SimulatedTransport.js +1 -1
- package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.d.ts +1 -1
- package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.js +1 -1
- package/src/engine/network/transport/adapters/WebSocketTransport.d.ts +1 -1
- package/src/engine/network/transport/adapters/WebSocketTransport.js +1 -1
- package/src/engine/network/transport/adapters/WebTransportTransport.d.ts +1 -1
- package/src/engine/network/transport/adapters/WebTransportTransport.js +1 -1
- package/src/engine/network/transport/fragments/FragmentAssembler.d.ts +1 -1
- package/src/engine/network/transport/fragments/FragmentAssembler.js +1 -1
- package/src/engine/network/transport/fragments/FragmentRetention.d.ts +1 -1
- package/src/engine/network/transport/fragments/FragmentRetention.js +1 -1
- package/src/engine/network/transport/fragments/packet_size.d.ts +1 -1
- package/src/engine/network/transport/fragments/packet_size.js +1 -1
- package/src/engine/simulation/Ticker.d.ts +1 -1
- package/src/engine/simulation/Ticker.js +1 -1
- package/src/engine/sound/SoundEngine.js +1 -1
- package/src/engine/ui/DraggableAspect.d.ts +1 -1
- package/src/engine/ui/DraggableAspect.js +1 -1
- package/src/view/View.js +1 -1
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { GLSL3, NoBlending, RawShaderMaterial } from "three";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// Shadow-pass depth material for voxel impostors. World-space-sized
|
|
5
|
+
// camera-facing billboard, same geometry as the colour pass — in the
|
|
6
|
+
// shadow pass `modelViewMatrix = light_view * model`, so the quad
|
|
7
|
+
// expansion (which happens in view space here) lands as a light-facing
|
|
8
|
+
// world-sized splat. The depth at every fragment of the splat equals
|
|
9
|
+
// the splat centre's depth in light space (the corner offset is in
|
|
10
|
+
// view-XY only), so gl_FragCoord.z directly gives the splat's distance
|
|
11
|
+
// from the light.
|
|
12
|
+
//
|
|
13
|
+
// Mirrors three.js's packDepthToRGBA so the PCF shadow sampler can
|
|
14
|
+
// unpack our output; identical encoding to ImpostorShaderDepthV0.
|
|
15
|
+
const shader_vx = `
|
|
16
|
+
in vec3 position;
|
|
17
|
+
in vec2 uv;
|
|
18
|
+
in vec3 iPosition;
|
|
19
|
+
in vec3 iNormal;
|
|
20
|
+
|
|
21
|
+
out vec2 vUv;
|
|
22
|
+
|
|
23
|
+
uniform mat4 modelMatrix;
|
|
24
|
+
uniform mat4 modelViewMatrix;
|
|
25
|
+
uniform mat4 projectionMatrix;
|
|
26
|
+
uniform float uPointDiameter;
|
|
27
|
+
|
|
28
|
+
void main() {
|
|
29
|
+
vUv = uv;
|
|
30
|
+
|
|
31
|
+
float model_scale = length(modelMatrix[0].xyz);
|
|
32
|
+
float world_diameter = uPointDiameter * model_scale;
|
|
33
|
+
float radius_OS = uPointDiameter * 0.5;
|
|
34
|
+
|
|
35
|
+
// Inward-shift must match the colour pass exactly so the
|
|
36
|
+
// cast silhouette agrees with the visible one — see
|
|
37
|
+
// VoxelImpostorShaderV0 for the rationale.
|
|
38
|
+
vec3 centre_OS = iPosition - iNormal * radius_OS;
|
|
39
|
+
vec4 centre_view = modelViewMatrix * vec4(centre_OS, 1.0);
|
|
40
|
+
vec2 corner = position.xy * world_diameter;
|
|
41
|
+
gl_Position = projectionMatrix * (centre_view + vec4(corner, 0.0, 0.0));
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
const shader_fg = `
|
|
46
|
+
precision highp float;
|
|
47
|
+
precision highp int;
|
|
48
|
+
|
|
49
|
+
in vec2 vUv;
|
|
50
|
+
|
|
51
|
+
out vec4 color_out;
|
|
52
|
+
|
|
53
|
+
uniform bool uDiscMask;
|
|
54
|
+
|
|
55
|
+
const float PackUpscale = 256.0 / 255.0;
|
|
56
|
+
const vec3 PackFactors = vec3(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0);
|
|
57
|
+
const float ShiftRight8 = 1.0 / 256.0;
|
|
58
|
+
|
|
59
|
+
vec4 packDepthToRGBA(const in float v) {
|
|
60
|
+
vec4 r = vec4(fract(v * PackFactors), v);
|
|
61
|
+
r.yzw -= r.xyz * ShiftRight8;
|
|
62
|
+
return r * PackUpscale;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
void main() {
|
|
66
|
+
if (uDiscMask) {
|
|
67
|
+
vec2 c = vUv - 0.5;
|
|
68
|
+
if (dot(c, c) > 0.25) {
|
|
69
|
+
discard;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
color_out = packDepthToRGBA(gl_FragCoord.z);
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Depth-pass companion to {@link VoxelImpostorShaderLitV0}. Wire as
|
|
79
|
+
* ShadedGeometry.depth_material so the impostor casts a shadow whose
|
|
80
|
+
* silhouette matches the visible splat cloud (modulo the half-splat
|
|
81
|
+
* normal bias the lit shader applies on the receiver side).
|
|
82
|
+
*
|
|
83
|
+
* Keep `uPointDiameter` and `uDiscMask` aligned with the colour pass.
|
|
84
|
+
*/
|
|
85
|
+
export class VoxelImpostorShaderDepthV0 extends RawShaderMaterial {
|
|
86
|
+
constructor() {
|
|
87
|
+
super({
|
|
88
|
+
vertexShader: shader_vx,
|
|
89
|
+
fragmentShader: shader_fg,
|
|
90
|
+
glslVersion: GLSL3,
|
|
91
|
+
uniforms: {
|
|
92
|
+
uPointDiameter: { value: 0.05 },
|
|
93
|
+
uDiscMask: { value: false }
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
this.blending = NoBlending;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PBR-lit voxel impostor material. Each voxel is a world-space-sized
|
|
3
|
+
* camera-facing billboard; lighting follows the baked per-voxel normal,
|
|
4
|
+
* not the quad orientation. Casts and receives shadows.
|
|
5
|
+
*
|
|
6
|
+
* Pair with {@link ShadedGeometry.from}(geometry, material) — default
|
|
7
|
+
* DrawMode.Triangles is correct.
|
|
8
|
+
*
|
|
9
|
+
* Per-instance attributes: iPosition / iNormal / iAlbedo / iORM (set
|
|
10
|
+
* up by make_voxel_impostor_geometry). Per-instance uniforms:
|
|
11
|
+
* - uPointDiameter: splat diameter in OBJECT space. The shader
|
|
12
|
+
* multiplies by the entity's modelMatrix scale at draw time.
|
|
13
|
+
* - diffuse / emissive / roughness / metalness — standard PBR knobs.
|
|
14
|
+
*/
|
|
15
|
+
export class VoxelImpostorShaderLitV0 extends ShaderMaterial {
|
|
16
|
+
constructor();
|
|
17
|
+
}
|
|
18
|
+
import { ShaderMaterial } from "three";
|
|
19
|
+
//# sourceMappingURL=VoxelImpostorShaderLitV0.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoxelImpostorShaderLitV0.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderLitV0.js"],"names":[],"mappings":"AA+LA;;;;;;;;;;;;;GAaG;AACH;IACI,cAuBC;CACJ;+BAtOiE,OAAO"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { Color, ShaderMaterial, UniformsLib, UniformsUtils } from "three";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// PBR-lit variant of {@link VoxelImpostorShaderV0}. Each voxel renders
|
|
5
|
+
// as a camera-facing billboard sized in WORLD space; the per-instance
|
|
6
|
+
// baked normal drives the lighting equations and the per-instance ORM
|
|
7
|
+
// modulates roughness / metalness / AO. ShaderMaterial (not Raw) so
|
|
8
|
+
// three.js auto-injects modelMatrix / viewMatrix / normalMatrix /
|
|
9
|
+
// UniformsLib.lights via lights: true.
|
|
10
|
+
//
|
|
11
|
+
// Shadow handling — receiver side:
|
|
12
|
+
// The vertex shader builds a worldPosition for <shadowmap_vertex>
|
|
13
|
+
// that uses the splat CENTRE (every quad vertex shares the same
|
|
14
|
+
// iPosition, so the shadow coord is uniform across the splat — what
|
|
15
|
+
// you want for a single point sample), shifted along the surface
|
|
16
|
+
// normal by exactly the splat's world-space radius. That's the
|
|
17
|
+
// "50% of the quad size" normal-bias trick — at the impostor's
|
|
18
|
+
// design viewing distance this is sub-pixel (~half a pixel) and so
|
|
19
|
+
// invisible, while being more than enough to keep the splat from
|
|
20
|
+
// shadowing itself.
|
|
21
|
+
//
|
|
22
|
+
// Caster side is the paired VoxelImpostorShaderDepthV0.
|
|
23
|
+
//
|
|
24
|
+
// GLSL 1.0 syntax (attribute / varying) so three.js can mix in its
|
|
25
|
+
// chunks; three.js auto-converts to GLSL 3.0 on WebGL2.
|
|
26
|
+
const shader_vx = `
|
|
27
|
+
#define STANDARD
|
|
28
|
+
|
|
29
|
+
attribute vec3 iPosition;
|
|
30
|
+
attribute vec3 iNormal;
|
|
31
|
+
attribute vec3 iAlbedo;
|
|
32
|
+
attribute vec3 iORM;
|
|
33
|
+
|
|
34
|
+
flat varying vec3 vAlbedo;
|
|
35
|
+
flat varying vec3 vNormal_OS;
|
|
36
|
+
flat varying vec3 vORM;
|
|
37
|
+
varying vec3 vViewPosition;
|
|
38
|
+
varying vec2 vUv;
|
|
39
|
+
|
|
40
|
+
uniform float uPointDiameter;
|
|
41
|
+
|
|
42
|
+
#include <common>
|
|
43
|
+
#include <fog_pars_vertex>
|
|
44
|
+
#include <shadowmap_pars_vertex>
|
|
45
|
+
#include <logdepthbuf_pars_vertex>
|
|
46
|
+
#include <clipping_planes_pars_vertex>
|
|
47
|
+
|
|
48
|
+
void main() {
|
|
49
|
+
vUv = uv;
|
|
50
|
+
vAlbedo = iAlbedo;
|
|
51
|
+
vORM = iORM;
|
|
52
|
+
vNormal_OS = iNormal;
|
|
53
|
+
|
|
54
|
+
// World-sized camera-facing billboard. Same as the unlit V0:
|
|
55
|
+
// expand the quad in view space (which is rigid w.r.t. world)
|
|
56
|
+
// by the OS diameter scaled into world units.
|
|
57
|
+
float model_scale = length(modelMatrix[0].xyz);
|
|
58
|
+
float world_diameter = uPointDiameter * model_scale;
|
|
59
|
+
float world_radius = world_diameter * 0.5;
|
|
60
|
+
float radius_OS = uPointDiameter * 0.5;
|
|
61
|
+
|
|
62
|
+
// Inward-shift the splat centre so its outer edge sits at
|
|
63
|
+
// the original surface. iPosition from the voxeliser is the
|
|
64
|
+
// surface centroid (un-shifted) — see voxelize_samples.js.
|
|
65
|
+
vec3 centre_OS = iPosition - iNormal * radius_OS;
|
|
66
|
+
|
|
67
|
+
vec4 centre_view = modelViewMatrix * vec4(centre_OS, 1.0);
|
|
68
|
+
vec2 corner = position.xy * world_diameter;
|
|
69
|
+
vec4 pos_view = centre_view + vec4(corner, 0.0, 0.0);
|
|
70
|
+
|
|
71
|
+
vViewPosition = -pos_view.xyz;
|
|
72
|
+
gl_Position = projectionMatrix * pos_view;
|
|
73
|
+
|
|
74
|
+
// Surface normal in view space — drives the lit fragment
|
|
75
|
+
// pipeline and is consumed by <shadowmap_vertex> to compute a
|
|
76
|
+
// world-space normal for its bias step.
|
|
77
|
+
vec3 transformedNormal = normalize(normalMatrix * iNormal);
|
|
78
|
+
|
|
79
|
+
// worldPosition for <shadowmap_vertex>:
|
|
80
|
+
//
|
|
81
|
+
// Use the UN-SHIFTED iPosition (= the surface centroid) as
|
|
82
|
+
// the base, then add a normal-direction bias of one world
|
|
83
|
+
// radius. The chunk adds the per-light shadowNormalBias on
|
|
84
|
+
// top.
|
|
85
|
+
//
|
|
86
|
+
// This is the "50% of the quad size" bias the user asked
|
|
87
|
+
// for, with a useful symmetry: the visible splat is centred
|
|
88
|
+
// at (surface - radius * normal), and its outer edge on the
|
|
89
|
+
// normal side sits at the surface — exactly where the
|
|
90
|
+
// receiver's shadow coord lands once we add (+radius * normal)
|
|
91
|
+
// to the un-shifted surface position. So the shadow lookup
|
|
92
|
+
// happens at the splat's own outer-edge depth, which is
|
|
93
|
+
// sub-pixel-stable against the caster's depth across
|
|
94
|
+
// typical viewing distances. Self-shadow acne goes away.
|
|
95
|
+
vec3 normal_world = normalize(mat3(modelMatrix) * iNormal);
|
|
96
|
+
vec3 centre_world = (modelMatrix * vec4(iPosition, 1.0)).xyz;
|
|
97
|
+
vec4 worldPosition = vec4(centre_world + normal_world * world_radius, 1.0);
|
|
98
|
+
|
|
99
|
+
#include <logdepthbuf_vertex>
|
|
100
|
+
#include <clipping_planes_vertex>
|
|
101
|
+
#include <shadowmap_vertex>
|
|
102
|
+
#include <fog_vertex>
|
|
103
|
+
}
|
|
104
|
+
`;
|
|
105
|
+
const shader_fg = `
|
|
106
|
+
#define STANDARD
|
|
107
|
+
|
|
108
|
+
uniform vec3 diffuse;
|
|
109
|
+
uniform vec3 emissive;
|
|
110
|
+
uniform float roughness;
|
|
111
|
+
uniform float metalness;
|
|
112
|
+
uniform float opacity;
|
|
113
|
+
|
|
114
|
+
flat varying vec3 vAlbedo;
|
|
115
|
+
flat varying vec3 vNormal_OS;
|
|
116
|
+
flat varying vec3 vORM;
|
|
117
|
+
varying vec3 vViewPosition;
|
|
118
|
+
|
|
119
|
+
uniform mat3 normalMatrix;
|
|
120
|
+
|
|
121
|
+
uniform bool uDiscMask;
|
|
122
|
+
varying vec2 vUv; // for disc mask via uv interpolation
|
|
123
|
+
|
|
124
|
+
#include <common>
|
|
125
|
+
#include <packing>
|
|
126
|
+
#include <dithering_pars_fragment>
|
|
127
|
+
#include <color_pars_fragment>
|
|
128
|
+
#include <bsdfs>
|
|
129
|
+
#include <cube_uv_reflection_fragment>
|
|
130
|
+
#include <envmap_common_pars_fragment>
|
|
131
|
+
#include <envmap_physical_pars_fragment>
|
|
132
|
+
#include <fog_pars_fragment>
|
|
133
|
+
#include <lights_pars_begin>
|
|
134
|
+
#include <lights_physical_pars_fragment>
|
|
135
|
+
#include <shadowmap_pars_fragment>
|
|
136
|
+
#include <logdepthbuf_pars_fragment>
|
|
137
|
+
#include <clipping_planes_pars_fragment>
|
|
138
|
+
|
|
139
|
+
void main() {
|
|
140
|
+
#include <clipping_planes_fragment>
|
|
141
|
+
|
|
142
|
+
if (uDiscMask) {
|
|
143
|
+
vec2 c = vUv - 0.5;
|
|
144
|
+
if (dot(c, c) > 0.25) {
|
|
145
|
+
discard;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// sRGB -> linear (voxeliser re-encodes the averaged-linear
|
|
150
|
+
// albedo to sRGB so the on-GPU sample matches the octahedral
|
|
151
|
+
// atlas's "sRGB bytes labelled linear" format).
|
|
152
|
+
vec3 albedo_linear = sRGBToLinear(vec4(vAlbedo, 1.0)).rgb;
|
|
153
|
+
|
|
154
|
+
vec4 diffuseColor = vec4(albedo_linear * diffuse, 1.0);
|
|
155
|
+
ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));
|
|
156
|
+
|
|
157
|
+
float occlusionFactor = vORM.r;
|
|
158
|
+
float roughnessFactor = roughness * vORM.g;
|
|
159
|
+
float metalnessFactor = metalness * vORM.b;
|
|
160
|
+
|
|
161
|
+
vec3 totalEmissiveRadiance = emissive;
|
|
162
|
+
|
|
163
|
+
vec3 normal = normalize(normalMatrix * vNormal_OS);
|
|
164
|
+
vec3 geometryNormal = normal;
|
|
165
|
+
|
|
166
|
+
#include <logdepthbuf_fragment>
|
|
167
|
+
|
|
168
|
+
#include <lights_physical_fragment>
|
|
169
|
+
#include <lights_fragment_begin>
|
|
170
|
+
#include <lights_fragment_maps>
|
|
171
|
+
#include <lights_fragment_end>
|
|
172
|
+
|
|
173
|
+
reflectedLight.directDiffuse *= occlusionFactor;
|
|
174
|
+
reflectedLight.indirectDiffuse *= occlusionFactor;
|
|
175
|
+
reflectedLight.indirectSpecular *= occlusionFactor;
|
|
176
|
+
|
|
177
|
+
vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
|
|
178
|
+
vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
|
|
179
|
+
vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
|
|
180
|
+
|
|
181
|
+
gl_FragColor = vec4(outgoingLight, 1.0);
|
|
182
|
+
|
|
183
|
+
#include <tonemapping_fragment>
|
|
184
|
+
#include <encodings_fragment>
|
|
185
|
+
#include <fog_fragment>
|
|
186
|
+
#include <premultiplied_alpha_fragment>
|
|
187
|
+
#include <dithering_fragment>
|
|
188
|
+
}
|
|
189
|
+
`;
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* PBR-lit voxel impostor material. Each voxel is a world-space-sized
|
|
194
|
+
* camera-facing billboard; lighting follows the baked per-voxel normal,
|
|
195
|
+
* not the quad orientation. Casts and receives shadows.
|
|
196
|
+
*
|
|
197
|
+
* Pair with {@link ShadedGeometry.from}(geometry, material) — default
|
|
198
|
+
* DrawMode.Triangles is correct.
|
|
199
|
+
*
|
|
200
|
+
* Per-instance attributes: iPosition / iNormal / iAlbedo / iORM (set
|
|
201
|
+
* up by make_voxel_impostor_geometry). Per-instance uniforms:
|
|
202
|
+
* - uPointDiameter: splat diameter in OBJECT space. The shader
|
|
203
|
+
* multiplies by the entity's modelMatrix scale at draw time.
|
|
204
|
+
* - diffuse / emissive / roughness / metalness — standard PBR knobs.
|
|
205
|
+
*/
|
|
206
|
+
export class VoxelImpostorShaderLitV0 extends ShaderMaterial {
|
|
207
|
+
constructor() {
|
|
208
|
+
const uniforms = UniformsUtils.merge([
|
|
209
|
+
UniformsLib.common,
|
|
210
|
+
UniformsLib.fog,
|
|
211
|
+
UniformsLib.lights,
|
|
212
|
+
{
|
|
213
|
+
roughness: { value: 1.0 },
|
|
214
|
+
metalness: { value: 0.0 },
|
|
215
|
+
emissive: { value: new Color(0x000000) }
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
uPointDiameter: { value: 0.05 },
|
|
219
|
+
uDiscMask: { value: false }
|
|
220
|
+
}
|
|
221
|
+
]);
|
|
222
|
+
|
|
223
|
+
super({
|
|
224
|
+
uniforms,
|
|
225
|
+
vertexShader: shader_vx,
|
|
226
|
+
fragmentShader: shader_fg,
|
|
227
|
+
lights: true,
|
|
228
|
+
fog: true
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoxelImpostorShaderNormalsV0.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderNormalsV0.js"],"names":[],"mappings":"AAyDA;IACI,cAUC;CACJ;kCArEwC,OAAO"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { GLSL3, RawShaderMaterial } from "three";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// Debug visualisation: shows each voxel's baked OBJECT-space normal as
|
|
5
|
+
// RGB. Same world-space-sized camera-facing quad as the unlit V0.
|
|
6
|
+
const shader_vx = `
|
|
7
|
+
in vec3 position;
|
|
8
|
+
in vec2 uv;
|
|
9
|
+
in vec3 iPosition;
|
|
10
|
+
in vec3 iNormal;
|
|
11
|
+
|
|
12
|
+
out vec2 vUv;
|
|
13
|
+
flat out vec3 vNormal_OS;
|
|
14
|
+
|
|
15
|
+
uniform mat4 modelMatrix;
|
|
16
|
+
uniform mat4 modelViewMatrix;
|
|
17
|
+
uniform mat4 projectionMatrix;
|
|
18
|
+
uniform float uPointDiameter;
|
|
19
|
+
|
|
20
|
+
void main() {
|
|
21
|
+
vUv = uv;
|
|
22
|
+
vNormal_OS = iNormal;
|
|
23
|
+
|
|
24
|
+
float model_scale = length(modelMatrix[0].xyz);
|
|
25
|
+
float world_diameter = uPointDiameter * model_scale;
|
|
26
|
+
float radius_OS = uPointDiameter * 0.5;
|
|
27
|
+
|
|
28
|
+
// Inward-shift; see VoxelImpostorShaderV0 for rationale.
|
|
29
|
+
vec3 centre_OS = iPosition - iNormal * radius_OS;
|
|
30
|
+
vec4 centre_view = modelViewMatrix * vec4(centre_OS, 1.0);
|
|
31
|
+
vec2 corner = position.xy * world_diameter;
|
|
32
|
+
gl_Position = projectionMatrix * (centre_view + vec4(corner, 0.0, 0.0));
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
const shader_fg = `
|
|
37
|
+
precision highp float;
|
|
38
|
+
precision highp int;
|
|
39
|
+
|
|
40
|
+
in vec2 vUv;
|
|
41
|
+
flat in vec3 vNormal_OS;
|
|
42
|
+
|
|
43
|
+
out vec4 color_out;
|
|
44
|
+
|
|
45
|
+
uniform bool uDiscMask;
|
|
46
|
+
|
|
47
|
+
void main() {
|
|
48
|
+
if (uDiscMask) {
|
|
49
|
+
vec2 c = vUv - 0.5;
|
|
50
|
+
if (dot(c, c) > 0.25) {
|
|
51
|
+
discard;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
color_out = vec4(vNormal_OS * 0.5 + 0.5, 1.0);
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
|
|
58
|
+
export class VoxelImpostorShaderNormalsV0 extends RawShaderMaterial {
|
|
59
|
+
constructor() {
|
|
60
|
+
super({
|
|
61
|
+
vertexShader: shader_vx,
|
|
62
|
+
fragmentShader: shader_fg,
|
|
63
|
+
glslVersion: GLSL3,
|
|
64
|
+
uniforms: {
|
|
65
|
+
uPointDiameter: { value: 0.05 },
|
|
66
|
+
uDiscMask: { value: false }
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unlit voxel impostor material. Each voxel renders as a camera-facing
|
|
3
|
+
* billboard sized in world space, so the on-screen footprint scales
|
|
4
|
+
* naturally with viewing distance.
|
|
5
|
+
*
|
|
6
|
+
* Pair with {@link ShadedGeometry.from}(geometry, material) — the
|
|
7
|
+
* default DrawMode.Triangles is correct, since the splat is a quad.
|
|
8
|
+
*/
|
|
9
|
+
export class VoxelImpostorShaderV0 extends RawShaderMaterial {
|
|
10
|
+
constructor();
|
|
11
|
+
}
|
|
12
|
+
import { RawShaderMaterial } from "three";
|
|
13
|
+
//# sourceMappingURL=VoxelImpostorShaderV0.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoxelImpostorShaderV0.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderV0.js"],"names":[],"mappings":"AA4FA;;;;;;;GAOG;AACH;IACI,cAwBC;CACJ;kCA9HwC,OAAO"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { GLSL3, RawShaderMaterial } from "three";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// Unlit voxel-impostor shader.
|
|
5
|
+
//
|
|
6
|
+
// Per-instance camera-facing billboard quad, sized in WORLD space. The
|
|
7
|
+
// quad expansion happens in view space — and since the view matrix is
|
|
8
|
+
// rigid (rotation + translation, no scale), distances in view space
|
|
9
|
+
// equal distances in world. So a corner offset of `world_diameter * 0.5`
|
|
10
|
+
// added to the splat centre's view-space position gives the right
|
|
11
|
+
// world-aligned footprint, and perspective projection scales it with
|
|
12
|
+
// distance automatically — close in, the splat covers many pixels;
|
|
13
|
+
// far away, it shrinks below a pixel.
|
|
14
|
+
//
|
|
15
|
+
// uPointDiameter is in OBJECT space (bake space); the shader multiplies
|
|
16
|
+
// by the entity's uniform scale (length(modelMatrix[0])) to bring it
|
|
17
|
+
// into world space at draw time. This decouples the impostor data from
|
|
18
|
+
// the runtime entity scale.
|
|
19
|
+
const shader_vx = `
|
|
20
|
+
in vec3 position;
|
|
21
|
+
in vec2 uv;
|
|
22
|
+
|
|
23
|
+
in vec3 iPosition;
|
|
24
|
+
in vec3 iNormal;
|
|
25
|
+
in vec3 iAlbedo;
|
|
26
|
+
in vec3 iORM;
|
|
27
|
+
|
|
28
|
+
out vec2 vUv;
|
|
29
|
+
flat out vec3 vNormalView;
|
|
30
|
+
flat out vec3 vAlbedo;
|
|
31
|
+
flat out vec3 vORM;
|
|
32
|
+
|
|
33
|
+
uniform mat4 modelMatrix;
|
|
34
|
+
uniform mat4 modelViewMatrix;
|
|
35
|
+
uniform mat4 projectionMatrix;
|
|
36
|
+
uniform mat3 normalMatrix;
|
|
37
|
+
uniform float uPointDiameter;
|
|
38
|
+
|
|
39
|
+
void main() {
|
|
40
|
+
vUv = uv;
|
|
41
|
+
vAlbedo = iAlbedo;
|
|
42
|
+
vORM = iORM;
|
|
43
|
+
vNormalView = normalize(normalMatrix * iNormal);
|
|
44
|
+
|
|
45
|
+
float model_scale = length(modelMatrix[0].xyz);
|
|
46
|
+
float world_diameter = uPointDiameter * model_scale;
|
|
47
|
+
float radius_OS = uPointDiameter * 0.5;
|
|
48
|
+
|
|
49
|
+
// Inward-shift along the surface normal so the splat's OUTER
|
|
50
|
+
// edge (= centre + radius along normal) lands at the original
|
|
51
|
+
// surface position (iPosition is the un-shifted surface
|
|
52
|
+
// centroid the voxeliser produced). Without the shift, a
|
|
53
|
+
// camera-facing quad of diameter D centred at the surface
|
|
54
|
+
// extends D/2 past it on silhouette voxels, inflating the
|
|
55
|
+
// outline. With the shift, silhouette voxels render edge-on
|
|
56
|
+
// exactly at the mesh outline; inside voxels are pushed
|
|
57
|
+
// slightly below the surface (sub-pixel at design distance).
|
|
58
|
+
vec3 centre_OS = iPosition - iNormal * radius_OS;
|
|
59
|
+
|
|
60
|
+
vec4 centre_view = modelViewMatrix * vec4(centre_OS, 1.0);
|
|
61
|
+
vec2 corner = position.xy * world_diameter;
|
|
62
|
+
vec4 pos_view = centre_view + vec4(corner, 0.0, 0.0);
|
|
63
|
+
|
|
64
|
+
gl_Position = projectionMatrix * pos_view;
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
const shader_fg = `
|
|
69
|
+
precision highp float;
|
|
70
|
+
precision highp int;
|
|
71
|
+
|
|
72
|
+
in vec2 vUv;
|
|
73
|
+
flat in vec3 vNormalView;
|
|
74
|
+
flat in vec3 vAlbedo;
|
|
75
|
+
flat in vec3 vORM;
|
|
76
|
+
|
|
77
|
+
out vec4 color_out;
|
|
78
|
+
|
|
79
|
+
uniform bool uDiscMask;
|
|
80
|
+
|
|
81
|
+
void main() {
|
|
82
|
+
if (uDiscMask) {
|
|
83
|
+
vec2 c = vUv - 0.5;
|
|
84
|
+
if (dot(c, c) > 0.25) {
|
|
85
|
+
discard;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
color_out = vec4(vAlbedo, 1.0);
|
|
89
|
+
}
|
|
90
|
+
`;
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Unlit voxel impostor material. Each voxel renders as a camera-facing
|
|
95
|
+
* billboard sized in world space, so the on-screen footprint scales
|
|
96
|
+
* naturally with viewing distance.
|
|
97
|
+
*
|
|
98
|
+
* Pair with {@link ShadedGeometry.from}(geometry, material) — the
|
|
99
|
+
* default DrawMode.Triangles is correct, since the splat is a quad.
|
|
100
|
+
*/
|
|
101
|
+
export class VoxelImpostorShaderV0 extends RawShaderMaterial {
|
|
102
|
+
constructor() {
|
|
103
|
+
super({
|
|
104
|
+
vertexShader: shader_vx,
|
|
105
|
+
fragmentShader: shader_fg,
|
|
106
|
+
glslVersion: GLSL3,
|
|
107
|
+
uniforms: {
|
|
108
|
+
/**
|
|
109
|
+
* World-space diameter of each splat, in OBJECT-space
|
|
110
|
+
* units. Multiplied by the entity's modelMatrix scale
|
|
111
|
+
* at draw time. For tight coverage set to the voxel
|
|
112
|
+
* cell size (see VoxelImpostorDescription.voxel_size).
|
|
113
|
+
*/
|
|
114
|
+
uPointDiameter: {
|
|
115
|
+
value: 0.05
|
|
116
|
+
},
|
|
117
|
+
/**
|
|
118
|
+
* If true, discards fragments outside the inscribed
|
|
119
|
+
* disc — turns square splats into round ones.
|
|
120
|
+
*/
|
|
121
|
+
uDiscMask: {
|
|
122
|
+
value: false
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderViewportDepthV0.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoxelImpostorShaderViewportDepthV0.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderViewportDepthV0.js"],"names":[],"mappings":"AAuDA;IACI,cAUC;CACJ;kCAnEwC,OAAO"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { GLSL3, RawShaderMaterial } from "three";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// Debug visualisation: viewport depth of each voxel as grayscale.
|
|
5
|
+
// Same world-space-sized camera-facing quad as the other shaders.
|
|
6
|
+
const shader_vx = `
|
|
7
|
+
in vec3 position;
|
|
8
|
+
in vec2 uv;
|
|
9
|
+
in vec3 iPosition;
|
|
10
|
+
in vec3 iNormal;
|
|
11
|
+
|
|
12
|
+
out vec2 vUv;
|
|
13
|
+
|
|
14
|
+
uniform mat4 modelMatrix;
|
|
15
|
+
uniform mat4 modelViewMatrix;
|
|
16
|
+
uniform mat4 projectionMatrix;
|
|
17
|
+
uniform float uPointDiameter;
|
|
18
|
+
|
|
19
|
+
void main() {
|
|
20
|
+
vUv = uv;
|
|
21
|
+
|
|
22
|
+
float model_scale = length(modelMatrix[0].xyz);
|
|
23
|
+
float world_diameter = uPointDiameter * model_scale;
|
|
24
|
+
float radius_OS = uPointDiameter * 0.5;
|
|
25
|
+
|
|
26
|
+
// Inward-shift; see VoxelImpostorShaderV0 for rationale.
|
|
27
|
+
vec3 centre_OS = iPosition - iNormal * radius_OS;
|
|
28
|
+
vec4 centre_view = modelViewMatrix * vec4(centre_OS, 1.0);
|
|
29
|
+
vec2 corner = position.xy * world_diameter;
|
|
30
|
+
gl_Position = projectionMatrix * (centre_view + vec4(corner, 0.0, 0.0));
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
const shader_fg = `
|
|
35
|
+
precision highp float;
|
|
36
|
+
precision highp int;
|
|
37
|
+
|
|
38
|
+
in vec2 vUv;
|
|
39
|
+
|
|
40
|
+
out vec4 color_out;
|
|
41
|
+
|
|
42
|
+
uniform bool uDiscMask;
|
|
43
|
+
|
|
44
|
+
void main() {
|
|
45
|
+
if (uDiscMask) {
|
|
46
|
+
vec2 c = vUv - 0.5;
|
|
47
|
+
if (dot(c, c) > 0.25) {
|
|
48
|
+
discard;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
float d = 1.0 - gl_FragCoord.z;
|
|
52
|
+
color_out = vec4(d, d, d, 1.0);
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
export class VoxelImpostorShaderViewportDepthV0 extends RawShaderMaterial {
|
|
57
|
+
constructor() {
|
|
58
|
+
super({
|
|
59
|
+
vertexShader: shader_vx,
|
|
60
|
+
fragmentShader: shader_fg,
|
|
61
|
+
glslVersion: GLSL3,
|
|
62
|
+
uniforms: {
|
|
63
|
+
uPointDiameter: { value: 0.05 },
|
|
64
|
+
uDiscMask: { value: false }
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InstancedBufferGeometry with one instance per voxel. Each instance is
|
|
3
|
+
* a unit quad whose vertex shader pushes the quad to a world-space
|
|
4
|
+
* footprint around the voxel's iPosition. Because the splat's size is
|
|
5
|
+
* specified in world units, it scales correctly with viewing distance:
|
|
6
|
+
*
|
|
7
|
+
* - At the impostor's design distance (where one voxel projects to
|
|
8
|
+
* about one screen pixel), the quad covers a single pixel.
|
|
9
|
+
* - Closer in, the quad expands to cover the same voxel cell on
|
|
10
|
+
* screen — no holes.
|
|
11
|
+
* - Farther out, the quad shrinks below a pixel — no z-fighting.
|
|
12
|
+
*
|
|
13
|
+
* This is the camera-facing-billboard reading of the Witcher 4 "voxel
|
|
14
|
+
* point" — the on-screen size of each voxel is whatever its world-space
|
|
15
|
+
* cell projects to, not a fixed screen size. Shadows work for free
|
|
16
|
+
* because the depth caster, rendered with the same shader from the
|
|
17
|
+
* light's view, also produces world-sized splats in light space.
|
|
18
|
+
*
|
|
19
|
+
* The interleaved point buffer is shared across iPosition / iNormal /
|
|
20
|
+
* iAlbedo / iORM via offsets — one GPU upload covers the lot.
|
|
21
|
+
*
|
|
22
|
+
* @param {VoxelImpostorDescription} description
|
|
23
|
+
* @returns {InstancedBufferGeometry}
|
|
24
|
+
*/
|
|
25
|
+
export function make_voxel_impostor_geometry(description: VoxelImpostorDescription): InstancedBufferGeometry;
|
|
26
|
+
import { InstancedBufferGeometry } from "three";
|
|
27
|
+
//# sourceMappingURL=make_voxel_impostor_geometry.d.ts.map
|