@zephyr3d/editor 0.3.7 → 0.3.8

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.
Files changed (61) hide show
  1. package/dist/assets/{index-ySiLtSxz.js → index-BZ1L8ggE.js} +43 -3
  2. package/dist/assistant/zephyr-types-index.json +13230 -9488
  3. package/dist/images/icon1024.png +0 -0
  4. package/dist/index.html +1 -1
  5. package/dist/modules/zephyr3d_backend-webgl.js +2 -0
  6. package/dist/modules/zephyr3d_backend-webgl.js.map +1 -1
  7. package/dist/modules/zephyr3d_backend-webgpu.js +457 -16
  8. package/dist/modules/zephyr3d_backend-webgpu.js.map +1 -1
  9. package/dist/modules/zephyr3d_device.js +27 -0
  10. package/dist/modules/zephyr3d_device.js.map +1 -1
  11. package/dist/modules/zephyr3d_loaders.js +208 -1
  12. package/dist/modules/zephyr3d_loaders.js.map +1 -1
  13. package/dist/modules/zephyr3d_scene.js +774 -80
  14. package/dist/modules/zephyr3d_scene.js.map +1 -1
  15. package/dist/vendor/zephyr3d/backend-webgl/dist/capabilities_webgl.js +2 -0
  16. package/dist/vendor/zephyr3d/backend-webgl/dist/capabilities_webgl.js.map +1 -1
  17. package/dist/vendor/zephyr3d/backend-webgpu/dist/capabilities_webgpu.js +2 -0
  18. package/dist/vendor/zephyr3d/backend-webgpu/dist/capabilities_webgpu.js.map +1 -1
  19. package/dist/vendor/zephyr3d/backend-webgpu/dist/commandqueue.js +55 -10
  20. package/dist/vendor/zephyr3d/backend-webgpu/dist/commandqueue.js.map +1 -1
  21. package/dist/vendor/zephyr3d/backend-webgpu/dist/computepass_webgpu.js +4 -0
  22. package/dist/vendor/zephyr3d/backend-webgpu/dist/computepass_webgpu.js.map +1 -1
  23. package/dist/vendor/zephyr3d/backend-webgpu/dist/device.js +44 -1
  24. package/dist/vendor/zephyr3d/backend-webgpu/dist/device.js.map +1 -1
  25. package/dist/vendor/zephyr3d/backend-webgpu/dist/renderpass_webgpu.js +58 -5
  26. package/dist/vendor/zephyr3d/backend-webgpu/dist/renderpass_webgpu.js.map +1 -1
  27. package/dist/vendor/zephyr3d/backend-webgpu/dist/timestamp_query.js +297 -0
  28. package/dist/vendor/zephyr3d/backend-webgpu/dist/timestamp_query.js.map +1 -0
  29. package/dist/vendor/zephyr3d/device/dist/base_types.js.map +1 -1
  30. package/dist/vendor/zephyr3d/device/dist/device.js +27 -0
  31. package/dist/vendor/zephyr3d/device/dist/device.js.map +1 -1
  32. package/dist/vendor/zephyr3d/device/dist/index.d.ts +81 -1
  33. package/dist/vendor/zephyr3d/loaders/dist/gltf/gltf_importer.js +208 -1
  34. package/dist/vendor/zephyr3d/loaders/dist/gltf/gltf_importer.js.map +1 -1
  35. package/dist/vendor/zephyr3d/loaders/dist/index.d.ts +8 -0
  36. package/dist/vendor/zephyr3d/scene/dist/animation/animationset.js +334 -63
  37. package/dist/vendor/zephyr3d/scene/dist/animation/animationset.js.map +1 -1
  38. package/dist/vendor/zephyr3d/scene/dist/animation/morphtargetgrouptrack.js +66 -0
  39. package/dist/vendor/zephyr3d/scene/dist/animation/morphtargetgrouptrack.js.map +1 -0
  40. package/dist/vendor/zephyr3d/scene/dist/asset/model.js +9 -0
  41. package/dist/vendor/zephyr3d/scene/dist/asset/model.js.map +1 -1
  42. package/dist/vendor/zephyr3d/scene/dist/index.d.ts +260 -4
  43. package/dist/vendor/zephyr3d/scene/dist/index.js +7 -0
  44. package/dist/vendor/zephyr3d/scene/dist/index.js.map +1 -1
  45. package/dist/vendor/zephyr3d/scene/dist/posteffect/sao.js +1 -1
  46. package/dist/vendor/zephyr3d/scene/dist/posteffect/sao.js.map +1 -1
  47. package/dist/vendor/zephyr3d/scene/dist/render/rendergraph/executor.js +270 -1
  48. package/dist/vendor/zephyr3d/scene/dist/render/rendergraph/executor.js.map +1 -1
  49. package/dist/vendor/zephyr3d/scene/dist/render/rendergraph/forward_plus_builder.js +19 -1
  50. package/dist/vendor/zephyr3d/scene/dist/render/rendergraph/forward_plus_builder.js.map +1 -1
  51. package/dist/vendor/zephyr3d/scene/dist/render/rendergraph/types.js.map +1 -1
  52. package/dist/vendor/zephyr3d/scene/dist/scene/scene.js +1 -0
  53. package/dist/vendor/zephyr3d/scene/dist/scene/scene.js.map +1 -1
  54. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/manager.js +2 -1
  55. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/manager.js.map +1 -1
  56. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/animation.js +70 -1
  57. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/animation.js.map +1 -1
  58. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/camera.js.map +1 -1
  59. package/package.json +6 -6
  60. package/dist/vendor/zephyr3d/scene/dist/animation/joint_dynamics/convex_collider.js +0 -320
  61. package/dist/vendor/zephyr3d/scene/dist/animation/joint_dynamics/convex_collider.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import * as _zephyr3d_device from '@zephyr3d/device';
2
- import { TextureCube, FrameBuffer, Texture2D, GPUDataBuffer, PrimitiveType, TextureSampler, BindGroupLayout, ProgramBuilder, PBInsideFunctionScope, PBShaderExp, PBGlobalScope, VertexSemantic, StructuredBuffer, VertexAttribFormat, VertexStepMode, IndexBuffer, BindGroup, GPUProgram, RenderStateSet, FaceMode, PBFunctionScope, Texture2DArray, BaseTexture, ShaderTypeFunc, TextureFormat, AbstractDevice, ColorState, TextureAddressMode, TextureFilterMode, SamplerOptions, TextureAtlasManager, DeviceBackend } from '@zephyr3d/device';
2
+ import { TextureCube, FrameBuffer, Texture2D, GPUDataBuffer, PrimitiveType, TextureSampler, BindGroupLayout, ProgramBuilder, PBInsideFunctionScope, PBShaderExp, PBGlobalScope, VertexSemantic, StructuredBuffer, VertexAttribFormat, VertexStepMode, IndexBuffer, BindGroup, GPUProgram, RenderStateSet, FaceMode, PBFunctionScope, Texture2DArray, BaseTexture, ShaderTypeFunc, TextureFormat, AbstractDevice, TimestampQueryStatus, ColorState, TextureAddressMode, TextureFilterMode, SamplerOptions, TextureAtlasManager, DeviceBackend } from '@zephyr3d/device';
3
3
  import * as _zephyr3d_base from '@zephyr3d/base';
4
4
  import { Disposable, TypedArray, Ray, AABB, Matrix4x4, Plane, Frustum, Vector3, Nullable, GenericConstructor, RequireOptionals, Immutable, Vector4, Clonable, IDisposable, Vector2, IEventTarget, Observable, DRef, Rect, CubeFace, Quaternion, Interpolator, InterpolationMode, InterpolatorScalar, DeepPartial, VFS, HttpRequest, WriteOptions, ReadOptions, DeepRequireOptionals } from '@zephyr3d/base';
5
5
 
@@ -7313,6 +7313,79 @@ interface CompiledRenderGraph {
7313
7313
  /** Resource lifetime information keyed by resource ID. */
7314
7314
  readonly lifetimes: ReadonlyMap<number, RGResourceLifetime>;
7315
7315
  }
7316
+ /**
7317
+ * Profiling scope type in a render graph timing tree.
7318
+ * @public
7319
+ */
7320
+ type RGProfileScopeType = 'graph' | 'pass' | 'subpass';
7321
+ /**
7322
+ * Render graph GPU timestamp profiling options.
7323
+ * @public
7324
+ */
7325
+ interface RGProfilingOptions {
7326
+ /** Enable render graph timestamp profiling. Default true when an options object is provided. */
7327
+ enabled?: boolean;
7328
+ /** Measure the whole graph execution. Default true. */
7329
+ graph?: boolean;
7330
+ /** Measure every render graph pass. Default true. */
7331
+ pass?: boolean;
7332
+ /** Measure every subpass and expose it as a child scope. Default true. */
7333
+ subpass?: boolean;
7334
+ /** Include pending upload/copy commands at timestamp boundaries. Default true. */
7335
+ includePendingUploads?: boolean;
7336
+ /** Allow graph profile scopes to remain open across frame boundaries. Default false. */
7337
+ allowCrossFrame?: boolean;
7338
+ /** Maximum unresolved profile frames kept by the executor. Default 3. */
7339
+ maxPendingFrames?: number;
7340
+ /** Root graph profile label. Default 'RenderGraph'. */
7341
+ label?: string;
7342
+ /** Device used for timestamp queries. If omitted, the scene global getDevice() is used. */
7343
+ device?: AbstractDevice;
7344
+ }
7345
+ /**
7346
+ * Render graph executor construction options.
7347
+ * @public
7348
+ */
7349
+ interface RenderGraphExecutorOptions {
7350
+ /** Device used for timestamp queries. If omitted, the scene global getDevice() is used. */
7351
+ device?: AbstractDevice;
7352
+ /** Render graph timestamp profiling options. Default false. */
7353
+ profiling?: boolean | RGProfilingOptions;
7354
+ }
7355
+ /**
7356
+ * Resolved GPU timing for one graph/pass/subpass scope.
7357
+ * @public
7358
+ */
7359
+ interface RGProfileScopeResult {
7360
+ /** Scope label. */
7361
+ name: string;
7362
+ /** Scope type. */
7363
+ type: RGProfileScopeType;
7364
+ /** Timestamp query id used by the device, or 0 for synthetic/unsupported scopes. */
7365
+ queryId: number;
7366
+ /** GPU duration in milliseconds. */
7367
+ durationMs: number;
7368
+ /** Timestamp result status. */
7369
+ status: TimestampQueryStatus;
7370
+ /** Child scopes. */
7371
+ children: RGProfileScopeResult[];
7372
+ /** Optional diagnostic message. */
7373
+ message?: string;
7374
+ }
7375
+ /**
7376
+ * Resolved GPU timing tree for one render graph execution.
7377
+ * @public
7378
+ */
7379
+ interface RGProfileResult {
7380
+ /** Render frame id when profiling began. */
7381
+ frameId: number;
7382
+ /** Aggregate profile status. */
7383
+ status: TimestampQueryStatus;
7384
+ /** Root graph scope. */
7385
+ graph: RGProfileScopeResult;
7386
+ /** Top-level pass scopes. Same objects as graph.children. */
7387
+ passes: RGProfileScopeResult[];
7388
+ }
7316
7389
  /**
7317
7390
  * Resolved dimensions for a texture allocation.
7318
7391
  * @public
@@ -7506,7 +7579,36 @@ declare class RenderGraph {
7506
7579
  * @public
7507
7580
  */
7508
7581
  declare class RenderGraphExecutor<TTexture = unknown, TFramebuffer = unknown> {
7509
- constructor(allocator: RGTextureAllocator<TTexture, TFramebuffer>, backbufferWidth: number, backbufferHeight: number);
7582
+ private static _defaultProfilingOptions;
7583
+ private static _latestProfileResult;
7584
+ private static _latestPendingProfileFrame;
7585
+ private static _latestResolvedProfileSerial;
7586
+ private static _nextProfileSerial;
7587
+ constructor(allocator: RGTextureAllocator<TTexture, TFramebuffer>, backbufferWidth: number, backbufferHeight: number, options?: RenderGraphExecutorOptions);
7588
+ /**
7589
+ * Set the default profiling options used by newly constructed render graph executors.
7590
+ */
7591
+ static setDefaultProfilingOptions(options: boolean | RGProfilingOptions): void;
7592
+ /**
7593
+ * Get the latest resolved profile result from any render graph executor.
7594
+ */
7595
+ static getLatestProfileResult(): RGProfileResult | null;
7596
+ /**
7597
+ * Resolve the latest pending render graph profile result from any executor.
7598
+ */
7599
+ static resolveProfileResult(): Promise<RGProfileResult | null>;
7600
+ /**
7601
+ * Enable, disable, or update timestamp profiling for this executor.
7602
+ */
7603
+ setProfilingOptions(options: boolean | RGProfilingOptions): void;
7604
+ /**
7605
+ * Get the latest resolved profile result produced by this executor.
7606
+ */
7607
+ getLatestProfileResult(): RGProfileResult | null;
7608
+ /**
7609
+ * Resolve the latest pending profile result produced by this executor.
7610
+ */
7611
+ resolveProfileResult(): Promise<RGProfileResult | null>;
7510
7612
  /**
7511
7613
  * Update the backbuffer dimensions used for 'backbuffer-relative' sizing.
7512
7614
  */
@@ -7536,6 +7638,58 @@ declare class RenderGraphExecutor<TTexture = unknown, TFramebuffer = unknown> {
7536
7638
  reset(): void;
7537
7639
  }
7538
7640
 
7641
+ /**
7642
+ * Bridges the render graph's {@link RGTextureAllocator} interface to the
7643
+ * engine's device resource pool (`device.pool`).
7644
+ *
7645
+ * Transient textures are fetched from the pool on `allocate()` and
7646
+ * returned to the pool on `release()`, enabling automatic reuse
7647
+ * across frames without manual lifecycle management.
7648
+ *
7649
+ * Usage:
7650
+ * ```ts
7651
+ * const allocator = new DevicePoolAllocator();
7652
+ * const executor = new RenderGraphExecutor(allocator, width, height);
7653
+ * ```
7654
+ *
7655
+ * @public
7656
+ */
7657
+ declare class DevicePoolAllocator implements RGTextureAllocator<Texture2D, FrameBuffer> {
7658
+ /**
7659
+ * Allocate a transient texture from the device pool.
7660
+ *
7661
+ * @param desc - Texture descriptor from the render graph pass.
7662
+ * @param size - Resolved pixel dimensions.
7663
+ * @returns A pooled Texture2D instance.
7664
+ */
7665
+ allocate(desc: RGTextureDesc, size: RGResolvedSize): Texture2D;
7666
+ /**
7667
+ * Release a transient texture back to the device pool.
7668
+ *
7669
+ * @param texture - The texture to release.
7670
+ */
7671
+ release(texture: Texture2D): void;
7672
+ /**
7673
+ * Retain a pooled texture so it can be owned outside the graph lifetime.
7674
+ *
7675
+ * @param texture - The texture to retain.
7676
+ */
7677
+ retain(texture: Texture2D): void;
7678
+ /**
7679
+ * Allocate a temporary framebuffer from the device pool.
7680
+ *
7681
+ * @param desc - Framebuffer descriptor from the render graph pass.
7682
+ * @returns A pooled FrameBuffer instance.
7683
+ */
7684
+ allocateFramebuffer(desc: RGFramebufferDesc): FrameBuffer;
7685
+ /**
7686
+ * Release a temporary framebuffer back to the device pool.
7687
+ *
7688
+ * @param framebuffer - The framebuffer to release.
7689
+ */
7690
+ releaseFramebuffer(framebuffer: FrameBuffer): void;
7691
+ }
7692
+
7539
7693
  /**
7540
7694
  * Manages cross-frame history resources that can be imported into a render graph.
7541
7695
  *
@@ -7709,6 +7863,72 @@ declare class HistoryResourceManager<TTexture = Texture2D> {
7709
7863
  dispose(): void;
7710
7864
  }
7711
7865
 
7866
+ /**
7867
+ * Resource names for render graph history resources.
7868
+ * @public
7869
+ */
7870
+ declare const RGHistoryResources: {
7871
+ readonly TAA_COLOR: "taaColor";
7872
+ readonly TAA_MOTION_VECTOR: "taaMotionVector";
7873
+ readonly SSR_REFLECT: "ssrReflect";
7874
+ readonly SSR_MOTION_VECTOR: "ssrMotionVector";
7875
+ };
7876
+
7877
+ /**
7878
+ * Options controlling which features are enabled in the forward+ pipeline.
7879
+ *
7880
+ * Derived from camera settings and device capabilities each frame.
7881
+ *
7882
+ * @public
7883
+ */
7884
+ interface ForwardPlusOptions {
7885
+ /** Enable depth prepass (always true for now). */
7886
+ depthPrepass: boolean;
7887
+ /** Enable motion vectors (requires TAA or motionBlur). */
7888
+ motionVectors: boolean;
7889
+ /** Enable Hi-Z pyramid (for SSR ray tracing). */
7890
+ hiZ: boolean;
7891
+ /** Enable screen-space reflections. */
7892
+ ssr: boolean;
7893
+ /** Whether to compute SSR thickness. */
7894
+ ssrCalcThickness: boolean;
7895
+ /** Whether GPU picking is requested this frame. */
7896
+ gpuPicking: boolean;
7897
+ /** Whether transmission/refraction materials are present. */
7898
+ needSceneColor: boolean;
7899
+ /** Whether scene-color-dependent materials also require scene depth. */
7900
+ needSceneColorWithDepth: boolean;
7901
+ /** Whether SSR needs transmission depth before the main light pass. */
7902
+ needsTransmissionDepthForSSR: boolean;
7903
+ /** Enable screen-space subsurface scattering. */
7904
+ sss: boolean;
7905
+ }
7906
+ /**
7907
+ * Constructs a render graph representing the forward+ pipeline.
7908
+ *
7909
+ * Each step in the existing `SceneRenderer._renderScene` becomes a graph pass.
7910
+ * Execute callbacks delegate to the existing rendering code, sharing a mutable
7911
+ * `FrameState`.
7912
+ *
7913
+ * @param graph - The render graph to populate.
7914
+ * @param ctx - The draw context for this frame.
7915
+ * @param renderQueue - The culled render queue.
7916
+ * @param options - Pipeline feature toggles.
7917
+ * @returns The backbuffer handle (graph output).
7918
+ *
7919
+ * @public
7920
+ */
7921
+ declare function buildForwardPlusGraph(graph: RenderGraph, ctx: DrawContext, renderQueue: RenderQueue, options: ForwardPlusOptions): RGHandle;
7922
+ /**
7923
+ * Build, compile, and execute the forward+ pipeline as a render graph.
7924
+ *
7925
+ * This is the drop-in replacement for `SceneRenderer._renderScene`.
7926
+ *
7927
+ * @param ctx - The draw context for this frame.
7928
+ * @public
7929
+ */
7930
+ declare function executeForwardPlusGraph(ctx: DrawContext): void;
7931
+
7712
7932
  /**
7713
7933
  * Rendering layer of post processing effects
7714
7934
  * @public
@@ -11777,6 +11997,41 @@ declare class MorphTargetTrack extends AnimationTrack<MorphState> {
11777
11997
  reset(node: SceneNode): void;
11778
11998
  }
11779
11999
 
12000
+ /**
12001
+ * Animates a model-level morph target group by name.
12002
+ * @public
12003
+ */
12004
+ declare class MorphTargetGroupTrack extends AnimationTrack<number> {
12005
+ private _groupName;
12006
+ private _interpolator;
12007
+ private readonly _state;
12008
+ /**
12009
+ * Create a morph target group animation track.
12010
+ * @param groupName - Morph target group name
12011
+ * @param interpolator - Scalar interpolator for the group weight
12012
+ * @param embedded - Whether this track is embedded
12013
+ */
12014
+ constructor(groupName?: string, interpolator?: Interpolator, embedded?: boolean);
12015
+ /** Morph target group name controlled by this track. */
12016
+ get groupName(): string;
12017
+ set groupName(value: string);
12018
+ /** Scalar interpolator for this track. */
12019
+ get interpolator(): Interpolator;
12020
+ set interpolator(value: Interpolator);
12021
+ /** {@inheritDoc AnimationTrack.clone} */
12022
+ clone(): this;
12023
+ /** {@inheritDoc AnimationTrack.calculateState} */
12024
+ calculateState(target: object, currentTime: number): number;
12025
+ /** {@inheritDoc AnimationTrack.applyState} */
12026
+ applyState(node: SceneNode, weight: number): void;
12027
+ /** {@inheritDoc AnimationTrack.mixState} */
12028
+ mixState(a: number, b: number, t: number): number;
12029
+ /** {@inheritDoc AnimationTrack.getBlendId} */
12030
+ getBlendId(): string;
12031
+ /** {@inheritDoc AnimationTrack.getDuration} */
12032
+ getDuration(): number;
12033
+ }
12034
+
11780
12035
  /**
11781
12036
  * Geometry cache frame data for a single sampled time.
11782
12037
  *
@@ -15833,9 +16088,10 @@ interface AssetMorphTargetGroup {
15833
16088
  */
15834
16089
  interface AssetAnimationTrack {
15835
16090
  node: AssetHierarchyNode;
15836
- type: 'translation' | 'scale' | 'rotation' | 'weights';
16091
+ type: 'translation' | 'scale' | 'rotation' | 'weights' | 'morph-target-group';
15837
16092
  interpolator: Interpolator;
15838
16093
  defaultMorphWeights?: number[];
16094
+ morphTargetGroupName?: string;
15839
16095
  }
15840
16096
  /**
15841
16097
  * A single geometry cache frame.
@@ -27648,4 +27904,4 @@ declare const ATMOSPHERIC_FOG_BIT: number;
27648
27904
  */
27649
27905
  declare const HEIGHT_FOG_BIT: number;
27650
27906
 
27651
- export { AABBTree, ABufferOIT, ATMOSPHERIC_FOG_BIT, AbsNode, AbstractPostEffect, AllConditionNode, type AngleLimitConfig, AnimationClip, AnimationController, type AnimationControllerEventMap, type AnimationControllerSetStateOptions, type AnimationControllerStateDefinition, type AnimationFrameEvent, type AnimationMarker, type AnimationMarkerEvent, AnimationPlayback, type AnimationPlaybackEvent, type AnimationPlaybackEventMap, type AnimationPlaybackState, type AnimationPlaybackStopEvent, type AnimationPlaybackSyncMode, type AnimationPlaybackSyncOptions, AnimationSet, type AnimationSetEventMap, type AnimationStopReason, type AnimationTimeRef, AnimationTimeline, type AnimationTimelineActiveDisposition, type AnimationTimelineDefinition, type AnimationTimelineEventPolicy, type AnimationTimelineEventResponse, type AnimationTimelineEventResult, type AnimationTimelineEventTarget, AnimationTimelineRunner, type AnimationTimelineRunnerEventMap, type AnimationTimelineRunnerState, type AnimationTimelineStateReturnTarget, type AnimationTimelineStep, AnimationTrack, AnyConditionNode, type AppCreationOptions, type AppOptions, Application, type ApplyResultOutput, ArcCosNode, ArcSinNode, ArcTan2Node, ArcTanNode, ArccosineHNode, ArcsineHNode, ArctangentHNode, type AssetAnimationData, type AssetAnimationTrack, type AssetFixedGeometryCacheAnimationTrack, type AssetGeometryCacheAnimationTrack, type AssetGeometryCacheFrame, AssetHierarchyNode, type AssetImageInfo, type AssetJointDynamicsChain, type AssetJointDynamicsCollider, type AssetJointDynamicsFlatPlane, type AssetJointDynamicsSpringBone, type AssetMToonMaterial, AssetManager, type AssetMaterial, type AssetMaterialClearcoat, type AssetMaterialCommon, type AssetMaterialIridescence, type AssetMaterialSheen, type AssetMaterialTransmission, type AssetMeshData, type AssetMorphTargetBinding, type AssetMorphTargetGroup, type AssetPBRMaterialCommon, type AssetPBRMaterialMR, type AssetPBRMaterialSG, type AssetPCAGeometryCacheAnimationTrack, type AssetPrimitiveInfo, type AssetRotationTrack, type AssetSamplerInfo, type AssetScaleTrack, AssetScene, type AssetSkeletalAnimationTrack, AssetSkeleton, type AssetSpringBone, type AssetSpringBoneCollider, type AssetSpringBoneColliderGroup, type AssetSpringBoneColliderShape, type AssetSpringBoneJoint, type AssetSubMeshData, type AssetTextureInfo, type AssetTranslationTrack, type AssetUnlitMaterial, type AssetVertexBufferInfo, type AvatarBindMode, type AvatarBodyRegionTarget, type AvatarBodyRegions, type AvatarEquipOptions, type AvatarFitMode, type AvatarJointMap, AvatarOutfitInstance, type AvatarOutfitSource, type AvatarOutfitValidation, type AvatarSlotId, type AvatarSlotOptions, AvatarWardrobe, type AvatarWardrobeOptions, BUILTIN_ASSET_TEST_CUBEMAP, BUILTIN_ASSET_TEXTURE_SHEEN_LUT, BaseCameraController, type BaseFetchOptions, BaseGraphNode, BaseLight, BaseSprite, BaseTextureNode, type BatchDrawable, BatchGroup, BillboardMatrixNode, type BlendMode, BlinnMaterial, type BlitType, Blitter, Bloom, type BluePrintEditorState, type BluePrintUniformTexture, type BluePrintUniformValue, type BlueprintDAG, type BoneNode, BoundingBox, type BoundingVolume, type BoxCreationOptions, BoxFilterBlitter, BoxFrameShape, BoxShape, CCDSolver, type CachedBindGroup, Camera, type CameraHistoryData, CameraNearFarNode, type CameraOITMode, CameraPositionNode, CameraVectorNode, type CapsuleCollider, type CapsuleCreationOptions, CapsuleShape, CeilNode, ClampNode, ClipmapTerrain, ClipmapTerrainMaterial, ColliderForce, type ColliderR, type ColliderRW, type CollisionResult, ColorAdjust, type ColoredEdge, type ColoredLineEdge, type ColoredQuadraticEdge, CompAddNode, CompComparisonNode, CompDivNode, CompMulNode, CompSubNode, type ComparisonMode, Compositor, type CompositorContext, ConstantBVec2Node, ConstantBVec3Node, ConstantBVec4Node, ConstantBooleanNode, ConstantScalarNode, ConstantTexture2DArrayNode, ConstantTexture2DNode, ConstantTextureCubeNode, ConstantVec2Node, ConstantVec3Node, ConstantVec4Node, type Constraint, type ConstraintBuildOptions, ConstraintType, type ControllerConfig, type ControllerConfigUpdate, CopyBlitter, type CopyHumanoidAnimationOptions, CosHNode, CosNode, CrossProductNode, CubemapSHProjector, CullVisitor, type CylinderCreationOptions, CylinderShape, DDXNode, DDYNode, Degrees2RadiansNode, DepthPass, DirectionalLight, DistanceNode, DotProductNode, DracoMeshDecoder, type DrawContext, type Drawable, type DrawableInstanceInfo, EPSILON, type EdgeColor, type EditorMode, ElapsedTimeNode, type EmitterBehavior, type EmitterShape, Engine, EnvConstantAmbient, EnvHemisphericAmbient, type EnvLightType, EnvLightWrapper, EnvShIBL, Environment, EnvironmentLighting, EqualNode, Exp2Node, ExpNode, type ExtractMixinReturnType, type ExtractMixinType, FABRIKSolver, FBMWaveGenerator, FFTWaveGenerator, FPSCameraController, type FPSCameraControllerOptions, FWidthNode, FXAA, FaceForwardNode, type FixedGeometryCacheFrame, type FixedGeometryCacheState, FixedGeometryCacheTrack, type FlatPlane, FloorNode, FmaNode, type FogType, FontAsset, type FontAssetFetchOptions, type FontAssetMSDFAtlasSettings, type FontMetrics, FractNode, FunctionCallNode, FunctionInputNode, FunctionOutputNode, GPUClothSystem, type GPUClothSystemOptions, type GPUClothWrapBindingData, type GPUClothWrapBindingTarget, GaussianBlurBlitter, GenericMathNode, type GeometryCacheFrame, type GeometryCacheMeshBinding, type GeometryCacheState, GerstnerWaveGenerator, type GlyphContour, type GlyphData, type GlyphPoint, type GrabberR, type GrabberRW, GraphNode, type GraphNodeInput, type GraphNodeOutput, type GraphStructure, type GrassInstanceInfo, GrassLayer, GrassMaterial, GrassRenderer, Grayscale, HEIGHT_FOG_BIT, Hash1Node, Hash2Node, Hash3Node, HistoryResourceManager, type Host, HumanoidBodyRig, HumanoidHandRig, type HumanoidJointMapping, type HumanoidRetargetAxisLocks, type HumanoidRootMotionMode, type HumanoidRootMotionScaleMode, type HumanoidSkeletalAnimationMaskOptions, type HumanoidSkeletalAnimationMaskPreset, type IAttachedScript, type IBaseEvent, type IControllerKeyboardEvent, type IControllerKeydownEvent, type IControllerKeypressEvent, type IControllerKeyupEvent, type IControllerMouseEvent, type IControllerPointerCancelEvent, type IControllerPointerDownEvent, type IControllerPointerMoveEvent, type IControllerPointerUpEvent, type IControllerWheelEvent, type IGraphNode, IKAngleConstraint, IKChain, IKConstraint, type IKJoint, IKModifier, IKSolver, type IMixinAlbedoColor, type IMixinBlinnPhong, type IMixinFoliage, type IMixinLambert, type IMixinLight, type IMixinPBRBluePrint, type IMixinPBRCommon, type IMixinPBRMetallicRoughness, type IMixinPBRSpecularGlossiness, type IMixinVertexColor, type IModKey, type IRUniformTexture, type IRUniformValue, type IRenderHook, type IRenderable, type InputEventHandler, InputManager, InstanceBindGroupAllocator, type InstanceData, InstanceIndexNode, type InstanceUniformType, type InterChainConstraint, InvProjMatrixNode, InvSqrtNode, InvViewProjMatrixNode, type JointChainConfig, type JointDynamicSystemConfig, type JointDynamicsColliderHandle, type JointDynamicsColliderSnapshot, type JointDynamicsFlatPlaneHandle, type JointDynamicsFlatPlaneSnapshot, type JointDynamicsGrabberHandle, type JointDynamicsGrabberSnapshot, JointDynamicsModifier, JointDynamicsSystem, JointDynamicsSystemController, type JointNameMatcher, LIGHT_TYPE_DIRECTIONAL, LIGHT_TYPE_NONE, LIGHT_TYPE_POINT, LIGHT_TYPE_RECT, LIGHT_TYPE_SPOT, LambertMaterial, LengthNode, type LineCollisionResult, Log2Node, type LogMode, LogNode, LogicallyAndNode, LogicallyOrNode, MAX_CLUSTERED_LIGHTS, MAX_GERSTNER_WAVE_COUNT, MAX_MORPH_ATTRIBUTES, MAX_MORPH_TARGETS, MAX_TERRAIN_MIPMAP_LEVELS, MORPH_ATTRIBUTE_VECTOR_COUNT, MORPH_TARGET_COLOR, MORPH_TARGET_NORMAL, MORPH_TARGET_POSITION, MORPH_TARGET_TANGENT, MORPH_TARGET_TEX0, MORPH_TARGET_TEX1, MORPH_TARGET_TEX2, MORPH_TARGET_TEX3, MORPH_WEIGHTS_VECTOR_COUNT, type MSDFBitmap, type MSDFOptions, type MSDFShape, MSDFText, MSDFTextAtlasManager, MSDFTextSprite, MToonMaterial, type MToonOutlineWidthMode, MakeVectorNode, Material, MaterialBlueprintIR, type MaterialBlueprintIRBehaviors, type MaterialTextureInfo, MaterialVaryingFlags, MaxNode, Mesh$1 as Mesh, MeshMaterial, type MeshUpdateCallback, type Metadata$1 as Metadata, MinNode, MixNode, ModNode, type ModelFetchOptions, type ModelInfo, type ModelLoader, type MorphBoundingInfo, type MorphData, type MorphInfo, type MorphState, MorphTargetTrack, MultiChainSpringSystem, type MultiChainSpringSystemOptions, type NamedJointsSkeletalAnimationMaskOptions, NamedObject, type NearestPointsResult, type NodeConnection, NodeEulerRotationTrack, type NodeIterateFunc, NodeRotationTrack, NodeScaleTrack, NodeTranslationTrack, NormalizeNode, NotEqualNode, type OIT, Octree, OctreeNode, OctreeNodeChunk, OctreePlacement, OrbitCameraController, type OrbitCameraControllerOptions, OrthoCamera, PBRBlockNode, PBRBluePrintMaterial, type PBRBlueprintOutputName, PBRMetallicRoughnessMaterial, type PBRReflectionMode, PBRSpecularGlossinessMaterial, type PCAGeometryCacheState, PCAGeometryCacheTrack, type PCAGeometryCacheTrackData, type PairAdjustment, PannerNode, ParticleMaterial, ParticleSystem, PerlinNoise2DNode, PerspectiveCamera, type PhysicsCurves, type PickResult, type PickTarget, PixelNormalNode, PixelWorldPositionNode, type PlaneCollider, type PlaneCreationOptions, PlaneShape, type PlayAnimationOptions, type PointInit, PointLight, type PointR, type PointRW, type PointTransform, PostEffectLayer, PowNode, Primitive, ProjectionMatrixNode, type PropEdit, type PropertyAccessor, type PropertyAccessorOptions, type PropertySceneNodeOptions, type PropertyToType, PropertyTrack, type PropertyType, type PropertyValue, PunctualLight, QUEUE_OPAQUE, QUEUE_TRANSPARENT, RENDER_PASS_TYPE_DEPTH, RENDER_PASS_TYPE_LIGHT, RENDER_PASS_TYPE_OBJECT_COLOR, RENDER_PASS_TYPE_SHADOWMAP, Radians2DegreesNode, RaycastVisitor, RectLight, ReflectNode, RefractNode, type RenderFunc, type RenderItemList, type RenderItemListBundle, type RenderItemListInfo, RenderPass, type RenderPath, RenderQueue, type RenderQueueItem, type RenderQueueRef, RenderTarget, type ResolutionTransform, ResolveVertexNormalNode, ResolveVertexPositionNode, ResolveVertexTangentNode, ResourceManager, RotateAboutAxisNode, RuntimeScript, type RuntimeScriptArrayDeclaration, type RuntimeScriptArrayElementDeclaration, type RuntimeScriptConfig, type RuntimeScriptObjectDeclaration, type RuntimeScriptObjectFieldDeclaration, type RuntimeScriptPropertyDeclaration, type RuntimeScriptPropertyInfo, type RuntimeScriptPropertyOptions, type RuntimeScriptPropertyType, type RuntimeScriptValueDeclaration, type RuntimeScriptValueType, SAO, type SSSDebugView, type SSSQualityPreset, type SSSResolvedSettings, type SamplerType, SaturateNode, type SaveOptions, Scene, type SceneMorphTargetBinding, type SceneMorphTargetGroup, SceneNode, type SceneNodeVisible, ScreenAdapter, type ScreenConfig, ScreenRenderTarget, type ScreenScaleMode, ScriptAttachment, type ScriptAttachmentConfig, ScriptRegistry, ScriptingSystem, type ScriptingSystemOptions, SelectionNode, type SerializableClass, type SerializedMorphTargetBinding, type SerializedMorphTargetGroup, ShaderHelper, ShadowMapPass, ShadowMapper, type ShadowMode, type ShadowQualityPreset, ShadowRegion, Shape, type ShapeCreationOptions, type ShapeOptionType, type ShapeType, SharedModel, SignNode, SimplexNoise2DNode, type SimulationParams, SinHNode, SinNode, type SkeletalAnimationMaskCommonOptions, type SkeletalAnimationMaskOptions, type SkeletalAnimationMaskRootMotionMode, type SkeletalAnimationMaskUnsupportedTrackMode, Skeleton, type SkeletonBindPose, SkeletonModifier, SkeletonRig, type SkeletonRigOptions, SkinBinding, type SkinnedBoundingBox, SkyEnvTextureNode, SkyRenderer, type SkyType, SmoothStepNode, type SphereCollider, type SphereCreationOptions, SphereShape, SpotLight, SpringChain, type SpringCollider, type SpringConstraint, SpringModifier, type SpringParticle, SpringSystem, type SpringSystemOptions, Sprite, SpriteBlockNode, SpriteBlueprintMaterial, SpriteMaterial, SqrtNode, StandardSpriteMaterial, StepNode, type StopAnimationOptions, SubsurfaceProfile, type SubsurfaceProfilePreset, type SurfaceCheckResult, SwizzleNode, TanHNode, TanNode, type TerrainDebugMode, type TetrahedronCreationOptions, TetrahedronFrameShape, TetrahedronShape, TextSprite, type TextureFetchOptions, type TextureMixinInstanceTypes, type TextureMixinTypes, type TextureProp, type TexturePropUniforms, TextureSampleGrad, TextureSampleNode, type ToMixedTextureType, Tonemap, type TorusCreationOptions, TorusShape, type TransformAccess, TransformNode, type TwistConstraint, TwoBoneIKSolver, UnlitMaterial, VertexBinormalNode, VertexBlockNode, VertexColorNode, VertexIndexNode, VertexNormalNode, VertexOutputNode, VertexPositionNode, VertexTangentNode, VertexUVNode, ViewMatrixNode, ViewProjMatrixNode, type Visitor, Water, type WaveGenerator, WeightedBlendedOIT, applyAngleLimits, applyMaterialMixins, applyResult, applyRuntimeScriptConfig, buildConstraints, buildMSDFShape, buildSurfaceFaces, checkSurfaceCollision, collisionDetection, collisionDetectionCapsule, collisionDetectionSphere, computeMaxDepth, computeNearestPoints, createCapsuleCollider, createGPUClothWrapBindingData, createGeometryCacheState, createPlaneCollider, createSphereCollider, createSpringConstraint, createSpringParticle, createTransformAccess, decode2HalfFromRGBA, decodeFloatFromRGBA, decodeNormalizedFloatFromRGBA, decodeRGBM, defineProps, encode2HalfToRGBA, encodeFloatToRGBA, encodeNormalizedFloatToRGBA, encodeRGBM, ensureGeometryCacheMeshBinding, fetchSampler, gammaToLinear, generateMSDF, getApp, getDevice, getEngine, getInput, getRuntimeScriptProperties, gradient, hash11, hash12, hash13, hash21, hash22, hash23, hash31, hash32, hash33, interleavedGradientNoise, isGPUClothSupported, linearToGamma, mixGeometryCacheBoundingBox, mixinAlbedoColor, mixinBlinnPhong, mixinFoliage, mixinLambert, mixinLight, mixinPBRBluePrint, mixinPBRCommon, mixinPBRMetallicRoughness, mixinPBRSpecularGlossness, mixinTextureProps, mixinVertexColor, noise3D, normalizeRuntimeScriptConfig, normalizeScriptAttachmentConfig, normalizeScriptAttachments, panoramaToCubemap, perlinNoise2D, perlinNoise3D, prefilterCubemap, pushInCollisionDetection, pushInFromCapsule, pushInFromCollider, pushInFromSphere, pushoutFromCapsule, pushoutFromCollider, pushoutFromSphere, resolveCapsuleCollision, resolvePlaneCollision, resolveSphereCollision, restoreGeometryCacheMeshBinding, scriptProp, simulate, smoothNoise3D, sortRootPointsByProximity, temporalResolve, tryGetApp, updateColliderFromNode, valueNoise, whiteNoise, worleyFBM, worleyNoise };
27907
+ export { AABBTree, ABufferOIT, ATMOSPHERIC_FOG_BIT, AbsNode, AbstractPostEffect, AllConditionNode, type AngleLimitConfig, AnimationClip, AnimationController, type AnimationControllerEventMap, type AnimationControllerSetStateOptions, type AnimationControllerStateDefinition, type AnimationFrameEvent, type AnimationMarker, type AnimationMarkerEvent, AnimationPlayback, type AnimationPlaybackEvent, type AnimationPlaybackEventMap, type AnimationPlaybackState, type AnimationPlaybackStopEvent, type AnimationPlaybackSyncMode, type AnimationPlaybackSyncOptions, AnimationSet, type AnimationSetEventMap, type AnimationStopReason, type AnimationTimeRef, AnimationTimeline, type AnimationTimelineActiveDisposition, type AnimationTimelineDefinition, type AnimationTimelineEventPolicy, type AnimationTimelineEventResponse, type AnimationTimelineEventResult, type AnimationTimelineEventTarget, AnimationTimelineRunner, type AnimationTimelineRunnerEventMap, type AnimationTimelineRunnerState, type AnimationTimelineStateReturnTarget, type AnimationTimelineStep, AnimationTrack, AnyConditionNode, type AppCreationOptions, type AppOptions, Application, type ApplyResultOutput, ArcCosNode, ArcSinNode, ArcTan2Node, ArcTanNode, ArccosineHNode, ArcsineHNode, ArctangentHNode, type AssetAnimationData, type AssetAnimationTrack, type AssetFixedGeometryCacheAnimationTrack, type AssetGeometryCacheAnimationTrack, type AssetGeometryCacheFrame, AssetHierarchyNode, type AssetImageInfo, type AssetJointDynamicsChain, type AssetJointDynamicsCollider, type AssetJointDynamicsFlatPlane, type AssetJointDynamicsSpringBone, type AssetMToonMaterial, AssetManager, type AssetMaterial, type AssetMaterialClearcoat, type AssetMaterialCommon, type AssetMaterialIridescence, type AssetMaterialSheen, type AssetMaterialTransmission, type AssetMeshData, type AssetMorphTargetBinding, type AssetMorphTargetGroup, type AssetPBRMaterialCommon, type AssetPBRMaterialMR, type AssetPBRMaterialSG, type AssetPCAGeometryCacheAnimationTrack, type AssetPrimitiveInfo, type AssetRotationTrack, type AssetSamplerInfo, type AssetScaleTrack, AssetScene, type AssetSkeletalAnimationTrack, AssetSkeleton, type AssetSpringBone, type AssetSpringBoneCollider, type AssetSpringBoneColliderGroup, type AssetSpringBoneColliderShape, type AssetSpringBoneJoint, type AssetSubMeshData, type AssetTextureInfo, type AssetTranslationTrack, type AssetUnlitMaterial, type AssetVertexBufferInfo, type AvatarBindMode, type AvatarBodyRegionTarget, type AvatarBodyRegions, type AvatarEquipOptions, type AvatarFitMode, type AvatarJointMap, AvatarOutfitInstance, type AvatarOutfitSource, type AvatarOutfitValidation, type AvatarSlotId, type AvatarSlotOptions, AvatarWardrobe, type AvatarWardrobeOptions, BUILTIN_ASSET_TEST_CUBEMAP, BUILTIN_ASSET_TEXTURE_SHEEN_LUT, BaseCameraController, type BaseFetchOptions, BaseGraphNode, BaseLight, BaseSprite, BaseTextureNode, type BatchDrawable, BatchGroup, BillboardMatrixNode, type BlendMode, BlinnMaterial, type BlitType, Blitter, Bloom, type BluePrintEditorState, type BluePrintUniformTexture, type BluePrintUniformValue, type BlueprintDAG, type BoneNode, BoundingBox, type BoundingVolume, type BoxCreationOptions, BoxFilterBlitter, BoxFrameShape, BoxShape, CCDSolver, type CachedBindGroup, Camera, type CameraHistoryData, CameraNearFarNode, type CameraOITMode, CameraPositionNode, CameraVectorNode, type CapsuleCollider, type CapsuleCreationOptions, CapsuleShape, CeilNode, ClampNode, ClipmapTerrain, ClipmapTerrainMaterial, ColliderForce, type ColliderR, type ColliderRW, type CollisionResult, ColorAdjust, type ColoredEdge, type ColoredLineEdge, type ColoredQuadraticEdge, CompAddNode, CompComparisonNode, CompDivNode, CompMulNode, CompSubNode, type ComparisonMode, type CompiledRenderGraph, Compositor, type CompositorContext, ConstantBVec2Node, ConstantBVec3Node, ConstantBVec4Node, ConstantBooleanNode, ConstantScalarNode, ConstantTexture2DArrayNode, ConstantTexture2DNode, ConstantTextureCubeNode, ConstantVec2Node, ConstantVec3Node, ConstantVec4Node, type Constraint, type ConstraintBuildOptions, ConstraintType, type ControllerConfig, type ControllerConfigUpdate, CopyBlitter, type CopyHumanoidAnimationOptions, CosHNode, CosNode, CrossProductNode, CubemapSHProjector, CullVisitor, type CylinderCreationOptions, CylinderShape, DDXNode, DDYNode, Degrees2RadiansNode, DepthPass, DevicePoolAllocator, DirectionalLight, DistanceNode, DotProductNode, DracoMeshDecoder, type DrawContext, type Drawable, type DrawableInstanceInfo, EPSILON, type EdgeColor, type EditorMode, ElapsedTimeNode, type EmitterBehavior, type EmitterShape, Engine, EnvConstantAmbient, EnvHemisphericAmbient, type EnvLightType, EnvLightWrapper, EnvShIBL, Environment, EnvironmentLighting, EqualNode, Exp2Node, ExpNode, type ExtractMixinReturnType, type ExtractMixinType, FABRIKSolver, FBMWaveGenerator, FFTWaveGenerator, FPSCameraController, type FPSCameraControllerOptions, FWidthNode, FXAA, FaceForwardNode, type FixedGeometryCacheFrame, type FixedGeometryCacheState, FixedGeometryCacheTrack, type FlatPlane, FloorNode, FmaNode, type FogType, FontAsset, type FontAssetFetchOptions, type FontAssetMSDFAtlasSettings, type FontMetrics, type ForwardPlusOptions, FractNode, FunctionCallNode, FunctionInputNode, FunctionOutputNode, GPUClothSystem, type GPUClothSystemOptions, type GPUClothWrapBindingData, type GPUClothWrapBindingTarget, GaussianBlurBlitter, GenericMathNode, type GeometryCacheFrame, type GeometryCacheMeshBinding, type GeometryCacheState, GerstnerWaveGenerator, type GlyphContour, type GlyphData, type GlyphPoint, type GrabberR, type GrabberRW, GraphNode, type GraphNodeInput, type GraphNodeOutput, type GraphStructure, type GrassInstanceInfo, GrassLayer, GrassMaterial, GrassRenderer, Grayscale, HEIGHT_FOG_BIT, Hash1Node, Hash2Node, Hash3Node, HistoryResourceManager, type Host, HumanoidBodyRig, HumanoidHandRig, type HumanoidJointMapping, type HumanoidRetargetAxisLocks, type HumanoidRootMotionMode, type HumanoidRootMotionScaleMode, type HumanoidSkeletalAnimationMaskOptions, type HumanoidSkeletalAnimationMaskPreset, type IAttachedScript, type IBaseEvent, type IControllerKeyboardEvent, type IControllerKeydownEvent, type IControllerKeypressEvent, type IControllerKeyupEvent, type IControllerMouseEvent, type IControllerPointerCancelEvent, type IControllerPointerDownEvent, type IControllerPointerMoveEvent, type IControllerPointerUpEvent, type IControllerWheelEvent, type IGraphNode, IKAngleConstraint, IKChain, IKConstraint, type IKJoint, IKModifier, IKSolver, type IMixinAlbedoColor, type IMixinBlinnPhong, type IMixinFoliage, type IMixinLambert, type IMixinLight, type IMixinPBRBluePrint, type IMixinPBRCommon, type IMixinPBRMetallicRoughness, type IMixinPBRSpecularGlossiness, type IMixinVertexColor, type IModKey, type IRUniformTexture, type IRUniformValue, type IRenderHook, type IRenderable, type InputEventHandler, InputManager, InstanceBindGroupAllocator, type InstanceData, InstanceIndexNode, type InstanceUniformType, type InterChainConstraint, InvProjMatrixNode, InvSqrtNode, InvViewProjMatrixNode, type JointChainConfig, type JointDynamicSystemConfig, type JointDynamicsColliderHandle, type JointDynamicsColliderSnapshot, type JointDynamicsFlatPlaneHandle, type JointDynamicsFlatPlaneSnapshot, type JointDynamicsGrabberHandle, type JointDynamicsGrabberSnapshot, JointDynamicsModifier, JointDynamicsSystem, JointDynamicsSystemController, type JointNameMatcher, LIGHT_TYPE_DIRECTIONAL, LIGHT_TYPE_NONE, LIGHT_TYPE_POINT, LIGHT_TYPE_RECT, LIGHT_TYPE_SPOT, LambertMaterial, LengthNode, type LineCollisionResult, Log2Node, type LogMode, LogNode, LogicallyAndNode, LogicallyOrNode, MAX_CLUSTERED_LIGHTS, MAX_GERSTNER_WAVE_COUNT, MAX_MORPH_ATTRIBUTES, MAX_MORPH_TARGETS, MAX_TERRAIN_MIPMAP_LEVELS, MORPH_ATTRIBUTE_VECTOR_COUNT, MORPH_TARGET_COLOR, MORPH_TARGET_NORMAL, MORPH_TARGET_POSITION, MORPH_TARGET_TANGENT, MORPH_TARGET_TEX0, MORPH_TARGET_TEX1, MORPH_TARGET_TEX2, MORPH_TARGET_TEX3, MORPH_WEIGHTS_VECTOR_COUNT, type MSDFBitmap, type MSDFOptions, type MSDFShape, MSDFText, MSDFTextAtlasManager, MSDFTextSprite, MToonMaterial, type MToonOutlineWidthMode, MakeVectorNode, Material, MaterialBlueprintIR, type MaterialBlueprintIRBehaviors, type MaterialTextureInfo, MaterialVaryingFlags, MaxNode, Mesh$1 as Mesh, MeshMaterial, type MeshUpdateCallback, type Metadata$1 as Metadata, MinNode, MixNode, ModNode, type ModelFetchOptions, type ModelInfo, type ModelLoader, type MorphBoundingInfo, type MorphData, type MorphInfo, type MorphState, MorphTargetGroupTrack, MorphTargetTrack, MultiChainSpringSystem, type MultiChainSpringSystemOptions, type NamedJointsSkeletalAnimationMaskOptions, NamedObject, type NearestPointsResult, type NodeConnection, NodeEulerRotationTrack, type NodeIterateFunc, NodeRotationTrack, NodeScaleTrack, NodeTranslationTrack, NormalizeNode, NotEqualNode, type OIT, Octree, OctreeNode, OctreeNodeChunk, OctreePlacement, OrbitCameraController, type OrbitCameraControllerOptions, OrthoCamera, PBRBlockNode, PBRBluePrintMaterial, type PBRBlueprintOutputName, PBRMetallicRoughnessMaterial, type PBRReflectionMode, PBRSpecularGlossinessMaterial, type PCAGeometryCacheState, PCAGeometryCacheTrack, type PCAGeometryCacheTrackData, type PairAdjustment, PannerNode, ParticleMaterial, ParticleSystem, PerlinNoise2DNode, PerspectiveCamera, type PhysicsCurves, type PickResult, type PickTarget, PixelNormalNode, PixelWorldPositionNode, type PlaneCollider, type PlaneCreationOptions, PlaneShape, type PlayAnimationOptions, type PointInit, PointLight, type PointR, type PointRW, type PointTransform, PostEffectLayer, PowNode, Primitive, ProjectionMatrixNode, type PropEdit, type PropertyAccessor, type PropertyAccessorOptions, type PropertySceneNodeOptions, type PropertyToType, PropertyTrack, type PropertyType, type PropertyValue, PunctualLight, QUEUE_OPAQUE, QUEUE_TRANSPARENT, RENDER_PASS_TYPE_DEPTH, RENDER_PASS_TYPE_LIGHT, RENDER_PASS_TYPE_OBJECT_COLOR, RENDER_PASS_TYPE_SHADOWMAP, type RGExecuteContext, type RGExecuteFn, type RGFramebufferDesc, RGHandle, RGHistoryResources, type RGPassBuilder, type RGProfileResult, type RGProfileScopeResult, type RGProfileScopeType, type RGProfilingOptions, type RGResolvedSize, type RGResourceLifetime, type RGSizeMode, RGSubpass, type RGTextureAllocator, type RGTextureDesc, Radians2DegreesNode, RaycastVisitor, RectLight, ReflectNode, RefractNode, type RenderFunc, RenderGraph, RenderGraphExecutor, type RenderGraphExecutorOptions, type RenderItemList, type RenderItemListBundle, type RenderItemListInfo, RenderPass, type RenderPath, RenderQueue, type RenderQueueItem, type RenderQueueRef, RenderTarget, type ResolutionTransform, ResolveVertexNormalNode, ResolveVertexPositionNode, ResolveVertexTangentNode, ResourceManager, RotateAboutAxisNode, RuntimeScript, type RuntimeScriptArrayDeclaration, type RuntimeScriptArrayElementDeclaration, type RuntimeScriptConfig, type RuntimeScriptObjectDeclaration, type RuntimeScriptObjectFieldDeclaration, type RuntimeScriptPropertyDeclaration, type RuntimeScriptPropertyInfo, type RuntimeScriptPropertyOptions, type RuntimeScriptPropertyType, type RuntimeScriptValueDeclaration, type RuntimeScriptValueType, SAO, type SSSDebugView, type SSSQualityPreset, type SSSResolvedSettings, type SamplerType, SaturateNode, type SaveOptions, Scene, type SceneMorphTargetBinding, type SceneMorphTargetGroup, SceneNode, type SceneNodeVisible, ScreenAdapter, type ScreenConfig, ScreenRenderTarget, type ScreenScaleMode, ScriptAttachment, type ScriptAttachmentConfig, ScriptRegistry, ScriptingSystem, type ScriptingSystemOptions, SelectionNode, type SerializableClass, type SerializedMorphTargetBinding, type SerializedMorphTargetGroup, ShaderHelper, ShadowMapPass, ShadowMapper, type ShadowMode, type ShadowQualityPreset, ShadowRegion, Shape, type ShapeCreationOptions, type ShapeOptionType, type ShapeType, SharedModel, SignNode, SimplexNoise2DNode, type SimulationParams, SinHNode, SinNode, type SkeletalAnimationMaskCommonOptions, type SkeletalAnimationMaskOptions, type SkeletalAnimationMaskRootMotionMode, type SkeletalAnimationMaskUnsupportedTrackMode, Skeleton, type SkeletonBindPose, SkeletonModifier, SkeletonRig, type SkeletonRigOptions, SkinBinding, type SkinnedBoundingBox, SkyEnvTextureNode, SkyRenderer, type SkyType, SmoothStepNode, type SphereCollider, type SphereCreationOptions, SphereShape, SpotLight, SpringChain, type SpringCollider, type SpringConstraint, SpringModifier, type SpringParticle, SpringSystem, type SpringSystemOptions, Sprite, SpriteBlockNode, SpriteBlueprintMaterial, SpriteMaterial, SqrtNode, StandardSpriteMaterial, StepNode, type StopAnimationOptions, SubsurfaceProfile, type SubsurfaceProfilePreset, type SurfaceCheckResult, SwizzleNode, TanHNode, TanNode, type TerrainDebugMode, type TetrahedronCreationOptions, TetrahedronFrameShape, TetrahedronShape, TextSprite, type TextureFetchOptions, type TextureMixinInstanceTypes, type TextureMixinTypes, type TextureProp, type TexturePropUniforms, TextureSampleGrad, TextureSampleNode, type ToMixedTextureType, Tonemap, type TorusCreationOptions, TorusShape, type TransformAccess, TransformNode, type TwistConstraint, TwoBoneIKSolver, UnlitMaterial, VertexBinormalNode, VertexBlockNode, VertexColorNode, VertexIndexNode, VertexNormalNode, VertexOutputNode, VertexPositionNode, VertexTangentNode, VertexUVNode, ViewMatrixNode, ViewProjMatrixNode, type Visitor, Water, type WaveGenerator, WeightedBlendedOIT, applyAngleLimits, applyMaterialMixins, applyResult, applyRuntimeScriptConfig, buildConstraints, buildForwardPlusGraph, buildMSDFShape, buildSurfaceFaces, checkSurfaceCollision, collisionDetection, collisionDetectionCapsule, collisionDetectionSphere, computeMaxDepth, computeNearestPoints, createCapsuleCollider, createGPUClothWrapBindingData, createGeometryCacheState, createPlaneCollider, createSphereCollider, createSpringConstraint, createSpringParticle, createTransformAccess, decode2HalfFromRGBA, decodeFloatFromRGBA, decodeNormalizedFloatFromRGBA, decodeRGBM, defineProps, encode2HalfToRGBA, encodeFloatToRGBA, encodeNormalizedFloatToRGBA, encodeRGBM, ensureGeometryCacheMeshBinding, executeForwardPlusGraph, fetchSampler, gammaToLinear, generateMSDF, getApp, getDevice, getEngine, getInput, getRuntimeScriptProperties, gradient, hash11, hash12, hash13, hash21, hash22, hash23, hash31, hash32, hash33, interleavedGradientNoise, isGPUClothSupported, linearToGamma, mixGeometryCacheBoundingBox, mixinAlbedoColor, mixinBlinnPhong, mixinFoliage, mixinLambert, mixinLight, mixinPBRBluePrint, mixinPBRCommon, mixinPBRMetallicRoughness, mixinPBRSpecularGlossness, mixinTextureProps, mixinVertexColor, noise3D, normalizeRuntimeScriptConfig, normalizeScriptAttachmentConfig, normalizeScriptAttachments, panoramaToCubemap, perlinNoise2D, perlinNoise3D, prefilterCubemap, pushInCollisionDetection, pushInFromCapsule, pushInFromCollider, pushInFromSphere, pushoutFromCapsule, pushoutFromCollider, pushoutFromSphere, resolveCapsuleCollision, resolvePlaneCollision, resolveSphereCollision, restoreGeometryCacheMeshBinding, scriptProp, simulate, smoothNoise3D, sortRootPointsByProximity, temporalResolve, tryGetApp, updateColliderFromNode, valueNoise, whiteNoise, worleyFBM, worleyNoise };
@@ -50,7 +50,13 @@ export { GerstnerWaveGenerator } from './render/gerstner_wavegenerator.js';
50
50
  export { FBMWaveGenerator } from './render/fbm_wavegenerator.js';
51
51
  export { RenderTarget } from './render/rendertarget.js';
52
52
  export { ScreenRenderTarget } from './render/screenrendertarget.js';
53
+ export { RGHandle, RGSubpass } from './render/rendergraph/types.js';
54
+ export { RenderGraph } from './render/rendergraph/rendergraph.js';
55
+ export { RenderGraphExecutor } from './render/rendergraph/executor.js';
56
+ export { DevicePoolAllocator } from './render/rendergraph/device_pool_allocator.js';
53
57
  export { HistoryResourceManager } from './render/rendergraph/history_resource_manager.js';
58
+ export { RGHistoryResources } from './render/rendergraph/history_resources.js';
59
+ export { buildForwardPlusGraph, executeForwardPlusGraph } from './render/rendergraph/forward_plus_builder.js';
54
60
  export { ShaderHelper } from './material/shader/helper.js';
55
61
  export { LambertMaterial } from './material/lambert.js';
56
62
  export { BlinnMaterial } from './material/blinn.js';
@@ -112,6 +118,7 @@ export { NodeEulerRotationTrack } from './animation/eulerrotationtrack.js';
112
118
  export { NodeScaleTrack } from './animation/scaletrack.js';
113
119
  export { PropertyTrack } from './animation/proptrack.js';
114
120
  export { MorphTargetTrack } from './animation/morphtrack.js';
121
+ export { MorphTargetGroupTrack } from './animation/morphtargetgrouptrack.js';
115
122
  export { FixedGeometryCacheTrack } from './animation/fixed_geometry_cache_track.js';
116
123
  export { createGeometryCacheState, ensureGeometryCacheMeshBinding, mixGeometryCacheBoundingBox, restoreGeometryCacheMeshBinding } from './animation/geometry_cache_utils.js';
117
124
  export { PCAGeometryCacheTrack } from './animation/pca_geometry_cache_track.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -158,7 +158,7 @@ class DepthLimitAOBlurBlitter extends BilateralBlurBlitter {
158
158
  device.clearFrameBuffer(packed ? new Vector4(0, 0, 0, 1) : new Vector4(1, 0, 0, 1), null, null);
159
159
  const bindgroup = packed ? SAO._bindgroupPacked : SAO._bindgroup;
160
160
  bindgroup.setValue('flip', this.needFlip(device) ? 1 : 0);
161
- bindgroup.setTexture('depthTex', sceneDepthTexture);
161
+ bindgroup.setTexture('depthTex', sceneDepthTexture, fetchSampler('clamp_nearest_nomip'));
162
162
  bindgroup.setValue('scale', this._saoScale);
163
163
  bindgroup.setValue('invProj', Matrix4x4.invert(ctx.camera.getProjectionMatrix()));
164
164
  bindgroup.setValue('bias', this._saoBias);
@@ -1 +1 @@
1
- {"version":3,"file":"sao.js","sources":["../../src/posteffect/sao.ts"],"sourcesContent":["import type {\r\n AbstractDevice,\r\n BindGroup,\r\n GPUProgram,\r\n PBInsideFunctionScope,\r\n PBShaderExp,\r\n RenderStateSet,\r\n Texture2D\r\n} from '@zephyr3d/device';\r\nimport { isFloatTextureFormat } from '@zephyr3d/device';\r\nimport { AbstractPostEffect, PostEffectLayer } from './posteffect';\r\nimport { decodeNormalizedFloatFromRGBA, encodeNormalizedFloatToRGBA } from '../shaders/misc';\r\nimport type { Nullable } from '@zephyr3d/base';\r\nimport { Matrix4x4, Vector2, Vector4 } from '@zephyr3d/base';\r\nimport { BilateralBlurBlitter } from '../blitter/bilateralblur';\r\nimport type { BlitType } from '../blitter';\r\nimport type { DrawContext } from '../render';\r\nimport { fetchSampler } from '../utility/misc';\r\n\r\nconst NUM_SAMPLES = 7;\r\nconst NUM_RINGS = 4;\r\n\r\nclass DepthLimitAOBlurBlitter extends BilateralBlurBlitter {\r\n private _packed: boolean;\r\n constructor(finalPhase: boolean) {\r\n super(finalPhase);\r\n this._packed = false;\r\n }\r\n get packed() {\r\n return this._packed;\r\n }\r\n set packed(val) {\r\n if (this._packed !== !!val) {\r\n this._packed = !!val;\r\n this.invalidateHash();\r\n }\r\n }\r\n protected calcHash() {\r\n return `${this._packed}:${super.calcHash()}`;\r\n }\r\n readTexel(\r\n scope: PBInsideFunctionScope,\r\n type: BlitType,\r\n srcTex: PBShaderExp,\r\n srcUV: PBShaderExp,\r\n srcLayer: PBShaderExp,\r\n sampleType: 'float' | 'int' | 'uint' | 'depth'\r\n ) {\r\n const pb = scope.$builder;\r\n const texel = super.readTexel(scope, type, srcTex, srcUV, srcLayer, sampleType);\r\n if (this._packed) {\r\n return pb.vec4(pb.vec3(decodeNormalizedFloatFromRGBA(scope, texel)), 1);\r\n } else {\r\n return pb.vec4(texel.rrr, 1);\r\n }\r\n }\r\n writeTexel(scope: PBInsideFunctionScope, type: BlitType, uv: PBShaderExp, texel: PBShaderExp) {\r\n const pb = scope.$builder;\r\n const outTexel = super.writeTexel(scope, type, uv, pb.vec4(texel.rrr, 1));\r\n return this._finalPhase || !this._packed\r\n ? pb.vec4(outTexel.rrr, 1)\r\n : encodeNormalizedFloatToRGBA(scope, outTexel.r);\r\n }\r\n}\r\n/**\r\n * The Scalable Ambient Obscurance (SAO) post effect\r\n * @public\r\n */\r\nexport class SAO extends AbstractPostEffect {\r\n private static _program: Nullable<GPUProgram> = null;\r\n private static _programPacked: Nullable<GPUProgram> = null;\r\n private static _renderState: Nullable<RenderStateSet> = null;\r\n private static _renderStateBlend: Nullable<RenderStateSet> = null;\r\n private static _bindgroup: Nullable<BindGroup> = null;\r\n private static _bindgroupPacked: Nullable<BindGroup> = null;\r\n private _saoScale: number;\r\n private _saoBias: number;\r\n private _saoIntensity: number;\r\n private _saoRadius: number;\r\n private _saoMinResolution: number;\r\n private readonly _saoRandomSeed: number;\r\n private _saoBlurDepthCutoff: number;\r\n private readonly _blitterH: DepthLimitAOBlurBlitter;\r\n private readonly _blitterV: DepthLimitAOBlurBlitter;\r\n private _supported: boolean;\r\n /**\r\n * Creates an instance of SAO post effect\r\n */\r\n constructor() {\r\n super();\r\n this._supported = true;\r\n this._layer = PostEffectLayer.opaque;\r\n this._saoScale = 10;\r\n this._saoBias = 1;\r\n this._saoIntensity = 0.025;\r\n this._saoRadius = 100;\r\n this._saoMinResolution = 0;\r\n this._saoRandomSeed = 0;\r\n this._saoBlurDepthCutoff = 2;\r\n this._blitterH = new DepthLimitAOBlurBlitter(false);\r\n this._blitterH.kernelRadius = 8;\r\n this._blitterH.stdDev = 10;\r\n this._blitterV = new DepthLimitAOBlurBlitter(true);\r\n this._blitterV.kernelRadius = 8;\r\n this._blitterV.stdDev = 10;\r\n }\r\n /** Scale value */\r\n get scale() {\r\n return this._saoScale;\r\n }\r\n set scale(val) {\r\n this._saoScale = val;\r\n }\r\n /** Bias value */\r\n get bias() {\r\n return this._saoBias;\r\n }\r\n set bias(val) {\r\n this._saoBias = val;\r\n }\r\n /** Radius value */\r\n get radius() {\r\n return this._saoRadius;\r\n }\r\n set radius(val) {\r\n this._saoRadius = val;\r\n }\r\n /** SAO intensity */\r\n get intensity() {\r\n return this._saoIntensity;\r\n }\r\n set intensity(val) {\r\n this._saoIntensity = val;\r\n }\r\n /** Minimum resolution */\r\n get minResolution() {\r\n return this._saoMinResolution;\r\n }\r\n set minResolution(val) {\r\n this._saoMinResolution = val;\r\n }\r\n /** Blur kernel size */\r\n get blurKernelSize() {\r\n return this._blitterH.kernelRadius;\r\n }\r\n set blurKernelSize(val) {\r\n val = Math.min(64, Math.max(0, val >> 0));\r\n this._blitterH.kernelRadius = val;\r\n this._blitterV.kernelRadius = val;\r\n }\r\n /** Gaussian blur stddev value */\r\n get blurStdDev() {\r\n return this._blitterH.stdDev;\r\n }\r\n set blurStdDev(val) {\r\n this._blitterH.stdDev = val;\r\n this._blitterV.stdDev = val;\r\n }\r\n /** Cutoff of depth limited blur */\r\n get blurDepthCutoff() {\r\n return this._saoBlurDepthCutoff;\r\n }\r\n set blurDepthCutoff(val) {\r\n this._saoBlurDepthCutoff = val;\r\n }\r\n /** {@inheritDoc AbstractPostEffect.requireLinearDepthTexture} */\r\n requireLinearDepthTexture() {\r\n return true;\r\n }\r\n /** {@inheritDoc AbstractPostEffect.requireDepthAttachment} */\r\n requireDepthAttachment() {\r\n return true;\r\n }\r\n /** {@inheritDoc AbstractPostEffect.apply} */\r\n apply(ctx: DrawContext, inputColorTexture: Texture2D, sceneDepthTexture: Texture2D, srgbOutput: boolean) {\r\n const device = ctx.device;\r\n const viewport = device.getViewport();\r\n this._prepare(device, inputColorTexture);\r\n this.passThrough(ctx, inputColorTexture, srgbOutput);\r\n if (!this._supported) {\r\n return;\r\n }\r\n const fmt = this._getIntermediateTextureFormat(device);\r\n const depth = device.getFramebuffer()!.getDepthAttachment() as Texture2D;\r\n\r\n const fbao = device.pool.fetchTemporalTexture2D(false, fmt, depth.width, depth.height, false);\r\n const fbblur = device.pool.fetchTemporalTexture2D(false, fmt, depth.width, depth.height, false);\r\n const packed = fbao.format === 'rgba8unorm';\r\n const cameraNearFar = new Vector2(ctx.camera.getNearPlane(), ctx.camera.getFarPlane());\r\n device.pushDeviceStates();\r\n device.setFramebuffer([fbao], depth);\r\n device.clearFrameBuffer(packed ? new Vector4(0, 0, 0, 1) : new Vector4(1, 0, 0, 1), null, null);\r\n const bindgroup = packed ? SAO._bindgroupPacked! : SAO._bindgroup!;\r\n bindgroup.setValue('flip', this.needFlip(device) ? 1 : 0);\r\n bindgroup.setTexture('depthTex', sceneDepthTexture);\r\n bindgroup.setValue('scale', this._saoScale);\r\n bindgroup.setValue('invProj', Matrix4x4.invert(ctx.camera.getProjectionMatrix()));\r\n bindgroup.setValue('bias', this._saoBias);\r\n bindgroup.setValue('cameraNearFar', cameraNearFar);\r\n bindgroup.setValue('intensity', this._saoIntensity);\r\n bindgroup.setValue('kernelRadius', this._saoRadius);\r\n bindgroup.setValue('minResolution', this._saoMinResolution);\r\n bindgroup.setValue('size', new Vector2(viewport.width, viewport.height));\r\n bindgroup.setValue('randomSeed', this._saoRandomSeed);\r\n device.setRenderStates(SAO._renderState);\r\n device.setProgram(packed ? SAO._programPacked : SAO._program);\r\n device.setBindGroup(0, bindgroup);\r\n this.drawFullscreenQuad(SAO._renderState!);\r\n this._blitterH.size = new Vector2(inputColorTexture.width, inputColorTexture.height);\r\n this._blitterH.depthTex = sceneDepthTexture;\r\n this._blitterH.depthCutoff = this._saoBlurDepthCutoff;\r\n this._blitterH.sampler = fetchSampler('clamp_nearest_nomip');\r\n this._blitterH.cameraNearFar = cameraNearFar;\r\n this._blitterH.packed = packed;\r\n this._blitterH.renderStates = SAO._renderState;\r\n this._blitterV.size = new Vector2(inputColorTexture.width, inputColorTexture.height);\r\n this._blitterV.depthTex = sceneDepthTexture;\r\n this._blitterV.depthCutoff = this._saoBlurDepthCutoff;\r\n this._blitterV.sampler = fetchSampler('clamp_nearest_nomip');\r\n this._blitterV.cameraNearFar = cameraNearFar;\r\n this._blitterV.packed = packed;\r\n this._blitterV.srgbOut = srgbOutput;\r\n this._blitterV.renderStates = SAO._renderStateBlend;\r\n this._blitterH.blit(fbao, fbblur);\r\n device.popDeviceStates();\r\n this._blitterV.blit(fbblur, device.getFramebuffer()!);\r\n device.pool.releaseTexture(fbao);\r\n device.pool.releaseTexture(fbblur);\r\n }\r\n private _getIntermediateTextureFormat(device: AbstractDevice) {\r\n const texCaps = device.getDeviceCaps().textureCaps;\r\n return device.type === 'webgl' ||\r\n (!texCaps.supportHalfFloatColorBuffer && !texCaps.supportFloatColorBuffer)\r\n ? 'rgba8unorm'\r\n : texCaps.supportHalfFloatColorBuffer\r\n ? 'r16f'\r\n : 'r32f';\r\n }\r\n /** @internal */\r\n private _prepare(device: AbstractDevice, _srcTexture: Texture2D) {\r\n const fb = device.getFramebuffer();\r\n const isFloatFramebuffer = fb && isFloatTextureFormat(fb.getColorAttachments()[0].format);\r\n this._supported = !isFloatFramebuffer || device.getDeviceCaps().framebufferCaps.supportFloatBlending;\r\n if (this._supported) {\r\n if (!SAO._renderState) {\r\n SAO._renderState = device.createRenderStateSet();\r\n SAO._renderState.useDepthState().enableTest(true).enableWrite(false).setCompareFunc('gt');\r\n SAO._renderState.useRasterizerState().setCullMode('none');\r\n SAO._renderStateBlend = device.createRenderStateSet();\r\n SAO._renderStateBlend.useDepthState().enableTest(true).enableWrite(false).setCompareFunc('gt');\r\n SAO._renderStateBlend.useRasterizerState().setCullMode('none');\r\n SAO._renderStateBlend\r\n .useBlendingState()\r\n .enable(true)\r\n .setBlendFuncRGB('zero', 'src-color')\r\n .setBlendFuncAlpha('zero', 'one');\r\n }\r\n function createProgram(packed: boolean) {\r\n const program = device.buildRenderProgram({\r\n vertex(pb) {\r\n this.flip = pb.int().uniform(0);\r\n this.$inputs.pos = pb.vec2().attrib('position');\r\n this.$outputs.uv = pb.vec2();\r\n pb.main(function () {\r\n this.$builtins.position = pb.vec4(this.$inputs.pos, 1, 1);\r\n this.$outputs.uv = pb.add(pb.mul(this.$inputs.pos.xy, 0.5), pb.vec2(0.5));\r\n this.$if(pb.notEqual(this.flip, 0), function () {\r\n this.$builtins.position.y = pb.neg(this.$builtins.position.y);\r\n });\r\n });\r\n },\r\n fragment(pb) {\r\n this.depthTex = pb.tex2D().sampleType('unfilterable-float').uniform(0);\r\n this.scale = pb.float().uniform(0);\r\n this.invProj = pb.mat4().uniform(0);\r\n this.cameraNearFar = pb.vec2().uniform(0);\r\n this.intensity = pb.float().uniform(0);\r\n this.bias = pb.float().uniform(0);\r\n this.kernelRadius = pb.float().uniform(0);\r\n this.minResolution = pb.float().uniform(0);\r\n this.size = pb.vec2().uniform(0);\r\n this.randomSeed = pb.float().uniform(0);\r\n this.$l.scaleDividedByCameraFar = pb.float();\r\n this.$l.minResolutionMultipliedByCameraFar = pb.float();\r\n pb.func('rand', [pb.vec2('uv')], function () {\r\n this.$l.a = 12.9898;\r\n this.$l.b = 78.233;\r\n this.$l.c = 43758.5453;\r\n this.$l.dt = pb.dot(this.uv, pb.vec2(this.a, this.b));\r\n this.$l.sn = pb.mod(this.dt, Math.PI);\r\n this.$return(pb.fract(pb.mul(pb.sin(this.sn), this.c)));\r\n });\r\n pb.func('getPositionVS', [pb.vec2('uv')], function () {\r\n this.$l.depthValue = pb.textureSample(this.depthTex, this.uv);\r\n if (device.type === 'webgl') {\r\n this.$l.linearDepth = decodeNormalizedFloatFromRGBA(this, this.depthValue);\r\n } else {\r\n this.$l.linearDepth = this.depthValue.r;\r\n }\r\n this.$l.nonLinearDepth = pb.div(\r\n pb.sub(pb.div(this.cameraNearFar.x, this.linearDepth), this.cameraNearFar.y),\r\n pb.sub(this.cameraNearFar.x, this.cameraNearFar.y)\r\n );\r\n this.$l.clipSpacePos = pb.vec4(\r\n pb.sub(pb.mul(this.uv, 2), pb.vec2(1)),\r\n pb.sub(pb.mul(this.nonLinearDepth, 2), 1),\r\n 1\r\n );\r\n // this.$l.clipSpacePos = pb.vec4(this.uv, this.nonLinearDepth, 1);\r\n this.$l.vPos = pb.mul(this.invProj, this.clipSpacePos);\r\n this.vPos = pb.div(this.vPos, this.vPos.w);\r\n this.$return(this.vPos.xyz);\r\n });\r\n pb.func(\r\n 'getOcclusion',\r\n [pb.vec3('centerPos'), pb.vec3('centerNormal'), pb.vec3('samplePos')],\r\n function () {\r\n this.$l.viewDelta = pb.sub(this.samplePos, this.centerPos);\r\n this.$l.viewDistance = pb.length(this.viewDelta);\r\n this.$l.scaledScreenDistance = pb.mul(this.scaleDividedByCameraFar, this.viewDistance);\r\n this.$return(\r\n pb.div(\r\n pb.max(\r\n 0,\r\n pb.sub(\r\n pb.div(\r\n pb.sub(\r\n pb.dot(this.centerNormal, this.viewDelta),\r\n this.minResolutionMultipliedByCameraFar\r\n ),\r\n this.scaledScreenDistance\r\n ),\r\n this.bias\r\n )\r\n ),\r\n pb.add(pb.mul(this.scaledScreenDistance, this.scaledScreenDistance), 1)\r\n )\r\n );\r\n }\r\n );\r\n pb.func('getAO', [pb.vec3('vPos')], function () {\r\n this.scaleDividedByCameraFar = pb.div(this.scale, this.cameraNearFar.y);\r\n this.minResolutionMultipliedByCameraFar = pb.mul(this.minResolution, this.cameraNearFar.y);\r\n this.$l.centerViewNormal = pb.normalize(pb.cross(pb.dpdx(this.vPos), pb.dpdy(this.vPos)));\r\n this.$l.angle = pb.mul(\r\n this.rand(pb.add(this.$inputs.uv, pb.vec2(this.randomSeed))),\r\n Math.PI * 2\r\n );\r\n this.$l.radius = pb.div(pb.vec2(pb.mul(this.kernelRadius, 1 / NUM_SAMPLES)), this.size);\r\n this.$l.radiusStep = this.radius;\r\n this.$l.occlusionSum = pb.float(0);\r\n this.$l.weightSum = pb.float(0);\r\n this.$for(pb.int('i'), 0, NUM_SAMPLES, function () {\r\n this.$l.sampleUV = pb.add(\r\n this.$inputs.uv,\r\n pb.mul(pb.vec2(pb.cos(this.angle), pb.sin(this.angle)), this.radius)\r\n );\r\n this.radius = pb.add(this.radius, this.radiusStep);\r\n this.angle = pb.add(this.angle, (Math.PI * NUM_RINGS) / NUM_SAMPLES);\r\n this.samplePos = this.getPositionVS(this.sampleUV);\r\n this.occlusionSum = pb.add(\r\n this.occlusionSum,\r\n this.getOcclusion(this.vPos, this.centerViewNormal, this.samplePos)\r\n );\r\n this.weightSum = pb.add(this.weightSum, 1);\r\n });\r\n this.$if(pb.equal(this.weightSum, 0), function () {\r\n pb.discard();\r\n });\r\n this.$return(pb.div(pb.mul(this.occlusionSum, this.intensity), this.weightSum));\r\n });\r\n pb.main(function () {\r\n this.$l.vPos = this.getPositionVS(this.$inputs.uv);\r\n this.$l.ao = pb.clamp(pb.sub(1, this.getAO(this.vPos)), 0, packed ? 0.999 : 1);\r\n if (packed) {\r\n this.$outputs.outColor = encodeNormalizedFloatToRGBA(this, this.ao);\r\n } else {\r\n this.$outputs.outColor = pb.vec4(this.ao, this.ao, this.ao, 1);\r\n }\r\n });\r\n }\r\n })!;\r\n program.name = packed ? '@SAO_Packed' : '@SAO';\r\n return program;\r\n }\r\n if (!SAO._program) {\r\n SAO._program = createProgram(false);\r\n SAO._programPacked = createProgram(true);\r\n SAO._bindgroup = device.createBindGroup(SAO._program.bindGroupLayouts[0]);\r\n SAO._bindgroupPacked = device.createBindGroup(SAO._programPacked.bindGroupLayouts[0]);\r\n }\r\n }\r\n }\r\n}\r\n"],"names":["NUM_SAMPLES","NUM_RINGS","DepthLimitAOBlurBlitter","BilateralBlurBlitter","_packed","finalPhase","packed","val","invalidateHash","calcHash","readTexel","scope","type","srcTex","srcUV","srcLayer","sampleType","pb","$builder","texel","vec4","vec3","decodeNormalizedFloatFromRGBA","rrr","writeTexel","uv","outTexel","_finalPhase","encodeNormalizedFloatToRGBA","r","SAO","AbstractPostEffect","_program","_programPacked","_renderState","_renderStateBlend","_bindgroup","_bindgroupPacked","_saoScale","_saoBias","_saoIntensity","_saoRadius","_saoMinResolution","_saoRandomSeed","_saoBlurDepthCutoff","_blitterH","_blitterV","_supported","_layer","PostEffectLayer","opaque","kernelRadius","stdDev","scale","bias","radius","intensity","minResolution","blurKernelSize","Math","min","max","blurStdDev","blurDepthCutoff","requireLinearDepthTexture","requireDepthAttachment","apply","ctx","inputColorTexture","sceneDepthTexture","srgbOutput","device","viewport","getViewport","_prepare","passThrough","fmt","_getIntermediateTextureFormat","depth","getFramebuffer","getDepthAttachment","fbao","pool","fetchTemporalTexture2D","width","height","fbblur","format","cameraNearFar","Vector2","camera","getNearPlane","getFarPlane","pushDeviceStates","setFramebuffer","clearFrameBuffer","Vector4","bindgroup","setValue","needFlip","setTexture","Matrix4x4","invert","getProjectionMatrix","setRenderStates","setProgram","setBindGroup","drawFullscreenQuad","size","depthTex","depthCutoff","sampler","fetchSampler","renderStates","srgbOut","blit","popDeviceStates","releaseTexture","texCaps","getDeviceCaps","textureCaps","supportHalfFloatColorBuffer","supportFloatColorBuffer","_srcTexture","fb","isFloatFramebuffer","isFloatTextureFormat","getColorAttachments","framebufferCaps","supportFloatBlending","createRenderStateSet","useDepthState","enableTest","enableWrite","setCompareFunc","useRasterizerState","setCullMode","useBlendingState","enable","setBlendFuncRGB","setBlendFuncAlpha","createProgram","program","buildRenderProgram","vertex","flip","int","uniform","$inputs","pos","vec2","attrib","$outputs","main","$builtins","position","add","mul","xy","$if","notEqual","y","neg","fragment","tex2D","float","invProj","mat4","randomSeed","$l","scaleDividedByCameraFar","minResolutionMultipliedByCameraFar","func","a","b","c","dt","dot","sn","mod","PI","$return","fract","sin","depthValue","textureSample","linearDepth","nonLinearDepth","div","sub","x","clipSpacePos","vPos","w","xyz","viewDelta","samplePos","centerPos","viewDistance","length","scaledScreenDistance","centerNormal","centerViewNormal","normalize","cross","dpdx","dpdy","angle","rand","radiusStep","occlusionSum","weightSum","$for","sampleUV","cos","getPositionVS","getOcclusion","equal","discard","ao","clamp","getAO","outColor","name","createBindGroup","bindGroupLayouts"],"mappings":";;;;;;;AAmBA,MAAMA,WAAc,GAAA,CAAA;AACpB,MAAMC,SAAY,GAAA,CAAA;AAElB,MAAMC,uBAAgCC,SAAAA,oBAAAA,CAAAA;IAC5BC,OAAiB;AACzB,IAAA,WAAA,CAAYC,UAAmB,CAAE;AAC/B,QAAA,KAAK,CAACA,UAAAA,CAAAA;QACN,IAAI,CAACD,OAAO,GAAG,KAAA;AACjB;AACA,IAAA,IAAIE,MAAS,GAAA;QACX,OAAO,IAAI,CAACF,OAAO;AACrB;IACA,IAAIE,MAAAA,CAAOC,GAAG,EAAE;AACd,QAAA,IAAI,IAAI,CAACH,OAAO,KAAK,CAAC,CAACG,GAAK,EAAA;AAC1B,YAAA,IAAI,CAACH,OAAO,GAAG,CAAC,CAACG,GAAAA;AACjB,YAAA,IAAI,CAACC,cAAc,EAAA;AACrB;AACF;IACUC,QAAW,GAAA;QACnB,OAAO,CAAA,EAAG,IAAI,CAACL,OAAO,CAAC,CAAC,EAAE,KAAK,CAACK,QAAY,EAAA,CAAA,CAAA;AAC9C;IACAC,SACEC,CAAAA,KAA4B,EAC5BC,IAAc,EACdC,MAAmB,EACnBC,KAAkB,EAClBC,QAAqB,EACrBC,UAA8C,EAC9C;QACA,MAAMC,EAAAA,GAAKN,MAAMO,QAAQ;QACzB,MAAMC,KAAAA,GAAQ,KAAK,CAACT,SAAAA,CAAUC,OAAOC,IAAMC,EAAAA,MAAAA,EAAQ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,CAAA,CAAA;AAC5E,4BAAA,IAAIA,MAAQ,EAAA;gCACV,IAAI,CAACkJ,QAAQ,CAACsE,QAAQ,GAAGlM,4BAA4B,IAAI,EAAE,IAAI,CAAC+L,EAAE,CAAA;6BAC7D,MAAA;AACL,gCAAA,IAAI,CAACnE,QAAQ,CAACsE,QAAQ,GAAG7M,EAAAA,CAAGG,IAAI,CAAC,IAAI,CAACuM,EAAE,EAAE,IAAI,CAACA,EAAE,EAAE,IAAI,CAACA,EAAE,EAAE,CAAA,CAAA;AAC9D;AACF,yBAAA,CAAA;AACF;AACF,iBAAA,CAAA;gBACA7E,OAAQiF,CAAAA,IAAI,GAAGzN,MAAAA,GAAS,aAAgB,GAAA,MAAA;gBACxC,OAAOwI,OAAAA;AACT;YACA,IAAI,CAAChH,GAAIE,CAAAA,QAAQ,EAAE;gBACjBF,GAAIE,CAAAA,QAAQ,GAAG6G,aAAc,CAAA,KAAA,CAAA;gBAC7B/G,GAAIG,CAAAA,cAAc,GAAG4G,aAAc,CAAA,IAAA,CAAA;gBACnC/G,GAAIM,CAAAA,UAAU,GAAGmC,MAAAA,CAAOyJ,eAAe,CAAClM,IAAIE,QAAQ,CAACiM,gBAAgB,CAAC,CAAE,CAAA,CAAA;gBACxEnM,GAAIO,CAAAA,gBAAgB,GAAGkC,MAAAA,CAAOyJ,eAAe,CAAClM,IAAIG,cAAc,CAACgM,gBAAgB,CAAC,CAAE,CAAA,CAAA;AACtF;AACF;AACF;AACF;;;;"}
1
+ {"version":3,"file":"sao.js","sources":["../../src/posteffect/sao.ts"],"sourcesContent":["import type {\r\n AbstractDevice,\r\n BindGroup,\r\n GPUProgram,\r\n PBInsideFunctionScope,\r\n PBShaderExp,\r\n RenderStateSet,\r\n Texture2D\r\n} from '@zephyr3d/device';\r\nimport { isFloatTextureFormat } from '@zephyr3d/device';\r\nimport { AbstractPostEffect, PostEffectLayer } from './posteffect';\r\nimport { decodeNormalizedFloatFromRGBA, encodeNormalizedFloatToRGBA } from '../shaders/misc';\r\nimport type { Nullable } from '@zephyr3d/base';\r\nimport { Matrix4x4, Vector2, Vector4 } from '@zephyr3d/base';\r\nimport { BilateralBlurBlitter } from '../blitter/bilateralblur';\r\nimport type { BlitType } from '../blitter';\r\nimport type { DrawContext } from '../render';\r\nimport { fetchSampler } from '../utility/misc';\r\n\r\nconst NUM_SAMPLES = 7;\r\nconst NUM_RINGS = 4;\r\n\r\nclass DepthLimitAOBlurBlitter extends BilateralBlurBlitter {\r\n private _packed: boolean;\r\n constructor(finalPhase: boolean) {\r\n super(finalPhase);\r\n this._packed = false;\r\n }\r\n get packed() {\r\n return this._packed;\r\n }\r\n set packed(val) {\r\n if (this._packed !== !!val) {\r\n this._packed = !!val;\r\n this.invalidateHash();\r\n }\r\n }\r\n protected calcHash() {\r\n return `${this._packed}:${super.calcHash()}`;\r\n }\r\n readTexel(\r\n scope: PBInsideFunctionScope,\r\n type: BlitType,\r\n srcTex: PBShaderExp,\r\n srcUV: PBShaderExp,\r\n srcLayer: PBShaderExp,\r\n sampleType: 'float' | 'int' | 'uint' | 'depth'\r\n ) {\r\n const pb = scope.$builder;\r\n const texel = super.readTexel(scope, type, srcTex, srcUV, srcLayer, sampleType);\r\n if (this._packed) {\r\n return pb.vec4(pb.vec3(decodeNormalizedFloatFromRGBA(scope, texel)), 1);\r\n } else {\r\n return pb.vec4(texel.rrr, 1);\r\n }\r\n }\r\n writeTexel(scope: PBInsideFunctionScope, type: BlitType, uv: PBShaderExp, texel: PBShaderExp) {\r\n const pb = scope.$builder;\r\n const outTexel = super.writeTexel(scope, type, uv, pb.vec4(texel.rrr, 1));\r\n return this._finalPhase || !this._packed\r\n ? pb.vec4(outTexel.rrr, 1)\r\n : encodeNormalizedFloatToRGBA(scope, outTexel.r);\r\n }\r\n}\r\n/**\r\n * The Scalable Ambient Obscurance (SAO) post effect\r\n * @public\r\n */\r\nexport class SAO extends AbstractPostEffect {\r\n private static _program: Nullable<GPUProgram> = null;\r\n private static _programPacked: Nullable<GPUProgram> = null;\r\n private static _renderState: Nullable<RenderStateSet> = null;\r\n private static _renderStateBlend: Nullable<RenderStateSet> = null;\r\n private static _bindgroup: Nullable<BindGroup> = null;\r\n private static _bindgroupPacked: Nullable<BindGroup> = null;\r\n private _saoScale: number;\r\n private _saoBias: number;\r\n private _saoIntensity: number;\r\n private _saoRadius: number;\r\n private _saoMinResolution: number;\r\n private readonly _saoRandomSeed: number;\r\n private _saoBlurDepthCutoff: number;\r\n private readonly _blitterH: DepthLimitAOBlurBlitter;\r\n private readonly _blitterV: DepthLimitAOBlurBlitter;\r\n private _supported: boolean;\r\n /**\r\n * Creates an instance of SAO post effect\r\n */\r\n constructor() {\r\n super();\r\n this._supported = true;\r\n this._layer = PostEffectLayer.opaque;\r\n this._saoScale = 10;\r\n this._saoBias = 1;\r\n this._saoIntensity = 0.025;\r\n this._saoRadius = 100;\r\n this._saoMinResolution = 0;\r\n this._saoRandomSeed = 0;\r\n this._saoBlurDepthCutoff = 2;\r\n this._blitterH = new DepthLimitAOBlurBlitter(false);\r\n this._blitterH.kernelRadius = 8;\r\n this._blitterH.stdDev = 10;\r\n this._blitterV = new DepthLimitAOBlurBlitter(true);\r\n this._blitterV.kernelRadius = 8;\r\n this._blitterV.stdDev = 10;\r\n }\r\n /** Scale value */\r\n get scale() {\r\n return this._saoScale;\r\n }\r\n set scale(val) {\r\n this._saoScale = val;\r\n }\r\n /** Bias value */\r\n get bias() {\r\n return this._saoBias;\r\n }\r\n set bias(val) {\r\n this._saoBias = val;\r\n }\r\n /** Radius value */\r\n get radius() {\r\n return this._saoRadius;\r\n }\r\n set radius(val) {\r\n this._saoRadius = val;\r\n }\r\n /** SAO intensity */\r\n get intensity() {\r\n return this._saoIntensity;\r\n }\r\n set intensity(val) {\r\n this._saoIntensity = val;\r\n }\r\n /** Minimum resolution */\r\n get minResolution() {\r\n return this._saoMinResolution;\r\n }\r\n set minResolution(val) {\r\n this._saoMinResolution = val;\r\n }\r\n /** Blur kernel size */\r\n get blurKernelSize() {\r\n return this._blitterH.kernelRadius;\r\n }\r\n set blurKernelSize(val) {\r\n val = Math.min(64, Math.max(0, val >> 0));\r\n this._blitterH.kernelRadius = val;\r\n this._blitterV.kernelRadius = val;\r\n }\r\n /** Gaussian blur stddev value */\r\n get blurStdDev() {\r\n return this._blitterH.stdDev;\r\n }\r\n set blurStdDev(val) {\r\n this._blitterH.stdDev = val;\r\n this._blitterV.stdDev = val;\r\n }\r\n /** Cutoff of depth limited blur */\r\n get blurDepthCutoff() {\r\n return this._saoBlurDepthCutoff;\r\n }\r\n set blurDepthCutoff(val) {\r\n this._saoBlurDepthCutoff = val;\r\n }\r\n /** {@inheritDoc AbstractPostEffect.requireLinearDepthTexture} */\r\n requireLinearDepthTexture() {\r\n return true;\r\n }\r\n /** {@inheritDoc AbstractPostEffect.requireDepthAttachment} */\r\n requireDepthAttachment() {\r\n return true;\r\n }\r\n /** {@inheritDoc AbstractPostEffect.apply} */\r\n apply(ctx: DrawContext, inputColorTexture: Texture2D, sceneDepthTexture: Texture2D, srgbOutput: boolean) {\r\n const device = ctx.device;\r\n const viewport = device.getViewport();\r\n this._prepare(device, inputColorTexture);\r\n this.passThrough(ctx, inputColorTexture, srgbOutput);\r\n if (!this._supported) {\r\n return;\r\n }\r\n const fmt = this._getIntermediateTextureFormat(device);\r\n const depth = device.getFramebuffer()!.getDepthAttachment() as Texture2D;\r\n\r\n const fbao = device.pool.fetchTemporalTexture2D(false, fmt, depth.width, depth.height, false);\r\n const fbblur = device.pool.fetchTemporalTexture2D(false, fmt, depth.width, depth.height, false);\r\n const packed = fbao.format === 'rgba8unorm';\r\n const cameraNearFar = new Vector2(ctx.camera.getNearPlane(), ctx.camera.getFarPlane());\r\n device.pushDeviceStates();\r\n device.setFramebuffer([fbao], depth);\r\n device.clearFrameBuffer(packed ? new Vector4(0, 0, 0, 1) : new Vector4(1, 0, 0, 1), null, null);\r\n const bindgroup = packed ? SAO._bindgroupPacked! : SAO._bindgroup!;\r\n bindgroup.setValue('flip', this.needFlip(device) ? 1 : 0);\r\n bindgroup.setTexture('depthTex', sceneDepthTexture, fetchSampler('clamp_nearest_nomip'));\r\n bindgroup.setValue('scale', this._saoScale);\r\n bindgroup.setValue('invProj', Matrix4x4.invert(ctx.camera.getProjectionMatrix()));\r\n bindgroup.setValue('bias', this._saoBias);\r\n bindgroup.setValue('cameraNearFar', cameraNearFar);\r\n bindgroup.setValue('intensity', this._saoIntensity);\r\n bindgroup.setValue('kernelRadius', this._saoRadius);\r\n bindgroup.setValue('minResolution', this._saoMinResolution);\r\n bindgroup.setValue('size', new Vector2(viewport.width, viewport.height));\r\n bindgroup.setValue('randomSeed', this._saoRandomSeed);\r\n device.setRenderStates(SAO._renderState);\r\n device.setProgram(packed ? SAO._programPacked : SAO._program);\r\n device.setBindGroup(0, bindgroup);\r\n this.drawFullscreenQuad(SAO._renderState!);\r\n this._blitterH.size = new Vector2(inputColorTexture.width, inputColorTexture.height);\r\n this._blitterH.depthTex = sceneDepthTexture;\r\n this._blitterH.depthCutoff = this._saoBlurDepthCutoff;\r\n this._blitterH.sampler = fetchSampler('clamp_nearest_nomip');\r\n this._blitterH.cameraNearFar = cameraNearFar;\r\n this._blitterH.packed = packed;\r\n this._blitterH.renderStates = SAO._renderState;\r\n this._blitterV.size = new Vector2(inputColorTexture.width, inputColorTexture.height);\r\n this._blitterV.depthTex = sceneDepthTexture;\r\n this._blitterV.depthCutoff = this._saoBlurDepthCutoff;\r\n this._blitterV.sampler = fetchSampler('clamp_nearest_nomip');\r\n this._blitterV.cameraNearFar = cameraNearFar;\r\n this._blitterV.packed = packed;\r\n this._blitterV.srgbOut = srgbOutput;\r\n this._blitterV.renderStates = SAO._renderStateBlend;\r\n this._blitterH.blit(fbao, fbblur);\r\n device.popDeviceStates();\r\n this._blitterV.blit(fbblur, device.getFramebuffer()!);\r\n device.pool.releaseTexture(fbao);\r\n device.pool.releaseTexture(fbblur);\r\n }\r\n private _getIntermediateTextureFormat(device: AbstractDevice) {\r\n const texCaps = device.getDeviceCaps().textureCaps;\r\n return device.type === 'webgl' ||\r\n (!texCaps.supportHalfFloatColorBuffer && !texCaps.supportFloatColorBuffer)\r\n ? 'rgba8unorm'\r\n : texCaps.supportHalfFloatColorBuffer\r\n ? 'r16f'\r\n : 'r32f';\r\n }\r\n /** @internal */\r\n private _prepare(device: AbstractDevice, _srcTexture: Texture2D) {\r\n const fb = device.getFramebuffer();\r\n const isFloatFramebuffer = fb && isFloatTextureFormat(fb.getColorAttachments()[0].format);\r\n this._supported = !isFloatFramebuffer || device.getDeviceCaps().framebufferCaps.supportFloatBlending;\r\n if (this._supported) {\r\n if (!SAO._renderState) {\r\n SAO._renderState = device.createRenderStateSet();\r\n SAO._renderState.useDepthState().enableTest(true).enableWrite(false).setCompareFunc('gt');\r\n SAO._renderState.useRasterizerState().setCullMode('none');\r\n SAO._renderStateBlend = device.createRenderStateSet();\r\n SAO._renderStateBlend.useDepthState().enableTest(true).enableWrite(false).setCompareFunc('gt');\r\n SAO._renderStateBlend.useRasterizerState().setCullMode('none');\r\n SAO._renderStateBlend\r\n .useBlendingState()\r\n .enable(true)\r\n .setBlendFuncRGB('zero', 'src-color')\r\n .setBlendFuncAlpha('zero', 'one');\r\n }\r\n function createProgram(packed: boolean) {\r\n const program = device.buildRenderProgram({\r\n vertex(pb) {\r\n this.flip = pb.int().uniform(0);\r\n this.$inputs.pos = pb.vec2().attrib('position');\r\n this.$outputs.uv = pb.vec2();\r\n pb.main(function () {\r\n this.$builtins.position = pb.vec4(this.$inputs.pos, 1, 1);\r\n this.$outputs.uv = pb.add(pb.mul(this.$inputs.pos.xy, 0.5), pb.vec2(0.5));\r\n this.$if(pb.notEqual(this.flip, 0), function () {\r\n this.$builtins.position.y = pb.neg(this.$builtins.position.y);\r\n });\r\n });\r\n },\r\n fragment(pb) {\r\n this.depthTex = pb.tex2D().sampleType('unfilterable-float').uniform(0);\r\n this.scale = pb.float().uniform(0);\r\n this.invProj = pb.mat4().uniform(0);\r\n this.cameraNearFar = pb.vec2().uniform(0);\r\n this.intensity = pb.float().uniform(0);\r\n this.bias = pb.float().uniform(0);\r\n this.kernelRadius = pb.float().uniform(0);\r\n this.minResolution = pb.float().uniform(0);\r\n this.size = pb.vec2().uniform(0);\r\n this.randomSeed = pb.float().uniform(0);\r\n this.$l.scaleDividedByCameraFar = pb.float();\r\n this.$l.minResolutionMultipliedByCameraFar = pb.float();\r\n pb.func('rand', [pb.vec2('uv')], function () {\r\n this.$l.a = 12.9898;\r\n this.$l.b = 78.233;\r\n this.$l.c = 43758.5453;\r\n this.$l.dt = pb.dot(this.uv, pb.vec2(this.a, this.b));\r\n this.$l.sn = pb.mod(this.dt, Math.PI);\r\n this.$return(pb.fract(pb.mul(pb.sin(this.sn), this.c)));\r\n });\r\n pb.func('getPositionVS', [pb.vec2('uv')], function () {\r\n this.$l.depthValue = pb.textureSample(this.depthTex, this.uv);\r\n if (device.type === 'webgl') {\r\n this.$l.linearDepth = decodeNormalizedFloatFromRGBA(this, this.depthValue);\r\n } else {\r\n this.$l.linearDepth = this.depthValue.r;\r\n }\r\n this.$l.nonLinearDepth = pb.div(\r\n pb.sub(pb.div(this.cameraNearFar.x, this.linearDepth), this.cameraNearFar.y),\r\n pb.sub(this.cameraNearFar.x, this.cameraNearFar.y)\r\n );\r\n this.$l.clipSpacePos = pb.vec4(\r\n pb.sub(pb.mul(this.uv, 2), pb.vec2(1)),\r\n pb.sub(pb.mul(this.nonLinearDepth, 2), 1),\r\n 1\r\n );\r\n // this.$l.clipSpacePos = pb.vec4(this.uv, this.nonLinearDepth, 1);\r\n this.$l.vPos = pb.mul(this.invProj, this.clipSpacePos);\r\n this.vPos = pb.div(this.vPos, this.vPos.w);\r\n this.$return(this.vPos.xyz);\r\n });\r\n pb.func(\r\n 'getOcclusion',\r\n [pb.vec3('centerPos'), pb.vec3('centerNormal'), pb.vec3('samplePos')],\r\n function () {\r\n this.$l.viewDelta = pb.sub(this.samplePos, this.centerPos);\r\n this.$l.viewDistance = pb.length(this.viewDelta);\r\n this.$l.scaledScreenDistance = pb.mul(this.scaleDividedByCameraFar, this.viewDistance);\r\n this.$return(\r\n pb.div(\r\n pb.max(\r\n 0,\r\n pb.sub(\r\n pb.div(\r\n pb.sub(\r\n pb.dot(this.centerNormal, this.viewDelta),\r\n this.minResolutionMultipliedByCameraFar\r\n ),\r\n this.scaledScreenDistance\r\n ),\r\n this.bias\r\n )\r\n ),\r\n pb.add(pb.mul(this.scaledScreenDistance, this.scaledScreenDistance), 1)\r\n )\r\n );\r\n }\r\n );\r\n pb.func('getAO', [pb.vec3('vPos')], function () {\r\n this.scaleDividedByCameraFar = pb.div(this.scale, this.cameraNearFar.y);\r\n this.minResolutionMultipliedByCameraFar = pb.mul(this.minResolution, this.cameraNearFar.y);\r\n this.$l.centerViewNormal = pb.normalize(pb.cross(pb.dpdx(this.vPos), pb.dpdy(this.vPos)));\r\n this.$l.angle = pb.mul(\r\n this.rand(pb.add(this.$inputs.uv, pb.vec2(this.randomSeed))),\r\n Math.PI * 2\r\n );\r\n this.$l.radius = pb.div(pb.vec2(pb.mul(this.kernelRadius, 1 / NUM_SAMPLES)), this.size);\r\n this.$l.radiusStep = this.radius;\r\n this.$l.occlusionSum = pb.float(0);\r\n this.$l.weightSum = pb.float(0);\r\n this.$for(pb.int('i'), 0, NUM_SAMPLES, function () {\r\n this.$l.sampleUV = pb.add(\r\n this.$inputs.uv,\r\n pb.mul(pb.vec2(pb.cos(this.angle), pb.sin(this.angle)), this.radius)\r\n );\r\n this.radius = pb.add(this.radius, this.radiusStep);\r\n this.angle = pb.add(this.angle, (Math.PI * NUM_RINGS) / NUM_SAMPLES);\r\n this.samplePos = this.getPositionVS(this.sampleUV);\r\n this.occlusionSum = pb.add(\r\n this.occlusionSum,\r\n this.getOcclusion(this.vPos, this.centerViewNormal, this.samplePos)\r\n );\r\n this.weightSum = pb.add(this.weightSum, 1);\r\n });\r\n this.$if(pb.equal(this.weightSum, 0), function () {\r\n pb.discard();\r\n });\r\n this.$return(pb.div(pb.mul(this.occlusionSum, this.intensity), this.weightSum));\r\n });\r\n pb.main(function () {\r\n this.$l.vPos = this.getPositionVS(this.$inputs.uv);\r\n this.$l.ao = pb.clamp(pb.sub(1, this.getAO(this.vPos)), 0, packed ? 0.999 : 1);\r\n if (packed) {\r\n this.$outputs.outColor = encodeNormalizedFloatToRGBA(this, this.ao);\r\n } else {\r\n this.$outputs.outColor = pb.vec4(this.ao, this.ao, this.ao, 1);\r\n }\r\n });\r\n }\r\n })!;\r\n program.name = packed ? '@SAO_Packed' : '@SAO';\r\n return program;\r\n }\r\n if (!SAO._program) {\r\n SAO._program = createProgram(false);\r\n SAO._programPacked = createProgram(true);\r\n SAO._bindgroup = device.createBindGroup(SAO._program.bindGroupLayouts[0]);\r\n SAO._bindgroupPacked = device.createBindGroup(SAO._programPacked.bindGroupLayouts[0]);\r\n }\r\n }\r\n }\r\n}\r\n"],"names":["NUM_SAMPLES","NUM_RINGS","DepthLimitAOBlurBlitter","BilateralBlurBlitter","_packed","finalPhase","packed","val","invalidateHash","calcHash","readTexel","scope","type","srcTex","srcUV","srcLayer","sampleType","pb","$builder","texel","vec4","vec3","decodeNormalizedFloatFromRGBA","rrr","writeTexel","uv","outTexel","_finalPhase","encodeNormalizedFloatToRGBA","r","SAO","AbstractPostEffect","_program","_programPacked","_renderState","_renderStateBlend","_bindgroup","_bindgroupPacked","_saoScale","_saoBias","_saoIntensity","_saoRadius","_saoMinResolution","_saoRandomSeed","_saoBlurDepthCutoff","_blitterH","_blitterV","_supported","_layer","PostEffectLayer","opaque","kernelRadius","stdDev","scale","bias","radius","intensity","minResolution","blurKernelSize","Math","min","max","blurStdDev","blurDepthCutoff","requireLinearDepthTexture","requireDepthAttachment","apply","ctx","inputColorTexture","sceneDepthTexture","srgbOutput","device","viewport","getViewport","_prepare","passThrough","fmt","_getIntermediateTextureFormat","depth","getFramebuffer","getDepthAttachment","fbao","pool","fetchTemporalTexture2D","width","height","fbblur","format","cameraNearFar","Vector2","camera","getNearPlane","getFarPlane","pushDeviceStates","setFramebuffer","clearFrameBuffer","Vector4","bindgroup","setValue","needFlip","setTexture","fetchSampler","Matrix4x4","invert","getProjectionMatrix","setRenderStates","setProgram","setBindGroup","drawFullscreenQuad","size","depthTex","depthCutoff","sampler","renderStates","srgbOut","blit","popDeviceStates","releaseTexture","texCaps","getDeviceCaps","textureCaps","supportHalfFloatColorBuffer","supportFloatColorBuffer","_srcTexture","fb","isFloatFramebuffer","isFloatTextureFormat","getColorAttachments","framebufferCaps","supportFloatBlending","createRenderStateSet","useDepthState","enableTest","enableWrite","setCompareFunc","useRasterizerState","setCullMode","useBlendingState","enable","setBlendFuncRGB","setBlendFuncAlpha","createProgram","program","buildRenderProgram","vertex","flip","int","uniform","$inputs","pos","vec2","attrib","$outputs","main","$builtins","position","add","mul","xy","$if","notEqual","y","neg","fragment","tex2D","float","invProj","mat4","randomSeed","$l","scaleDividedByCameraFar","minResolutionMultipliedByCameraFar","func","a","b","c","dt","dot","sn","mod","PI","$return","fract","sin","depthValue","textureSample","linearDepth","nonLinearDepth","div","sub","x","clipSpacePos","vPos","w","xyz","viewDelta","samplePos","centerPos","viewDistance","length","scaledScreenDistance","centerNormal","centerViewNormal","normalize","cross","dpdx","dpdy","angle","rand","radiusStep","occlusionSum","weightSum","$for","sampleUV","cos","getPositionVS","getOcclusion","equal","discard","ao","clamp","getAO","outColor","name","createBindGroup","bindGroupLayouts"],"mappings":";;;;;;;AAmBA,MAAMA,WAAc,GAAA,CAAA;AACpB,MAAMC,SAAY,GAAA,CAAA;AAElB,MAAMC,uBAAgCC,SAAAA,oBAAAA,CAAAA;IAC5BC,OAAiB;AACzB,IAAA,WAAA,CAAYC,UAAmB,CAAE;AAC/B,QAAA,KAAK,CAACA,UAAAA,CAAAA;QACN,IAAI,CAACD,OAAO,GAAG,KAAA;AACjB;AACA,IAAA,IAAIE,MAAS,GAAA;QACX,OAAO,IAAI,CAACF,OAAO;AACrB;IACA,IAAIE,MAAAA,CAAOC,G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