@threepipe/webgi-plugins
Version:
WebGi - Realistic Rendering Plugins for ThreePipe.
123 lines • 4.91 kB
TypeScript
import { AScreenPassExtensionPlugin, Color, GBufferPlugin, ICamera, IMaterial, IObject3D, IPassID, IPipelinePass, IRenderManager, IScene, IUniform, IWebGLRenderer, PickingPlugin, RenderPass, ShaderMaterial, Texture, TextureDataType, ThreeViewer, UiObjectConfig, ValOrFunc, Vector2, WebGLRenderTarget } from 'threepipe';
export type OutlinePluginTarget = WebGLRenderTarget;
export type OutlinePluginPass = OutlineRenderPass<'outline', OutlinePluginTarget | undefined>;
/**
* Outline Plugin
* Adds an extension to {@link ScreenPass} material and a RenderPass to render the outlines and highlights of the selected objects.
* It interfaces with the {@link PickingPlugin} to render the outlines of the selected objects.
* The intensity, thickness, etc of the effect can be controlled with the `intensity`(previously outlineIntensity), `thickness` etc properties.
*
* @category Plugins
*/
export declare class OutlinePlugin extends AScreenPassExtensionPlugin {
readonly passId = "outline";
static readonly PluginType = "OutlinePlugin";
static readonly OldPluginType = "Outline";
readonly extraUniforms: {
readonly outlineIntensity: {
readonly value: 1;
};
readonly outlineThickness: {
readonly value: 2;
};
readonly highlightTransparency: {
readonly value: 1;
};
readonly outlineColor: {
readonly value: Color;
};
readonly enableHighlight: {
readonly value: true;
};
readonly dpr: IUniform<number>;
readonly outlineBuffer: {
readonly value: null;
};
readonly tDiffuseSize: {
readonly value: Vector2;
};
};
extraDefines: {
readonly DEBUG_OUTLINE: "0";
};
/**
* The priority of the material extension when applied to the material in ScreenPass
* set to very low priority, so applied at the end.
*/
priority: number;
enabled: boolean;
enableHighlight: boolean;
enableDynamicSelection: boolean;
intensity: number;
highlightTransparency: number;
color: Color;
thickness: number;
debugOutline: boolean;
highlightSelectedMaterials: boolean;
highlightMaterialSameNames: boolean;
/**
* Highlight Transparency.
*
* For internal use, don't change. use {@link highlightTransparency} instead.
*/
transparency: number;
parsFragmentSnippet: () => string;
protected _shaderPatch: string;
constructor(enabled?: boolean, bufferType?: TextureDataType);
dependencies: (typeof GBufferPlugin | typeof PickingPlugin)[];
private _pickingWidgetDisabled;
setDirty(): void;
protected _pass?: OutlinePluginPass;
onAdded(viewer: ThreeViewer): void;
onRemove(viewer: ThreeViewer): void;
target?: OutlinePluginTarget;
texture?: Texture;
readonly material: ShaderMaterial;
readonly bufferType: TextureDataType;
protected _createTarget(recreate?: boolean): void;
protected _disposeTarget(): void;
private _getSelectedObject;
protected _createPass(): OutlineRenderPass<"outline", OutlinePluginTarget | undefined>;
protected _viewerListeners: {
preRender: () => void;
};
mouseInOutAnimationEnabled: boolean;
private _state;
private _animationCallBack?;
private _startTransparencyAnimation;
get outlineIntensity(): number;
set outlineIntensity(v: number);
get outlineColor(): number;
set outlineColor(v: number);
}
type SelType = IObject3D | IMaterial | IObject3D[] | IMaterial[] | undefined;
export declare class OutlineRenderPass<TP extends IPassID = IPassID, T extends WebGLRenderTarget | undefined = WebGLRenderTarget | undefined> extends RenderPass implements IPipelinePass<TP> {
readonly passId: TP;
private _getSelectedObjectOrMaterial;
target: ValOrFunc<T>;
readonly isOutlineRenderPass = true;
uiConfig: UiObjectConfig;
enabled: boolean;
scene?: IScene;
before: string[];
after: string[];
required: string[];
overrideMaterial: ShaderMaterial;
constructor(passId: TP, _getSelectedObjectOrMaterial: () => SelType, target: ValOrFunc<T>, overrideMaterial: ShaderMaterial);
/**
* Renders to {@link target}
* @param renderer
* @param writeBuffer - this is ignored? or used as transmissionRenderTarget?
* @param _1 - this is ignored
* @param deltaTime
* @param maskActive
*/
render(renderer: IWebGLRenderer, writeBuffer?: WebGLRenderTarget<Texture | Texture[]> | null, _1?: WebGLRenderTarget<Texture | Texture[]>, deltaTime?: number, maskActive?: boolean): void;
private _renderSelectedObject;
onDirty: (() => void)[];
dispose(): void;
setDirty(): void;
beforeRender(scene: IScene, camera: ICamera, _: IRenderManager): void;
}
export {};
//# sourceMappingURL=OutlinePlugin.d.ts.map