UNPKG

threepipe

Version:

A modern 3D viewer framework built on top of three.js, written in TypeScript, designed to make creating high-quality, modular, and extensible 3D experiences on the web simple and enjoyable.

74 lines 3.01 kB
import { WebGLRenderTarget } from 'three'; import { IPassID, IPipelinePass } from '../../postprocessing'; import { ThreeViewer } from '../../viewer'; import { PipelinePassPlugin } from '../base/PipelinePassPlugin'; import { IWebGLRenderer } from '../../core'; import { AddBlendTexturePass } from '../../postprocessing/AddBlendTexturePass'; import { ValOrFunc } from 'ts-browser-helpers'; import { ProgressivePlugin } from './ProgressivePlugin'; import { IRenderTarget } from '../../rendering'; /** * FrameFade Plugin * * Adds a post-render pass to smoothly fade to a new rendered frame over time. * This is useful for example when changing the camera position, material, object properties, etc to avoid a sudden jump. * @category Plugins */ export declare class FrameFadePlugin extends PipelinePassPlugin<FrameFadeBlendPass, 'frameFade'> { readonly passId = "frameFade"; static readonly PluginType = "FrameFadePlugin"; dependencies: (typeof ProgressivePlugin)[]; isEditor: boolean; fadeOnActiveCameraChange: boolean; fadeOnMaterialUpdate: boolean; fadeOnSceneUpdate: boolean; protected _pointerEnabled: boolean; protected _target?: IRenderTarget; constructor(enabled?: boolean); saveFrameTimeThreshold: number; /** * Start a frame fade transition. * Note that the current frame data will only be used if the last running transition is ended or near the end. To do it anyway, call {@link stopTransition} first * @param duration */ startTransition(duration: number): Promise<void>; /** * Stop a frame fade transition if running. Note that it will be stopped next frame. */ stopTransition(): void; onAdded(viewer: ThreeViewer): void; onRemove(viewer: ThreeViewer): void; private _fadeCam; private _fadeMat; private _fadeScene; private _fadeObjectUpdate; private _onPointerMove; setDirty(): void; get dirty(): boolean; set dirty(_: boolean); protected _createPass(): FrameFadeBlendPass; get canFrameFade(): boolean | undefined; get lastFrame(): import('three').Texture<import('three').TextureEventMap> | undefined; get target(): IRenderTarget | undefined; protected _beforeRender(): boolean; } export declare class FrameFadeBlendPass extends AddBlendTexturePass implements IPipelinePass { readonly passId: IPassID; plugin: FrameFadePlugin; before: string[]; after: string[]; required: string[]; dirty: ValOrFunc<boolean>; fadeTime: number; fadeTimeState: number; toSaveFrame: boolean; private _lastTime; constructor(passId: IPassID, plugin: FrameFadePlugin, maxIntensity?: number); render(renderer: IWebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, deltaTime: number, maskActive: boolean): void; } declare module '../../core/IObject' { interface IObjectSetDirtyOptions { frameFade?: boolean; } } //# sourceMappingURL=../../src/plugins/pipeline/FrameFadePlugin.d.ts.map