de51ae29bdc33d4721612db5b322a18ddcf7dd5c.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. System.register(["__unresolved_0", "cc", "cc/env", "__unresolved_1"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Camera, CCBoolean, CCFloat, CCInteger, Component, Material, rendering, Texture2D, EDITOR, fillRequiredPipelineSettings, makePipelineSettings, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _dec20, _dec21, _dec22, _dec23, _dec24, _class, _class2, _descriptor, _descriptor2, _crd, ccclass, disallowMultiple, executeInEditMode, menu, property, requireComponent, type, BuiltinPipelineSettings;
  4. function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
  5. function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
  6. function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
  7. function _reportPossibleCrUseOffillRequiredPipelineSettings(extras) {
  8. _reporterNs.report("fillRequiredPipelineSettings", "./builtin-pipeline-types", _context.meta, extras);
  9. }
  10. function _reportPossibleCrUseOfmakePipelineSettings(extras) {
  11. _reporterNs.report("makePipelineSettings", "./builtin-pipeline-types", _context.meta, extras);
  12. }
  13. function _reportPossibleCrUseOfPipelineSettings(extras) {
  14. _reporterNs.report("PipelineSettings", "./builtin-pipeline-types", _context.meta, extras);
  15. }
  16. return {
  17. setters: [function (_unresolved_) {
  18. _reporterNs = _unresolved_;
  19. }, function (_cc) {
  20. _cclegacy = _cc.cclegacy;
  21. __checkObsolete__ = _cc.__checkObsolete__;
  22. __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
  23. _decorator = _cc._decorator;
  24. Camera = _cc.Camera;
  25. CCBoolean = _cc.CCBoolean;
  26. CCFloat = _cc.CCFloat;
  27. CCInteger = _cc.CCInteger;
  28. Component = _cc.Component;
  29. Material = _cc.Material;
  30. rendering = _cc.rendering;
  31. Texture2D = _cc.Texture2D;
  32. }, function (_ccEnv) {
  33. EDITOR = _ccEnv.EDITOR;
  34. }, function (_unresolved_2) {
  35. fillRequiredPipelineSettings = _unresolved_2.fillRequiredPipelineSettings;
  36. makePipelineSettings = _unresolved_2.makePipelineSettings;
  37. }],
  38. execute: function () {
  39. _crd = true;
  40. _cclegacy._RF.push({}, "de1c2EHcMhAIYRZY5nyTQHG", "builtin-pipeline-settings", undefined);
  41. /*
  42. Copyright (c) 2021-2024 Xiamen Yaji Software Co., Ltd.
  43. https://www.cocos.com/
  44. Permission is hereby granted, free of charge, to any person obtaining a copy
  45. of this software and associated documentation files (the "Software"), to deal
  46. in the Software without restriction, including without limitation the rights to
  47. use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
  48. of the Software, and to permit persons to whom the Software is furnished to do so,
  49. subject to the following conditions:
  50. The above copyright notice and this permission notice shall be included in
  51. all copies or substantial portions of the Software.
  52. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  53. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  54. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  55. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  56. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  57. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  58. THE SOFTWARE.
  59. */
  60. __checkObsolete__(['_decorator', 'Camera', 'CCBoolean', 'CCFloat', 'CCInteger', 'Component', 'Material', 'rendering', 'Texture2D']);
  61. ({
  62. ccclass,
  63. disallowMultiple,
  64. executeInEditMode,
  65. menu,
  66. property,
  67. requireComponent,
  68. type
  69. } = _decorator);
  70. _export("BuiltinPipelineSettings", BuiltinPipelineSettings = (_dec = ccclass('BuiltinPipelineSettings'), _dec2 = menu('Rendering/BuiltinPipelineSettings'), _dec3 = requireComponent(Camera), _dec4 = property(CCBoolean), _dec5 = property({
  71. displayName: 'Editor Preview (Experimental)',
  72. type: CCBoolean
  73. }), _dec6 = property({
  74. group: {
  75. id: 'MSAA',
  76. name: 'Multisample Anti-Aliasing'
  77. },
  78. type: CCBoolean
  79. }), _dec7 = property({
  80. group: {
  81. id: 'MSAA',
  82. name: 'Multisample Anti-Aliasing',
  83. style: 'section'
  84. },
  85. type: CCInteger,
  86. range: [2, 4, 2]
  87. }), _dec8 = property({
  88. group: {
  89. id: 'ShadingScale',
  90. name: 'ShadingScale',
  91. style: 'section'
  92. },
  93. type: CCBoolean
  94. }), _dec9 = property({
  95. tooltip: 'i18n:postprocess.shadingScale',
  96. group: {
  97. id: 'ShadingScale',
  98. name: 'ShadingScale'
  99. },
  100. type: CCFloat,
  101. range: [0.01, 4, 0.01],
  102. slide: true
  103. }), _dec10 = property({
  104. group: {
  105. id: 'Bloom',
  106. name: 'Bloom (PostProcessing)',
  107. style: 'section'
  108. },
  109. type: CCBoolean
  110. }), _dec11 = property({
  111. group: {
  112. id: 'Bloom',
  113. name: 'Bloom (PostProcessing)',
  114. style: 'section'
  115. },
  116. type: Material
  117. }), _dec12 = property({
  118. tooltip: 'i18n:bloom.enableAlphaMask',
  119. group: {
  120. id: 'Bloom',
  121. name: 'Bloom (PostProcessing)',
  122. style: 'section'
  123. },
  124. type: CCBoolean
  125. }), _dec13 = property({
  126. tooltip: 'i18n:bloom.iterations',
  127. group: {
  128. id: 'Bloom',
  129. name: 'Bloom (PostProcessing)',
  130. style: 'section'
  131. },
  132. type: CCInteger,
  133. range: [1, 6, 1],
  134. slide: true
  135. }), _dec14 = property({
  136. tooltip: 'i18n:bloom.threshold',
  137. group: {
  138. id: 'Bloom',
  139. name: 'Bloom (PostProcessing)',
  140. style: 'section'
  141. },
  142. type: CCFloat,
  143. min: 0
  144. }), _dec15 = property({
  145. group: {
  146. id: 'Color Grading',
  147. name: 'ColorGrading (LDR) (PostProcessing)',
  148. style: 'section'
  149. },
  150. type: CCBoolean
  151. }), _dec16 = property({
  152. group: {
  153. id: 'Color Grading',
  154. name: 'ColorGrading (LDR) (PostProcessing)',
  155. style: 'section'
  156. },
  157. type: Material
  158. }), _dec17 = property({
  159. tooltip: 'i18n:color_grading.contribute',
  160. group: {
  161. id: 'Color Grading',
  162. name: 'ColorGrading (LDR) (PostProcessing)',
  163. style: 'section'
  164. },
  165. type: CCFloat,
  166. range: [0, 1, 0.01],
  167. slide: true
  168. }), _dec18 = property({
  169. tooltip: 'i18n:color_grading.originalMap',
  170. group: {
  171. id: 'Color Grading',
  172. name: 'ColorGrading (LDR) (PostProcessing)',
  173. style: 'section'
  174. },
  175. type: Texture2D
  176. }), _dec19 = property({
  177. group: {
  178. id: 'FXAA',
  179. name: 'Fast Approximate Anti-Aliasing (PostProcessing)',
  180. style: 'section'
  181. },
  182. type: CCBoolean
  183. }), _dec20 = property({
  184. group: {
  185. id: 'FXAA',
  186. name: 'Fast Approximate Anti-Aliasing (PostProcessing)',
  187. style: 'section'
  188. },
  189. type: Material
  190. }), _dec21 = property({
  191. group: {
  192. id: 'FSR',
  193. name: 'FidelityFX Super Resolution',
  194. style: 'section'
  195. },
  196. type: CCBoolean
  197. }), _dec22 = property({
  198. group: {
  199. id: 'FSR',
  200. name: 'FidelityFX Super Resolution',
  201. style: 'section'
  202. },
  203. type: Material
  204. }), _dec23 = property({
  205. group: {
  206. id: 'FSR',
  207. name: 'FidelityFX Super Resolution',
  208. style: 'section'
  209. },
  210. type: CCFloat,
  211. range: [0, 1, 0.01],
  212. slide: true
  213. }), _dec24 = property({
  214. group: {
  215. id: 'ToneMapping',
  216. name: 'ToneMapping',
  217. style: 'section'
  218. },
  219. type: Material
  220. }), _dec(_class = _dec2(_class = _dec3(_class = disallowMultiple(_class = executeInEditMode(_class = (_class2 = class BuiltinPipelineSettings extends Component {
  221. constructor() {
  222. super(...arguments);
  223. _initializerDefineProperty(this, "_settings", _descriptor, this);
  224. // Editor Preview
  225. _initializerDefineProperty(this, "_editorPreview", _descriptor2, this);
  226. }
  227. getPipelineSettings() {
  228. return this._settings;
  229. } // Enable/Disable
  230. onEnable() {
  231. (_crd && fillRequiredPipelineSettings === void 0 ? (_reportPossibleCrUseOffillRequiredPipelineSettings({
  232. error: Error()
  233. }), fillRequiredPipelineSettings) : fillRequiredPipelineSettings)(this._settings);
  234. var cameraComponent = this.getComponent(Camera);
  235. var camera = cameraComponent.camera;
  236. camera.pipelineSettings = this._settings;
  237. if (EDITOR) {
  238. this._tryEnableEditorPreview();
  239. }
  240. }
  241. onDisable() {
  242. var cameraComponent = this.getComponent(Camera);
  243. var camera = cameraComponent.camera;
  244. camera.pipelineSettings = null;
  245. if (EDITOR) {
  246. this._disableEditorPreview();
  247. }
  248. }
  249. get editorPreview() {
  250. return this._editorPreview;
  251. }
  252. set editorPreview(v) {
  253. this._editorPreview = v;
  254. if (EDITOR) {
  255. this._tryEnableEditorPreview();
  256. }
  257. }
  258. _tryEnableEditorPreview() {
  259. if (rendering === undefined) {
  260. return;
  261. }
  262. if (this._editorPreview) {
  263. rendering.setEditorPipelineSettings(this._settings);
  264. } else {
  265. this._disableEditorPreview();
  266. }
  267. }
  268. _disableEditorPreview() {
  269. if (rendering === undefined) {
  270. return;
  271. }
  272. var current = rendering.getEditorPipelineSettings();
  273. if (current === this._settings) {
  274. rendering.setEditorPipelineSettings(null);
  275. }
  276. } // MSAA
  277. get MsaaEnable() {
  278. return this._settings.msaa.enabled;
  279. }
  280. set MsaaEnable(value) {
  281. this._settings.msaa.enabled = value;
  282. if (EDITOR) {
  283. this._tryEnableEditorPreview();
  284. }
  285. }
  286. set msaaSampleCount(value) {
  287. value = 2 ** Math.ceil(Math.log2(Math.max(value, 2)));
  288. value = Math.min(value, 4);
  289. this._settings.msaa.sampleCount = value;
  290. if (EDITOR) {
  291. this._tryEnableEditorPreview();
  292. }
  293. }
  294. get msaaSampleCount() {
  295. return this._settings.msaa.sampleCount;
  296. } // Shading Scale
  297. set shadingScaleEnable(value) {
  298. this._settings.enableShadingScale = value;
  299. if (EDITOR) {
  300. this._tryEnableEditorPreview();
  301. }
  302. }
  303. get shadingScaleEnable() {
  304. return this._settings.enableShadingScale;
  305. }
  306. set shadingScale(value) {
  307. this._settings.shadingScale = value;
  308. if (EDITOR) {
  309. this._tryEnableEditorPreview();
  310. }
  311. }
  312. get shadingScale() {
  313. return this._settings.shadingScale;
  314. } // Bloom
  315. set bloomEnable(value) {
  316. this._settings.bloom.enabled = value;
  317. if (EDITOR) {
  318. this._tryEnableEditorPreview();
  319. }
  320. }
  321. get bloomEnable() {
  322. return this._settings.bloom.enabled;
  323. }
  324. set bloomMaterial(value) {
  325. if (this._settings.bloom.material === value) {
  326. return;
  327. }
  328. this._settings.bloom.material = value;
  329. if (EDITOR) {
  330. this._tryEnableEditorPreview();
  331. }
  332. }
  333. get bloomMaterial() {
  334. return this._settings.bloom.material;
  335. }
  336. set bloomEnableAlphaMask(value) {
  337. this._settings.bloom.enableAlphaMask = value;
  338. if (EDITOR) {
  339. this._tryEnableEditorPreview();
  340. }
  341. }
  342. get bloomEnableAlphaMask() {
  343. return this._settings.bloom.enableAlphaMask;
  344. }
  345. set bloomIterations(value) {
  346. this._settings.bloom.iterations = value;
  347. if (EDITOR) {
  348. this._tryEnableEditorPreview();
  349. }
  350. }
  351. get bloomIterations() {
  352. return this._settings.bloom.iterations;
  353. }
  354. set bloomThreshold(value) {
  355. this._settings.bloom.threshold = value;
  356. }
  357. get bloomThreshold() {
  358. return this._settings.bloom.threshold;
  359. }
  360. set bloomIntensity(value) {
  361. this._settings.bloom.intensity = value;
  362. }
  363. get bloomIntensity() {
  364. return this._settings.bloom.intensity;
  365. } // Color Grading (LDR)
  366. set colorGradingEnable(value) {
  367. this._settings.colorGrading.enabled = value;
  368. if (EDITOR) {
  369. this._tryEnableEditorPreview();
  370. }
  371. }
  372. get colorGradingEnable() {
  373. return this._settings.colorGrading.enabled;
  374. }
  375. set colorGradingMaterial(value) {
  376. if (this._settings.colorGrading.material === value) {
  377. return;
  378. }
  379. this._settings.colorGrading.material = value;
  380. if (EDITOR) {
  381. this._tryEnableEditorPreview();
  382. }
  383. }
  384. get colorGradingMaterial() {
  385. return this._settings.colorGrading.material;
  386. }
  387. set colorGradingContribute(value) {
  388. this._settings.colorGrading.contribute = value;
  389. }
  390. get colorGradingContribute() {
  391. return this._settings.colorGrading.contribute;
  392. }
  393. set colorGradingMap(val) {
  394. this._settings.colorGrading.colorGradingMap = val;
  395. if (EDITOR) {
  396. this._tryEnableEditorPreview();
  397. }
  398. }
  399. get colorGradingMap() {
  400. return this._settings.colorGrading.colorGradingMap;
  401. } // FXAA
  402. set fxaaEnable(value) {
  403. this._settings.fxaa.enabled = value;
  404. if (EDITOR) {
  405. this._tryEnableEditorPreview();
  406. }
  407. }
  408. get fxaaEnable() {
  409. return this._settings.fxaa.enabled;
  410. }
  411. set fxaaMaterial(value) {
  412. if (this._settings.fxaa.material === value) {
  413. return;
  414. }
  415. this._settings.fxaa.material = value;
  416. if (EDITOR) {
  417. this._tryEnableEditorPreview();
  418. }
  419. }
  420. get fxaaMaterial() {
  421. return this._settings.fxaa.material;
  422. } // FSR
  423. set fsrEnable(value) {
  424. this._settings.fsr.enabled = value;
  425. if (EDITOR) {
  426. this._tryEnableEditorPreview();
  427. }
  428. }
  429. get fsrEnable() {
  430. return this._settings.fsr.enabled;
  431. }
  432. set fsrMaterial(value) {
  433. if (this._settings.fsr.material === value) {
  434. return;
  435. }
  436. this._settings.fsr.material = value;
  437. if (EDITOR) {
  438. this._tryEnableEditorPreview();
  439. }
  440. }
  441. get fsrMaterial() {
  442. return this._settings.fsr.material;
  443. }
  444. set fsrSharpness(value) {
  445. this._settings.fsr.sharpness = value;
  446. }
  447. get fsrSharpness() {
  448. return this._settings.fsr.sharpness;
  449. }
  450. set toneMappingMaterial(value) {
  451. if (this._settings.toneMapping.material === value) {
  452. return;
  453. }
  454. this._settings.toneMapping.material = value;
  455. if (EDITOR) {
  456. this._tryEnableEditorPreview();
  457. }
  458. }
  459. get toneMappingMaterial() {
  460. return this._settings.toneMapping.material;
  461. }
  462. }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "_settings", [property], {
  463. configurable: true,
  464. enumerable: true,
  465. writable: true,
  466. initializer: function initializer() {
  467. return (_crd && makePipelineSettings === void 0 ? (_reportPossibleCrUseOfmakePipelineSettings({
  468. error: Error()
  469. }), makePipelineSettings) : makePipelineSettings)();
  470. }
  471. }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "_editorPreview", [_dec4], {
  472. configurable: true,
  473. enumerable: true,
  474. writable: true,
  475. initializer: function initializer() {
  476. return false;
  477. }
  478. }), _applyDecoratedDescriptor(_class2.prototype, "editorPreview", [_dec5], Object.getOwnPropertyDescriptor(_class2.prototype, "editorPreview"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "MsaaEnable", [_dec6], Object.getOwnPropertyDescriptor(_class2.prototype, "MsaaEnable"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "msaaSampleCount", [_dec7], Object.getOwnPropertyDescriptor(_class2.prototype, "msaaSampleCount"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "shadingScaleEnable", [_dec8], Object.getOwnPropertyDescriptor(_class2.prototype, "shadingScaleEnable"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "shadingScale", [_dec9], Object.getOwnPropertyDescriptor(_class2.prototype, "shadingScale"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "bloomEnable", [_dec10], Object.getOwnPropertyDescriptor(_class2.prototype, "bloomEnable"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "bloomMaterial", [_dec11], Object.getOwnPropertyDescriptor(_class2.prototype, "bloomMaterial"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "bloomEnableAlphaMask", [_dec12], Object.getOwnPropertyDescriptor(_class2.prototype, "bloomEnableAlphaMask"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "bloomIterations", [_dec13], Object.getOwnPropertyDescriptor(_class2.prototype, "bloomIterations"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "bloomThreshold", [_dec14], Object.getOwnPropertyDescriptor(_class2.prototype, "bloomThreshold"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "colorGradingEnable", [_dec15], Object.getOwnPropertyDescriptor(_class2.prototype, "colorGradingEnable"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "colorGradingMaterial", [_dec16], Object.getOwnPropertyDescriptor(_class2.prototype, "colorGradingMaterial"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "colorGradingContribute", [_dec17], Object.getOwnPropertyDescriptor(_class2.prototype, "colorGradingContribute"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "colorGradingMap", [_dec18], Object.getOwnPropertyDescriptor(_class2.prototype, "colorGradingMap"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "fxaaEnable", [_dec19], Object.getOwnPropertyDescriptor(_class2.prototype, "fxaaEnable"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "fxaaMaterial", [_dec20], Object.getOwnPropertyDescriptor(_class2.prototype, "fxaaMaterial"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "fsrEnable", [_dec21], Object.getOwnPropertyDescriptor(_class2.prototype, "fsrEnable"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "fsrMaterial", [_dec22], Object.getOwnPropertyDescriptor(_class2.prototype, "fsrMaterial"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "fsrSharpness", [_dec23], Object.getOwnPropertyDescriptor(_class2.prototype, "fsrSharpness"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "toneMappingMaterial", [_dec24], Object.getOwnPropertyDescriptor(_class2.prototype, "toneMappingMaterial"), _class2.prototype)), _class2)) || _class) || _class) || _class) || _class) || _class));
  479. _cclegacy._RF.pop();
  480. _crd = false;
  481. }
  482. };
  483. });
  484. //# sourceMappingURL=de51ae29bdc33d4721612db5b322a18ddcf7dd5c.js.map