@threenative/core 0.3.9 → 0.3.11
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/capabilities.json +1 -1
- package/dist/{game-cb99J-YE.d.ts → game-DzMcitDO.d.ts} +1 -0
- package/dist/hot.d.ts +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +93 -28
- package/dist/playtest.d.ts +1 -1
- package/dist/playtest.js +1 -1
- package/dist/world.js +13 -6
- package/mcp/animation-server.mjs +26 -18
- package/mcp/engine-server.mjs +1 -1
- package/mcp/servers.mjs +1 -1
- package/package.json +7 -7
- package/patches/{three@0.185.1.patch → three@0.187.0.patch} +2543 -3560
- package/scripts/apply-three-patch.mjs +4 -2
- package/src/gpu-frame-observation.ts +24 -1
- package/src/index.ts +1 -1
- package/src/look/auto-exposure.ts +5 -4
- package/src/look/exposure-graph.ts +2 -3
- package/src/look/filmic-tone-mapping.ts +17 -1
- package/src/look/local-exposure.ts +7 -5
- package/src/look/unreal-bloom.ts +7 -5
- package/src/look/world-environment.ts +10 -9
- package/src/pipeline-census.ts +18 -2
- package/src/render/batched-velocity.ts +5 -4
- package/src/render/probe-volume.ts +3 -3
- package/src/render/sky-capture.ts +1 -2
- package/src/render/soft-shadow.ts +2 -4
- package/src/render/traced-reflections.ts +5 -5
- package/src/render/velocity.ts +1 -1
- package/src/render/virtual-shadow.ts +3 -3
- package/src/render-camera-cull.ts +32 -1
- package/src/renderer.ts +6 -4
- package/src/version.ts +1 -1
- package/src/warmup.ts +30 -11
- package/src/world-cells.ts +4 -1
- package/src/world-tiles.ts +4 -1
- package/patches/three@0.185.1-prd269-upgrade.patch +0 -22726
package/capabilities.json
CHANGED
|
@@ -873,7 +873,7 @@
|
|
|
873
873
|
"`setExposureBias(stops)` is Unreal's Exposure Compensation, live: the game changes it per place or weather (`WorldEnvironment.apply` returns the node as `exposure`)"
|
|
874
874
|
],
|
|
875
875
|
"package": "@threenative/core",
|
|
876
|
-
"signature": "export class AutoExposureNode extends
|
|
876
|
+
"signature": "export class AutoExposureNode extends Node<\"float\"> { … }",
|
|
877
877
|
"situations": [
|
|
878
878
|
"the frame should expose itself the way a fresh Unreal project does as the sun and the view change",
|
|
879
879
|
"a white snowfield or a bright storm should not meter to middle grey, and the compensation changes with the weather"
|
|
@@ -1295,6 +1295,7 @@ interface IWarmUpReport {
|
|
|
1295
1295
|
/** The narrow slice of the renderer this needs. Structural so a test needs no renderer. */
|
|
1296
1296
|
interface IWarmUpRenderer {
|
|
1297
1297
|
compileAsync?: (scene: Object3D, camera: Camera, targetScene?: Object3D) => Promise<void>;
|
|
1298
|
+
compileComputeAsync?: (node: unknown) => Promise<void>;
|
|
1298
1299
|
computeAsync?: (node: unknown) => Promise<void>;
|
|
1299
1300
|
pipelineCensus?: () => IPipelineCensus;
|
|
1300
1301
|
/**
|
package/dist/hot.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -3,16 +3,16 @@ import { Object3D, AnimationClip, AnimationMixer, Vector3, Camera, Group, Scene,
|
|
|
3
3
|
export { A as AssetPriority, b as IAssetCacheReport, c as IAssetCacheState, I as IAssetLoader, a as IAssetLoaderOptions, d as IAssetPrefetchProgress, e as IAssetRequestOptions, f as ITextureOptions, g as createAssetLoader, r as reconcileMirroredClips } from './assets-YUbXa3-Y.js';
|
|
4
4
|
export { A as AudioBus, I as IAudioBusOptions, b as IAudioCompressorOptions, c as IAudioPlayOptions, r as resetAudioCueLedger } from './audio-DIJE5HTr.js';
|
|
5
5
|
export { C as CanvasLayer } from './canvas-layer-vCtanIeB.js';
|
|
6
|
-
import { b as IGamePluginRuntime, a as IGamePluginHooks } from './game-
|
|
7
|
-
export { A as AfterPhysicsCallback, C as ContextMenuPolicy, G as GEOMETRY_ASSET_KEY, c as GEOMETRY_CAPTURE_DEFAULT_LIMIT, d as GEOMETRY_CAPTURE_MAX_LIMIT, e as GEOMETRY_CAPTURE_SORTS, f as GEOMETRY_CAPTURE_TIMEOUT_MS, g as GEOMETRY_CAPTURE_WALK_CAP, h as GeometryCaptureSort, i as ICtx, I as IGame, j as IGameObservationContribution, k as IGameObservationSampleRequest, l as IGamePlatformSource, m as IGeometryCaptureAsset, n as IGeometryCaptureMesh, o as IGeometryCapturePass, p as IGeometryCaptureReport, q as IGeometryCaptureRequest, r as IGeometryCaptureRow, s as IInputAction, t as IInputGamepad, u as IPointerDragHandle, v as IPointerEvent3D, w as IPointerEvents3D, x as IPointerEvents3DOptions, y as IPointerEvents3DPicker, z as IPointerState, B as IRandom, D as IRawInputPointer, E as IRawInputPointerEdge, F as IRawInputState, H as IRaycastOptions, J as IScenePickerOptions, K as IThreeNativeAudioConfig, L as IThreeNativeAudioLoop, M as IThreeNativeAudioOverride, N as IThreeNativeAudioSpectrum, O as IThreeNativeBootSplash, P as IThreeNativeConfig, Q as IThreeNativeIconVariants, R as IThreeNativeLodConfig, S as IThreeNativeLodGenerationConfig, T as IThreeNativeLodOverride, U as IThreeNativeLodRuntimeConfig, V as IThreeNativeTexturesConfig, W as ITweenOptions, X as IWarmUpCacheOptions, Y as IWarmUpObservation, Z as IWarmUpOptions, _ as IWarmUpProgress, $ as IWarmUpRenderer, a0 as IWarmUpReport, a1 as InputBindings, a2 as InputMap, a3 as InputPlatformSource, a4 as PointerEvent3DListener, a5 as PointerEvent3DType, a6 as PointerEvents3D, a7 as Scene, a8 as SceneFrame, a9 as ScenePicker, aa as ScheduleHandle, ab as Scheduler, ac as ThreeNativeBackgroundMode, ad as ThreeNativeLodMinTrianglesScope, ae as ThreeNativeLodPreset, af as ThreeNativeOrientation, ag as ThreeNativeUiRenderer, ah as WarmUpCacheStatus, ai as WarmUpObservationStatus, aj as afterPhysics, ak as captureMouse, al as createRandom, am as defineGame, an as warmUpScene } from './game-
|
|
6
|
+
import { b as IGamePluginRuntime, a as IGamePluginHooks } from './game-DzMcitDO.js';
|
|
7
|
+
export { A as AfterPhysicsCallback, C as ContextMenuPolicy, G as GEOMETRY_ASSET_KEY, c as GEOMETRY_CAPTURE_DEFAULT_LIMIT, d as GEOMETRY_CAPTURE_MAX_LIMIT, e as GEOMETRY_CAPTURE_SORTS, f as GEOMETRY_CAPTURE_TIMEOUT_MS, g as GEOMETRY_CAPTURE_WALK_CAP, h as GeometryCaptureSort, i as ICtx, I as IGame, j as IGameObservationContribution, k as IGameObservationSampleRequest, l as IGamePlatformSource, m as IGeometryCaptureAsset, n as IGeometryCaptureMesh, o as IGeometryCapturePass, p as IGeometryCaptureReport, q as IGeometryCaptureRequest, r as IGeometryCaptureRow, s as IInputAction, t as IInputGamepad, u as IPointerDragHandle, v as IPointerEvent3D, w as IPointerEvents3D, x as IPointerEvents3DOptions, y as IPointerEvents3DPicker, z as IPointerState, B as IRandom, D as IRawInputPointer, E as IRawInputPointerEdge, F as IRawInputState, H as IRaycastOptions, J as IScenePickerOptions, K as IThreeNativeAudioConfig, L as IThreeNativeAudioLoop, M as IThreeNativeAudioOverride, N as IThreeNativeAudioSpectrum, O as IThreeNativeBootSplash, P as IThreeNativeConfig, Q as IThreeNativeIconVariants, R as IThreeNativeLodConfig, S as IThreeNativeLodGenerationConfig, T as IThreeNativeLodOverride, U as IThreeNativeLodRuntimeConfig, V as IThreeNativeTexturesConfig, W as ITweenOptions, X as IWarmUpCacheOptions, Y as IWarmUpObservation, Z as IWarmUpOptions, _ as IWarmUpProgress, $ as IWarmUpRenderer, a0 as IWarmUpReport, a1 as InputBindings, a2 as InputMap, a3 as InputPlatformSource, a4 as PointerEvent3DListener, a5 as PointerEvent3DType, a6 as PointerEvents3D, a7 as Scene, a8 as SceneFrame, a9 as ScenePicker, aa as ScheduleHandle, ab as Scheduler, ac as ThreeNativeBackgroundMode, ad as ThreeNativeLodMinTrianglesScope, ae as ThreeNativeLodPreset, af as ThreeNativeOrientation, ag as ThreeNativeUiRenderer, ah as WarmUpCacheStatus, ai as WarmUpObservationStatus, aj as afterPhysics, ak as captureMouse, al as createRandom, am as defineGame, an as warmUpScene } from './game-DzMcitDO.js';
|
|
8
8
|
import * as three_webgpu from 'three/webgpu';
|
|
9
|
-
import { StorageTexture, ComputeNode, UniformNode, Node, TextureNode, CubeRenderTarget, WebGPURenderer, NodeMaterial, StorageBufferNode, StructTypeNode, Data3DTexture, ShadowBaseNode, NodeBuilder, NodeFrame,
|
|
9
|
+
import { StorageTexture, ComputeNode, UniformNode, Node, TextureNode, CubeRenderTarget, WebGPURenderer, NodeMaterial, StorageBufferNode, StructTypeNode, Data3DTexture, ShadowBaseNode, NodeBuilder, NodeFrame, SpriteNodeMaterial, StorageTextureNode, Storage3DTexture } from 'three/webgpu';
|
|
10
10
|
import { I as IRendererLike, h as IStageGpuReading, F as FramePassKind, a as IFrameBudgetWindow } from './renderer-rZm0hVqq.js';
|
|
11
11
|
export { D as DEFAULT_PIPELINE_CENSUS_LIMIT, i as DEFAULT_TARGET_FPS, j as FRAME_BUDGET_MARKER, k as FRAME_BUDGET_PHASES, l as FRAME_HITCH_MARKER, m as FrameBudget, n as FrameBudgetPhase, o as FrameCounters, p as ICounterDevice, g as IFrameBudgetOptions, q as IFrameBudgetPassSummary, b as IFrameBudgetSimulation, r as IFrameBudgetSummary, s as IFrameCounters, d as IFramePhaseSample, e as IPipelineCensus, t as IPipelineCensusCounts, u as IPipelineCensusEvent, v as IPipelineCensusOptions, w as IPipelineProvenance, x as IPipelineShaderObservation, y as IPlatformInfo, z as IRenderChainApplied, A as IRenderChainBudgetWindow, B as IRenderChainDroppedStage, C as IRenderChainOptions, E as IRenderChainRenderer, G as IRenderChainRequest, H as IRenderChainStage, J as IRenderChainStageContext, K as IRenderChainVelocityMeasurement, L as IRenderChainVelocityReport, M as IRenderChainVelocityRequest, N as IRenderChainVelocityResult, c as IRenderPassSample, O as ITargetFps, P as IVelocityRenderPass, Q as MAX_TARGET_FPS, R as MainDrawSource, S as PIPELINE_CENSUS_CAPABILITY, T as PIPELINE_CENSUS_VERSION, U as PipelineCensus, V as PipelineCensusMode, W as PipelineCensusStatus, X as PlatformFormFactor, Y as PlatformOS, Z as PlatformRuntime, _ as RENDER_CHAIN_MARKER, $ as RENDER_CHAIN_STAGE_ORDER, a0 as RENDER_CHAIN_TIERS, a1 as RenderChain, a2 as RenderChainSource, a3 as RenderChainStageId, a4 as RenderChainStageName, a5 as RenderChainTier, a6 as RenderChainTierRequest, a7 as RenderChainVelocitySource, a8 as RendererToneMapping, a9 as TargetFpsSource, aa as VELOCITY_OUTPUT_NAME, ab as VELOCITY_PREVIOUS_BONE_MATRICES, ac as VELOCITY_PREVIOUS_INSTANCE_MATRICES, ad as VELOCITY_PREVIOUS_WORLD_MATRIX, ae as VelocityTracker, af as counterDeviceOf, ag as createPipelineCensus, ah as ensureVelocityOutput, ai as getPlatform, aj as isMobile, ak as isNative, al as isTouchscreenAvailable, am as isWeb, an as prewarm, ao as readRenderChainObservation, ap as readRenderChainReport, aq as readVelocityPreviousBoneMatrices, ar as readVelocityPreviousMatrices, as as readVelocityPreviousWorldMatrix, at as resolveTargetFps, au as snapRefreshRate, av as stageGpuReading, aw as velocityTexture, ax as withVelocityContext } from './renderer-rZm0hVqq.js';
|
|
12
12
|
import { I as IComputeDriven$1, c as IGPUReadbackSample, d as IBudgetCandidate } from './model-lod-CTpZ6imz.js';
|
|
13
13
|
export { C as ComputeDrivenRegistry, D as DISCRETE_LOD_DEFAULT_ERROR_PIXELS, e as DISCRETE_LOD_DEFAULT_HYSTERESIS, G as GPUReadback, f as IGPUReadbackOptions, g as baseGeometryOf, l as lodPixelScale, u as updateModelLods } from './model-lod-CTpZ6imz.js';
|
|
14
14
|
import { SkyMesh } from 'three/addons/objects/SkyMesh.js';
|
|
15
|
-
import {
|
|
15
|
+
import { pass } from 'three/tsl';
|
|
16
16
|
import { Node as Node$1, UniformNode as UniformNode$1 } from 'three/src/nodes/Nodes.js';
|
|
17
17
|
import 'zustand/vanilla';
|
|
18
18
|
|
|
@@ -3691,12 +3691,12 @@ interface IExposureSettings {
|
|
|
3691
3691
|
}
|
|
3692
3692
|
declare const exposureSettings: Readonly<IExposureSettings>;
|
|
3693
3693
|
|
|
3694
|
-
type ColourTexture =
|
|
3694
|
+
type ColourTexture = TextureNode;
|
|
3695
3695
|
type Meter = (colour: Node<"vec4">, uv: Node<"vec2">) => Node<"vec2">;
|
|
3696
3696
|
type Decode = (mean: Node<"float">) => Node<"float">;
|
|
3697
3697
|
|
|
3698
3698
|
/** Owns scratch targets only. Never draws the world or installs another output transform. */
|
|
3699
|
-
declare class AutoExposureNode extends
|
|
3699
|
+
declare class AutoExposureNode extends Node<"float"> {
|
|
3700
3700
|
#private;
|
|
3701
3701
|
static get type(): string;
|
|
3702
3702
|
readonly input: ColourTexture;
|
|
@@ -5949,6 +5949,6 @@ declare function boneLengthDeviations(root: Object3D, bind: IBoneLengthSnapshot,
|
|
|
5949
5949
|
* unavoidable here — core is bundled for browsers and cannot read `package.json` at runtime — so
|
|
5950
5950
|
* the spec now asserts this equals the manifest instead of asserting a number somebody typed.
|
|
5951
5951
|
*/
|
|
5952
|
-
declare const version = "0.3.
|
|
5952
|
+
declare const version = "0.3.11";
|
|
5953
5953
|
|
|
5954
5954
|
export { ATLAS_PADDING, ATMOSPHERE_LUT_RESOLUTIONS, AnimationComposer, AnimationPlayer, Atmosphere, type AtmosphereDirection, AtmosphereLuts, type AtmosphereRgb, AutoExposureNode, Billboard3D, type BillboardLockAxis, BlendSpace1D, BlendSpace2D, BudgetLadder, type BudgetVerdict, CameraShake, type CameraShakeCurve, type ChainStage, ClusteredBatch, ClusteredMesh, Daylight, ENVIRONMENT_TOO_SMALL_MARKER, EPIC_SSGI, type FinalGatherMethod, FlightModel, FluidField2D, FluidParticles3D, FramePassKind, GIBudget, type GIMethod, GIVisualize, type GIVisualizeMode, GI_METHODS, GI_VISUALIZE_MODES, GPUParticles3D, GPUSceneBVH, type GPUSceneBVHTraceFunction, GroundSnap, type IAddInSlicesOptions, type IAddInSlicesProgress, type IAddInSlicesReport, type IAircraftAirframe, type IAnimationComposerOptions, type IAnimationLayer, type IAnimationMask, type IAnimationMotionDelta, type IAnimationPlayOptions, type IAnimationPlayerOptions, type IAnimationRootMotionOptions, type IAnimationUpdateRateReport, type IAtmosphereLutResolution, type IAtmosphereLutResolutions, type IAtmosphereOptions, type IAtmosphereParameterPatch, type IAtmosphereParameters, type IAtmosphereScenePass, type IBillboard3DOptions, type IBoneContactReport, type IBoneLengthDeviation, type IBoneLengthDeviationReport, type IBoneLengthDeviationsOptions, type IBoneLengthSnapshot, type IBonePoseError, type IBudgetLadderOptions, type IBudgetWindow, type ICameraShakeOffset, type ICameraShakeOptions, type IClipBindingReport, type IClipCoverageReport, type IClipPoseErrorOptions, type IClipPoseErrorReport, type IClipPoseSubject, type IClipTrackBinding, type IClusterTable, type IClusteredBatchBuildOptions, type IClusteredBatchOptions, type IClusteredMeshOptions, type IClusteredPlacement, IComputeDriven$1 as IComputeDriven, type IDaylightOptions, type IEmitParticleRequest, type IExposureSettings, type IFlightAxes, type IFlightControls, type IFlightDeck, type IFlightEnvironment, type IFlightForces, type IFlightModelOptions, type IFlightModifiers, type IFlightQuaternion, type IFlightState, type IFlightVector3, type IFluidBounds, type IFluidCollider, type IFluidFieldOptions, type IFluidFieldSampler, type IFluidFieldVector2, type IFluidParticlesOptions, type IFluidParticlesStats, IFrameBudgetWindow, type IGIBudgetOptions, type IGIBudgetReport, type IGIVisualizeOptions, type IGPUParticles3DOptions, type IGPUParticles3DRuntime, type IGPUParticles3DSpawnBuffers, type IGPUParticles3DSpawnRequest, type IGPUParticles3DStats, IGPUReadbackSample, type IGPUSceneBVHMaterialGroup, type IGPUSceneBVHOptions, IGamePluginHooks, IGamePluginRuntime, type IGiTier, type IGroundSnapOptions, type IInstancedBatchBuildOptions, type IInstancedBatchOptions, type IInstancedPlacement, type ILampShadowStats, type ILaunchFailure, type ILoadAllOptions, type ILoadAllProgress, type IMatrixWorldReport, type IMeasureThreePoseOptions, type IMergeByMaterialOptions, type IMergePart, type IMergePartsOptions, type INormaliseToMetresOptions, type IPathFollow3DOptions, type IPathFollow3DProjection, type IPathFollow3DSample, type IProbeVolumeBakeProgress, type IProbeVolumeCoefficient, type IProbeVolumeObservation, type IProbeVolumeOptions, type IReflectionRoute, type IReplayOptions, type IReplayRecording, type IReplayRecordingSample, type IResolvedAtmosphereParameters, type IRippleFieldFlow, type IRippleFieldOptions, type ISceneShape, type ISceneWarning, type IShadowFilter, type IShadowFilterBudgetOptions, type IShadowFilterReport, type IShadowTier, type ISkeletalMesh3DOptions, type ISkyCaptureOptions, type ISoftBody3DOptions, type ISoftBodyCollision, type ISolarPosition, type ISolarPositionInput, type ISourceAngleShadowInputs, type ISourceAngleShadowOptions, type ISpanProbeTarget, type ISpanSummary, type ISpanWindow, type ISpectralOceanCascade, type ISpectralOceanHeight, type ISpectralOceanOptions, type ISpriteAnimator3DOptions, type ISpriteFrame3D, IStageGpuReading, type IStaticTransformCensus, type IStrideReport, type ISurfaceCacheMaterial, type ISurfaceCacheOptions, type ISurfaceCacheReport, type ISurfaceCacheTexture, type ISurfaceLight, type ISurfaceLightsOptions, type IThreePoseBounds, type IThreePoseMeasurement, type ITracedHit, type ITracedRay, type ITracedReflectionsOptions, type ITracerPool3DOptions, type ITracerSpawnOptions, type IUnlitFoliageWarning, type IValidationReport, type IVirtualShadowOptions, type IVirtualShadowStats, type IWaterReflectionOptions, type IWaterSurfaceOptions, type IWaveFieldDomainWarp, type IWaveFieldGraphOptions, type IWaveFieldOptions, type IWaveFieldSample, type IWaveFieldWave, type IWorldEnvironmentOptions, type IWorldEnvironmentStageContext, type IWorldEnvironmentTarget, InstancedBatch, LAMP_SHADOW_MARKER, LUT_RESOLUTIONS, type LaunchFailureKind, type MatrixWorldMode, MatrixWorldPass, NEUTRAL_FLIGHT_MODIFIERS, type NormaliseAxis, OPACITY_IGNORED_MARKER, type OutputRenderer, PROBE_VOLUME_MARKER, PathFollow3D, ProbeVolume, type ProbeVolumeDensity, type QualityTier, RENDERLIST_VALIDATE_FLAG, RENDERLIST_VALIDATE_MARKER, type Recording, RenderListValidator, type ReplayPointer, RippleField, SCENE_WARNING_MARKER, SHADOW_FILTER_TIERS, SHADOW_STAGES, SPANS, SPANS_FLAG, SPANS_MARKER, SPAN_COUNT, SPAN_NAMES, STATIC_TRANSFORM_MARKER, type ScreenSpaceAA, ShadowFilterBudget, type ShadowFilterTier, SkeletalMesh3D, SkyCapture, SkyCaptureSchedule, SoftBody3D, type SpanId, SpanRecorder, SpectralOcean, SpriteAnimator3D, type SpritePlaybackMode, type SsgiQuality, SurfaceCache, SurfaceLights, type ThreePoseQuaternion, type ThreePoseVector, type TonemapMode, TracedReflections, TracerPool3D, UNLIT_FOLIAGE_FIX, UNLIT_FOLIAGE_MARKER, VIRTUAL_SHADOW_CASTER_LAYER, VIRTUAL_SHADOW_MARKER, VIRTUAL_SHADOW_MOVER_LAYER, VIRTUAL_SHADOW_WIDE_CASTER_LAYER, VirtualShadowNode, WaterSurface3D, type WaveDirection, WaveField, WorldEnvironment, addFoliageBackLight, addInSlices, addSpan, aerodynamicCoefficients, airDensity, aircraftMass, alwaysRender, attachToBone, attitudeAxes, beginSpan, boneContact, boneLengthDeviations, boneLengths, bvhIntersectFirstHit, clipBoneCoverage, clipPoseError, clipTrackBindings, createReplayDriver, debugFlag, describeSceneShape, describeSceneWarning, directionFromSolarPosition, directionalTransmittance, displayPeriodMs, endSpan, ev100FromCamera, ev100FromExposure, ev100FromLuminance, exposeDebug, exposureFromEv100, exposureSettings, formatSceneWarning, formatSpansWindow, formatUnlitFoliageWarning, formatValidationReport, gearClearance, installFilmicToneMapping, installSpanProbes, invalidateStatic, isStatic, lampPenumbraTangent, lampShadowMarker, loadAll, lookDiagnostics, markStatic, measureThreePose, mergeByMaterial, mergeParts, normaliseToMetres, onLaunchFailure, parseReplayRecording, penumbraUv, posedBounds, qualityPreset, qualityTiers, rayStruct, readGIMarker, readLampShadowMarker, readProbeVolumeObservation, readShadowTierMarker, readVirtualShadowMarker, refreshStaticTransforms, renderListValidationRequested, renderTrapAudit, replay, resetStaticTransforms, resolveAtmosphereLutResolutions, resolveAtmosphereParameters, sceneWarning, setAttitude, setSpanRecorder, skeletonBones, softCircleDataTexture, solarPosition, solarPositionAt, sourceAngleShadowFilter, sourceRadiusShadowFilter, spanNow, spanRecorder, spansRequested, staticTransformCensus, unlitFoliageWarning, unmarkStatic, updateAtmosphereParameters, updateClusteredMeshes, useRoughDiffuse, validateWorldMatrices, version, zenithTransmittance };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as tsl from 'three/tsl';
|
|
2
|
-
import { vec3, materialEmissive, normalView, positionViewDirection, float, uniform, mrt, velocity, output, context, vec2, exp, mix, vec4, uniformArray, vertexIndex, texture, smoothstep, clamp, floor, textureLoad, ivec2, int, Fn, Loop, If, Break, max, min, cross as cross$1, dot, abs, texture3D, positionWorld, normalWorld, normalize, cubeTexture, viewportCoordinate, renderGroup, property, shadow, reference, lightShadowMatrix, and, Stack,
|
|
2
|
+
import { vec3, materialEmissive, normalView, positionViewDirection, float, uniform, mrt, velocity, output, context, vec2, exp, mix, vec4, uniformArray, vertexIndex, texture, smoothstep, clamp, floor, textureLoad, ivec2, int, Fn, Loop, If, Break, max, min, cross as cross$1, dot, abs, texture3D, positionWorld, normalWorld, normalize, cubeTexture, viewportCoordinate, renderGroup, property, shadow, reference, lightShadowMatrix, and, Stack, shadowPositionWorld, dFdx, dFdy, length, nodeObject, pass, emissive, diffuseColor, roughness, metalness, convertToTexture, instancedArray, instanceIndex, deltaTime, time, uint, sin, cos, positionLocal, reflector, screenUV, viewportSharedTexture, select, viewportLinearDepth, linearDepth, viewportDepthTexture, cameraFar, cameraNear, cameraPosition, sqrt, step, exp2, storage, textureSize, screenCoordinate, uv, getViewPosition, color, compute, storageTexture as storageTexture$1, uvec2, textureStore, pmremTexture, sign, atan, log, reflect, rtt, screenSize, pow, positionGeometry, saturate, attribute, mat4, normalLocal, normalGeometry, tangentLocal, tangentGeometry, positionPrevious } from 'three/tsl';
|
|
3
3
|
import { AnimationAction, AnimationMixer, Vector3, Sphere, Matrix4, NumberKeyframeTrack, Skeleton, Object3D, Matrix3, Scene, OrthographicCamera, Box3, Frustum, Quaternion, MathUtils, BufferGeometry, Color, BufferAttribute, Mesh, LoopOnce, LoopRepeat, AudioListener, Audio, PositionalAudio, Vector2, Raycaster, EquirectangularReflectionMapping, CustomToneMapping, Group, HalfFloatType, CubeCamera, SphereGeometry, BackSide, NoToneMapping, Vector4, InstancedMesh, PlaneGeometry, Box2, FrontSide, VSMShadowMap, PCFSoftShadowMap, PCFShadowMap, AgXToneMapping, HemisphereLight, DirectionalLight, FogExp2, Texture, NeutralToneMapping, ACESFilmicToneMapping, MaterialBlending, Sprite, DataTexture, RGBAFormat as RGBAFormat$1, UnsignedByteType, CatmullRomCurve3, LessEqualCompare, GreaterEqualCompare, AttachedBindMode, InterpolateLinear, AnimationUtils, AnimationClip, QuaternionKeyframeTrack, InterpolateDiscrete, NoColorSpace, SRGBColorSpace, AudioContext, LinearFilter as LinearFilter$1, ClampToEdgeWrapping as ClampToEdgeWrapping$1, Euler, RenderTarget as RenderTarget$1, NearestFilter as NearestFilter$1, FloatType as FloatType$1, CylinderGeometry, RGBA_ASTC_4x4_Format, PropertyBinding, getConsoleFunction, setConsoleFunction, NormalAnimationBlendMode, PerspectiveCamera, Plane, InstancedBufferAttribute, BatchedMesh, AlwaysDepth, InstancedBufferGeometry, SkinnedMesh, Points, LineSegments, LineLoop, Line, LOD, StaticDrawUsage } from 'three';
|
|
4
4
|
import { mergeGeometries } from 'three/addons/utils/BufferGeometryUtils.js';
|
|
5
|
-
import { CubeRenderTarget, MeshBasicNodeMaterial, PMREMGenerator, HalfFloatType as HalfFloatType$1, LinearFilter, RenderTarget, FloatType, NearestFilter, RenderTarget3D, RGBAFormat, Data3DTexture, ClampToEdgeWrapping, NodeMaterial, ShadowBaseNode, AssignNode,
|
|
5
|
+
import { CubeRenderTarget, MeshBasicNodeMaterial, PMREMGenerator, HalfFloatType as HalfFloatType$1, LinearFilter, RenderTarget, FloatType, NearestFilter, RenderTarget3D, RGBAFormat, Data3DTexture, ClampToEdgeWrapping, NodeMaterial, ShadowBaseNode, AssignNode, Node, NodeUpdateType, QuadMesh, RendererUtils, BlendMode, Storage3DTexture, StorageTexture, MeshStandardNodeMaterial, MeshPhysicalNodeMaterial, StorageBufferAttribute, RenderPipeline, ReadbackBuffer, MeshLambertNodeMaterial, MeshMatcapNodeMaterial, MeshNormalNodeMaterial, MeshPhongNodeMaterial, MeshToonNodeMaterial } from 'three/webgpu';
|
|
6
6
|
import { clone } from 'three/addons/utils/SkeletonUtils.js';
|
|
7
7
|
import { MeshBVH, SAH } from 'three-mesh-bvh';
|
|
8
8
|
import { createStore } from 'zustand/vanilla';
|
|
@@ -6400,6 +6400,8 @@ var MIN_DISTANCE2 = 1e-4;
|
|
|
6400
6400
|
var animationRateSources = /* @__PURE__ */ new WeakMap();
|
|
6401
6401
|
var animationRateStates = /* @__PURE__ */ new WeakMap();
|
|
6402
6402
|
var animationRateRoots = /* @__PURE__ */ new Set();
|
|
6403
|
+
var RATE_HOLD_RIGS = 32;
|
|
6404
|
+
var RATE_MEASURE_FRAMES = 4;
|
|
6403
6405
|
var animationRateRootRefs = /* @__PURE__ */ new WeakMap();
|
|
6404
6406
|
var animationRateCarriers = /* @__PURE__ */ new Set();
|
|
6405
6407
|
function observeAnimationRates(carrier, sources) {
|
|
@@ -6460,6 +6462,8 @@ var RenderCameraCull = class {
|
|
|
6460
6462
|
#animatedFrom = [];
|
|
6461
6463
|
/** The renderables under each rate root, in walk order, from the same walk as {@link #animated}. */
|
|
6462
6464
|
#rigParts = /* @__PURE__ */ new Map();
|
|
6465
|
+
/** A rig inside a rig: the inner rate comes from the outer walk, so no rig may skip its walk. */
|
|
6466
|
+
#nestedRigs = false;
|
|
6463
6467
|
#collectingParts = [];
|
|
6464
6468
|
#collectAnimated;
|
|
6465
6469
|
/** The camera's descendants this frame, so camera attachment needs no walk up the parents. */
|
|
@@ -6504,6 +6508,7 @@ var RenderCameraCull = class {
|
|
|
6504
6508
|
this.#collectAnimated = (object4) => {
|
|
6505
6509
|
if (isRenderable(object4)) this.#collectingParts.push(object4);
|
|
6506
6510
|
const outer = this.#animated.get(object4);
|
|
6511
|
+
if (outer !== void 0) this.#nestedRigs = true;
|
|
6507
6512
|
this.#animated.set(
|
|
6508
6513
|
object4,
|
|
6509
6514
|
outer === void 0 ? this.#collecting : [...outer, ...this.#collecting]
|
|
@@ -6537,6 +6542,7 @@ var RenderCameraCull = class {
|
|
|
6537
6542
|
this.#animated.clear();
|
|
6538
6543
|
this.#animatedFrom.length = 0;
|
|
6539
6544
|
this.#rigParts.clear();
|
|
6545
|
+
this.#nestedRigs = false;
|
|
6540
6546
|
for (const ref of animationRateRoots) {
|
|
6541
6547
|
const root = ref.deref();
|
|
6542
6548
|
const state2 = animationRateStates.get(root);
|
|
@@ -6580,9 +6586,14 @@ var RenderCameraCull = class {
|
|
|
6580
6586
|
this.#prepareCamera(camera, viewportHeight);
|
|
6581
6587
|
if (!this.#prepareAnimated()) return;
|
|
6582
6588
|
const rootShown = this.#isVisibleInWorld(root);
|
|
6589
|
+
const holds = rootShown && !this.#nestedRigs && animationRateCarriers.size === 0 && animationRateRoots.size >= RATE_HOLD_RIGS;
|
|
6590
|
+
let turn = this.#animationFrame;
|
|
6583
6591
|
for (const ref of animationRateRoots) {
|
|
6584
6592
|
const rig = ref.deref();
|
|
6585
|
-
if (rig
|
|
6593
|
+
if (rig === void 0 || !this.#reaches(rig, root)) continue;
|
|
6594
|
+
turn += 1;
|
|
6595
|
+
if (!holds || turn % RATE_MEASURE_FRAMES === 0 || !this.#holdRate(rig))
|
|
6596
|
+
this.#visitRig(rig, rootShown);
|
|
6586
6597
|
}
|
|
6587
6598
|
for (const ref of animationRateCarriers) {
|
|
6588
6599
|
const carrier = ref.deref();
|
|
@@ -6597,6 +6608,13 @@ var RenderCameraCull = class {
|
|
|
6597
6608
|
if (observes && this.#reaches(carrier, root)) carrier.traverseVisible(this.#animationVisitor);
|
|
6598
6609
|
}
|
|
6599
6610
|
}
|
|
6611
|
+
/** Carries a rig's rate into this frame; false when last frame did not measure or hold it, as for a rig just shown. */
|
|
6612
|
+
#holdRate(rig) {
|
|
6613
|
+
const state2 = animationRateStates.get(rig);
|
|
6614
|
+
if (state2?.source !== this || state2.frame !== this.#animationFrame - 1) return false;
|
|
6615
|
+
state2.frame = this.#animationFrame;
|
|
6616
|
+
return true;
|
|
6617
|
+
}
|
|
6600
6618
|
/**
|
|
6601
6619
|
* The rig's visible walk, as `traverseVisible` would make it. Only its renderables act, so on the
|
|
6602
6620
|
* native engine, with the walk's root shown, each kept part asks whether it is shown, rather
|
|
@@ -15933,7 +15951,7 @@ function state(mesh) {
|
|
|
15933
15951
|
function ensureBatchedMeshVelocity(mesh) {
|
|
15934
15952
|
const current = state(mesh)._matricesTexture;
|
|
15935
15953
|
if (current === null) throw new Error("BatchedMesh has no current matrix texture.");
|
|
15936
|
-
if (state(mesh)._previousMatricesTexture
|
|
15954
|
+
if (state(mesh)._previousMatricesTexture != null) return;
|
|
15937
15955
|
const image = matrixImage(current);
|
|
15938
15956
|
const previous = new DataTexture(
|
|
15939
15957
|
image.data.slice(),
|
|
@@ -15977,7 +15995,7 @@ function setBatchedMeshPreviousMatrices(mesh, previous) {
|
|
|
15977
15995
|
function disposeBatchedMeshVelocity(mesh) {
|
|
15978
15996
|
const previous = state(mesh)._previousMatricesTexture;
|
|
15979
15997
|
previous?.dispose();
|
|
15980
|
-
state(mesh)._previousMatricesTexture =
|
|
15998
|
+
state(mesh)._previousMatricesTexture = null;
|
|
15981
15999
|
}
|
|
15982
16000
|
function matrixImage(texture7) {
|
|
15983
16001
|
const image = texture7.image;
|
|
@@ -17646,7 +17664,7 @@ function batchedMatrixData(mesh) {
|
|
|
17646
17664
|
return mesh._matricesTexture?.image?.data;
|
|
17647
17665
|
}
|
|
17648
17666
|
function hasBatchedPreviousMatrices(mesh) {
|
|
17649
|
-
return mesh._previousMatricesTexture
|
|
17667
|
+
return mesh._previousMatricesTexture != null;
|
|
17650
17668
|
}
|
|
17651
17669
|
function isNode(value) {
|
|
17652
17670
|
return typeof value === "object" && value !== null && value.isNode === true;
|
|
@@ -19114,6 +19132,7 @@ var GpuFrameObservation = class {
|
|
|
19114
19132
|
throw new Error(`${PREFIX}LIMITS`);
|
|
19115
19133
|
this.#maxFrames = options.maxFrames;
|
|
19116
19134
|
this.#maxQueries = options.maxQueries;
|
|
19135
|
+
this.#watch(getPool());
|
|
19117
19136
|
}
|
|
19118
19137
|
generation;
|
|
19119
19138
|
firstFrame;
|
|
@@ -19123,6 +19142,8 @@ var GpuFrameObservation = class {
|
|
|
19123
19142
|
#stopFrame;
|
|
19124
19143
|
#failure;
|
|
19125
19144
|
#pool;
|
|
19145
|
+
#watched = /* @__PURE__ */ new WeakSet();
|
|
19146
|
+
#wrapped = false;
|
|
19126
19147
|
#batches = /* @__PURE__ */ new Map();
|
|
19127
19148
|
#queue = [];
|
|
19128
19149
|
#nextBatch = 0;
|
|
@@ -19144,6 +19165,23 @@ var GpuFrameObservation = class {
|
|
|
19144
19165
|
#ignoredCompletions = 0;
|
|
19145
19166
|
#maxFrames;
|
|
19146
19167
|
#maxQueries;
|
|
19168
|
+
/**
|
|
19169
|
+
* three 0.187 never leaves a pool full: an allocation past `maxQueries` resolves the pool by itself and
|
|
19170
|
+
* restarts at slot 0, so the earlier queries vanish without a trace. Allocation is the one place a restart
|
|
19171
|
+
* shows, as the index going backwards; r185 returned null there and left the pool full instead.
|
|
19172
|
+
*/
|
|
19173
|
+
#watch(value) {
|
|
19174
|
+
const pool = value;
|
|
19175
|
+
if (typeof pool?.allocateQueriesForContext !== "function" || this.#watched.has(pool)) return;
|
|
19176
|
+
this.#watched.add(pool);
|
|
19177
|
+
const allocate = pool.allocateQueriesForContext;
|
|
19178
|
+
pool.allocateQueriesForContext = (...args) => {
|
|
19179
|
+
const before = pool.currentQueryIndex ?? 0;
|
|
19180
|
+
const result = allocate.apply(pool, args);
|
|
19181
|
+
if ((pool.currentQueryIndex ?? 0) < before) this.#wrapped = true;
|
|
19182
|
+
return result;
|
|
19183
|
+
};
|
|
19184
|
+
}
|
|
19147
19185
|
#fail(reason) {
|
|
19148
19186
|
if (this.#state === "failed" || this.#state === "disposed") return;
|
|
19149
19187
|
this.#failure = reason.startsWith(PREFIX) ? reason : `${PREFIX}${reason}`;
|
|
@@ -19161,6 +19199,7 @@ var GpuFrameObservation = class {
|
|
|
19161
19199
|
}
|
|
19162
19200
|
#refreshUndrained() {
|
|
19163
19201
|
const value = this.getPool();
|
|
19202
|
+
this.#watch(value);
|
|
19164
19203
|
if (value === void 0 && this.#pool === void 0) return;
|
|
19165
19204
|
const pool = readPool(value);
|
|
19166
19205
|
if (this.#pool !== void 0 && this.#pool !== pool) throw new Error(`${PREFIX}POOL_RESET`);
|
|
@@ -19193,7 +19232,7 @@ var GpuFrameObservation = class {
|
|
|
19193
19232
|
const slots = [...selected.values()].reduce((sum2, group) => sum2 + group.length * 2, 0);
|
|
19194
19233
|
this.#undrainedFrames = selected.size;
|
|
19195
19234
|
this.#undrainedQueries = slots;
|
|
19196
|
-
if (pool.currentQueryIndex >= pool.maxQueries) {
|
|
19235
|
+
if (pool.currentQueryIndex >= pool.maxQueries || this.#wrapped) {
|
|
19197
19236
|
this.#allocationLoss = "unknown-after-saturation";
|
|
19198
19237
|
throw new Error(`${PREFIX}SATURATED_POOL`);
|
|
19199
19238
|
}
|
|
@@ -19765,10 +19804,15 @@ function filmicToneMappingNode(c = FILMIC_CURVE, grade = COLOR_GRADE) {
|
|
|
19765
19804
|
return c.dither === 0 ? display : dithered(display, c.dither);
|
|
19766
19805
|
};
|
|
19767
19806
|
}
|
|
19807
|
+
var installedCurves = /* @__PURE__ */ new WeakMap();
|
|
19768
19808
|
function installFilmicToneMapping(raw, c = FILMIC_CURVE, grade = COLOR_GRADE) {
|
|
19769
19809
|
const library = raw.library;
|
|
19770
19810
|
if (library?.addToneMapping === void 0) return void 0;
|
|
19771
|
-
|
|
19811
|
+
const curve = JSON.stringify([c, grade]);
|
|
19812
|
+
if (installedCurves.get(library) !== curve) {
|
|
19813
|
+
library.addToneMapping(filmicToneMappingNode(c, grade), CustomToneMapping);
|
|
19814
|
+
installedCurves.set(library, curve);
|
|
19815
|
+
}
|
|
19772
19816
|
return CustomToneMapping;
|
|
19773
19817
|
}
|
|
19774
19818
|
|
|
@@ -19968,7 +20012,7 @@ var qualityTiers = {
|
|
|
19968
20012
|
};
|
|
19969
20013
|
|
|
19970
20014
|
// src/version.ts
|
|
19971
|
-
var CORE_VERSION = "0.3.
|
|
20015
|
+
var CORE_VERSION = "0.3.11";
|
|
19972
20016
|
|
|
19973
20017
|
// src/pipeline-census.ts
|
|
19974
20018
|
var PIPELINE_CENSUS_VERSION = 1;
|
|
@@ -20548,12 +20592,24 @@ var PipelineCensus = class {
|
|
|
20548
20592
|
pipeline,
|
|
20549
20593
|
compute: compute2,
|
|
20550
20594
|
renderObject: void 0,
|
|
20551
|
-
mode: "sync"
|
|
20595
|
+
mode: asyncPromises(args[2]).length > 0 ? "async" : "sync"
|
|
20552
20596
|
});
|
|
20553
20597
|
const started = this.#now();
|
|
20554
20598
|
try {
|
|
20555
20599
|
const result = this.#throughBackend(() => original.apply(backend, [...args]));
|
|
20556
|
-
|
|
20600
|
+
const promises = asyncPromises(args[2]);
|
|
20601
|
+
if (promises.length > 0) {
|
|
20602
|
+
event2.mode = "async";
|
|
20603
|
+
event2.status = "pending";
|
|
20604
|
+
event2.pending = true;
|
|
20605
|
+
this.#pending += 1;
|
|
20606
|
+
void Promise.all(promises).then(
|
|
20607
|
+
() => this.#settleEvent(backend, event2, started, void 0),
|
|
20608
|
+
(error) => this.#settleEvent(backend, event2, started, error)
|
|
20609
|
+
);
|
|
20610
|
+
} else {
|
|
20611
|
+
this.#settleEvent(backend, event2, started, void 0);
|
|
20612
|
+
}
|
|
20557
20613
|
return result;
|
|
20558
20614
|
} catch (error) {
|
|
20559
20615
|
this.#settleEvent(backend, event2, started, error);
|
|
@@ -22478,7 +22534,8 @@ function wrapRenderer(raw, kind, applied, state2, reapply, alphaAntialiasing, pi
|
|
|
22478
22534
|
resolveGpuFrame: () => {
|
|
22479
22535
|
const resolveTimestampsAsync = raw.resolveTimestampsAsync;
|
|
22480
22536
|
if (resolveTimestampsAsync === void 0) return;
|
|
22481
|
-
|
|
22537
|
+
if (timestampCapable && raw.backend?.trackTimestamp !== true) return;
|
|
22538
|
+
const observationBatch = gpuObservation !== void 0 ? gpuObservation.capture() : void 0;
|
|
22482
22539
|
void resolveTimestampsAsync.call(raw)?.catch(() => void 0);
|
|
22483
22540
|
gpuObservation?.submitted(observationBatch);
|
|
22484
22541
|
void resolveTimestampsAsync.call(raw, "compute")?.catch(() => void 0);
|
|
@@ -24303,11 +24360,16 @@ function storeWarmUpCache(identity2, pipelines, computeNodes) {
|
|
|
24303
24360
|
}
|
|
24304
24361
|
}
|
|
24305
24362
|
function computeAsyncOf(renderer) {
|
|
24306
|
-
const receiver = typeof renderer.computeAsync === "function" ? renderer : renderer.raw;
|
|
24363
|
+
const receiver = typeof renderer.compileComputeAsync === "function" || typeof renderer.computeAsync === "function" ? renderer : renderer.raw;
|
|
24307
24364
|
if (typeof receiver !== "object" || receiver === null) return void 0;
|
|
24308
|
-
const { backend, computeAsync } = receiver;
|
|
24365
|
+
const { backend, compileComputeAsync, computeAsync } = receiver;
|
|
24366
|
+
if (backend?.isWebGPUBackend === true) {
|
|
24367
|
+
if (typeof compileComputeAsync !== "function") return void 0;
|
|
24368
|
+
return { warm: (node) => compileComputeAsync.call(receiver, node) };
|
|
24369
|
+
}
|
|
24309
24370
|
if (typeof computeAsync !== "function") return void 0;
|
|
24310
|
-
|
|
24371
|
+
const plain = computeAsync.bind(receiver);
|
|
24372
|
+
return { warm: (node) => plain(node) };
|
|
24311
24373
|
}
|
|
24312
24374
|
async function yieldThroughHost(yieldFrame) {
|
|
24313
24375
|
await Promise.all([
|
|
@@ -24349,8 +24411,8 @@ async function withinDeadline(deadline, work, yieldFrame, now4) {
|
|
|
24349
24411
|
return false;
|
|
24350
24412
|
}
|
|
24351
24413
|
async function runComputeWarmUp(renderer, nodes, compileTimeoutMs, deadline, now4, yieldFrame) {
|
|
24352
|
-
const
|
|
24353
|
-
if (
|
|
24414
|
+
const seam = computeAsyncOf(renderer);
|
|
24415
|
+
if (seam === void 0) {
|
|
24354
24416
|
return { compiled: 0, abandoned: 0, unsupported: true, timedOut: false };
|
|
24355
24417
|
}
|
|
24356
24418
|
let compiled = 0;
|
|
@@ -24365,7 +24427,7 @@ async function runComputeWarmUp(renderer, nodes, compileTimeoutMs, deadline, now
|
|
|
24365
24427
|
}
|
|
24366
24428
|
const finished = await withinDeadline(
|
|
24367
24429
|
Math.min(deadline, now4() + compileTimeoutMs),
|
|
24368
|
-
Promise.resolve().then(() =>
|
|
24430
|
+
Promise.resolve().then(() => seam.warm(nodes[index])),
|
|
24369
24431
|
yieldFrame,
|
|
24370
24432
|
now4
|
|
24371
24433
|
);
|
|
@@ -33898,7 +33960,7 @@ var VirtualShadowNode = class extends ShadowBaseNode {
|
|
|
33898
33960
|
return filter.call(stock, builder2, inputs);
|
|
33899
33961
|
};
|
|
33900
33962
|
}
|
|
33901
|
-
const material = getShadowMaterial(
|
|
33963
|
+
const material = node.getShadowMaterial();
|
|
33902
33964
|
shadowColor ??= material.colorNode;
|
|
33903
33965
|
material.colorNode = shadowColor;
|
|
33904
33966
|
const entry = {
|
|
@@ -34952,7 +35014,7 @@ var ExposureReadback = class {
|
|
|
34952
35014
|
function applyExposure(colour, exposure) {
|
|
34953
35015
|
return vec4(colour.rgb.mul(exposure), colour.a);
|
|
34954
35016
|
}
|
|
34955
|
-
var AutoExposureNode = class extends
|
|
35017
|
+
var AutoExposureNode = class extends Node {
|
|
34956
35018
|
static get type() {
|
|
34957
35019
|
return "AutoExposureNode";
|
|
34958
35020
|
}
|
|
@@ -34971,7 +35033,7 @@ var AutoExposureNode = class extends TempNode {
|
|
|
34971
35033
|
#seed = uniform(0);
|
|
34972
35034
|
#enabled = uniform(false);
|
|
34973
35035
|
#bias = uniform(0);
|
|
34974
|
-
#quad
|
|
35036
|
+
#quad;
|
|
34975
35037
|
#meterMaterial = new NodeMaterial();
|
|
34976
35038
|
#reduceMaterial = new NodeMaterial();
|
|
34977
35039
|
#tilesMaterial = new NodeMaterial();
|
|
@@ -35020,6 +35082,7 @@ var AutoExposureNode = class extends TempNode {
|
|
|
35020
35082
|
decode,
|
|
35021
35083
|
this.#bias
|
|
35022
35084
|
);
|
|
35085
|
+
this.#quad = new QuadMesh(this.#meterMaterial);
|
|
35023
35086
|
}
|
|
35024
35087
|
setup(builder) {
|
|
35025
35088
|
super.setup(builder);
|
|
@@ -35214,7 +35277,7 @@ function scratch3(type, linear) {
|
|
|
35214
35277
|
function mirror(u) {
|
|
35215
35278
|
return u.mod(2).sub(1).abs().oneMinus();
|
|
35216
35279
|
}
|
|
35217
|
-
var LocalExposureNode = class extends
|
|
35280
|
+
var LocalExposureNode = class extends Node {
|
|
35218
35281
|
static get type() {
|
|
35219
35282
|
return "LocalExposureNode";
|
|
35220
35283
|
}
|
|
@@ -35230,7 +35293,7 @@ var LocalExposureNode = class extends TempNode {
|
|
|
35230
35293
|
#blurSize = uniform(new Vector2(1, 1));
|
|
35231
35294
|
#blurRadius = uniform(BLUR_RADIUS);
|
|
35232
35295
|
#rangeStride = uniform(1);
|
|
35233
|
-
#quad
|
|
35296
|
+
#quad;
|
|
35234
35297
|
#logMaterial = new NodeMaterial();
|
|
35235
35298
|
#lumMaterial = new NodeMaterial();
|
|
35236
35299
|
#blurXMaterial = new NodeMaterial();
|
|
@@ -35385,6 +35448,7 @@ var LocalExposureNode = class extends TempNode {
|
|
|
35385
35448
|
});
|
|
35386
35449
|
return sum2;
|
|
35387
35450
|
})();
|
|
35451
|
+
this.#quad = new QuadMesh(this.#logMaterial);
|
|
35388
35452
|
}
|
|
35389
35453
|
setup(builder) {
|
|
35390
35454
|
super.setup(builder);
|
|
@@ -35774,7 +35838,7 @@ function bloomSchedule(width, height) {
|
|
|
35774
35838
|
};
|
|
35775
35839
|
});
|
|
35776
35840
|
}
|
|
35777
|
-
var UnrealBloomNode = class extends
|
|
35841
|
+
var UnrealBloomNode = class extends Node {
|
|
35778
35842
|
static get type() {
|
|
35779
35843
|
return "UnrealBloomNode";
|
|
35780
35844
|
}
|
|
@@ -35782,7 +35846,7 @@ var UnrealBloomNode = class extends TempNode {
|
|
|
35782
35846
|
static schedule = bloomSchedule;
|
|
35783
35847
|
input;
|
|
35784
35848
|
#size = new Vector2();
|
|
35785
|
-
#quad
|
|
35849
|
+
#quad;
|
|
35786
35850
|
#downMaterials = [];
|
|
35787
35851
|
#downTargets = [];
|
|
35788
35852
|
#downTextures = [];
|
|
@@ -35819,6 +35883,7 @@ var UnrealBloomNode = class extends TempNode {
|
|
|
35819
35883
|
})();
|
|
35820
35884
|
this.#downMaterials.push(material);
|
|
35821
35885
|
}
|
|
35886
|
+
this.#quad = new QuadMesh(this.#downMaterials[0]);
|
|
35822
35887
|
const { sizes, tints, intensity, gaussianIntensity } = unrealBloomSettings;
|
|
35823
35888
|
const tintScale = 1 / STAGES * intensity * gaussianIntensity;
|
|
35824
35889
|
let previous;
|
|
@@ -36334,8 +36399,8 @@ var WorldEnvironment = class {
|
|
|
36334
36399
|
return texture7;
|
|
36335
36400
|
};
|
|
36336
36401
|
const giDenoise = (node) => {
|
|
36337
|
-
|
|
36338
|
-
|
|
36402
|
+
let result = denoised(node);
|
|
36403
|
+
if (!options.denoiseEnabled) return result;
|
|
36339
36404
|
for (let pass2 = 0; pass2 < options.giDenoisePasses; pass2 += 1) {
|
|
36340
36405
|
const filter = denoise(result, depth(), normal(), view);
|
|
36341
36406
|
filter.index.value = pass2;
|
|
@@ -41664,7 +41729,7 @@ function boneLengthDeviations(root, bind, options = {}) {
|
|
|
41664
41729
|
}
|
|
41665
41730
|
|
|
41666
41731
|
// src/index.ts
|
|
41667
|
-
var version = "0.3.
|
|
41732
|
+
var version = "0.3.11";
|
|
41668
41733
|
/*!
|
|
41669
41734
|
* Selectively adapted from GGEZ packages/anim-runtime/src/runtime/helpers.ts
|
|
41670
41735
|
* (findBlend1DChildren, computeTriangleBarycentricWeights, findBlend2DEdgeWeights)
|
package/dist/playtest.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JsonValue, JsonPrimitive } from '@threenative/playtest/protocol';
|
|
2
2
|
export { PLAYTEST_CLOCK_GLOBAL } from '@threenative/playtest/protocol';
|
|
3
|
-
import { a as IGamePluginHooks } from './game-
|
|
3
|
+
import { a as IGamePluginHooks } from './game-DzMcitDO.js';
|
|
4
4
|
import './assets-YUbXa3-Y.js';
|
|
5
5
|
import 'three';
|
|
6
6
|
import './renderer-rZm0hVqq.js';
|
package/dist/playtest.js
CHANGED
package/dist/world.js
CHANGED
|
@@ -3899,6 +3899,7 @@ var TerrainTiles = class _TerrainTiles extends Object3D {
|
|
|
3899
3899
|
for (const tile of [...this.#resident.values()]) this.#evict(tile);
|
|
3900
3900
|
this.#resident.clear();
|
|
3901
3901
|
this.removeFromParent();
|
|
3902
|
+
super.dispose();
|
|
3902
3903
|
}
|
|
3903
3904
|
*#createField(origin, chunked) {
|
|
3904
3905
|
const sampler = {
|
|
@@ -9771,11 +9772,16 @@ function storeWarmUpCache(identity, pipelines, computeNodes) {
|
|
|
9771
9772
|
}
|
|
9772
9773
|
}
|
|
9773
9774
|
function computeAsyncOf(renderer) {
|
|
9774
|
-
const receiver = typeof renderer.computeAsync === "function" ? renderer : renderer.raw;
|
|
9775
|
+
const receiver = typeof renderer.compileComputeAsync === "function" || typeof renderer.computeAsync === "function" ? renderer : renderer.raw;
|
|
9775
9776
|
if (typeof receiver !== "object" || receiver === null) return void 0;
|
|
9776
|
-
const { backend, computeAsync } = receiver;
|
|
9777
|
+
const { backend, compileComputeAsync, computeAsync } = receiver;
|
|
9778
|
+
if (backend?.isWebGPUBackend === true) {
|
|
9779
|
+
if (typeof compileComputeAsync !== "function") return void 0;
|
|
9780
|
+
return { warm: (node) => compileComputeAsync.call(receiver, node) };
|
|
9781
|
+
}
|
|
9777
9782
|
if (typeof computeAsync !== "function") return void 0;
|
|
9778
|
-
|
|
9783
|
+
const plain = computeAsync.bind(receiver);
|
|
9784
|
+
return { warm: (node) => plain(node) };
|
|
9779
9785
|
}
|
|
9780
9786
|
async function yieldThroughHost(yieldFrame) {
|
|
9781
9787
|
await Promise.all([
|
|
@@ -9817,8 +9823,8 @@ async function withinDeadline(deadline, work, yieldFrame, now2) {
|
|
|
9817
9823
|
return false;
|
|
9818
9824
|
}
|
|
9819
9825
|
async function runComputeWarmUp(renderer, nodes3, compileTimeoutMs, deadline, now2, yieldFrame) {
|
|
9820
|
-
const
|
|
9821
|
-
if (
|
|
9826
|
+
const seam = computeAsyncOf(renderer);
|
|
9827
|
+
if (seam === void 0) {
|
|
9822
9828
|
return { compiled: 0, abandoned: 0, unsupported: true, timedOut: false };
|
|
9823
9829
|
}
|
|
9824
9830
|
let compiled = 0;
|
|
@@ -9833,7 +9839,7 @@ async function runComputeWarmUp(renderer, nodes3, compileTimeoutMs, deadline, no
|
|
|
9833
9839
|
}
|
|
9834
9840
|
const finished = await withinDeadline(
|
|
9835
9841
|
Math.min(deadline, now2() + compileTimeoutMs),
|
|
9836
|
-
Promise.resolve().then(() =>
|
|
9842
|
+
Promise.resolve().then(() => seam.warm(nodes3[index])),
|
|
9837
9843
|
yieldFrame,
|
|
9838
9844
|
now2
|
|
9839
9845
|
);
|
|
@@ -16059,6 +16065,7 @@ var WorldCells = class _WorldCells extends Group {
|
|
|
16059
16065
|
drainMeshPool();
|
|
16060
16066
|
this.#terrain?.dispose();
|
|
16061
16067
|
this.removeFromParent();
|
|
16068
|
+
super.dispose();
|
|
16062
16069
|
}
|
|
16063
16070
|
#updateResidency(followCell, x, z) {
|
|
16064
16071
|
const wanted = [];
|