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.

49 lines 2.2 kB
import { AViewerPluginSync, ThreeViewer } from '../../viewer'; import { IRenderTarget } from '../../rendering'; import { ValOrArr, ValOrFunc } from 'ts-browser-helpers'; import { ShaderMaterial } from 'three'; import { ITexture } from '../../core'; export interface RenderTargetBlock { target: ValOrFunc<IRenderTarget | { texture?: ValOrArr<ITexture>; } | undefined | null>; name: string; visible: boolean; transparent: boolean; originalColorSpace: boolean; div: HTMLDivElement; material?: ShaderMaterial; } /** * RenderTargetPreviewPlugin is a useful development and debugging plugin that renders any registered render-target to the screen in small collapsable panels. * * @category Plugins */ export declare class RenderTargetPreviewPlugin extends AViewerPluginSync { static readonly PluginType = "RenderTargetPreviewPlugin"; enabled: boolean; toJSON: any; mainDiv: HTMLDivElement; stylesheet?: HTMLStyleElement; constructor(enabled?: boolean); targetBlocks: RenderTargetBlock[]; onAdded(viewer: ThreeViewer): void; onRemove(viewer: ThreeViewer): void; private _postRender; /** * * @param target - render target or a function that returns a render target * @param name - name of the target * @param transparent - if true, the target will be rendered with transparency * @param originalColorSpace - if true, the target will be rendered in its original color space * @param visible - initial visibility * @param material - snippet for {@link ExtendedCopyPass} or a custom {@link ExtendedShaderMaterial} or three.js ShaderMaterial. Example to read just the red channel `(s)=>s + ' = vec4(' + s + '.r);'` */ addTarget(target: RenderTargetBlock['target'], name: string, transparent?: boolean, originalColorSpace?: boolean, visible?: boolean, material?: ValOrFunc<string, [string]> | ShaderMaterial): this; removeTarget(target: RenderTargetBlock['target']): this; downloadTarget(target1: RenderTargetBlock['target']): this; refreshUi(): void; setDirty(): void; dispose(): void; } //# sourceMappingURL=../../src/plugins/ui/RenderTargetPreviewPlugin.d.ts.map