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.

91 lines (90 loc) 4.25 kB
/** This file must only contain pure code and pure imports */ import { __esDecorate, __runInitializers } from "../tslib.es6.js"; import { PostProcess } from "./postProcess.pure.js"; import { serialize } from "../Misc/decorators.js"; import { ThinExtractHighlightsPostProcess } from "./thinExtractHighlightsPostProcess.js"; import { RegisterClass } from "../Misc/typeStore.js"; /** * The extract highlights post process sets all pixels to black except pixels above the specified luminance threshold. Used as the first step for a bloom effect. */ let ExtractHighlightsPostProcess = (() => { var _a; let _classSuper = PostProcess; let _instanceExtraInitializers = []; let _get_threshold_decorators; return _a = class ExtractHighlightsPostProcess extends _classSuper { /** * The luminance threshold, pixels below this value will be set to black. */ get threshold() { return this._effectWrapper.threshold; } set threshold(value) { this._effectWrapper.threshold = value; } /** @internal */ get _exposure() { return this._effectWrapper._exposure; } /** @internal */ set _exposure(value) { this._effectWrapper._exposure = value; } /** * Gets a string identifying the name of the class * @returns "ExtractHighlightsPostProcess" string */ getClassName() { return "ExtractHighlightsPostProcess"; } constructor(name, options, camera = null, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) { const localOptions = { uniforms: ThinExtractHighlightsPostProcess.Uniforms, size: typeof options === "number" ? options : undefined, camera, samplingMode, engine, reusable, textureType, blockCompilation, ...options, }; super(name, ThinExtractHighlightsPostProcess.FragmentUrl, { effectWrapper: typeof options === "number" || !options.effectWrapper ? new ThinExtractHighlightsPostProcess(name, engine, localOptions) : undefined, ...localOptions, }); /** * Post process which has the input texture to be used when performing highlight extraction * @internal */ this._inputPostProcess = (__runInitializers(this, _instanceExtraInitializers), null); this.onApplyObservable.add((effect) => { this.externalTextureSamplerBinding = !!this._inputPostProcess; if (this._inputPostProcess) { effect.setTextureFromPostProcess("textureSampler", this._inputPostProcess); } }); } }, (() => { const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0; _get_threshold_decorators = [serialize()]; __esDecorate(_a, null, _get_threshold_decorators, { kind: "getter", name: "threshold", static: false, private: false, access: { has: obj => "threshold" in obj, get: obj => obj.threshold }, metadata: _metadata }, null, _instanceExtraInitializers); if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata }); })(), _a; })(); export { ExtractHighlightsPostProcess }; let _Registered = false; /** * Register side effects for extractHighlightsPostProcess. * Safe to call multiple times; only the first call has an effect. */ export function RegisterExtractHighlightsPostProcess() { if (_Registered) { return; } _Registered = true; RegisterClass("BABYLON.ExtractHighlightsPostProcess", ExtractHighlightsPostProcess); } //# sourceMappingURL=extractHighlightsPostProcess.pure.js.map