777e3e193ce29bc7bb542aa480286a0997c03002a1cdbde4963a55eff12728d3.json 5.5 KB

1
  1. {"ast":null,"code":"import { EffectWrapper } from \"../Materials/effectRenderer.js\";\nimport { ToGammaSpace } from \"../Maths/math.constants.js\";\nimport { Engine } from \"../Engines/engine.js\";\n/**\n * Post process used to extract highlights.\n */\nexport class ThinExtractHighlightsPostProcess extends EffectWrapper {\n _gatherImports(useWebGPU, list) {\n if (useWebGPU) {\n this._webGPUReady = true;\n list.push(import(\"../ShadersWGSL/extractHighlights.fragment.js\"));\n } else {\n list.push(import(\"../Shaders/extractHighlights.fragment.js\"));\n }\n }\n /**\n * Constructs a new extract highlights post process\n * @param name Name of the effect\n * @param engine Engine to use to render the effect. If not provided, the last created engine will be used\n * @param options Options to configure the effect\n */\n constructor(name, engine = null, options) {\n super({\n ...options,\n name,\n engine: engine || Engine.LastCreatedEngine,\n useShaderStore: true,\n useAsPostProcess: true,\n fragmentShader: ThinExtractHighlightsPostProcess.FragmentUrl,\n uniforms: ThinExtractHighlightsPostProcess.Uniforms\n });\n /**\n * The luminance threshold, pixels below this value will be set to black.\n */\n this.threshold = 0.9;\n /** @internal */\n this._exposure = 1;\n }\n bind() {\n super.bind();\n const effect = this._drawWrapper.effect;\n effect.setFloat(\"threshold\", Math.pow(this.threshold, ToGammaSpace));\n effect.setFloat(\"exposure\", this._exposure);\n }\n}\n/**\n * The fragment shader url\n */\nThinExtractHighlightsPostProcess.FragmentUrl = \"extractHighlights\";\n/**\n * The list of uniforms used by the effect\n */\nThinExtractHighlightsPostProcess.Uniforms = [\"threshold\", \"exposure\"];","map":{"version":3,"names":["EffectWrapper","ToGammaSpace","Engine","ThinExtractHighlightsPostProcess","_gatherImports","useWebGPU","list","_webGPUReady","push","constructor","name","engine","options","LastCreatedEngine","useShaderStore","useAsPostProcess","fragmentShader","FragmentUrl","uniforms","Uniforms","threshold","_exposure","bind","effect","_drawWrapper","setFloat","Math","pow"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/PostProcesses/thinExtractHighlightsPostProcess.js"],"sourcesContent":["import { EffectWrapper } from \"../Materials/effectRenderer.js\";\nimport { ToGammaSpace } from \"../Maths/math.constants.js\";\nimport { Engine } from \"../Engines/engine.js\";\n/**\n * Post process used to extract highlights.\n */\nexport class ThinExtractHighlightsPostProcess extends EffectWrapper {\n _gatherImports(useWebGPU, list) {\n if (useWebGPU) {\n this._webGPUReady = true;\n list.push(import(\"../ShadersWGSL/extractHighlights.fragment.js\"));\n }\n else {\n list.push(import(\"../Shaders/extractHighlights.fragment.js\"));\n }\n }\n /**\n * Constructs a new extract highlights post process\n * @param name Name of the effect\n * @param engine Engine to use to render the effect. If not provided, the last created engine will be used\n * @param options Options to configure the effect\n */\n constructor(name, engine = null, options) {\n super({\n ...options,\n name,\n engine: engine || Engine.LastCreatedEngine,\n useShaderStore: true,\n useAsPostProcess: true,\n fragmentShader: ThinExtractHighlightsPostProcess.FragmentUrl,\n uniforms: ThinExtractHighlightsPostProcess.Uniforms,\n });\n /**\n * The luminance threshold, pixels below this value will be set to black.\n */\n this.threshold = 0.9;\n /** @internal */\n this._exposure = 1;\n }\n bind() {\n super.bind();\n const effect = this._drawWrapper.effect;\n effect.setFloat(\"threshold\", Math.pow(this.threshold, ToGammaSpace));\n effect.setFloat(\"exposure\", this._exposure);\n }\n}\n/**\n * The fragment shader url\n */\nThinExtractHighlightsPostProcess.FragmentUrl = \"extractHighlights\";\n/**\n * The list of uniforms used by the effect\n */\nThinExtractHighlightsPostProcess.Uniforms = [\"threshold\", \"exposure\"];\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,gCAAgC;AAC9D,SAASC,YAAY,QAAQ,4BAA4B;AACzD,SAASC,MAAM,QAAQ,sBAAsB;AAC7C;AACA;AACA;AACA,OAAO,MAAMC,gCAAgC,SAASH,aAAa,CAAC;EAChEI,cAAcA,CAACC,SAAS,EAAEC,IAAI,EAAE;IAC5B,IAAID,SAAS,EAAE;MACX,IAAI,CAACE,YAA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