UNPKG

@babylonjs/core

Version:

Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.

36 lines 1.71 kB
import { ThinSelectionOutlineLayer } from "../../../Layers/thinSelectionOutlineLayer.js"; import { FrameGraphBaseLayerTask } from "./baseLayerTask.js"; /** * Task which applies a selection outline effect to a texture. */ export class FrameGraphSelectionOutlineLayerTask extends FrameGraphBaseLayerTask { /** * Constructs a new selection outline layer task. * @param name Name of the task. * @param frameGraph The frame graph this task is associated with. * @param scene The scene to render the selection outline layer in. * @param options Options for the selection outline layer. */ constructor(name, frameGraph, scene, options) { super(name, frameGraph, scene, new ThinSelectionOutlineLayer(name, scene, options, true), 0, "none" /* FrameGraphBaseLayerBlurType.None */, false, false, false); this._objectRendererForLayerTask.objectList = { meshes: this.layer._selection || [], particleSystems: [], }; } getClassName() { return "FrameGraphSelectionOutlineLayerTask"; } record() { if (this.depthTexture === undefined) { throw new Error(`FrameGraphSelectionOutlineLayerTask "${this.name}": depthTexture is required`); } super.record(false, (context, effect) => { context.bindTextureHandle(effect, "depthSampler", this.depthTexture); context.bindTextureHandle(effect, "maskSampler", this._objectRendererForLayerTask.outputTexture); }); this.layer.textureWidth = this._layerTextureDimensions.width; this.layer.textureHeight = this._layerTextureDimensions.height; } } //# sourceMappingURL=selectionOutlineTask.js.map