UNPKG

@needle-tools/engine

Version:

Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.

91 lines (90 loc) 3.15 kB
import type { Effect } from "postprocessing"; import type { EditorModification, IEditorModification as IEditorModificationReceiver } from "../../engine/engine_editor-sync.js"; import { Behaviour } from "../Component.js"; import { PostProcessingEffect } from "./PostProcessingEffect.js"; import { IPostProcessingManager } from "./utils.js"; import { VolumeProfile } from "./VolumeProfile.js"; /** The Volume/PostprocessingManager component is responsible for managing post processing effects. * Add this component to any object in your scene to enable post processing effects. * * @example Add bloom * ```ts * const volume = new Volume(); * volume.addEffect(new BloomEffect({ * intensity: 3, * luminanceThreshold: .2 * })); * gameObject.addComponent(volume); * ``` * * @example Remove bloom * ```ts * volume.removeEffect(bloom); * ``` * * @example Add pixelation * ```ts * const pixelation = new PixelationEffect(); * pixelation.granularity.value = 10; * volume.addEffect(pixelation); * ``` * * @category Rendering * @category Effects * @group Components */ export declare class Volume extends Behaviour implements IEditorModificationReceiver, IPostProcessingManager { get isPostProcessingManager(): boolean; /** Currently active postprocessing effects */ get effects(): PostProcessingEffect[]; get dirty(): boolean; set dirty(value: boolean); sharedProfile?: VolumeProfile; /** * Set multisampling to "auto" to automatically adjust the multisampling level based on performance. * Set to a number to manually set the multisampling level. * @default "auto" * @min 0 * @max renderer.capabilities.maxSamples */ multisampling: "auto" | number; /** * Add a post processing effect to the stack and schedules the effect stack to be re-created. */ addEffect<T extends PostProcessingEffect | Effect>(effect: T): T; /** * Remove a post processing effect from the stack and schedules the effect stack to be re-created. */ removeEffect<T extends PostProcessingEffect | Effect>(effect: T): T; private _postprocessing?; private readonly _activeEffects; private readonly _effects; /** * When dirty the post processing effects will be re-applied */ markDirty(): void; /** @internal */ awake(): void; private _componentEnabledTime; private _multisampleAutoChangeTime; private _multisampleAutoDecreaseTime; /** @internal */ onEnable(): void; /** @internal */ onDisable(): void; /** @internal */ onBeforeRender(): void; /** @internal */ onDestroy(): void; private _lastApplyTime?; private _rapidApplyCount; private _isDirty; private apply; private _applyPostQueue; /** called from needle editor sync package if its active */ onEditorModification(modification: EditorModification): void | boolean | undefined; private _modificationQueue?; private _recreateId; private scheduleRecreate; } export { Volume as PostProcessingManager };