From c10a7247d7f66f4801e4bef000344d953cb5f87c Mon Sep 17 00:00:00 2001 From: PP Date: Tue, 18 Jul 2023 15:31:46 +0800 Subject: [PATCH 01/51] add back WASM_FALLBACK constant (#15758) --- cc.config.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cc.config.json b/cc.config.json index add518b733d..f4d4da87658 100644 --- a/cc.config.json +++ b/cc.config.json @@ -663,6 +663,12 @@ "value": false, "internal": true }, + "WASM_FALLBACK": { + "comment": "An internal constant to indicate whether need a fallback of wasm.\nIf true, we build a wasm fallback module for the compatibility of wasm files compiled by different version of emscripten.\nThis is useful when we use wasm on different version of Safari browsers.", + "type": "boolean", + "value": "$HTML5", + "internal": true + }, "WASM_SUBPACKAGE": { "comment": "An internal constant to indicate whether we use wasm assets as minigame subpackage.\nThis is useful when we need to reduce code size.", "type": "boolean", From ec88dc516000cb1d932cd7fc09d717ba1c6e1986 Mon Sep 17 00:00:00 2001 From: troublemaker52025 Date: Tue, 18 Jul 2023 16:47:15 +0800 Subject: [PATCH 02/51] fix invalid punctual lights for custom pipeline (#15759) --- cocos/rendering/custom/define.ts | 8 ++++---- cocos/rendering/custom/executor.ts | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cocos/rendering/custom/define.ts b/cocos/rendering/custom/define.ts index a461e93f1eb..35a5832108c 100644 --- a/cocos/rendering/custom/define.ts +++ b/cocos/rendering/custom/define.ts @@ -75,7 +75,7 @@ export function validPunctualLightsCulling (pipeline: BasicPipeline, camera: Cam const { spotLights } = camera.scene!; for (let i = 0; i < spotLights.length; i++) { const light = spotLights[i]; - if (light.baked) { + if (light.baked && !camera.node.scene.globals.disableLightmap) { continue; } @@ -88,7 +88,7 @@ export function validPunctualLightsCulling (pipeline: BasicPipeline, camera: Cam const { sphereLights } = camera.scene!; for (let i = 0; i < sphereLights.length; i++) { const light = sphereLights[i]; - if (light.baked) { + if (light.baked && !camera.node.scene.globals.disableLightmap) { continue; } geometry.Sphere.set(_sphere, light.position.x, light.position.y, light.position.z, light.range); @@ -117,8 +117,8 @@ export function validPunctualLightsCulling (pipeline: BasicPipeline, camera: Cam validPunctualLights.push(light); } } - // array push not supported. - pipeline.pipelineSceneData.validPunctualLights = validPunctualLights; + // in jsb, std::vector is not synchronized, so we need to assign it manually + sceneData.validPunctualLights = validPunctualLights; } const _cameras: Camera[] = []; diff --git a/cocos/rendering/custom/executor.ts b/cocos/rendering/custom/executor.ts index 285fc02d679..732f36b4f64 100644 --- a/cocos/rendering/custom/executor.ts +++ b/cocos/rendering/custom/executor.ts @@ -59,7 +59,7 @@ import { RenderShadowMapBatchedQueue } from '../render-shadow-map-batched-queue' import { PlanarShadowQueue } from '../planar-shadow-queue'; import { DefaultVisitor, depthFirstSearch, ReferenceGraphView } from './graph'; import { VectorGraphColorMap } from './effect'; -import { getDescBindingFromName, getDescriptorSetDataFromLayout, getDescriptorSetDataFromLayoutId, getRenderArea, mergeSrcToTargetDesc, updateGlobalDescBinding } from './define'; +import { getDescBindingFromName, getDescriptorSetDataFromLayout, getDescriptorSetDataFromLayoutId, getRenderArea, mergeSrcToTargetDesc, updateGlobalDescBinding, validPunctualLightsCulling } from './define'; import { RenderReflectionProbeQueue } from '../render-reflection-probe-queue'; import { builtinResMgr } from '../../asset/asset-manager/builtin-res-mgr'; import { Texture2D } from '../../asset/assets/texture-2d'; @@ -1131,6 +1131,7 @@ class DevicePreSceneTask extends WebSceneTask { } if (sceneFlag & SceneFlags.DEFAULT_LIGHTING) { this._submitInfo.additiveLight = context.additiveLight; + validPunctualLightsCulling(context.pipeline, this.camera); this._submitInfo.additiveLight.gatherLightPasses(this.camera, this._cmdBuff, this._currentQueue.devicePass.layoutName); } if (sceneFlag & SceneFlags.PLANAR_SHADOW) { From 81ab04144658935286b9cbcc0d01d8bf95893c04 Mon Sep 17 00:00:00 2001 From: Canvas Date: Tue, 18 Jul 2023 23:55:23 +0800 Subject: [PATCH 03/51] fix spine opacity failure. (#15765) --- cocos/2d/components/ui-opacity.ts | 9 ++++++++- cocos/spine/assembler/simple.ts | 1 + cocos/spine/skeleton.ts | 8 ++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/cocos/2d/components/ui-opacity.ts b/cocos/2d/components/ui-opacity.ts index 96a36be5a83..97c93687ab4 100644 --- a/cocos/2d/components/ui-opacity.ts +++ b/cocos/2d/components/ui-opacity.ts @@ -23,7 +23,7 @@ */ import { ccclass, disallowMultiple, editable, executeInEditMode, executionOrder, help, menu, serializable, tooltip } from 'cc.decorator'; -import { JSB } from 'internal:constants'; +import { EDITOR_NOT_IN_PREVIEW, JSB } from 'internal:constants'; import { Component } from '../../scene-graph/component'; import { misc } from '../../core'; import { UIRenderer } from '../framework/ui-renderer'; @@ -67,6 +67,13 @@ export class UIOpacity extends Component { this.node._uiProps.localOpacity = value / 255; this.setEntityLocalOpacityDirtyRecursively(true); + + if(EDITOR_NOT_IN_PREVIEW) { + setTimeout(()=>{ + EditorExtends.Node.emit('change', this.node.uuid, this.node); + }, 200); + } + } private setEntityLocalOpacityDirtyRecursively (dirty: boolean) { diff --git a/cocos/spine/assembler/simple.ts b/cocos/spine/assembler/simple.ts index 6175ad53dd0..e62fe5935a5 100644 --- a/cocos/spine/assembler/simple.ts +++ b/cocos/spine/assembler/simple.ts @@ -130,6 +130,7 @@ export const simple: IAssembler = { function updateComponentRenderData (comp: Skeleton, batcher: Batcher2D) { comp.drawList.reset(); if (comp.color.a === 0) return; + comp._updateColor(); _premultipliedAlpha = comp.premultipliedAlpha; _useTint = comp.useTint || comp.isAnimationCached(); if (comp.isAnimationCached()) { diff --git a/cocos/spine/skeleton.ts b/cocos/spine/skeleton.ts index 1509d19341d..c64122bc5b1 100644 --- a/cocos/spine/skeleton.ts +++ b/cocos/spine/skeleton.ts @@ -1490,12 +1490,16 @@ export class Skeleton extends UIRenderer { } } - protected _updateColor () { + /** + * @engineInternal + */ + public _updateColor (): void { + //if(EDITOR_NOT_IN_PREVIEW) cce.Node.emit('change-node', this.node); this.node._uiProps.colorDirty = true; const r = this._color.r / 255.0; const g = this._color.g / 255.0; const b = this._color.b / 255.0; - const a = this._color.a / 255.0; + const a = this.node._uiProps.opacity; this._instance.setColor(r, g, b, a); } From b21499ffce8182853c2e71155a215e8c324753dc Mon Sep 17 00:00:00 2001 From: bofeng-song Date: Wed, 19 Jul 2023 10:38:20 +0800 Subject: [PATCH 04/51] Fix potential error: cache invalid player due to object's destroy (#15746) * Fix potential error: cache invalid player due to object's destroy --- cocos/audio/audio-source.ts | 74 ++++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 26 deletions(-) diff --git a/cocos/audio/audio-source.ts b/cocos/audio/audio-source.ts index 7f966341c8b..07f35a44f39 100644 --- a/cocos/audio/audio-source.ts +++ b/cocos/audio/audio-source.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { AudioPlayer } from 'pal/audio'; +import { AudioPlayer, OneShotAudio } from 'pal/audio'; import { ccclass, help, menu, tooltip, type, range, serializable } from 'cc.decorator'; import { AudioPCMDataView, AudioState } from '../../pal/audio/type'; import { Component } from '../scene-graph/component'; @@ -59,6 +59,7 @@ export class AudioSource extends Component { @type(AudioClip) protected _clip: AudioClip | null = null; protected _player: AudioPlayer | null = null; + private _hasRegisterListener: boolean = false; @serializable protected _loop = false; @@ -78,9 +79,7 @@ export class AudioSource extends Component { private _resetPlayer (): void { if (this._player) { audioManager.removePlaying(this._player); - this._player.offEnded(); - this._player.offInterruptionBegin(); - this._player.offInterruptionEnd(); + this._unregisterListener(); this._player.destroy(); this._player = null; } @@ -137,6 +136,14 @@ export class AudioSource extends Component { // clear old player this._resetPlayer(); this._player = player; + this._syncStates(); + this.node?.emit(_LOADED_EVENT); + }).catch((e) => {}); + } + + private _registerListener (): void { + if (!this._hasRegisterListener && this._player) { + const player = this._player; player.onEnded(() => { audioManager.removePlaying(player); this.node?.emit(AudioSourceEventType.ENDED, this); @@ -145,11 +152,21 @@ export class AudioSource extends Component { audioManager.removePlaying(player); }); player.onInterruptionEnd(() => { - audioManager.addPlaying(player); + if (this._player === player) { + audioManager.addPlaying(player); + } }); - this._syncStates(); - this.node?.emit(_LOADED_EVENT); - }).catch((e) => {}); + this._hasRegisterListener = true; + } + } + + private _unregisterListener (): void { + if (this._player && this._hasRegisterListener) { + this._player.offEnded(); + this._player.offInterruptionBegin(); + this._player.offInterruptionEnd(); + this._hasRegisterListener = false; + } } /** @@ -231,8 +248,7 @@ export class AudioSource extends Component { public onDestroy (): void { this.stop(); - this._player?.destroy(); - this._player = null; + this.clip = null;// It will trigger _syncPlayer then call resetPlayer } /** * @en @@ -332,16 +348,21 @@ export class AudioSource extends Component { this._operationsBeforeLoading.push('play'); return; } + this._registerListener(); audioManager.discardOnePlayingIfNeeded(); // Replay if the audio is playing if (this.state === AudioState.PLAYING) { this._player?.stop().catch((e) => {}); } const player = this._player; - this._player?.play().then(() => { - audioManager.addPlaying(player!); - this.node?.emit(AudioSourceEventType.STARTED, this); - }).catch((e) => {}); + if (player) { + player.play().then(() => { + this.node?.emit(AudioSourceEventType.STARTED, this); + }).catch((e) => { + audioManager.removePlaying(player); + }); + audioManager.addPlaying(player); + } } /** @@ -355,10 +376,7 @@ export class AudioSource extends Component { this._operationsBeforeLoading.push('pause'); return; } - const player = this._player; - this._player?.pause().then(() => { - audioManager.removePlaying(player!); - }).catch((e) => {}); + this._player?.pause().catch((e) => {}); } /** @@ -372,10 +390,10 @@ export class AudioSource extends Component { this._operationsBeforeLoading.push('stop'); return; } - const player = this._player; - this._player?.stop().then(() => { - audioManager.removePlaying(player!); - }).catch((e) => {}); + if (this._player) { + this._player.stop().catch((e) => {}); + audioManager.removePlaying(this._player); + } } /** @@ -391,18 +409,22 @@ export class AudioSource extends Component { console.error('Invalid audio clip'); return; } + let player: OneShotAudio; AudioPlayer.loadOneShotAudio(clip._nativeAsset.url, this._volume * volumeScale, { audioLoadMode: clip.loadMode, }).then((oneShotAudio) => { + player = oneShotAudio; audioManager.discardOnePlayingIfNeeded(); - oneShotAudio.onPlay = (): void => { - audioManager.addPlaying(oneShotAudio); - }; oneShotAudio.onEnd = (): void => { audioManager.removePlaying(oneShotAudio); }; oneShotAudio.play(); - }).catch((e): void => {}); + audioManager.addPlaying(oneShotAudio); + }).catch((e): void => { + if (player) { + audioManager.removePlaying(player); + } + }); } protected _syncStates (): void { From 839a086ecadeaccecf9f2589e1d5da7453dee6d7 Mon Sep 17 00:00:00 2001 From: bofeng-song Date: Wed, 19 Jul 2023 10:38:59 +0800 Subject: [PATCH 05/51] Add smallestScreenSize to Manifest.xml (#15763) --- templates/android/template/app/AndroidManifest.xml | 4 ++-- templates/android/template/instantapp/AndroidManifest.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/android/template/app/AndroidManifest.xml b/templates/android/template/app/AndroidManifest.xml index 7aeabfd8f3c..a85bb7ca777 100644 --- a/templates/android/template/app/AndroidManifest.xml +++ b/templates/android/template/app/AndroidManifest.xml @@ -20,7 +20,7 @@ diff --git a/templates/android/template/instantapp/AndroidManifest.xml b/templates/android/template/instantapp/AndroidManifest.xml index 5aee933752e..0216ac9da8f 100644 --- a/templates/android/template/instantapp/AndroidManifest.xml +++ b/templates/android/template/instantapp/AndroidManifest.xml @@ -25,7 +25,7 @@ From 0b910aa7c4ebdab7998e7e7bb106cd9cef66545e Mon Sep 17 00:00:00 2001 From: Canvas Date: Wed, 19 Jul 2023 12:38:12 +0800 Subject: [PATCH 06/51] fix setDebugMode on JSB mode. (#15769) --- cocos/spine/skeleton.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cocos/spine/skeleton.ts b/cocos/spine/skeleton.ts index c64122bc5b1..190beae246a 100644 --- a/cocos/spine/skeleton.ts +++ b/cocos/spine/skeleton.ts @@ -1467,7 +1467,7 @@ export class Skeleton extends UIRenderer { this._debugRenderer.node.destroy(); this._debugRenderer = null; if (!this.isAnimationCached()) { - this._instance.setDebugMode(false); + if (!JSB) this._instance.setDebugMode(false); } } } @@ -1494,7 +1494,6 @@ export class Skeleton extends UIRenderer { * @engineInternal */ public _updateColor (): void { - //if(EDITOR_NOT_IN_PREVIEW) cce.Node.emit('change-node', this.node); this.node._uiProps.colorDirty = true; const r = this._color.r / 255.0; const g = this._color.g / 255.0; From 41304cfbd13cf65b49adc2d0ea838eff4c0f64f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E6=88=98?= <40414978+PatriceJiang@users.noreply.github.com> Date: Wed, 19 Jul 2023 17:46:17 +0800 Subject: [PATCH 07/51] fix setter for node.siblingIndex (#15776) --- cocos/scene-graph/node.jsb.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cocos/scene-graph/node.jsb.ts b/cocos/scene-graph/node.jsb.ts index db1a53c5b5c..15f31c4beee 100644 --- a/cocos/scene-graph/node.jsb.ts +++ b/cocos/scene-graph/node.jsb.ts @@ -1012,7 +1012,7 @@ Object.defineProperty(nodeProto, '_siblingIndex', { return this._sharedInt32Arr[0]; // Int32, 0: siblingIndex }, set(v) { - this.setSiblingIndex(v); + this._sharedInt32Arr[0] = v; }, }); @@ -1024,10 +1024,11 @@ Object.defineProperty(nodeProto, 'siblingIndex', { return this._sharedInt32Arr[0]; // Int32, 0: siblingIndex }, set(v) { - this.setSiblingIndex(v); + this._sharedInt32Arr[0] = v; }, }); +// note: setSiblingIndex is a JSB function, DO NOT override it nodeProto.getSiblingIndex = function getSiblingIndex() { return this._sharedInt32Arr[0]; // Int32, 0: siblingIndex }; From 6aba5f85d9806dd72a8c22774fe6449e006aa39f Mon Sep 17 00:00:00 2001 From: Ling Zhan Date: Wed, 19 Jul 2023 18:48:43 +0800 Subject: [PATCH 08/51] [fix] physics3d native cct api error (#15779) --- platforms/native/engine/jsb-physics.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platforms/native/engine/jsb-physics.js b/platforms/native/engine/jsb-physics.js index 31310609783..7f137116dfa 100644 --- a/platforms/native/engine/jsb-physics.js +++ b/platforms/native/engine/jsb-physics.js @@ -44,8 +44,8 @@ const CollisionEventObject = { const CCTShapeEventObject = { type: 'onControllerColliderHit', - selfController: null, - otherCollider: null, + controller: null, + collider: null, worldPosition: null, worldNormal: null, motionDirection: null, @@ -146,8 +146,8 @@ function emitCCTShapeEvent (t, cct, collider, b) { CCTShapeEventObject.worldNormal = new cc.Vec3(b[3], b[4], b[5]); CCTShapeEventObject.motionDirection = new cc.Vec3(b[6], b[7], b[8]); CCTShapeEventObject.motionLength = b[9]; - CCTShapeEventObject.selfController = cct; - CCTShapeEventObject.otherCollider = collider; + CCTShapeEventObject.controller = cct; + CCTShapeEventObject.collider = collider; cct.emit(t, CCTShapeEventObject); } @@ -914,7 +914,7 @@ class CharacterController { this.setCenter(this._com.center); this.setStepOffset(this._com.stepOffset); this.setSlopeLimit(this._com.slopeLimit); - this.setContactOffset(this._com.contactOffset); + this.setContactOffset(this._com.skinWidth); this.setDetectCollisions(true);//this._com.detectCollisions); this.setOverlapRecovery(true);//this._com.enableOverlapRecovery); } From 9ce02b54aa6bf54016c5fc4ccbb4f47004e4696a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E6=88=98?= <40414978+PatriceJiang@users.noreply.github.com> Date: Thu, 20 Jul 2023 10:21:41 +0800 Subject: [PATCH 09/51] use boost-bcp to reduce external size (#15770) --- native/utils/clear-platform.js | 293 ++++++++++- package-lock.json | 905 +++++++++++++++++++-------------- package.json | 4 + 3 files changed, 806 insertions(+), 396 deletions(-) diff --git a/native/utils/clear-platform.js b/native/utils/clear-platform.js index b034dd2113a..0cba7d8934e 100644 --- a/native/utils/clear-platform.js +++ b/native/utils/clear-platform.js @@ -1,8 +1,17 @@ 'use strict'; +// @ts-check + const chalk = require('chalk'); const path = require("path"); const fs = require('fs-extra'); +const tar = require('tar'); +const zlib = require('zlib'); +const axios = require('axios'); +const ProgressBar = require('progress'); +const os = require('os'); +const child_process = require('child_process'); +const fetch = require('node-fetch'); // usage: npm run clear-platform let externalDir = path.join(__dirname, "../external"); @@ -13,13 +22,22 @@ let winUsefulDirs = ['android', 'cmake', 'emscripten', 'ohos', 'sources', 'win64 let linuxUsefulDirs = ['android', 'cmake', 'emscripten', 'linux', 'ohos', 'sources']; let allDirs = []; +['log', 'warn', 'error', 'info'].forEach(field => { + const oldFn = console[field]; + console[field] = function (...args) { + oldFn.apply(this, [`[clear-platform.js:${field}] `, ...args]); + }; +}); + + main(); -function main() { +async function main() { readDirectory(externalDir, allDirs); console.log(chalk.green(`==== current exists 3rd-libs directories ====`)); console.log(allDirs); cleanPlatform(process.platform); + await minimizeBoost(); } function readDirectory(path, filesList) { @@ -52,7 +70,7 @@ function cleanPlatform(platform) { if (winUselessDirs.length > 0) { console.log(chalk.magenta(`==== Remove win32 useless 3rd-libs ====`)); console.log(winUselessDirs); - for (let i = 0; i < winUselessDirs.length; i++) { + for (let i = 0; i < winUselessDirs.length; i++) { let clearDirectory = path.join(externalDir, winUselessDirs[i]); console.log(` ${chalk.green('Remove directory: ')} ${clearDirectory}`); ensureRemove(clearDirectory); @@ -63,7 +81,7 @@ function cleanPlatform(platform) { } else if (platform === 'linux') { // linux let linuxUselessDirs = getArrDiff(allDirs, linuxUsefulDirs); - if (linuxUselessDirs.length > 0) { + if (linuxUselessDirs.length > 0) { console.log(chalk.magenta(`==== Remove linux useless 3rd-libs ====`)); console.log(linuxUselessDirs); for (let i = 0; i < linuxUselessDirs.length; i++) { @@ -99,7 +117,272 @@ function ensureRemove(clearDirectory) { } function getArrDiff(arr1, arr2) { - return arr1.concat(arr2).filter(function(v, i, arr) { - return arr.indexOf(v) === arr.lastIndexOf(v); + return arr1.concat(arr2).filter(function (v, i, arr) { + return arr.indexOf(v) === arr.lastIndexOf(v); + }); +} + +function execName(fn, winPostFix = '.exe', linuxPosFix = '') { + return os.platform() === 'win32' ? fn + winPostFix : fn + linuxPosFix; +} + +async function runCommand(dir, cmd, ...args) { + console.log(`Exec ${cmd} with [${args.join(', ')}]`); + return new Promise((resolve, reject) => { + const child = child_process.spawn(cmd, args, { + cwd: dir, + shell: true, + }); + child.stdout.on('data', (data) => { + console.log(data.toString('utf8')); + }); + child.stderr.on('data', (data) => { + console.error(data.toString('utf8')); + }); + child.on('error', (data) => { + console.log(`Error:`); + console.error(data.toString('utf8')); + }); + child.on('close', (code) => { + if (code == 0) { + return resolve(); + } + console.error(`Command ${cmd} exited with code ${code}`) + reject(new Error(`Command ${cmd} exited with code ${code}`)); + }) }); } + +async function filterFiles(root, tstFn) { + const all = []; + const walk = async (dir) => { + const st = fs.statSync(dir); + if (st.isDirectory()) { + const files = await fs.readdir(dir); + const sub = []; + for (let f of files) { + if (f.startsWith('.')) continue; + const p = path.join(dir, f); + if (tstFn(p, true)) sub.push(walk(p)); + } + await Promise.all(sub); + } else { + if (tstFn(dir, false)) all.push(dir); + } + } + await walk(root); + return all; +} + +async function batcher(array, batchSize, fn) { + for (let i = 0, l = array.length; i < l; i += batchSize) { + await Promise.all(array.slice(i, i + batchSize).map(fn)) + } +} + +async function minimizeBoost() { + const BOOST_VERSION = [1, 78, 0] + const BOOST_VERSION_DOTTED = BOOST_VERSION.join('.'); + const BOOST_VERSION_UNDERSCORE = BOOST_VERSION.join('_'); + const BOOST_ZIP_FILE = `boost_${BOOST_VERSION_UNDERSCORE}.tar.gz`; + const EXTERNAL_SOURCE_DIR = path.join(__dirname, '..', 'external', 'sources'); + const BOOST_DOWNLOAD = path.join(EXTERNAL_SOURCE_DIR, 'boost-download'); + const BOOST_ORIG_PATH = path.join(EXTERNAL_SOURCE_DIR, 'boost'); + const BOOST_DEST = path.join(EXTERNAL_SOURCE_DIR, 'boost-minimized'); + const BOOST_DECOMPRESSED_PATH = path.join(BOOST_DOWNLOAD, `boost_${BOOST_VERSION_UNDERSCORE}`); + const BOOST_FILE_PATH = path.join(BOOST_DOWNLOAD, BOOST_ZIP_FILE); + const BOOST_URL_REMOTE = `https://jaist.dl.sourceforge.net/project/boost/boost/${BOOST_VERSION_DOTTED}/boost_${BOOST_VERSION_UNDERSCORE}.tar.gz` + const BOOST_URL_LOCAL = `http://ftp.cocos.org/TestBuilds/Editor-3d/tools/boost_${BOOST_VERSION_UNDERSCORE}.tar.gz` + + const BCP_PATH = path.join(BOOST_DECOMPRESSED_PATH, 'dist', 'bin', execName('bcp')); + const ENGINE_ROOT = path.normalize(path.join(__dirname, '../../')); + + let headersUsedByEngine = []; + + const fnCheckDirectories = async () => { + if (!await fs.pathExists(BOOST_DOWNLOAD)) { + await fs.mkdir(BOOST_DOWNLOAD); + } + if (!await fs.pathExists(BOOST_DEST)) { + await fs.mkdir(BOOST_DEST); + } + } + + const fnDownloadWithAxios = async (url, dstUrl) => { + let bar = null; + const dstFile = fs.createWriteStream(dstUrl); + return new Promise((resolve, reject) => { + axios.get(url, { responseType: 'stream' }) + .then((res) => { + // console.log(res.headers); + const total = res.headers['Content-Length'] || res.headers['content-length']; + bar = new ProgressBar('Downloading [:bar] :percent :etas', { + complete: '=', + incomplete: ' ', + width: 40, + total: parseInt(total) + }); + res.data.pipe(dstFile); + res.data.on('data', (chunk) => { bar.tick(chunk.length); }); + res.data.on('end', () => { + console.log(` Download Finished`); + resolve(); + }); + }).catch(err => reject(err)); + }); + }; + + const fnDownloadWithCurl = async (url, dstUrl) => { + await runCommand(BOOST_DOWNLOAD, 'curl', url, '-o', `"${dstUrl}"`) + } + + const rm = async (file) => { + const st = fs.statSync(file); + if (st.isDirectory()) { + const files = (await fs.readdir(file)).filter(x => x !== '.' && x !== '..').map(x => path.join(file, x)); + await Promise.all(files.map(x => rm(x))); + await fs.rmdir(file) + } else { + await fs.unlink(file); + } + }; + + const fnDownloadBoost = async () => { + const targetExist = await fs.pathExists(BOOST_FILE_PATH); + if (!targetExist) { + let boostURL; + console.log(`Testing local url: ${BOOST_URL_LOCAL}`); + try { + const FETCH_TIMEOUTOUT = 3000; + const testLocal = await Promise.race( [fetch(BOOST_URL_LOCAL), new Promise((_, r)=> { + setTimeout(()=> r(new Error('Request timed out')), FETCH_TIMEOUTOUT); + })]); + if (testLocal.ok) { + console.log(` Use ${BOOST_URL_LOCAL}!`); + boostURL = BOOST_URL_LOCAL; + } else { + console.log(` Failed on error code, use ${BOOST_URL_REMOTE}!`); + boostURL = BOOST_URL_REMOTE; + } + } catch (e) { + console.error(e); + console.log(` Failed on exception, use ${BOOST_URL_REMOTE}!`); + boostURL = BOOST_URL_REMOTE; + } + console.log(` downloading ${boostURL}\n to ${BOOST_FILE_PATH}`); + + await fnDownloadWithAxios(boostURL, BOOST_FILE_PATH); + // await fnDownloadWithCurl(BOOST_URL, BOOST_FILE_PATH); + } else { + console.log(`Skip downloading, file ${BOOST_FILE_PATH} exists.`); + } + }; + + const fnDecompressBoost = async () => { + if (await fs.pathExists(BOOST_DECOMPRESSED_PATH)) { + console.log(` Folder ${BOOST_DECOMPRESSED_PATH} exists, skip decompressing...`); + return; + } + console.log(`Decompressing file ${BOOST_FILE_PATH}`); + const srcStream = fs.createReadStream(BOOST_FILE_PATH); + const st = fs.statSync(BOOST_FILE_PATH); + let bar; + return new Promise((resolve, reject) => { + bar = new ProgressBar(' Extracting [:bar] :percent :etas', { + complete: '=', + incomplete: ' ', + width: 40, + total: st.size + }); + srcStream.on('data', chunk => bar.tick(chunk.length)) + .pipe(zlib.createGunzip()) + .pipe(tar.extract({ cwd: BOOST_DOWNLOAD })) + .on('entry', (entry) => { + // console.log(` processing ${entry.path}`); + }) + .on('error', err => { + console.error(` decompressing error!`); + reject(err); + }) + .on('end', () => { + console.log(` decompressing done!`); + resolve(); + }); + }); + }; + + const fnCompileBoost = async () => { + if (await fs.pathExists(BCP_PATH)) { + console.log(` File ${BCP_PATH} already exists, skip compilation`); + return; + } + const bootstrap = path.join(BOOST_DECOMPRESSED_PATH, execName('bootstrap', '.bat', '.sh')); + const b2 = path.join(BOOST_DECOMPRESSED_PATH, execName('b2')); + await runCommand(BOOST_DECOMPRESSED_PATH, bootstrap); + await runCommand(BOOST_DECOMPRESSED_PATH, b2, 'headers'); + await runCommand(BOOST_DECOMPRESSED_PATH, b2, 'tools/bcp'); + + if (await fs.pathExists(BCP_PATH)) { + console.log(` Compile bcp.exe successed!`); + } else { + console.error(` Failed to compile bcp.exe, file not found!`) + } + }; + + const fnCollectBoostHeaders = async () => { + console.log(` Analyzing source files...`); + const allSource = await filterFiles(ENGINE_ROOT, (path, isdir) => { + return isdir ? !/native(\\|\/)+external/.test(path) : ['.h', '.hpp', '.cpp', '.mm'].filter(e => path.endsWith(e)).length > 0; + }); + console.log(`${allSource.length} files found!`); + const R = /#include\s+[<"]boost\/([^">]+)/ + const boostHeaders = {}; + await batcher(allSource, 20, async (file) => { + const data = await fs.readFile(file, 'utf8') + const includes = data.split(`\n`).filter(x => x.trim().startsWith("#include")).map(x => x.trim()).filter(x => R.test(x)); + includes.forEach(x => { + const m = x.match(R); + if (m) { + boostHeaders[m[1]] = true; + } + }) + }) + headersUsedByEngine = Object.keys(boostHeaders).sort(); + console.log(` headers: ${headersUsedByEngine.join(', ')}`); + }; + + const fnRunBCP = async () => { + await runCommand(BOOST_DECOMPRESSED_PATH, BCP_PATH, + `--boost="${BOOST_DECOMPRESSED_PATH}"`, + 'graph', /* manually add components here */ + ...headersUsedByEngine, + BOOST_DEST + ); + + if (await fs.pathExists(BOOST_ORIG_PATH)) { + console.log(`Remove old folder ${BOOST_ORIG_PATH}`); + await rm(BOOST_ORIG_PATH); + } + console.log(`Link to minimized boost folder ${BOOST_DEST}`); + await fs.rename(path.join(BOOST_DEST, 'boost'), BOOST_ORIG_PATH); + if (await fs.pathExists(BOOST_DEST)) { + console.log(`Remove folder ${BOOST_DEST}`); + await rm(BOOST_DEST); + } + }; + + const fnCleanUp = async () => { + if (await fs.pathExists(BOOST_DOWNLOAD)) { + await rm(BOOST_DOWNLOAD); + } + } + + + await fnCheckDirectories(); + await fnDownloadBoost(); + await fnDecompressBoost(); + await fnCompileBoost(); + await fnCollectBoostHeaders(); + await fnRunBCP(); + await fnCleanUp(); // skip this step when debugging +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0fa7f37bda9..b276c5e8771 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1122,7 +1122,7 @@ }, "@babel/plugin-syntax-async-generators": { "version": "7.8.4", - "resolved": "https://registry.nlark.com/@babel/plugin-syntax-async-generators/download/@babel/plugin-syntax-async-generators-7.8.4.tgz", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-async-generators/download/@babel/plugin-syntax-async-generators-7.8.4.tgz", "integrity": "sha1-qYP7Gusuw/btBCohD2QOkOeG/g0=", "dev": true, "requires": { @@ -1174,7 +1174,7 @@ }, "@babel/plugin-syntax-dynamic-import": { "version": "7.8.3", - "resolved": "https://registry.nlark.com/@babel/plugin-syntax-dynamic-import/download/@babel/plugin-syntax-dynamic-import-7.8.3.tgz?cache=0&sync_timestamp=1618847125283&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40babel%2Fplugin-syntax-dynamic-import%2Fdownload%2F%40babel%2Fplugin-syntax-dynamic-import-7.8.3.tgz", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-dynamic-import/download/@babel/plugin-syntax-dynamic-import-7.8.3.tgz", "integrity": "sha1-Yr+Ysto80h1iYVT8lu5bPLaOrLM=", "dev": true, "requires": { @@ -1217,7 +1217,7 @@ }, "@babel/plugin-syntax-json-strings": { "version": "7.8.3", - "resolved": "https://registry.nlark.com/@babel/plugin-syntax-json-strings/download/@babel/plugin-syntax-json-strings-7.8.3.tgz", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-json-strings/download/@babel/plugin-syntax-json-strings-7.8.3.tgz", "integrity": "sha1-AcohtmjNghjJ5kDLbdiMVBKyyWo=", "dev": true, "requires": { @@ -1226,7 +1226,7 @@ }, "@babel/plugin-syntax-logical-assignment-operators": { "version": "7.10.4", - "resolved": "https://registry.nlark.com/@babel/plugin-syntax-logical-assignment-operators/download/@babel/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-logical-assignment-operators/download/@babel/plugin-syntax-logical-assignment-operators-7.10.4.tgz", "integrity": "sha1-ypHvRjA1MESLkGZSusLp/plB9pk=", "dev": true, "requires": { @@ -1269,7 +1269,7 @@ }, "@babel/plugin-syntax-object-rest-spread": { "version": "7.8.3", - "resolved": "https://registry.nlark.com/@babel/plugin-syntax-object-rest-spread/download/@babel/plugin-syntax-object-rest-spread-7.8.3.tgz", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-object-rest-spread/download/@babel/plugin-syntax-object-rest-spread-7.8.3.tgz", "integrity": "sha1-YOIl7cvZimQDMqLnLdPmbxr1WHE=", "dev": true, "requires": { @@ -1287,7 +1287,7 @@ }, "@babel/plugin-syntax-optional-chaining": { "version": "7.8.3", - "resolved": "https://registry.nlark.com/@babel/plugin-syntax-optional-chaining/download/@babel/plugin-syntax-optional-chaining-7.8.3.tgz", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-optional-chaining/download/@babel/plugin-syntax-optional-chaining-7.8.3.tgz", "integrity": "sha1-T2nCq5UWfgGAzVM2YT+MV4j31Io=", "dev": true, "requires": { @@ -1647,7 +1647,7 @@ }, "@babel/preset-env": { "version": "7.8.7", - "resolved": "https://registry.npmmirror.com/@babel/preset-env/download/@babel/preset-env-7.8.7.tgz?cache=0&sync_timestamp=1637103615805&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2F%40babel%2Fpreset-env%2Fdownload%2F%40babel%2Fpreset-env-7.8.7.tgz", + "resolved": "https://registry.npm.taobao.org/@babel/preset-env/download/@babel/preset-env-7.8.7.tgz?cache=0&sync_timestamp=1593522855920&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fpreset-env%2Fdownload%2F%40babel%2Fpreset-env-7.8.7.tgz", "integrity": "sha1-H8fYnH910tcMK2do3mwuBJs8uds=", "dev": true, "requires": { @@ -1823,7 +1823,7 @@ }, "@cocos/box2d": { "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/@cocos/box2d/download/@cocos/box2d-1.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/@cocos/box2d/download/@cocos/box2d-1.0.1.tgz", "integrity": "sha1-Fc2lzPxRCCt91tNoo+S55IXS5To=", "requires": { "@types/systemjs": "^0.20.6" @@ -1863,13 +1863,13 @@ "dependencies": { "ansi-regex": { "version": "5.0.1", - "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { @@ -1878,7 +1878,7 @@ }, "cliui": { "version": "6.0.0", - "resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dev": true, "requires": { @@ -1889,7 +1889,7 @@ }, "color-convert": { "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { @@ -1898,13 +1898,13 @@ }, "color-name": { "version": "1.1.4", - "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "find-up": { "version": "4.1.0", - "resolved": "https://registry.npmmirror.com/find-up/-/find-up-4.1.0.tgz", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { @@ -1914,7 +1914,7 @@ }, "fs-extra": { "version": "8.1.0", - "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-8.1.0.tgz", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, "requires": { @@ -1925,7 +1925,7 @@ }, "get-caller-file": { "version": "2.0.5", - "resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, @@ -1940,13 +1940,13 @@ }, "is-fullwidth-code-point": { "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "locate-path": { "version": "5.0.0", - "resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-5.0.0.tgz", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { @@ -1955,7 +1955,7 @@ }, "p-locate": { "version": "4.1.0", - "resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-4.1.0.tgz", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { @@ -1964,13 +1964,13 @@ }, "path-exists": { "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-4.0.0.tgz", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "require-main-filename": { "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/require-main-filename/-/require-main-filename-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, @@ -1996,7 +1996,7 @@ }, "string-width": { "version": "4.2.3", - "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { @@ -2007,7 +2007,7 @@ }, "strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { @@ -2022,7 +2022,7 @@ }, "wrap-ansi": { "version": "6.2.0", - "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, "requires": { @@ -2033,13 +2033,13 @@ }, "y18n": { "version": "4.0.3", - "resolved": "https://registry.npmmirror.com/y18n/-/y18n-4.0.3.tgz", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", "dev": true }, "yargs": { "version": "15.4.1", - "resolved": "https://registry.npmmirror.com/yargs/-/yargs-15.4.1.tgz", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dev": true, "requires": { @@ -2058,7 +2058,7 @@ }, "yargs-parser": { "version": "18.1.3", - "resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-18.1.3.tgz", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "requires": { @@ -3585,7 +3585,7 @@ }, "type-fest": { "version": "0.20.2", - "resolved": "https://registry.npmmirror.com/type-fest/-/type-fest-0.20.2.tgz", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true } @@ -5845,7 +5845,7 @@ }, "@jest/types": { "version": "24.9.0", - "resolved": "https://registry.npmmirror.com/@jest/types/download/@jest/types-24.9.0.tgz", + "resolved": "https://registry.npm.taobao.org/@jest/types/download/@jest/types-24.9.0.tgz", "integrity": "sha1-Y8smy3UA0Gnlo4lEGnxqtekJ/Fk=", "dev": true, "requires": { @@ -5876,7 +5876,7 @@ }, "@jridgewell/resolve-uri": { "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", + "resolved": "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==" }, "@jridgewell/set-array": { @@ -5909,12 +5909,12 @@ }, "@jridgewell/sourcemap-codec": { "version": "1.4.13", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==" }, "@jridgewell/trace-mapping": { "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz", + "resolved": "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz", "integrity": "sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w==", "requires": { "@jridgewell/resolve-uri": "^3.0.3", @@ -6172,7 +6172,7 @@ }, "@types/fs-extra": { "version": "5.1.0", - "resolved": "https://registry.npmmirror.com/@types/fs-extra/download/@types/fs-extra-5.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/@types/fs-extra/download/@types/fs-extra-5.1.0.tgz", "integrity": "sha1-KjJe+XkBUEo4KHGMOQ00uEJqEKE=", "dev": true, "requires": { @@ -6205,7 +6205,7 @@ }, "@types/istanbul-reports": { "version": "1.1.2", - "resolved": "https://registry.npmmirror.com/@types/istanbul-reports/download/@types/istanbul-reports-1.1.2.tgz?cache=0&sync_timestamp=1637266160892&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2F%40types%2Fistanbul-reports%2Fdownload%2F%40types%2Fistanbul-reports-1.1.2.tgz", + "resolved": "https://registry.npm.taobao.org/@types/istanbul-reports/download/@types/istanbul-reports-1.1.2.tgz?cache=0&sync_timestamp=1613379043554&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fistanbul-reports%2Fdownload%2F%40types%2Fistanbul-reports-1.1.2.tgz", "integrity": "sha1-6HXMaJ5HvOVJ7IHz315vbxHPrrI=", "dev": true, "requires": { @@ -6215,7 +6215,7 @@ }, "@types/jest": { "version": "24.9.1", - "resolved": "https://registry.npmmirror.com/@types/jest/download/@types/jest-24.9.1.tgz", + "resolved": "https://registry.npm.taobao.org/@types/jest/download/@types/jest-24.9.1.tgz?cache=0&sync_timestamp=1616695463771&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fjest%2Fdownload%2F%40types%2Fjest-24.9.1.tgz", "integrity": "sha1-Arr5Vzx48bmXSl82d4s2aqd71TQ=", "dev": true, "requires": { @@ -6892,7 +6892,7 @@ }, "abab": { "version": "2.0.6", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "resolved": "https://registry.npmmirror.com/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, @@ -6904,7 +6904,7 @@ }, "acorn-globals": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", + "resolved": "https://registry.npmmirror.com/acorn-globals/-/acorn-globals-6.0.0.tgz", "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", "dev": true, "requires": { @@ -6930,13 +6930,13 @@ }, "acorn-walk": { "version": "7.2.0", - "resolved": "https://registry.nlark.com/acorn-walk/download/acorn-walk-7.2.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Facorn-walk%2Fdownload%2Facorn-walk-7.2.0.tgz", + "resolved": "https://registry.npm.taobao.org/acorn-walk/download/acorn-walk-7.2.0.tgz", "integrity": "sha1-DeiJpgEgOQmw++B7iTjcIdLpZ7w=", "dev": true }, "agent-base": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dev": true, "requires": { @@ -6999,7 +6999,7 @@ }, "ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-3.2.1.tgz", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz", "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", "requires": { "color-convert": "^1.9.0" @@ -7007,13 +7007,13 @@ }, "ansi-wrap": { "version": "0.1.0", - "resolved": "https://registry.nlark.com/ansi-wrap/download/ansi-wrap-0.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/ansi-wrap/download/ansi-wrap-0.1.0.tgz", "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", "dev": true }, "anymatch": { "version": "2.0.0", - "resolved": "https://registry.nlark.com/anymatch/download/anymatch-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/anymatch/download/anymatch-2.0.0.tgz", "integrity": "sha1-vLJLTzeTTZqnrBe0ra+J58du8us=", "dev": true, "requires": { @@ -7032,7 +7032,7 @@ }, "archy": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/archy/download/archy-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/archy/download/archy-1.0.0.tgz", "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", "dev": true }, @@ -7047,7 +7047,7 @@ }, "arr-diff": { "version": "4.0.0", - "resolved": "https://registry.nlark.com/arr-diff/download/arr-diff-4.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/arr-diff/download/arr-diff-4.0.0.tgz", "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", "dev": true }, @@ -7062,13 +7062,13 @@ }, "arr-flatten": { "version": "1.1.0", - "resolved": "https://registry.nlark.com/arr-flatten/download/arr-flatten-1.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/arr-flatten/download/arr-flatten-1.1.0.tgz", "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=", "dev": true }, "arr-map": { "version": "2.0.2", - "resolved": "https://registry.nlark.com/arr-map/download/arr-map-2.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/arr-map/download/arr-map-2.0.2.tgz", "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", "dev": true, "requires": { @@ -7077,7 +7077,7 @@ }, "arr-union": { "version": "3.1.0", - "resolved": "https://registry.nlark.com/arr-union/download/arr-union-3.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/arr-union/download/arr-union-3.1.0.tgz", "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, @@ -7142,7 +7142,7 @@ "dependencies": { "call-bind": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/call-bind/-/call-bind-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, "requires": { @@ -7242,12 +7242,12 @@ }, "array-union": { "version": "2.1.0", - "resolved": "https://registry.npm.taobao.org/array-union/download/array-union-2.1.0.tgz?cache=0&sync_timestamp=1614624262896&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Farray-union%2Fdownload%2Farray-union-2.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/array-union/download/array-union-2.1.0.tgz", "integrity": "sha1-t5hCCtvrHego2ErNii4j0+/oXo0=" }, "array-unique": { "version": "0.3.2", - "resolved": "https://registry.nlark.com/array-unique/download/array-unique-0.3.2.tgz", + "resolved": "https://registry.npm.taobao.org/array-unique/download/array-unique-0.3.2.tgz", "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, @@ -7431,13 +7431,13 @@ }, "async-each": { "version": "1.0.3", - "resolved": "https://registry.nlark.com/async-each/download/async-each-1.0.3.tgz", + "resolved": "https://registry.npm.taobao.org/async-each/download/async-each-1.0.3.tgz", "integrity": "sha1-tyfb+H12UWAvBvTUrDh/R9kbDL8=", "dev": true }, "async-settle": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/async-settle/download/async-settle-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/async-settle/download/async-settle-1.0.0.tgz", "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", "dev": true, "requires": { @@ -7446,13 +7446,13 @@ }, "asynckit": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, "atob": { "version": "2.1.2", - "resolved": "https://registry.nlark.com/atob/download/atob-2.1.2.tgz", + "resolved": "https://registry.npm.taobao.org/atob/download/atob-2.1.2.tgz", "integrity": "sha1-bZUX654DDSQ2ZmZR6GvZ9vE1M8k=", "dev": true }, @@ -7462,6 +7462,25 @@ "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", "dev": true }, + "axios": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", + "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "dev": true, + "requires": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + }, + "dependencies": { + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "dev": true + } + } + }, "babel-jest": { "version": "28.1.2", "resolved": "https://registry.npmmirror.com/babel-jest/-/babel-jest-28.1.2.tgz", @@ -7616,7 +7635,7 @@ }, "bach": { "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/bach/download/bach-1.2.0.tgz", + "resolved": "https://registry.npm.taobao.org/bach/download/bach-1.2.0.tgz", "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", "dev": true, "requires": { @@ -7662,7 +7681,7 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/is-accessor-descriptor/download/is-accessor-descriptor-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { @@ -7671,7 +7690,7 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/is-data-descriptor/download/is-data-descriptor-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-data-descriptor/download/is-data-descriptor-1.0.0.tgz", "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { @@ -7699,13 +7718,13 @@ }, "basic-auth": { "version": "1.1.0", - "resolved": "https://registry.nlark.com/basic-auth/download/basic-auth-1.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/basic-auth/download/basic-auth-1.1.0.tgz", "integrity": "sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ=", "dev": true }, "binary-extensions": { "version": "1.13.1", - "resolved": "https://registry.nlark.com/binary-extensions/download/binary-extensions-1.13.1.tgz", + "resolved": "https://registry.npm.taobao.org/binary-extensions/download/binary-extensions-1.13.1.tgz", "integrity": "sha1-WYr+VHVbKGilMw0q/51Ou1Mgm2U=", "dev": true }, @@ -7727,7 +7746,7 @@ }, "brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.nlark.com/brace-expansion/download/brace-expansion-1.1.11.tgz", + "resolved": "https://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz", "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", "requires": { "balanced-match": "^1.0.0", @@ -7785,7 +7804,7 @@ }, "browser-process-hrtime": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "resolved": "https://registry.npmmirror.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, @@ -8049,7 +8068,7 @@ }, "bs-logger": { "version": "0.2.6", - "resolved": "https://registry.nlark.com/bs-logger/download/bs-logger-0.2.6.tgz", + "resolved": "https://registry.npm.taobao.org/bs-logger/download/bs-logger-0.2.6.tgz", "integrity": "sha1-6302UwenLPl0zGzadraDVK0za9g=", "dev": true, "requires": { @@ -8113,7 +8132,7 @@ }, "cache-base": { "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/cache-base/download/cache-base-1.0.1.tgz?cache=0&sync_timestamp=1636237266442&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fcache-base%2Fdownload%2Fcache-base-1.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/cache-base/download/cache-base-1.0.1.tgz", "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=", "dev": true, "requires": { @@ -8146,12 +8165,12 @@ }, "callsites": { "version": "3.1.0", - "resolved": "https://registry.nlark.com/callsites/download/callsites-3.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/callsites/download/callsites-3.1.0.tgz", "integrity": "sha1-s2MKvYlDQy9Us/BRkjjjPNffL3M=" }, "camelcase": { "version": "5.3.1", - "resolved": "https://registry.npmmirror.com/camelcase/download/camelcase-5.3.1.tgz?cache=0&sync_timestamp=1636945130104&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fcamelcase%2Fdownload%2Fcamelcase-5.3.1.tgz", + "resolved": "https://registry.npm.taobao.org/camelcase/download/camelcase-5.3.1.tgz", "integrity": "sha1-48mzFWnhBoEd8kL3FXJaH0xJQyA=", "dev": true }, @@ -8163,7 +8182,7 @@ }, "chalk": { "version": "2.4.2", - "resolved": "https://registry.npmmirror.com/chalk/download/chalk-2.4.2.tgz", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-2.4.2.tgz?cache=0&sync_timestamp=1573282918610&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchalk%2Fdownload%2Fchalk-2.4.2.tgz", "integrity": "sha1-zUJUFnelQzPPVBpJEIwUMrRMlCQ=", "requires": { "ansi-styles": "^3.2.1", @@ -8180,12 +8199,12 @@ "child_process": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/child_process/-/child_process-1.0.2.tgz", - "integrity": "sha512-Wmza/JzL0SiWz7kl6MhIKT5ceIlnFPJX+lwUGj7Clhy5MMldsSoJR0+uvRzOS5Kv45Mq7t1PoE8TsOA9bzvb6g==", + "integrity": "sha1-sffn/HPSXn/R1FWtyU4UODAYK1o=", "dev": true }, "chokidar": { "version": "2.1.8", - "resolved": "https://registry.npmmirror.com/chokidar/download/chokidar-2.1.8.tgz", + "resolved": "https://registry.npm.taobao.org/chokidar/download/chokidar-2.1.8.tgz", "integrity": "sha1-gEs6e2qZNYw8XGHnHYco8EHP+Rc=", "dev": true, "requires": { @@ -8205,7 +8224,7 @@ "dependencies": { "glob-parent": { "version": "3.1.0", - "resolved": "https://registry.npmmirror.com/glob-parent/download/glob-parent-3.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/glob-parent/download/glob-parent-3.1.0.tgz?cache=0&sync_timestamp=1569108917227&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fglob-parent%2Fdownload%2Fglob-parent-3.1.0.tgz", "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "dev": true, "requires": { @@ -8215,7 +8234,7 @@ "dependencies": { "is-glob": { "version": "3.1.0", - "resolved": "https://registry.npmmirror.com/is-glob/download/is-glob-3.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-glob/download/is-glob-3.1.0.tgz", "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "dev": true, "requires": { @@ -8241,9 +8260,15 @@ } } }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true + }, "ci-info": { "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/ci-info/download/ci-info-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/ci-info/download/ci-info-2.0.0.tgz", "integrity": "sha1-Z6npZL4xpR4V5QENWObxKDQAL0Y=", "dev": true }, @@ -8265,7 +8290,7 @@ }, "class-utils": { "version": "0.3.6", - "resolved": "https://registry.nlark.com/class-utils/download/class-utils-0.3.6.tgz", + "resolved": "https://registry.npm.taobao.org/class-utils/download/class-utils-0.3.6.tgz", "integrity": "sha1-+TNprouafOAv1B+q0MqDAzGQxGM=", "dev": true, "requires": { @@ -8305,7 +8330,7 @@ }, "clone": { "version": "2.1.2", - "resolved": "https://registry.nlark.com/clone/download/clone-2.1.2.tgz", + "resolved": "https://registry.npm.taobao.org/clone/download/clone-2.1.2.tgz", "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", "dev": true }, @@ -8340,7 +8365,7 @@ }, "code-point-at": { "version": "1.1.0", - "resolved": "https://registry.npmmirror.com/code-point-at/download/code-point-at-1.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/code-point-at/download/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, @@ -8352,7 +8377,7 @@ }, "collection-map": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/collection-map/download/collection-map-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/collection-map/download/collection-map-1.0.0.tgz", "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", "dev": true, "requires": { @@ -8373,7 +8398,7 @@ }, "color-convert": { "version": "1.9.3", - "resolved": "https://registry.nlark.com/color-convert/download/color-convert-1.9.3.tgz", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz", "integrity": "sha1-u3GFBpDh8TZWfeYp0tVHHe2kweg=", "requires": { "color-name": "1.1.3" @@ -8424,7 +8449,7 @@ }, "combined-stream": { "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "requires": { @@ -8433,19 +8458,19 @@ }, "commander": { "version": "2.20.3", - "resolved": "https://registry.npmmirror.com/commander/download/commander-2.20.3.tgz?cache=0&sync_timestamp=1634886357672&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fcommander%2Fdownload%2Fcommander-2.20.3.tgz", + "resolved": "https://registry.npm.taobao.org/commander/download/commander-2.20.3.tgz", "integrity": "sha1-/UhehMA+tIgcIHIrpIA16FMa6zM=", "dev": true }, "commondir": { "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/commondir/-/commondir-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, "component-emitter": { "version": "1.3.0", - "resolved": "https://registry.nlark.com/component-emitter/download/component-emitter-1.3.0.tgz", + "resolved": "https://registry.npm.taobao.org/component-emitter/download/component-emitter-1.3.0.tgz", "integrity": "sha1-FuQHD7qK4ptnnyIVhT7hgasuq8A=", "dev": true }, @@ -8456,7 +8481,7 @@ }, "concat-stream": { "version": "1.6.2", - "resolved": "https://registry.nlark.com/concat-stream/download/concat-stream-1.6.2.tgz", + "resolved": "https://registry.npm.taobao.org/concat-stream/download/concat-stream-1.6.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fconcat-stream%2Fdownload%2Fconcat-stream-1.6.2.tgz", "integrity": "sha1-kEvfGUzTEi/Gdcd/xKw9T/D9GjQ=", "dev": true, "requires": { @@ -8494,7 +8519,7 @@ }, "copy-descriptor": { "version": "0.1.1", - "resolved": "https://registry.nlark.com/copy-descriptor/download/copy-descriptor-0.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/copy-descriptor/download/copy-descriptor-0.1.1.tgz", "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, @@ -8528,7 +8553,7 @@ "dependencies": { "semver": { "version": "7.0.0", - "resolved": "https://registry.nlark.com/semver/download/semver-7.0.0.tgz?cache=0&sync_timestamp=1618846864940&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsemver%2Fdownload%2Fsemver-7.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-7.0.0.tgz?cache=0&sync_timestamp=1581458063470&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-7.0.0.tgz", "integrity": "sha1-XzyjV2HkfgWyBsba/yz4FPAxa44=", "dev": true } @@ -8536,13 +8561,13 @@ }, "core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, "corser": { "version": "2.0.1", - "resolved": "https://registry.nlark.com/corser/download/corser-2.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/corser/download/corser-2.0.1.tgz", "integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=", "dev": true }, @@ -8636,7 +8661,7 @@ }, "cssstyle": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "resolved": "https://registry.npmmirror.com/cssstyle/-/cssstyle-2.3.0.tgz", "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", "dev": true, "requires": { @@ -8645,7 +8670,7 @@ "dependencies": { "cssom": { "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "resolved": "https://registry.npmmirror.com/cssom/-/cssom-0.3.8.tgz", "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", "dev": true } @@ -8683,13 +8708,13 @@ }, "decamelize": { "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/decamelize/download/decamelize-1.2.0.tgz?cache=0&sync_timestamp=1633055760479&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fdecamelize%2Fdownload%2Fdecamelize-1.2.0.tgz", + "resolved": "https://registry.npm.taobao.org/decamelize/download/decamelize-1.2.0.tgz", "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, "decimal.js": { "version": "10.3.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", + "resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.3.1.tgz", "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", "dev": true }, @@ -8702,7 +8727,7 @@ "dedent": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=" + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==" }, "deep-is": { "version": "0.1.3", @@ -8740,7 +8765,7 @@ }, "define-properties": { "version": "1.1.3", - "resolved": "https://registry.nlark.com/define-properties/download/define-properties-1.1.3.tgz?cache=0&sync_timestamp=1618847174317&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fdefine-properties%2Fdownload%2Fdefine-properties-1.1.3.tgz", + "resolved": "https://registry.npm.taobao.org/define-properties/download/define-properties-1.1.3.tgz", "integrity": "sha1-z4jabL7ib+bbcJT2HYcMvYTO6fE=", "dev": true, "requires": { @@ -8759,7 +8784,7 @@ "dependencies": { "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/is-accessor-descriptor/download/is-accessor-descriptor-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { @@ -8768,7 +8793,7 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/is-data-descriptor/download/is-data-descriptor-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-data-descriptor/download/is-data-descriptor-1.0.0.tgz", "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { @@ -8820,7 +8845,7 @@ }, "delayed-stream": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true }, @@ -8879,7 +8904,7 @@ }, "diff-sequences": { "version": "24.9.0", - "resolved": "https://registry.npmmirror.com/diff-sequences/download/diff-sequences-24.9.0.tgz", + "resolved": "https://registry.npm.taobao.org/diff-sequences/download/diff-sequences-24.9.0.tgz?cache=0&sync_timestamp=1579655107286&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdiff-sequences%2Fdownload%2Fdiff-sequences-24.9.0.tgz", "integrity": "sha1-VxXWJE4qpl9Iu6C8ly2wsLEelbU=", "dev": true }, @@ -8964,7 +8989,7 @@ }, "ecstatic": { "version": "3.3.2", - "resolved": "https://registry.npmmirror.com/ecstatic/download/ecstatic-3.3.2.tgz", + "resolved": "https://registry.npm.taobao.org/ecstatic/download/ecstatic-3.3.2.tgz", "integrity": "sha1-bR3UmBTQBZRoLGUq22YHamnUbEg=", "dev": true, "requires": { @@ -9025,7 +9050,7 @@ }, "error-ex": { "version": "1.3.2", - "resolved": "https://registry.nlark.com/error-ex/download/error-ex-1.3.2.tgz", + "resolved": "https://registry.npm.taobao.org/error-ex/download/error-ex-1.3.2.tgz", "integrity": "sha1-tKxAZIEH/c3PriQvQovqihTU8b8=", "dev": true, "requires": { @@ -9077,7 +9102,7 @@ "dependencies": { "call-bind": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/call-bind/-/call-bind-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, "requires": { @@ -9252,7 +9277,7 @@ }, "es6-iterator": { "version": "2.0.3", - "resolved": "https://registry.nlark.com/es6-iterator/download/es6-iterator-2.0.3.tgz", + "resolved": "https://registry.npm.taobao.org/es6-iterator/download/es6-iterator-2.0.3.tgz", "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", "dev": true, "requires": { @@ -9285,17 +9310,17 @@ }, "escalade": { "version": "3.1.1", - "resolved": "https://registry.npm.taobao.org/escalade/download/escalade-3.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/escalade/download/escalade-3.1.1.tgz?cache=0&sync_timestamp=1602567343144&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fescalade%2Fdownload%2Fescalade-3.1.1.tgz", "integrity": "sha1-2M/ccACWXFoBdLSoLqpcBVJ0LkA=" }, "escape-string-regexp": { "version": "1.0.5", - "resolved": "https://registry.nlark.com/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz", + "resolved": "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "escodegen": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "resolved": "https://registry.npmmirror.com/escodegen/-/escodegen-2.0.0.tgz", "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", "dev": true, "requires": { @@ -9308,13 +9333,13 @@ "dependencies": { "estraverse": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "resolved": "https://registry.npmmirror.com/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "optional": true @@ -9423,7 +9448,7 @@ }, "chalk": { "version": "4.1.2", - "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { @@ -9433,7 +9458,7 @@ }, "color-convert": { "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { @@ -9442,13 +9467,13 @@ }, "color-name": { "version": "1.1.4", - "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "cross-spawn": { "version": "7.0.3", - "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { @@ -9468,7 +9493,7 @@ }, "escape-string-regexp": { "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, @@ -9529,7 +9554,7 @@ }, "has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, @@ -9544,7 +9569,7 @@ }, "levn": { "version": "0.4.1", - "resolved": "https://registry.npmmirror.com/levn/-/levn-0.4.1.tgz", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "requires": { @@ -9601,19 +9626,19 @@ }, "path-key": { "version": "3.1.1", - "resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "prelude-ls": { "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/prelude-ls/-/prelude-ls-1.2.1.tgz", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, "shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { @@ -9622,7 +9647,7 @@ }, "shebang-regex": { "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, @@ -9646,7 +9671,7 @@ }, "type-check": { "version": "0.4.0", - "resolved": "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "requires": { @@ -9655,7 +9680,7 @@ }, "type-fest": { "version": "0.20.2", - "resolved": "https://registry.npmmirror.com/type-fest/-/type-fest-0.20.2.tgz", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true } @@ -9744,7 +9769,7 @@ "dependencies": { "debug": { "version": "3.2.7", - "resolved": "https://registry.npmmirror.com/debug/-/debug-3.2.7.tgz", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "requires": { @@ -9775,7 +9800,7 @@ "dependencies": { "debug": { "version": "3.2.7", - "resolved": "https://registry.npmmirror.com/debug/-/debug-3.2.7.tgz", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "requires": { @@ -9818,7 +9843,7 @@ }, "doctrine": { "version": "2.1.0", - "resolved": "https://registry.npmmirror.com/doctrine/-/doctrine-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { @@ -9978,7 +10003,7 @@ }, "execa": { "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/execa/download/execa-1.0.0.tgz?cache=0&sync_timestamp=1637147207309&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fexeca%2Fdownload%2Fexeca-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/execa/download/execa-1.0.0.tgz?cache=0&sync_timestamp=1576749091315&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fexeca%2Fdownload%2Fexeca-1.0.0.tgz", "integrity": "sha1-xiNqW7TfbW8V6I5/AXeYIWdJ3dg=", "dev": true, "requires": { @@ -10014,7 +10039,7 @@ "dependencies": { "debug": { "version": "2.6.9", - "resolved": "https://registry.npmmirror.com/debug/download/debug-2.6.9.tgz", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz", "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "requires": { @@ -10032,7 +10057,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.nlark.com/extend-shallow/download/extend-shallow-2.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -10041,7 +10066,7 @@ }, "ms": { "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/ms/download/ms-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true } @@ -10049,7 +10074,7 @@ }, "expand-tilde": { "version": "2.0.2", - "resolved": "https://registry.nlark.com/expand-tilde/download/expand-tilde-2.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/expand-tilde/download/expand-tilde-2.0.2.tgz", "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", "dev": true, "requires": { @@ -10058,7 +10083,7 @@ }, "expect": { "version": "26.6.2", - "resolved": "https://registry.npmmirror.com/expect/download/expect-26.6.2.tgz", + "resolved": "https://registry.npm.taobao.org/expect/download/expect-26.6.2.tgz?cache=0&sync_timestamp=1616701586390&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fexpect%2Fdownload%2Fexpect-26.6.2.tgz", "integrity": "sha1-xrmWvya/P+GLZ7LQ9R/JgbqTRBc=", "dev": true, "requires": { @@ -10072,7 +10097,7 @@ "dependencies": { "@jest/types": { "version": "26.6.2", - "resolved": "https://registry.npmmirror.com/@jest/types/download/@jest/types-26.6.2.tgz", + "resolved": "https://registry.npm.taobao.org/@jest/types/download/@jest/types-26.6.2.tgz", "integrity": "sha1-vvWlMgMOHYii9abZM/hOlyJu1I4=", "dev": true, "requires": { @@ -10103,7 +10128,7 @@ }, "ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.3.0.tgz?cache=0&sync_timestamp=1611327117754&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-styles%2Fdownload%2Fansi-styles-4.3.0.tgz", "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=", "dev": true, "requires": { @@ -10122,7 +10147,7 @@ }, "color-convert": { "version": "2.0.1", - "resolved": "https://registry.nlark.com/color-convert/download/color-convert-2.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", "dev": true, "requires": { @@ -10137,19 +10162,19 @@ }, "has-flag": { "version": "4.0.0", - "resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz?cache=0&sync_timestamp=1626715907927&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fhas-flag%2Fdownload%2Fhas-flag-4.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", "dev": true }, "jest-get-type": { "version": "26.3.0", - "resolved": "https://registry.npmmirror.com/jest-get-type/download/jest-get-type-26.3.0.tgz", + "resolved": "https://registry.npm.taobao.org/jest-get-type/download/jest-get-type-26.3.0.tgz", "integrity": "sha1-6X3Dw/U8K0Bsp6+u1Ek7HQmRmeA=", "dev": true }, "supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmmirror.com/supports-color/download/supports-color-7.2.0.tgz", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1611394043517&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz", "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=", "dev": true, "requires": { @@ -10183,7 +10208,7 @@ }, "extend-shallow": { "version": "3.0.2", - "resolved": "https://registry.nlark.com/extend-shallow/download/extend-shallow-3.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-3.0.2.tgz", "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "dev": true, "requires": { @@ -10193,7 +10218,7 @@ "dependencies": { "is-extendable": { "version": "1.0.1", - "resolved": "https://registry.nlark.com/is-extendable/download/is-extendable-1.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/is-extendable/download/is-extendable-1.0.1.tgz", "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", "dev": true, "requires": { @@ -10204,7 +10229,7 @@ }, "extglob": { "version": "2.0.4", - "resolved": "https://registry.nlark.com/extglob/download/extglob-2.0.4.tgz", + "resolved": "https://registry.npm.taobao.org/extglob/download/extglob-2.0.4.tgz", "integrity": "sha1-rQD+TcYSqSMuhxhxHcXLWrAoVUM=", "dev": true, "requires": { @@ -10229,7 +10254,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.nlark.com/extend-shallow/download/extend-shallow-2.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -10238,7 +10263,7 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/is-accessor-descriptor/download/is-accessor-descriptor-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { @@ -10247,7 +10272,7 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/is-data-descriptor/download/is-data-descriptor-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-data-descriptor/download/is-data-descriptor-1.0.0.tgz", "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { @@ -10269,7 +10294,7 @@ }, "fancy-log": { "version": "1.3.3", - "resolved": "https://registry.nlark.com/fancy-log/download/fancy-log-1.3.3.tgz", + "resolved": "https://registry.npm.taobao.org/fancy-log/download/fancy-log-1.3.3.tgz", "integrity": "sha1-28GRVPVYaQFQojlToK29A1vkX8c=", "dev": true, "requires": { @@ -10350,7 +10375,7 @@ }, "fast-levenshtein": { "version": "2.0.6", - "resolved": "https://registry.nlark.com/fast-levenshtein/download/fast-levenshtein-2.0.6.tgz", + "resolved": "https://registry.npm.taobao.org/fast-levenshtein/download/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, "fast-safe-stringify": { @@ -10505,16 +10530,27 @@ }, "for-own": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/for-own/download/for-own-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/for-own/download/for-own-1.0.0.tgz", "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", "dev": true, "requires": { "for-in": "^1.0.1" } }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, "fragment-cache": { "version": "0.2.1", - "resolved": "https://registry.nlark.com/fragment-cache/download/fragment-cache-0.2.1.tgz", + "resolved": "https://registry.npm.taobao.org/fragment-cache/download/fragment-cache-0.2.1.tgz", "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, "requires": { @@ -10524,12 +10560,12 @@ "fs": { "version": "0.0.1-security", "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", - "integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==", + "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=", "dev": true }, "fs-extra": { "version": "7.0.1", - "resolved": "https://registry.nlark.com/fs-extra/download/fs-extra-7.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/fs-extra/download/fs-extra-7.0.1.tgz", "integrity": "sha1-TxicRKoSO4lfcigE9V6iPq3DSOk=", "dev": true, "requires": { @@ -10538,9 +10574,29 @@ "universalify": "^0.1.0" } }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + } + } + }, "fs-mkdirp-stream": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/fs-mkdirp-stream/download/fs-mkdirp-stream-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/fs-mkdirp-stream/download/fs-mkdirp-stream-1.0.0.tgz", "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", "dev": true, "requires": { @@ -10550,7 +10606,7 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/fs.realpath/download/fs.realpath-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/fs.realpath/download/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { @@ -11183,7 +11239,7 @@ }, "function-bind": { "version": "1.1.1", - "resolved": "https://registry.nlark.com/function-bind/download/function-bind-1.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/function-bind/download/function-bind-1.1.1.tgz", "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=" }, "function.prototype.name": { @@ -11364,7 +11420,7 @@ }, "gensync": { "version": "1.0.0-beta.2", - "resolved": "https://registry.nlark.com/gensync/download/gensync-1.0.0-beta.2.tgz", + "resolved": "https://registry.npm.taobao.org/gensync/download/gensync-1.0.0-beta.2.tgz", "integrity": "sha1-MqbudsPX9S1GsrGuXZP+qFgKJeA=" }, "get-assigned-identifiers": { @@ -11398,7 +11454,7 @@ }, "get-stream": { "version": "4.1.0", - "resolved": "https://registry.nlark.com/get-stream/download/get-stream-4.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/get-stream/download/get-stream-4.1.0.tgz", "integrity": "sha1-wbJVV189wh1Zv8ec09K0axw6VLU=", "dev": true, "requires": { @@ -11440,7 +11496,7 @@ }, "get-value": { "version": "2.0.6", - "resolved": "https://registry.nlark.com/get-value/download/get-value-2.0.6.tgz", + "resolved": "https://registry.npm.taobao.org/get-value/download/get-value-2.0.6.tgz", "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", "dev": true }, @@ -11479,7 +11535,7 @@ }, "glob-stream": { "version": "6.1.0", - "resolved": "https://registry.nlark.com/glob-stream/download/glob-stream-6.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/glob-stream/download/glob-stream-6.1.0.tgz", "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=", "dev": true, "requires": { @@ -11497,7 +11553,7 @@ "dependencies": { "glob-parent": { "version": "3.1.0", - "resolved": "https://registry.npmmirror.com/glob-parent/download/glob-parent-3.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/glob-parent/download/glob-parent-3.1.0.tgz?cache=0&sync_timestamp=1569108917227&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fglob-parent%2Fdownload%2Fglob-parent-3.1.0.tgz", "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "dev": true, "requires": { @@ -11507,7 +11563,7 @@ }, "is-glob": { "version": "3.1.0", - "resolved": "https://registry.npmmirror.com/is-glob/download/is-glob-3.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-glob/download/is-glob-3.1.0.tgz", "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "dev": true, "requires": { @@ -11532,7 +11588,7 @@ }, "global-modules": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/global-modules/download/global-modules-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/global-modules/download/global-modules-1.0.0.tgz?cache=0&sync_timestamp=1571657602039&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fglobal-modules%2Fdownload%2Fglobal-modules-1.0.0.tgz", "integrity": "sha1-bXcPDrUjrHgWTXK15xqIdyZcw+o=", "dev": true, "requires": { @@ -11567,7 +11623,7 @@ }, "globals": { "version": "11.12.0", - "resolved": "https://registry.npmmirror.com/globals/download/globals-11.12.0.tgz", + "resolved": "https://registry.npm.taobao.org/globals/download/globals-11.12.0.tgz", "integrity": "sha1-q4eVM4hooLq9hSV1gBjCp+uVxC4=" }, "globalthis": { @@ -11603,7 +11659,7 @@ }, "glogg": { "version": "1.0.2", - "resolved": "https://registry.nlark.com/glogg/download/glogg-1.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/glogg/download/glogg-1.0.2.tgz", "integrity": "sha1-LX3XAr7aIus7/634gGltpthGMT8=", "dev": true, "requires": { @@ -11670,7 +11726,7 @@ "camelcase": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", "dev": true }, "gulp-cli": { @@ -11701,7 +11757,7 @@ }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/is-fullwidth-code-point/download/is-fullwidth-code-point-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { @@ -11710,7 +11766,7 @@ }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/string-width/download/string-width-1.0.2.tgz?cache=0&sync_timestamp=1632421309919&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fstring-width%2Fdownload%2Fstring-width-1.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/string-width/download/string-width-1.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring-width%2Fdownload%2Fstring-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { @@ -11826,7 +11882,7 @@ }, "gulplog": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/gulplog/download/gulplog-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/gulplog/download/gulplog-1.0.0.tgz", "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", "dev": true, "requires": { @@ -11835,7 +11891,7 @@ }, "has": { "version": "1.0.3", - "resolved": "https://registry.nlark.com/has/download/has-1.0.3.tgz", + "resolved": "https://registry.npm.taobao.org/has/download/has-1.0.3.tgz", "integrity": "sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y=", "requires": { "function-bind": "^1.1.1" @@ -11849,7 +11905,7 @@ }, "has-flag": { "version": "3.0.0", - "resolved": "https://registry.nlark.com/has-flag/download/has-flag-3.0.0.tgz?cache=0&sync_timestamp=1626715907927&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fhas-flag%2Fdownload%2Fhas-flag-3.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, "has-gulplog": { @@ -11914,7 +11970,7 @@ }, "has-value": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/has-value/download/has-value-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/has-value/download/has-value-1.0.0.tgz", "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", "dev": true, "requires": { @@ -11925,7 +11981,7 @@ }, "has-values": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/has-values/download/has-values-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/has-values/download/has-values-1.0.0.tgz", "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", "dev": true, "requires": { @@ -12039,7 +12095,7 @@ }, "http-proxy": { "version": "1.18.1", - "resolved": "https://registry.nlark.com/http-proxy/download/http-proxy-1.18.1.tgz?cache=0&sync_timestamp=1618847045732&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fhttp-proxy%2Fdownload%2Fhttp-proxy-1.18.1.tgz", + "resolved": "https://registry.npm.taobao.org/http-proxy/download/http-proxy-1.18.1.tgz", "integrity": "sha1-QBVB8FNIhLv5UmAzTnL4juOXZUk=", "dev": true, "requires": { @@ -12050,7 +12106,7 @@ }, "http-server": { "version": "0.12.3", - "resolved": "https://registry.npmmirror.com/http-server/download/http-server-0.12.3.tgz?cache=0&sync_timestamp=1634685922991&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fhttp-server%2Fdownload%2Fhttp-server-0.12.3.tgz", + "resolved": "https://registry.npm.taobao.org/http-server/download/http-server-0.12.3.tgz", "integrity": "sha1-ugRx0OzEJYhmFss1xPryeRQKDTc=", "dev": true, "requires": { @@ -12074,7 +12130,7 @@ }, "https-proxy-agent": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "resolved": "https://registry.npmmirror.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "requires": { @@ -12121,7 +12177,7 @@ }, "imurmurhash": { "version": "0.1.4", - "resolved": "https://registry.nlark.com/imurmurhash/download/imurmurhash-0.1.4.tgz", + "resolved": "https://registry.npm.taobao.org/imurmurhash/download/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, "indent-string": { @@ -12141,7 +12197,7 @@ }, "inherits": { "version": "2.0.4", - "resolved": "https://registry.nlark.com/inherits/download/inherits-2.0.4.tgz", + "resolved": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.4.tgz", "integrity": "sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=" }, "ini": { @@ -12209,7 +12265,7 @@ }, "invariant": { "version": "2.2.4", - "resolved": "https://registry.npm.taobao.org/invariant/download/invariant-2.2.4.tgz?cache=0&sync_timestamp=1615984365242&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Finvariant%2Fdownload%2Finvariant-2.2.4.tgz", + "resolved": "https://registry.npm.taobao.org/invariant/download/invariant-2.2.4.tgz", "integrity": "sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY=", "dev": true, "requires": { @@ -12218,7 +12274,7 @@ }, "invert-kv": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/invert-kv/download/invert-kv-1.0.0.tgz?cache=0&sync_timestamp=1630996809231&other_urls=https%3A%2F%2Fregistry.nlark.com%2Finvert-kv%2Fdownload%2Finvert-kv-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/invert-kv/download/invert-kv-1.0.0.tgz", "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", "dev": true }, @@ -12234,7 +12290,7 @@ }, "is-accessor-descriptor": { "version": "0.1.6", - "resolved": "https://registry.nlark.com/is-accessor-descriptor/download/is-accessor-descriptor-0.1.6.tgz", + "resolved": "https://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { @@ -12356,7 +12412,7 @@ }, "is-binary-path": { "version": "1.0.1", - "resolved": "https://registry.nlark.com/is-binary-path/download/is-binary-path-1.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/is-binary-path/download/is-binary-path-1.0.1.tgz", "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "dev": true, "requires": { @@ -12398,7 +12454,7 @@ }, "is-buffer": { "version": "1.1.6", - "resolved": "https://registry.npm.taobao.org/is-buffer/download/is-buffer-1.1.6.tgz?cache=0&sync_timestamp=1604432327227&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-buffer%2Fdownload%2Fis-buffer-1.1.6.tgz", + "resolved": "https://registry.npm.taobao.org/is-buffer/download/is-buffer-1.1.6.tgz", "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=", "dev": true }, @@ -12410,7 +12466,7 @@ }, "is-ci": { "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/is-ci/download/is-ci-2.0.0.tgz?cache=0&sync_timestamp=1635261061017&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fis-ci%2Fdownload%2Fis-ci-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-ci/download/is-ci-2.0.0.tgz", "integrity": "sha1-a8YzQYGBDgS1wis9WJ/cpVAmQEw=", "dev": true, "requires": { @@ -12428,7 +12484,7 @@ }, "is-data-descriptor": { "version": "0.1.4", - "resolved": "https://registry.nlark.com/is-data-descriptor/download/is-data-descriptor-0.1.4.tgz", + "resolved": "https://registry.npm.taobao.org/is-data-descriptor/download/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { @@ -12483,7 +12539,7 @@ }, "is-extendable": { "version": "0.1.1", - "resolved": "https://registry.nlark.com/is-extendable/download/is-extendable-0.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/is-extendable/download/is-extendable-0.1.1.tgz", "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", "dev": true }, @@ -12524,13 +12580,13 @@ }, "is-module": { "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/is-module/-/is-module-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", "dev": true }, "is-negated-glob": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/is-negated-glob/download/is-negated-glob-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-negated-glob/download/is-negated-glob-1.0.0.tgz", "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", "dev": true }, @@ -12591,7 +12647,7 @@ }, "is-potential-custom-element-name": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "resolved": "https://registry.npmmirror.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, @@ -12680,7 +12736,7 @@ }, "is-stream": { "version": "1.1.0", - "resolved": "https://registry.nlark.com/is-stream/download/is-stream-1.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-stream/download/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, @@ -12936,7 +12992,7 @@ }, "is-windows": { "version": "1.0.2", - "resolved": "https://registry.nlark.com/is-windows/download/is-windows-1.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/is-windows/download/is-windows-1.0.2.tgz", "integrity": "sha1-0YUOuXkezRjmGCzhKjDzlmNLsZ0=", "dev": true }, @@ -12952,13 +13008,13 @@ }, "isarray": { "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz?cache=0&sync_timestamp=1562592096220&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fisarray%2Fdownload%2Fisarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "isexe": { "version": "2.0.0", - "resolved": "https://registry.nlark.com/isexe/download/isexe-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/isexe/download/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { @@ -13961,7 +14017,7 @@ }, "jest-diff": { "version": "24.9.0", - "resolved": "https://registry.npmmirror.com/jest-diff/download/jest-diff-24.9.0.tgz", + "resolved": "https://registry.npm.taobao.org/jest-diff/download/jest-diff-24.9.0.tgz", "integrity": "sha1-kxt9DVd4obr3RSy4FuMl43JAVdo=", "dev": true, "requires": { @@ -14433,7 +14489,7 @@ }, "@types/istanbul-reports": { "version": "3.0.1", - "resolved": "https://registry.npmmirror.com/@types/istanbul-reports/download/@types/istanbul-reports-3.0.1.tgz?cache=0&sync_timestamp=1637266160892&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2F%40types%2Fistanbul-reports%2Fdownload%2F%40types%2Fistanbul-reports-3.0.1.tgz", + "resolved": "https://registry.npmmirror.com/@types/istanbul-reports/download/@types/istanbul-reports-3.0.1.tgz", "integrity": "sha1-kVP+mLuivVZaY63ZQ21vDX+EaP8=", "dev": true, "requires": { @@ -14442,7 +14498,7 @@ }, "@types/yargs": { "version": "16.0.4", - "resolved": "https://registry.npmmirror.com/@types/yargs/download/@types/yargs-16.0.4.tgz?cache=0&sync_timestamp=1637271118840&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2F%40types%2Fyargs%2Fdownload%2F%40types%2Fyargs-16.0.4.tgz", + "resolved": "https://registry.npmmirror.com/@types/yargs/download/@types/yargs-16.0.4.tgz", "integrity": "sha1-JqrZjdLCo45CEIbqmtQrnlFkKXc=", "dev": true, "requires": { @@ -14457,7 +14513,7 @@ }, "ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz", + "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz?cache=0&sync_timestamp=1618995588464&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fansi-styles%2Fdownload%2Fansi-styles-4.3.0.tgz", "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=", "dev": true, "requires": { @@ -14466,7 +14522,7 @@ }, "chalk": { "version": "4.1.2", - "resolved": "https://registry.npmmirror.com/chalk/download/chalk-4.1.2.tgz", + "resolved": "https://registry.nlark.com/chalk/download/chalk-4.1.2.tgz?cache=0&sync_timestamp=1627646655305&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-4.1.2.tgz", "integrity": "sha1-qsTit3NKdAhnrrFr8CqtVWoeegE=", "dev": true, "requires": { @@ -14545,7 +14601,7 @@ "dependencies": { "ansi-styles": { "version": "5.2.0", - "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-5.2.0.tgz", + "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-5.2.0.tgz?cache=0&sync_timestamp=1618995588464&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fansi-styles%2Fdownload%2Fansi-styles-5.2.0.tgz", "integrity": "sha1-B0SWkK1Fd30ZJKwquy/IiV26g2s=", "dev": true } @@ -14553,7 +14609,7 @@ }, "react-is": { "version": "17.0.2", - "resolved": "https://registry.npmmirror.com/react-is/download/react-is-17.0.2.tgz", + "resolved": "https://registry.npmmirror.com/react-is/download/react-is-17.0.2.tgz?cache=0&sync_timestamp=1637338596901&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Freact-is%2Fdownload%2Freact-is-17.0.2.tgz", "integrity": "sha1-5pHUqOnHiTZWVVOas3J2Kw77VPA=", "dev": true }, @@ -14570,7 +14626,7 @@ }, "jest-get-type": { "version": "24.9.0", - "resolved": "https://registry.npmmirror.com/jest-get-type/download/jest-get-type-24.9.0.tgz", + "resolved": "https://registry.npm.taobao.org/jest-get-type/download/jest-get-type-24.9.0.tgz?cache=0&sync_timestamp=1579655144842&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-get-type%2Fdownload%2Fjest-get-type-24.9.0.tgz", "integrity": "sha1-FoSgyKUPLkkBtmRK6GH1ee7S7w4=", "dev": true }, @@ -14863,7 +14919,7 @@ }, "jest-matcher-deep-close-to": { "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/jest-matcher-deep-close-to/download/jest-matcher-deep-close-to-2.0.1.tgz", + "resolved": "https://registry.nlark.com/jest-matcher-deep-close-to/download/jest-matcher-deep-close-to-2.0.1.tgz", "integrity": "sha1-L50NpE94oWo5BNGJguOV6Y43XFo=", "dev": true, "requires": { @@ -14872,7 +14928,7 @@ "dependencies": { "@jest/types": { "version": "25.5.0", - "resolved": "https://registry.npmmirror.com/@jest/types/download/@jest/types-25.5.0.tgz", + "resolved": "https://registry.nlark.com/@jest/types/download/@jest/types-25.5.0.tgz?cache=0&sync_timestamp=1624900057884&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40jest%2Ftypes%2Fdownload%2F%40jest%2Ftypes-25.5.0.tgz", "integrity": "sha1-TWpHk/e5WZ/DaAh3uFapfbzPKp0=", "dev": true, "requires": { @@ -14884,7 +14940,7 @@ }, "@types/yargs": { "version": "15.0.14", - "resolved": "https://registry.npmmirror.com/@types/yargs/download/@types/yargs-15.0.14.tgz?cache=0&sync_timestamp=1637271118840&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2F%40types%2Fyargs%2Fdownload%2F%40types%2Fyargs-15.0.14.tgz", + "resolved": "https://registry.nlark.com/@types/yargs/download/@types/yargs-15.0.14.tgz", "integrity": "sha1-Jtgh3biecEkhYLZtEKDrbfj2+wY=", "dev": true, "requires": { @@ -14908,7 +14964,7 @@ }, "chalk": { "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/chalk/download/chalk-3.0.0.tgz", + "resolved": "https://registry.nlark.com/chalk/download/chalk-3.0.0.tgz?cache=0&sync_timestamp=1618995367379&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-3.0.0.tgz", "integrity": "sha1-P3PCv1JlkfV0zEksUeJFY0n4ROQ=", "dev": true, "requires": { @@ -14918,7 +14974,7 @@ }, "color-convert": { "version": "2.0.1", - "resolved": "https://registry.nlark.com/color-convert/download/color-convert-2.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", "dev": true, "requires": { @@ -14933,7 +14989,7 @@ }, "diff-sequences": { "version": "25.2.6", - "resolved": "https://registry.npmmirror.com/diff-sequences/download/diff-sequences-25.2.6.tgz", + "resolved": "https://registry.nlark.com/diff-sequences/download/diff-sequences-25.2.6.tgz?cache=0&sync_timestamp=1624900057366&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fdiff-sequences%2Fdownload%2Fdiff-sequences-25.2.6.tgz", "integrity": "sha1-X0Z8AO3TU1K3vKRteSfWDmh6dt0=", "dev": true }, @@ -14945,7 +15001,7 @@ }, "jest-diff": { "version": "25.5.0", - "resolved": "https://registry.npmmirror.com/jest-diff/download/jest-diff-25.5.0.tgz", + "resolved": "https://registry.nlark.com/jest-diff/download/jest-diff-25.5.0.tgz", "integrity": "sha1-HdJu1k+WZnwGjO8Ca2d9+gGvz6k=", "dev": true, "requires": { @@ -14957,13 +15013,13 @@ }, "jest-get-type": { "version": "25.2.6", - "resolved": "https://registry.npmmirror.com/jest-get-type/download/jest-get-type-25.2.6.tgz", + "resolved": "https://registry.nlark.com/jest-get-type/download/jest-get-type-25.2.6.tgz?cache=0&sync_timestamp=1624900056951&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjest-get-type%2Fdownload%2Fjest-get-type-25.2.6.tgz", "integrity": "sha1-Cwoy+riQi0TVCL6BaBSH26u42Hc=", "dev": true }, "jest-matcher-utils": { "version": "25.4.0", - "resolved": "https://registry.npmmirror.com/jest-matcher-utils/download/jest-matcher-utils-25.4.0.tgz", + "resolved": "https://registry.nlark.com/jest-matcher-utils/download/jest-matcher-utils-25.4.0.tgz", "integrity": "sha1-3D567EAqHlZ+2AtXK5rShYeIleY=", "dev": true, "requires": { @@ -14975,7 +15031,7 @@ }, "pretty-format": { "version": "25.5.0", - "resolved": "https://registry.npmmirror.com/pretty-format/download/pretty-format-25.5.0.tgz", + "resolved": "https://registry.nlark.com/pretty-format/download/pretty-format-25.5.0.tgz", "integrity": "sha1-eHPB13T2gsNLjUi2dDor8qxVeRo=", "dev": true, "requires": { @@ -14987,7 +15043,7 @@ }, "supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmmirror.com/supports-color/download/supports-color-7.2.0.tgz", + "resolved": "https://registry.nlark.com/supports-color/download/supports-color-7.2.0.tgz", "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=", "dev": true, "requires": { @@ -14998,7 +15054,7 @@ }, "jest-matcher-utils": { "version": "26.6.2", - "resolved": "https://registry.npmmirror.com/jest-matcher-utils/download/jest-matcher-utils-26.6.2.tgz", + "resolved": "https://registry.npm.taobao.org/jest-matcher-utils/download/jest-matcher-utils-26.6.2.tgz?cache=0&sync_timestamp=1616701585427&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-matcher-utils%2Fdownload%2Fjest-matcher-utils-26.6.2.tgz", "integrity": "sha1-jm/W6GPIstMaxkcu6yN7xZXlPno=", "dev": true, "requires": { @@ -15010,7 +15066,7 @@ "dependencies": { "@jest/types": { "version": "26.6.2", - "resolved": "https://registry.npmmirror.com/@jest/types/download/@jest/types-26.6.2.tgz", + "resolved": "https://registry.npm.taobao.org/@jest/types/download/@jest/types-26.6.2.tgz", "integrity": "sha1-vvWlMgMOHYii9abZM/hOlyJu1I4=", "dev": true, "requires": { @@ -15047,7 +15103,7 @@ }, "ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.3.0.tgz?cache=0&sync_timestamp=1611327117754&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-styles%2Fdownload%2Fansi-styles-4.3.0.tgz", "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=", "dev": true, "requires": { @@ -15066,7 +15122,7 @@ }, "color-convert": { "version": "2.0.1", - "resolved": "https://registry.nlark.com/color-convert/download/color-convert-2.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", "dev": true, "requires": { @@ -15081,19 +15137,19 @@ }, "diff-sequences": { "version": "26.6.2", - "resolved": "https://registry.npmmirror.com/diff-sequences/download/diff-sequences-26.6.2.tgz", + "resolved": "https://registry.npm.taobao.org/diff-sequences/download/diff-sequences-26.6.2.tgz", "integrity": "sha1-SLqZFX3hkjQS7tQdtrbUqpynwLE=", "dev": true }, "has-flag": { "version": "4.0.0", - "resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz?cache=0&sync_timestamp=1626715907927&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fhas-flag%2Fdownload%2Fhas-flag-4.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", "dev": true }, "jest-diff": { "version": "26.6.2", - "resolved": "https://registry.npmmirror.com/jest-diff/download/jest-diff-26.6.2.tgz", + "resolved": "https://registry.npm.taobao.org/jest-diff/download/jest-diff-26.6.2.tgz?cache=0&sync_timestamp=1616701585219&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-diff%2Fdownload%2Fjest-diff-26.6.2.tgz", "integrity": "sha1-GqdGi1LDpo19XF/c381eSb0WQ5Q=", "dev": true, "requires": { @@ -15105,13 +15161,13 @@ }, "jest-get-type": { "version": "26.3.0", - "resolved": "https://registry.npmmirror.com/jest-get-type/download/jest-get-type-26.3.0.tgz", + "resolved": "https://registry.npm.taobao.org/jest-get-type/download/jest-get-type-26.3.0.tgz", "integrity": "sha1-6X3Dw/U8K0Bsp6+u1Ek7HQmRmeA=", "dev": true }, "pretty-format": { "version": "26.6.2", - "resolved": "https://registry.npmmirror.com/pretty-format/download/pretty-format-26.6.2.tgz", + "resolved": "https://registry.npm.taobao.org/pretty-format/download/pretty-format-26.6.2.tgz?cache=0&sync_timestamp=1616701219088&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpretty-format%2Fdownload%2Fpretty-format-26.6.2.tgz", "integrity": "sha1-41wnBfFMt/4v6U+geDRbREEg/JM=", "dev": true, "requires": { @@ -15123,13 +15179,13 @@ }, "react-is": { "version": "17.0.2", - "resolved": "https://registry.npmmirror.com/react-is/download/react-is-17.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/react-is/download/react-is-17.0.2.tgz", "integrity": "sha1-5pHUqOnHiTZWVVOas3J2Kw77VPA=", "dev": true }, "supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmmirror.com/supports-color/download/supports-color-7.2.0.tgz", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1611394043517&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz", "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=", "dev": true, "requires": { @@ -15140,7 +15196,7 @@ }, "jest-message-util": { "version": "26.6.2", - "resolved": "https://registry.npmmirror.com/jest-message-util/download/jest-message-util-26.6.2.tgz", + "resolved": "https://registry.npm.taobao.org/jest-message-util/download/jest-message-util-26.6.2.tgz?cache=0&sync_timestamp=1616701584149&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-message-util%2Fdownload%2Fjest-message-util-26.6.2.tgz", "integrity": "sha1-WBc3RK1vwFBrXSEVC5vlbvABygc=", "dev": true, "requires": { @@ -15157,7 +15213,7 @@ "dependencies": { "@jest/types": { "version": "26.6.2", - "resolved": "https://registry.npmmirror.com/@jest/types/download/@jest/types-26.6.2.tgz", + "resolved": "https://registry.npm.taobao.org/@jest/types/download/@jest/types-26.6.2.tgz", "integrity": "sha1-vvWlMgMOHYii9abZM/hOlyJu1I4=", "dev": true, "requires": { @@ -15194,7 +15250,7 @@ }, "ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.3.0.tgz?cache=0&sync_timestamp=1611327117754&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-styles%2Fdownload%2Fansi-styles-4.3.0.tgz", "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=", "dev": true, "requires": { @@ -15222,7 +15278,7 @@ }, "color-convert": { "version": "2.0.1", - "resolved": "https://registry.nlark.com/color-convert/download/color-convert-2.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", "dev": true, "requires": { @@ -15252,7 +15308,7 @@ }, "has-flag": { "version": "4.0.0", - "resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz?cache=0&sync_timestamp=1626715907927&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fhas-flag%2Fdownload%2Fhas-flag-4.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", "dev": true }, @@ -15274,7 +15330,7 @@ }, "pretty-format": { "version": "26.6.2", - "resolved": "https://registry.npmmirror.com/pretty-format/download/pretty-format-26.6.2.tgz", + "resolved": "https://registry.npm.taobao.org/pretty-format/download/pretty-format-26.6.2.tgz?cache=0&sync_timestamp=1616701219088&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpretty-format%2Fdownload%2Fpretty-format-26.6.2.tgz", "integrity": "sha1-41wnBfFMt/4v6U+geDRbREEg/JM=", "dev": true, "requires": { @@ -15286,13 +15342,13 @@ }, "react-is": { "version": "17.0.2", - "resolved": "https://registry.npmmirror.com/react-is/download/react-is-17.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/react-is/download/react-is-17.0.2.tgz", "integrity": "sha1-5pHUqOnHiTZWVVOas3J2Kw77VPA=", "dev": true }, "supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmmirror.com/supports-color/download/supports-color-7.2.0.tgz", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1611394043517&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz", "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=", "dev": true, "requires": { @@ -15411,7 +15467,7 @@ }, "jest-regex-util": { "version": "26.0.0", - "resolved": "https://registry.npmmirror.com/jest-regex-util/download/jest-regex-util-26.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/jest-regex-util/download/jest-regex-util-26.0.0.tgz?cache=0&sync_timestamp=1607352728942&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-regex-util%2Fdownload%2Fjest-regex-util-26.0.0.tgz", "integrity": "sha1-0l5xhLNuOf1GbDvEG+CXHoIf7ig=", "dev": true }, @@ -16700,7 +16756,7 @@ }, "jest-util": { "version": "26.6.2", - "resolved": "https://registry.npmmirror.com/jest-util/download/jest-util-26.6.2.tgz", + "resolved": "https://registry.npm.taobao.org/jest-util/download/jest-util-26.6.2.tgz?cache=0&sync_timestamp=1616701582882&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-util%2Fdownload%2Fjest-util-26.6.2.tgz", "integrity": "sha1-kHU12+TVpstMR6ybkm9q8pV2y8E=", "dev": true, "requires": { @@ -16714,7 +16770,7 @@ "dependencies": { "@jest/types": { "version": "26.6.2", - "resolved": "https://registry.npmmirror.com/@jest/types/download/@jest/types-26.6.2.tgz", + "resolved": "https://registry.npm.taobao.org/@jest/types/download/@jest/types-26.6.2.tgz", "integrity": "sha1-vvWlMgMOHYii9abZM/hOlyJu1I4=", "dev": true, "requires": { @@ -16745,7 +16801,7 @@ }, "ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.3.0.tgz?cache=0&sync_timestamp=1611327117754&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-styles%2Fdownload%2Fansi-styles-4.3.0.tgz", "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=", "dev": true, "requires": { @@ -16773,7 +16829,7 @@ }, "color-convert": { "version": "2.0.1", - "resolved": "https://registry.nlark.com/color-convert/download/color-convert-2.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", "dev": true, "requires": { @@ -16803,7 +16859,7 @@ }, "has-flag": { "version": "4.0.0", - "resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz?cache=0&sync_timestamp=1626715907927&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fhas-flag%2Fdownload%2Fhas-flag-4.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", "dev": true }, @@ -16825,7 +16881,7 @@ }, "supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmmirror.com/supports-color/download/supports-color-7.2.0.tgz", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1611394043517&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz", "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=", "dev": true, "requires": { @@ -17150,7 +17206,7 @@ }, "js-tokens": { "version": "4.0.0", - "resolved": "https://registry.nlark.com/js-tokens/download/js-tokens-4.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/js-tokens/download/js-tokens-4.0.0.tgz", "integrity": "sha1-GSA/tZmR35jjoocFDUZHzerzJJk=" }, "js-yaml": { @@ -17165,7 +17221,7 @@ }, "jsdom": { "version": "19.0.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-19.0.0.tgz", + "resolved": "https://registry.npmmirror.com/jsdom/-/jsdom-19.0.0.tgz", "integrity": "sha512-RYAyjCbxy/vri/CfnjUWJQQtZ3LKlLnDqj+9XLNnJPgEGeirZs3hllKR20re8LUZ6o1b1X4Jat+Qd26zmP41+A==", "dev": true, "requires": { @@ -17206,7 +17262,7 @@ }, "acorn": { "version": "8.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.7.1.tgz", "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true }, @@ -17353,7 +17409,7 @@ }, "jsesc": { "version": "2.5.2", - "resolved": "https://registry.nlark.com/jsesc/download/jsesc-2.5.2.tgz", + "resolved": "https://registry.npm.taobao.org/jsesc/download/jsesc-2.5.2.tgz", "integrity": "sha1-gFZNLkg9rPbo7yCWUKZ98/DCg6Q=" }, "json-parse-even-better-errors": { @@ -17364,12 +17420,12 @@ }, "json-schema-traverse": { "version": "0.4.1", - "resolved": "https://registry.nlark.com/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz", + "resolved": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz", "integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA=" }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", - "resolved": "https://registry.nlark.com/json-stable-stringify-without-jsonify/download/json-stable-stringify-without-jsonify-1.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/json-stable-stringify-without-jsonify/download/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" }, "json5": { @@ -17385,7 +17441,7 @@ }, "jsonfile": { "version": "4.0.0", - "resolved": "https://registry.nlark.com/jsonfile/download/jsonfile-4.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/jsonfile/download/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", "dev": true, "requires": { @@ -17428,7 +17484,7 @@ }, "last-run": { "version": "1.1.1", - "resolved": "https://registry.nlark.com/last-run/download/last-run-1.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/last-run/download/last-run-1.1.1.tgz", "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", "dev": true, "requires": { @@ -17447,7 +17503,7 @@ }, "lcid": { "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/lcid/download/lcid-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/lcid/download/lcid-1.0.0.tgz", "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "dev": true, "requires": { @@ -17465,7 +17521,7 @@ }, "leven": { "version": "3.1.0", - "resolved": "https://registry.nlark.com/leven/download/leven-3.1.0.tgz?cache=0&sync_timestamp=1628597922950&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fleven%2Fdownload%2Fleven-3.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/leven/download/leven-3.1.0.tgz", "integrity": "sha1-d4kd6DQGTMy6gq54QrtrFKE+1/I=", "dev": true }, @@ -17480,7 +17536,7 @@ }, "levn": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "resolved": "https://registry.npmmirror.com/levn/-/levn-0.3.0.tgz", "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", "dev": true, "requires": { @@ -17512,7 +17568,7 @@ }, "load-json-file": { "version": "1.1.0", - "resolved": "https://registry.nlark.com/load-json-file/download/load-json-file-1.1.0.tgz?cache=0&sync_timestamp=1631508607226&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fload-json-file%2Fdownload%2Fload-json-file-1.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/load-json-file/download/load-json-file-1.1.0.tgz", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { @@ -17552,7 +17608,7 @@ }, "loose-envify": { "version": "1.4.0", - "resolved": "https://registry.nlark.com/loose-envify/download/loose-envify-1.4.0.tgz", + "resolved": "https://registry.npm.taobao.org/loose-envify/download/loose-envify-1.4.0.tgz", "integrity": "sha1-ce5R+nvkyuwaY4OffmgtgTLTDK8=", "dev": true, "requires": { @@ -17561,7 +17617,7 @@ }, "lru-cache": { "version": "6.0.0", - "resolved": "https://registry.nlark.com/lru-cache/download/lru-cache-6.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/lru-cache/download/lru-cache-6.0.0.tgz", "integrity": "sha1-bW/mVw69lqr5D8rR2vo7JWbbOpQ=", "requires": { "yallist": "^4.0.0" @@ -17595,7 +17651,7 @@ }, "make-error": { "version": "1.3.6", - "resolved": "https://registry.nlark.com/make-error/download/make-error-1.3.6.tgz", + "resolved": "https://registry.npm.taobao.org/make-error/download/make-error-1.3.6.tgz?cache=0&sync_timestamp=1582105630664&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmake-error%2Fdownload%2Fmake-error-1.3.6.tgz", "integrity": "sha1-LrLjfqm2fEiR9oShOUeZr0hM96I=", "dev": true }, @@ -17628,7 +17684,7 @@ }, "map-age-cleaner": { "version": "0.1.3", - "resolved": "https://registry.nlark.com/map-age-cleaner/download/map-age-cleaner-0.1.3.tgz?cache=0&sync_timestamp=1629750856019&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fmap-age-cleaner%2Fdownload%2Fmap-age-cleaner-0.1.3.tgz", + "resolved": "https://registry.npm.taobao.org/map-age-cleaner/download/map-age-cleaner-0.1.3.tgz", "integrity": "sha1-fVg6cwZDTAVf5HSw9FB45uG0uSo=", "dev": true, "requires": { @@ -17637,13 +17693,13 @@ }, "map-cache": { "version": "0.2.2", - "resolved": "https://registry.nlark.com/map-cache/download/map-cache-0.2.2.tgz", + "resolved": "https://registry.npm.taobao.org/map-cache/download/map-cache-0.2.2.tgz", "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, "map-visit": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/map-visit/download/map-visit-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/map-visit/download/map-visit-1.0.0.tgz", "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "dev": true, "requires": { @@ -17664,7 +17720,7 @@ "dependencies": { "findup-sync": { "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/findup-sync/download/findup-sync-2.0.0.tgz?cache=0&sync_timestamp=1635766114067&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Ffindup-sync%2Fdownload%2Ffindup-sync-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/findup-sync/download/findup-sync-2.0.0.tgz", "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", "dev": true, "requires": { @@ -17676,7 +17732,7 @@ }, "is-glob": { "version": "3.1.0", - "resolved": "https://registry.npmmirror.com/is-glob/download/is-glob-3.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-glob/download/is-glob-3.1.0.tgz", "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "dev": true, "requires": { @@ -17698,7 +17754,7 @@ }, "mem": { "version": "4.3.0", - "resolved": "https://registry.nlark.com/mem/download/mem-4.3.0.tgz?cache=0&sync_timestamp=1626534487701&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fmem%2Fdownload%2Fmem-4.3.0.tgz", + "resolved": "https://registry.npm.taobao.org/mem/download/mem-4.3.0.tgz", "integrity": "sha1-Rhr0l7xK4JYIzbLmDu+2m/90QXg=", "dev": true, "requires": { @@ -17717,7 +17773,7 @@ }, "merge-stream": { "version": "2.0.0", - "resolved": "https://registry.nlark.com/merge-stream/download/merge-stream-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/merge-stream/download/merge-stream-2.0.0.tgz", "integrity": "sha1-UoI2KaFN0AyXcPtq1H3GMQ8sH2A=", "dev": true }, @@ -17767,19 +17823,19 @@ }, "mime": { "version": "1.6.0", - "resolved": "https://registry.npmmirror.com/mime/download/mime-1.6.0.tgz", + "resolved": "https://registry.npm.taobao.org/mime/download/mime-1.6.0.tgz?cache=0&sync_timestamp=1560034758817&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime%2Fdownload%2Fmime-1.6.0.tgz", "integrity": "sha1-Ms2eXGRVO9WNGaVor0Uqz/BJgbE=", "dev": true }, "mime-db": { "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true }, "mime-types": { "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, "requires": { @@ -17788,7 +17844,7 @@ }, "mimic-fn": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "resolved": "https://registry.npmmirror.com/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, @@ -17814,7 +17870,7 @@ }, "minimist": { "version": "1.2.5", - "resolved": "https://registry.npm.taobao.org/minimist/download/minimist-1.2.5.tgz", + "resolved": "https://registry.npm.taobao.org/minimist/download/minimist-1.2.5.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fminimist%2Fdownload%2Fminimist-1.2.5.tgz", "integrity": "sha1-Z9ZgFLZqaoqqDAg8X9WN9OTpdgI=", "dev": true }, @@ -17823,9 +17879,30 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.5.tgz", "integrity": "sha512-+yQl7SX3bIT83Lhb4BVorMAHVuqsskxRdlmO9kTpyukp8vsm2Sn/fUOV9xlnG8/a5JsypJzap21lz/y3FBMJ8Q==" }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + } + } + }, "mixin-deep": { "version": "1.3.2", - "resolved": "https://registry.nlark.com/mixin-deep/download/mixin-deep-1.3.2.tgz", + "resolved": "https://registry.npm.taobao.org/mixin-deep/download/mixin-deep-1.3.2.tgz", "integrity": "sha1-ESC0PcNZp4Xc5ltVuC4lfM9HlWY=", "dev": true, "requires": { @@ -17835,7 +17912,7 @@ "dependencies": { "is-extendable": { "version": "1.0.1", - "resolved": "https://registry.nlark.com/is-extendable/download/is-extendable-1.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/is-extendable/download/is-extendable-1.0.1.tgz", "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", "dev": true, "requires": { @@ -17844,6 +17921,12 @@ } } }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, "mkdirp-classic": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", @@ -17875,7 +17958,7 @@ }, "ms": { "version": "2.1.2", - "resolved": "https://registry.npmmirror.com/ms/download/ms-2.1.2.tgz", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=" }, "mute-stdout": { @@ -17900,7 +17983,7 @@ }, "nanomatch": { "version": "1.2.13", - "resolved": "https://registry.nlark.com/nanomatch/download/nanomatch-1.2.13.tgz", + "resolved": "https://registry.npm.taobao.org/nanomatch/download/nanomatch-1.2.13.tgz", "integrity": "sha1-uHqKpPwN6P5r6IiVs4mD/yZb0Rk=", "dev": true, "requires": { @@ -17919,7 +18002,7 @@ }, "natural-compare": { "version": "1.4.0", - "resolved": "https://registry.nlark.com/natural-compare/download/natural-compare-1.4.0.tgz", + "resolved": "https://registry.npm.taobao.org/natural-compare/download/natural-compare-1.4.0.tgz", "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" }, "natural-compare-lite": { @@ -17929,16 +18012,22 @@ }, "next-tick": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/next-tick/download/next-tick-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/next-tick/download/next-tick-1.0.0.tgz", "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", "dev": true }, "nice-try": { "version": "1.0.5", - "resolved": "https://registry.nlark.com/nice-try/download/nice-try-1.0.5.tgz", + "resolved": "https://registry.npm.taobao.org/nice-try/download/nice-try-1.0.5.tgz", "integrity": "sha1-ozeKdpbOfSI+iPybdkvX7xCJ42Y=", "dev": true }, + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "dev": true + }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmmirror.com/node-int64/-/node-int64-0.4.0.tgz", @@ -17953,7 +18042,7 @@ }, "normalize-package-data": { "version": "2.5.0", - "resolved": "https://registry.nlark.com/normalize-package-data/download/normalize-package-data-2.5.0.tgz?cache=0&sync_timestamp=1629301872905&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fnormalize-package-data%2Fdownload%2Fnormalize-package-data-2.5.0.tgz", + "resolved": "https://registry.npm.taobao.org/normalize-package-data/download/normalize-package-data-2.5.0.tgz", "integrity": "sha1-5m2xg4sgDB38IzIl0SyzZSDiNKg=", "dev": true, "requires": { @@ -17983,7 +18072,7 @@ }, "npm-run-path": { "version": "2.0.2", - "resolved": "https://registry.npmmirror.com/npm-run-path/download/npm-run-path-2.0.2.tgz?cache=0&sync_timestamp=1633420566316&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fnpm-run-path%2Fdownload%2Fnpm-run-path-2.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/npm-run-path/download/npm-run-path-2.0.2.tgz?cache=0&sync_timestamp=1577053500910&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnpm-run-path%2Fdownload%2Fnpm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { @@ -17992,13 +18081,13 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/number-is-nan/download/number-is-nan-1.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/number-is-nan/download/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, "nwsapi": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", + "resolved": "https://registry.npmmirror.com/nwsapi/-/nwsapi-2.2.0.tgz", "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", "dev": true }, @@ -18047,13 +18136,13 @@ }, "object-keys": { "version": "1.1.1", - "resolved": "https://registry.nlark.com/object-keys/download/object-keys-1.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/object-keys/download/object-keys-1.1.1.tgz", "integrity": "sha1-HEfyct8nfzsdrwYWd9nILiMixg4=", "dev": true }, "object-visit": { "version": "1.0.1", - "resolved": "https://registry.nlark.com/object-visit/download/object-visit-1.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/object-visit/download/object-visit-1.0.1.tgz", "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "dev": true, "requires": { @@ -18097,7 +18186,7 @@ "dependencies": { "call-bind": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/call-bind/-/call-bind-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, "requires": { @@ -18177,7 +18266,7 @@ "dependencies": { "call-bind": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/call-bind/-/call-bind-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, "requires": { @@ -18217,7 +18306,7 @@ }, "once": { "version": "1.4.0", - "resolved": "https://registry.nlark.com/once/download/once-1.4.0.tgz", + "resolved": "https://registry.npm.taobao.org/once/download/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { "wrappy": "1" @@ -18225,7 +18314,7 @@ }, "onetime": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "resolved": "https://registry.npmmirror.com/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "requires": { @@ -18245,13 +18334,13 @@ }, "opener": { "version": "1.5.2", - "resolved": "https://registry.nlark.com/opener/download/opener-1.5.2.tgz?cache=0&sync_timestamp=1618847055043&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fopener%2Fdownload%2Fopener-1.5.2.tgz", + "resolved": "https://registry.npm.taobao.org/opener/download/opener-1.5.2.tgz", "integrity": "sha1-XTfh81B3udysQwE3InGv3rKhNZg=", "dev": true }, "optionator": { "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "resolved": "https://registry.npmmirror.com/optionator/-/optionator-0.8.3.tgz", "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, "requires": { @@ -18280,7 +18369,7 @@ }, "os-locale": { "version": "1.4.0", - "resolved": "https://registry.npmmirror.com/os-locale/download/os-locale-1.4.0.tgz?cache=0&sync_timestamp=1633618260196&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fos-locale%2Fdownload%2Fos-locale-1.4.0.tgz", + "resolved": "https://registry.npm.taobao.org/os-locale/download/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "dev": true, "requires": { @@ -18295,7 +18384,7 @@ }, "p-finally": { "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/p-finally/download/p-finally-1.0.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-finally%2Fdownload%2Fp-finally-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/p-finally/download/p-finally-1.0.0.tgz", "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", "dev": true }, @@ -18334,7 +18423,7 @@ }, "p-try": { "version": "2.2.0", - "resolved": "https://registry.npmmirror.com/p-try/download/p-try-2.2.0.tgz", + "resolved": "https://registry.npm.taobao.org/p-try/download/p-try-2.2.0.tgz", "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", "dev": true }, @@ -18387,7 +18476,7 @@ }, "parse-json": { "version": "2.2.0", - "resolved": "https://registry.npmmirror.com/parse-json/download/parse-json-2.2.0.tgz?cache=0&sync_timestamp=1637475717072&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fparse-json%2Fdownload%2Fparse-json-2.2.0.tgz", + "resolved": "https://registry.npm.taobao.org/parse-json/download/parse-json-2.2.0.tgz", "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { @@ -18396,7 +18485,7 @@ }, "parse-node-version": { "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/parse-node-version/download/parse-node-version-1.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/parse-node-version/download/parse-node-version-1.0.1.tgz", "integrity": "sha1-4rXb7eAOf6m8NjYH9TMn6LBzGJs=", "dev": true }, @@ -18408,20 +18497,20 @@ }, "parse5": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "resolved": "https://registry.npmmirror.com/parse5/-/parse5-6.0.1.tgz", "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", "dev": true }, "pascalcase": { "version": "0.1.1", - "resolved": "https://registry.nlark.com/pascalcase/download/pascalcase-0.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/pascalcase/download/pascalcase-0.1.1.tgz", "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, "path": { "version": "0.12.7", "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", - "integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==", + "integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=", "dev": true, "requires": { "process": "^0.11.1", @@ -18436,13 +18525,13 @@ }, "path-dirname": { "version": "1.0.2", - "resolved": "https://registry.nlark.com/path-dirname/download/path-dirname-1.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/path-dirname/download/path-dirname-1.0.2.tgz", "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", "dev": true }, "path-exists": { "version": "3.0.0", - "resolved": "https://registry.nlark.com/path-exists/download/path-exists-3.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-3.0.0.tgz", "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, @@ -18470,7 +18559,7 @@ }, "path-root": { "version": "0.1.1", - "resolved": "https://registry.nlark.com/path-root/download/path-root-0.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/path-root/download/path-root-0.1.1.tgz", "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", "dev": true, "requires": { @@ -18479,7 +18568,7 @@ }, "path-root-regex": { "version": "0.1.2", - "resolved": "https://registry.nlark.com/path-root-regex/download/path-root-regex-0.1.2.tgz", + "resolved": "https://registry.npm.taobao.org/path-root-regex/download/path-root-regex-0.1.2.tgz", "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", "dev": true }, @@ -18536,19 +18625,19 @@ }, "pify": { "version": "2.3.0", - "resolved": "https://registry.npm.taobao.org/pify/download/pify-2.3.0.tgz", + "resolved": "https://registry.npm.taobao.org/pify/download/pify-2.3.0.tgz?cache=0&sync_timestamp=1581697613983&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpify%2Fdownload%2Fpify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, "pinkie": { "version": "2.0.4", - "resolved": "https://registry.nlark.com/pinkie/download/pinkie-2.0.4.tgz", + "resolved": "https://registry.npm.taobao.org/pinkie/download/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true }, "pinkie-promise": { "version": "2.0.1", - "resolved": "https://registry.nlark.com/pinkie-promise/download/pinkie-promise-2.0.1.tgz?cache=0&sync_timestamp=1618847023792&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fpinkie-promise%2Fdownload%2Fpinkie-promise-2.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/pinkie-promise/download/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { @@ -18626,7 +18715,7 @@ }, "portfinder": { "version": "1.0.28", - "resolved": "https://registry.nlark.com/portfinder/download/portfinder-1.0.28.tgz", + "resolved": "https://registry.npm.taobao.org/portfinder/download/portfinder-1.0.28.tgz", "integrity": "sha1-Z8RiKFK9U3TdHdkA93n1NGL6x3g=", "dev": true, "requires": { @@ -18637,7 +18726,7 @@ "dependencies": { "debug": { "version": "3.2.7", - "resolved": "https://registry.npmmirror.com/debug/download/debug-3.2.7.tgz", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-3.2.7.tgz?cache=0&sync_timestamp=1607566580543&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.2.7.tgz", "integrity": "sha1-clgLfpFF+zm2Z2+cXl+xALk0F5o=", "dev": true, "requires": { @@ -18657,19 +18746,19 @@ }, "posix-character-classes": { "version": "0.1.1", - "resolved": "https://registry.nlark.com/posix-character-classes/download/posix-character-classes-0.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/posix-character-classes/download/posix-character-classes-0.1.1.tgz", "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", "dev": true }, "prelude-ls": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "resolved": "https://registry.npmmirror.com/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", "dev": true }, "pretty-format": { "version": "24.9.0", - "resolved": "https://registry.npmmirror.com/pretty-format/download/pretty-format-24.9.0.tgz", + "resolved": "https://registry.npm.taobao.org/pretty-format/download/pretty-format-24.9.0.tgz", "integrity": "sha1-EvrDGzcBmk7qPBGqmpWet2KKp8k=", "dev": true, "requires": { @@ -18681,7 +18770,7 @@ "dependencies": { "ansi-regex": { "version": "4.1.0", - "resolved": "https://registry.nlark.com/ansi-regex/download/ansi-regex-4.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/ansi-regex/download/ansi-regex-4.1.0.tgz", "integrity": "sha1-i5+PCM8ay4Q3Vqg5yox+MWjFGZc=", "dev": true } @@ -18702,7 +18791,7 @@ "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", "dev": true }, "process-nextick-args": { @@ -18711,6 +18800,12 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, "prompts": { "version": "2.4.2", "resolved": "https://registry.npmmirror.com/prompts/-/prompts-2.4.2.tgz", @@ -18721,9 +18816,15 @@ "sisteransi": "^1.0.5" } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, "psl": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "resolved": "https://registry.npmmirror.com/psl/-/psl-1.8.0.tgz", "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", "dev": true }, @@ -18795,7 +18896,7 @@ }, "punycode": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "resolved": "https://registry.npmmirror.com/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, @@ -18841,7 +18942,7 @@ }, "react-is": { "version": "16.13.1", - "resolved": "https://registry.npmmirror.com/react-is/download/react-is-16.13.1.tgz", + "resolved": "https://registry.npm.taobao.org/react-is/download/react-is-16.13.1.tgz", "integrity": "sha1-eJcppNw23imZ3BVt1sHZwYzqVqQ=", "dev": true }, @@ -18856,7 +18957,7 @@ }, "read-pkg": { "version": "1.1.0", - "resolved": "https://registry.nlark.com/read-pkg/download/read-pkg-1.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/read-pkg/download/read-pkg-1.1.0.tgz", "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "dev": true, "requires": { @@ -18867,7 +18968,7 @@ }, "read-pkg-up": { "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/read-pkg-up/download/read-pkg-up-1.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/read-pkg-up/download/read-pkg-up-1.0.1.tgz", "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "dev": true, "requires": { @@ -18877,7 +18978,7 @@ "dependencies": { "find-up": { "version": "1.1.2", - "resolved": "https://registry.npmmirror.com/find-up/download/find-up-1.1.2.tgz?cache=0&sync_timestamp=1633620747957&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Ffind-up%2Fdownload%2Ffind-up-1.1.2.tgz", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { @@ -18887,7 +18988,7 @@ }, "path-exists": { "version": "2.1.0", - "resolved": "https://registry.nlark.com/path-exists/download/path-exists-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { @@ -18924,7 +19025,7 @@ }, "readdirp": { "version": "2.2.1", - "resolved": "https://registry.nlark.com/readdirp/download/readdirp-2.2.1.tgz", + "resolved": "https://registry.npm.taobao.org/readdirp/download/readdirp-2.2.1.tgz?cache=0&sync_timestamp=1575629866543&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Freaddirp%2Fdownload%2Freaddirp-2.2.1.tgz", "integrity": "sha1-DodiKjMlqjPokihcr4tOhGUppSU=", "dev": true, "requires": { @@ -18935,7 +19036,7 @@ }, "rechoir": { "version": "0.6.2", - "resolved": "https://registry.nlark.com/rechoir/download/rechoir-0.6.2.tgz?cache=0&sync_timestamp=1627101677944&other_urls=https%3A%2F%2Fregistry.nlark.com%2Frechoir%2Fdownload%2Frechoir-0.6.2.tgz", + "resolved": "https://registry.npm.taobao.org/rechoir/download/rechoir-0.6.2.tgz", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, "requires": { @@ -18975,7 +19076,7 @@ }, "regex-not": { "version": "1.0.2", - "resolved": "https://registry.nlark.com/regex-not/download/regex-not-1.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/regex-not/download/regex-not-1.0.2.tgz", "integrity": "sha1-H07OJ+ALC2XgJHpoEOaoXYOldSw=", "dev": true, "requires": { @@ -19048,7 +19149,7 @@ "dependencies": { "jsesc": { "version": "0.5.0", - "resolved": "https://registry.nlark.com/jsesc/download/jsesc-0.5.0.tgz", + "resolved": "https://registry.npm.taobao.org/jsesc/download/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true } @@ -19077,7 +19178,7 @@ }, "remove-trailing-separator": { "version": "1.1.0", - "resolved": "https://registry.nlark.com/remove-trailing-separator/download/remove-trailing-separator-1.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/remove-trailing-separator/download/remove-trailing-separator-1.1.0.tgz", "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", "dev": true }, @@ -19112,7 +19213,7 @@ }, "require-directory": { "version": "2.1.1", - "resolved": "https://registry.nlark.com/require-directory/download/require-directory-2.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/require-directory/download/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, @@ -19124,7 +19225,7 @@ }, "requires-port": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/requires-port/download/requires-port-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/requires-port/download/requires-port-1.0.0.tgz", "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", "dev": true }, @@ -19180,7 +19281,7 @@ }, "resolve-url": { "version": "0.2.1", - "resolved": "https://registry.npmmirror.com/resolve-url/download/resolve-url-0.2.1.tgz", + "resolved": "https://registry.npm.taobao.org/resolve-url/download/resolve-url-0.2.1.tgz", "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, @@ -19192,7 +19293,7 @@ }, "ret": { "version": "0.1.15", - "resolved": "https://registry.nlark.com/ret/download/ret-0.1.15.tgz", + "resolved": "https://registry.npm.taobao.org/ret/download/ret-0.1.15.tgz", "integrity": "sha1-uKSCXVvbH8P29Twrwz+BOIaBx7w=", "dev": true }, @@ -19275,7 +19376,7 @@ }, "@babel/highlight": { "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "resolved": "https://registry.npmmirror.com/@babel/highlight/-/highlight-7.18.6.tgz", "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", "dev": true, "requires": { @@ -19432,7 +19533,7 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.nlark.com/safe-buffer/download/safe-buffer-5.1.2.tgz?cache=0&sync_timestamp=1618847044058&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsafe-buffer%2Fdownload%2Fsafe-buffer-5.1.2.tgz", + "resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz", "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=" }, "safe-regex": { @@ -19487,13 +19588,13 @@ }, "safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.nlark.com/safer-buffer/download/safer-buffer-2.1.2.tgz", + "resolved": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsafer-buffer%2Fdownload%2Fsafer-buffer-2.1.2.tgz", "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=", "dev": true }, "saxes": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "resolved": "https://registry.npmmirror.com/saxes/-/saxes-5.0.1.tgz", "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", "dev": true, "requires": { @@ -19514,7 +19615,7 @@ }, "semver-greatest-satisfied-range": { "version": "1.1.0", - "resolved": "https://registry.nlark.com/semver-greatest-satisfied-range/download/semver-greatest-satisfied-range-1.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/semver-greatest-satisfied-range/download/semver-greatest-satisfied-range-1.1.0.tgz", "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els=", "dev": true, "requires": { @@ -19532,13 +19633,13 @@ }, "set-blocking": { "version": "2.0.0", - "resolved": "https://registry.nlark.com/set-blocking/download/set-blocking-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/set-blocking/download/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, "set-value": { "version": "2.0.1", - "resolved": "https://registry.nlark.com/set-value/download/set-value-2.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/set-value/download/set-value-2.0.1.tgz", "integrity": "sha1-oY1AUw5vB95CKMfe/kInr4ytAFs=", "dev": true, "requires": { @@ -19550,7 +19651,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.nlark.com/extend-shallow/download/extend-shallow-2.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -19612,7 +19713,7 @@ }, "side-channel": { "version": "1.0.4", - "resolved": "https://registry.nlark.com/side-channel/download/side-channel-1.0.4.tgz", + "resolved": "https://registry.npm.taobao.org/side-channel/download/side-channel-1.0.4.tgz", "integrity": "sha1-785cj9wQTudRslxY1CkAEfpeos8=", "dev": true, "requires": { @@ -19654,12 +19755,12 @@ }, "slash": { "version": "3.0.0", - "resolved": "https://registry.nlark.com/slash/download/slash-3.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/slash/download/slash-3.0.0.tgz", "integrity": "sha1-ZTm+hwwWWtvVJAIg2+Nh8bxNRjQ=" }, "snapdragon": { "version": "0.8.2", - "resolved": "https://registry.npm.taobao.org/snapdragon/download/snapdragon-0.8.2.tgz?cache=0&sync_timestamp=1617971785350&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsnapdragon%2Fdownload%2Fsnapdragon-0.8.2.tgz", + "resolved": "https://registry.npm.taobao.org/snapdragon/download/snapdragon-0.8.2.tgz", "integrity": "sha1-ZJIufFZbDhQgS6GqfWlkJ40lGC0=", "dev": true, "requires": { @@ -19675,7 +19776,7 @@ "dependencies": { "debug": { "version": "2.6.9", - "resolved": "https://registry.npmmirror.com/debug/download/debug-2.6.9.tgz", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz", "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "requires": { @@ -19693,7 +19794,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.nlark.com/extend-shallow/download/extend-shallow-2.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -19702,7 +19803,7 @@ }, "ms": { "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/ms/download/ms-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true } @@ -19730,7 +19831,7 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/is-accessor-descriptor/download/is-accessor-descriptor-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { @@ -19739,7 +19840,7 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/is-data-descriptor/download/is-data-descriptor-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-data-descriptor/download/is-data-descriptor-1.0.0.tgz", "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { @@ -19761,7 +19862,7 @@ }, "snapdragon-util": { "version": "3.0.1", - "resolved": "https://registry.nlark.com/snapdragon-util/download/snapdragon-util-3.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/snapdragon-util/download/snapdragon-util-3.0.1.tgz", "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=", "dev": true, "requires": { @@ -19830,7 +19931,7 @@ }, "sparkles": { "version": "1.0.1", - "resolved": "https://registry.nlark.com/sparkles/download/sparkles-1.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/sparkles/download/sparkles-1.0.1.tgz", "integrity": "sha1-AI22XtzmxQ7sDF4ijhlFBh3QQ3w=", "dev": true }, @@ -19874,7 +19975,7 @@ }, "split-string": { "version": "3.1.0", - "resolved": "https://registry.nlark.com/split-string/download/split-string-3.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/split-string/download/split-string-3.1.0.tgz", "integrity": "sha1-fLCd2jqGWFcFxks5pkZgOGguj+I=", "dev": true, "requires": { @@ -19883,13 +19984,13 @@ }, "sprintf-js": { "version": "1.0.3", - "resolved": "https://registry.nlark.com/sprintf-js/download/sprintf-js-1.0.3.tgz?cache=0&sync_timestamp=1618847174560&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsprintf-js%2Fdownload%2Fsprintf-js-1.0.3.tgz", + "resolved": "https://registry.npm.taobao.org/sprintf-js/download/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, "stack-trace": { "version": "0.0.10", - "resolved": "https://registry.nlark.com/stack-trace/download/stack-trace-0.0.10.tgz?cache=0&sync_timestamp=1620387179562&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fstack-trace%2Fdownload%2Fstack-trace-0.0.10.tgz", + "resolved": "https://registry.npm.taobao.org/stack-trace/download/stack-trace-0.0.10.tgz", "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", "dev": true }, @@ -19904,7 +20005,7 @@ "dependencies": { "escape-string-regexp": { "version": "2.0.0", - "resolved": "https://registry.nlark.com/escape-string-regexp/download/escape-string-regexp-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-2.0.0.tgz", "integrity": "sha1-owME6Z2qMuI7L9IPUbq9B8/8o0Q=", "dev": true } @@ -20160,7 +20261,7 @@ "dependencies": { "call-bind": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/call-bind/-/call-bind-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, "requires": { @@ -20211,7 +20312,7 @@ "dependencies": { "call-bind": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/call-bind/-/call-bind-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, "requires": { @@ -20275,7 +20376,7 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/strip-eof/download/strip-eof-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/strip-eof/download/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, @@ -20301,7 +20402,7 @@ }, "supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmmirror.com/supports-color/download/supports-color-5.5.0.tgz", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-5.5.0.tgz", "integrity": "sha1-4uaaRKyHcveKHsCzW2id9lMO/I8=", "requires": { "has-flag": "^3.0.0" @@ -20336,7 +20437,7 @@ }, "supports-preserve-symlinks-flag": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "resolved": "https://registry.npmmirror.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" }, "sver-compat": { @@ -20351,7 +20452,7 @@ }, "symbol-tree": { "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "resolved": "https://registry.npmmirror.com/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, @@ -20364,6 +20465,28 @@ "acorn-node": "^1.2.0" } }, + "tar": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", + "dev": true, + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "dependencies": { + "minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true + } + } + }, "terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmmirror.com/terminal-link/-/terminal-link-2.1.1.tgz", @@ -20400,7 +20523,7 @@ }, "source-map-support": { "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "resolved": "https://registry.npmmirror.com/source-map-support/download/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, "requires": { @@ -20423,7 +20546,7 @@ }, "text-table": { "version": "0.2.0", - "resolved": "https://registry.nlark.com/text-table/download/text-table-0.2.0.tgz?cache=0&sync_timestamp=1618847142316&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ftext-table%2Fdownload%2Ftext-table-0.2.0.tgz", + "resolved": "https://registry.npm.taobao.org/text-table/download/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" }, "tfig": { @@ -20439,13 +20562,13 @@ "dependencies": { "ansi-regex": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-4.1.1.tgz", "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", "dev": true }, "cliui": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "resolved": "https://registry.npmmirror.com/cliui/-/cliui-5.0.0.tgz", "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { @@ -20456,25 +20579,25 @@ }, "emoji-regex": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, "get-caller-file": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, "require-main-filename": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "resolved": "https://registry.npmmirror.com/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, "string-width": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "resolved": "https://registry.npmmirror.com/string-width/-/string-width-3.1.0.tgz", "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { @@ -20485,7 +20608,7 @@ }, "strip-ansi": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-5.2.0.tgz", "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { @@ -20500,7 +20623,7 @@ }, "wrap-ansi": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz", "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, "requires": { @@ -20511,13 +20634,13 @@ }, "y18n": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "resolved": "https://registry.npmmirror.com/y18n/-/y18n-4.0.3.tgz", "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", "dev": true }, "yargs": { "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "resolved": "https://registry.npmmirror.com/yargs/-/yargs-13.3.2.tgz", "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", "dev": true, "requires": { @@ -20535,7 +20658,7 @@ }, "yargs-parser": { "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-13.1.2.tgz", "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", "dev": true, "requires": { @@ -20585,7 +20708,7 @@ }, "time-stamp": { "version": "1.1.0", - "resolved": "https://registry.nlark.com/time-stamp/download/time-stamp-1.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/time-stamp/download/time-stamp-1.1.0.tgz", "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", "dev": true }, @@ -20609,13 +20732,13 @@ }, "tmpl": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "resolved": "https://registry.npmmirror.com/tmpl/-/tmpl-1.0.5.tgz", "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", "dev": true }, "to-absolute-glob": { "version": "2.0.2", - "resolved": "https://registry.nlark.com/to-absolute-glob/download/to-absolute-glob-2.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/to-absolute-glob/download/to-absolute-glob-2.0.2.tgz", "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", "dev": true, "requires": { @@ -20625,12 +20748,12 @@ }, "to-fast-properties": { "version": "2.0.0", - "resolved": "https://registry.nlark.com/to-fast-properties/download/to-fast-properties-2.0.0.tgz?cache=0&sync_timestamp=1628418893613&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fto-fast-properties%2Fdownload%2Fto-fast-properties-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/to-fast-properties/download/to-fast-properties-2.0.0.tgz", "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" }, "to-object-path": { "version": "0.3.0", - "resolved": "https://registry.nlark.com/to-object-path/download/to-object-path-0.3.0.tgz", + "resolved": "https://registry.npm.taobao.org/to-object-path/download/to-object-path-0.3.0.tgz", "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "dev": true, "requires": { @@ -20650,7 +20773,7 @@ }, "to-regex": { "version": "3.0.2", - "resolved": "https://registry.nlark.com/to-regex/download/to-regex-3.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/to-regex/download/to-regex-3.0.2.tgz", "integrity": "sha1-E8/dmzNlUvMLUfM6iuG0Knp1mc4=", "dev": true, "requires": { @@ -20681,7 +20804,7 @@ }, "tough-cookie": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", + "resolved": "https://registry.npmmirror.com/tough-cookie/-/tough-cookie-4.0.0.tgz", "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", "dev": true, "requires": { @@ -20722,13 +20845,13 @@ "dependencies": { "mkdirp": { "version": "1.0.4", - "resolved": "https://registry.npmmirror.com/mkdirp/download/mkdirp-1.0.4.tgz", + "resolved": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-1.0.4.tgz?cache=0&sync_timestamp=1587535418745&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmkdirp%2Fdownload%2Fmkdirp-1.0.4.tgz", "integrity": "sha1-PrXtYmInVteaXw4qIh3+utdcL34=", "dev": true }, "semver": { "version": "7.3.5", - "resolved": "https://registry.nlark.com/semver/download/semver-7.3.5.tgz?cache=0&sync_timestamp=1618846864940&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsemver%2Fdownload%2Fsemver-7.3.5.tgz", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-7.3.5.tgz?cache=0&sync_timestamp=1616463603361&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-7.3.5.tgz", "integrity": "sha1-C2Ich5NI2JmOSw5L6Us/EuYBjvc=", "dev": true, "requires": { @@ -21120,7 +21243,7 @@ }, "unc-path-regex": { "version": "0.1.2", - "resolved": "https://registry.nlark.com/unc-path-regex/download/unc-path-regex-0.1.2.tgz", + "resolved": "https://registry.npm.taobao.org/unc-path-regex/download/unc-path-regex-0.1.2.tgz", "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", "dev": true }, @@ -21190,7 +21313,7 @@ }, "union": { "version": "0.5.0", - "resolved": "https://registry.nlark.com/union/download/union-0.5.0.tgz", + "resolved": "https://registry.npm.taobao.org/union/download/union-0.5.0.tgz", "integrity": "sha1-ssEb6E9gU4U3uEbtuboma6AJAHU=", "dev": true, "requires": { @@ -21199,7 +21322,7 @@ }, "union-value": { "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/union-value/download/union-value-1.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/union-value/download/union-value-1.0.1.tgz", "integrity": "sha1-C2/nuDWuzaYcbqTU8CwUIh4QmEc=", "dev": true, "requires": { @@ -21221,13 +21344,13 @@ }, "universalify": { "version": "0.1.2", - "resolved": "https://registry.nlark.com/universalify/download/universalify-0.1.2.tgz", + "resolved": "https://registry.npm.taobao.org/universalify/download/universalify-0.1.2.tgz", "integrity": "sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=", "dev": true }, "unset-value": { "version": "1.0.0", - "resolved": "https://registry.nlark.com/unset-value/download/unset-value-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/unset-value/download/unset-value-1.0.0.tgz", "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "dev": true, "requires": { @@ -21237,7 +21360,7 @@ "dependencies": { "has-value": { "version": "0.3.1", - "resolved": "https://registry.nlark.com/has-value/download/has-value-0.3.1.tgz", + "resolved": "https://registry.npm.taobao.org/has-value/download/has-value-0.3.1.tgz", "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "dev": true, "requires": { @@ -21259,7 +21382,7 @@ }, "has-values": { "version": "0.1.4", - "resolved": "https://registry.nlark.com/has-values/download/has-values-0.1.4.tgz", + "resolved": "https://registry.npm.taobao.org/has-values/download/has-values-0.1.4.tgz", "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", "dev": true }, @@ -21273,7 +21396,7 @@ }, "upath": { "version": "1.2.0", - "resolved": "https://registry.npm.taobao.org/upath/download/upath-1.2.0.tgz", + "resolved": "https://registry.npm.taobao.org/upath/download/upath-1.2.0.tgz?cache=0&sync_timestamp=1567457281208&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fupath%2Fdownload%2Fupath-1.2.0.tgz", "integrity": "sha1-j2bbzVWog6za5ECK+LA1pQRMGJQ=", "dev": true }, @@ -21303,7 +21426,7 @@ }, "urix": { "version": "0.1.0", - "resolved": "https://registry.npmmirror.com/urix/download/urix-0.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/urix/download/urix-0.1.0.tgz", "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", "dev": true }, @@ -21327,13 +21450,13 @@ }, "url-join": { "version": "2.0.5", - "resolved": "https://registry.nlark.com/url-join/download/url-join-2.0.5.tgz", + "resolved": "https://registry.npm.taobao.org/url-join/download/url-join-2.0.5.tgz", "integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg=", "dev": true }, "use": { "version": "3.1.1", - "resolved": "https://registry.nlark.com/use/download/use-3.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/use/download/use-3.1.1.tgz", "integrity": "sha1-1QyMrHmhn7wg8pEfVuuXP04QBw8=", "dev": true }, @@ -21348,7 +21471,7 @@ "dependencies": { "inherits": { "version": "2.0.3", - "resolved": "https://registry.nlark.com/inherits/download/inherits-2.0.3.tgz", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true } @@ -21356,7 +21479,7 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.nlark.com/util-deprecate/download/util-deprecate-1.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/util-deprecate/download/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, @@ -21382,7 +21505,7 @@ }, "validate-npm-package-license": { "version": "3.0.4", - "resolved": "https://registry.nlark.com/validate-npm-package-license/download/validate-npm-package-license-3.0.4.tgz", + "resolved": "https://registry.npm.taobao.org/validate-npm-package-license/download/validate-npm-package-license-3.0.4.tgz", "integrity": "sha1-/JH2uce6FchX9MssXe/uw51PQQo=", "dev": true, "requires": { @@ -21392,7 +21515,7 @@ }, "value-or-function": { "version": "3.0.0", - "resolved": "https://registry.nlark.com/value-or-function/download/value-or-function-3.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/value-or-function/download/value-or-function-3.0.0.tgz", "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", "dev": true }, @@ -21537,7 +21660,7 @@ }, "w3c-hr-time": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", + "resolved": "https://registry.npmmirror.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", "dev": true, "requires": { @@ -21769,7 +21892,7 @@ }, "wrappy": { "version": "1.0.2", - "resolved": "https://registry.nlark.com/wrappy/download/wrappy-1.0.2.tgz?cache=0&sync_timestamp=1619133505879&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fwrappy%2Fdownload%2Fwrappy-1.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/wrappy/download/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { @@ -21792,7 +21915,7 @@ }, "xmlchars": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "resolved": "https://registry.npmmirror.com/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true }, @@ -21816,12 +21939,12 @@ }, "yallist": { "version": "4.0.0", - "resolved": "https://registry.nlark.com/yallist/download/yallist-4.0.0.tgz?cache=0&sync_timestamp=1622604530774&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fyallist%2Fdownload%2Fyallist-4.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/yallist/download/yallist-4.0.0.tgz", "integrity": "sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=" }, "yargs": { "version": "12.0.5", - "resolved": "https://registry.npmmirror.com/yargs/download/yargs-12.0.5.tgz?cache=0&sync_timestamp=1632605487521&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fyargs%2Fdownload%2Fyargs-12.0.5.tgz", + "resolved": "https://registry.npm.taobao.org/yargs/download/yargs-12.0.5.tgz?cache=0&sync_timestamp=1583129847322&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs%2Fdownload%2Fyargs-12.0.5.tgz", "integrity": "sha1-BfWZe2CWR7ZPZrgeO0sQo2jnrRM=", "dev": true, "requires": { @@ -21841,13 +21964,13 @@ "dependencies": { "ansi-regex": { "version": "3.0.0", - "resolved": "https://registry.nlark.com/ansi-regex/download/ansi-regex-3.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/ansi-regex/download/ansi-regex-3.0.0.tgz?cache=0&sync_timestamp=1570188663907&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-regex%2Fdownload%2Fansi-regex-3.0.0.tgz", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "cliui": { "version": "4.1.0", - "resolved": "https://registry.nlark.com/cliui/download/cliui-4.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/cliui/download/cliui-4.1.0.tgz?cache=0&sync_timestamp=1573943292170&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcliui%2Fdownload%2Fcliui-4.1.0.tgz", "integrity": "sha1-NIQi2+gtgAswIu709qwQvy5NG0k=", "dev": true, "requires": { @@ -21867,13 +21990,13 @@ }, "invert-kv": { "version": "2.0.0", - "resolved": "https://registry.nlark.com/invert-kv/download/invert-kv-2.0.0.tgz?cache=0&sync_timestamp=1630996809231&other_urls=https%3A%2F%2Fregistry.nlark.com%2Finvert-kv%2Fdownload%2Finvert-kv-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/invert-kv/download/invert-kv-2.0.0.tgz", "integrity": "sha1-c5P1r6Weyf9fZ6J2INEcIm4+7AI=", "dev": true }, "lcid": { "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/lcid/download/lcid-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/lcid/download/lcid-2.0.0.tgz", "integrity": "sha1-bvXS32DlL4LrIopMNz6NHzlyU88=", "dev": true, "requires": { @@ -21892,7 +22015,7 @@ }, "os-locale": { "version": "3.1.0", - "resolved": "https://registry.npmmirror.com/os-locale/download/os-locale-3.1.0.tgz?cache=0&sync_timestamp=1633618260196&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fos-locale%2Fdownload%2Fos-locale-3.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/os-locale/download/os-locale-3.1.0.tgz", "integrity": "sha1-qAKm7hfyTBBIOrmTVxnO9O0Wvxo=", "dev": true, "requires": { @@ -21918,7 +22041,7 @@ }, "string-width": { "version": "2.1.1", - "resolved": "https://registry.npmmirror.com/string-width/download/string-width-2.1.1.tgz?cache=0&sync_timestamp=1632421309919&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fstring-width%2Fdownload%2Fstring-width-2.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/string-width/download/string-width-2.1.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring-width%2Fdownload%2Fstring-width-2.1.1.tgz", "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", "dev": true, "requires": { @@ -21928,7 +22051,7 @@ }, "strip-ansi": { "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/strip-ansi/download/strip-ansi-4.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-4.0.0.tgz?cache=0&sync_timestamp=1573280518303&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstrip-ansi%2Fdownload%2Fstrip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { @@ -21949,7 +22072,7 @@ }, "yargs-parser": { "version": "11.1.1", - "resolved": "https://registry.npmmirror.com/yargs-parser/download/yargs-parser-11.1.1.tgz?cache=0&sync_timestamp=1637031045984&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fyargs-parser%2Fdownload%2Fyargs-parser-11.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/yargs-parser/download/yargs-parser-11.1.1.tgz?cache=0&sync_timestamp=1583130314354&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs-parser%2Fdownload%2Fyargs-parser-11.1.1.tgz", "integrity": "sha1-h5oIZZc7yp9rq1y987HGfsfTvPQ=", "dev": true, "requires": { diff --git a/package.json b/package.json index 2a7ceb35714..6276d27946c 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", "async": "^2.6.4", + "axios": "^1.4.0", "babelify": "^10.0.0", "browserify": "^17.0.0", "chalk": "^2.4.1", @@ -69,10 +70,13 @@ "jest-extended": "^1.1.0", "jest-matcher-deep-close-to": "^2.0.1", "jsdom": "^19.0.0", + "node-fetch": "^2.6.1", "path": "^0.12.7", "pngjs": "^6.0.0", + "progress": "^2.0.3", "spectorjs": "^0.9.15", "stats.js": "^0.17.0", + "tar": "^6.1.15", "tmp": "^0.2.1", "tree-kill": "^1.2.0", "ts-jest": "^26.5.4", From ebbba606ca3d5b2c35d8cb2d7d59d2aad1955dd7 Mon Sep 17 00:00:00 2001 From: mmyduckx <308303735@qq.com> Date: Thu, 20 Jul 2023 16:33:16 +0800 Subject: [PATCH 10/51] Fix videoplayer status after pause&finish (#15782) * fix videoplayer.isplaying status after pause * fix isPlaying status when play video finish --- cocos/video/video-player-impl.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/video/video-player-impl.ts b/cocos/video/video-player-impl.ts index ac921c4828f..cc9a4ba7d64 100644 --- a/cocos/video/video-player-impl.ts +++ b/cocos/video/video-player-impl.ts @@ -163,11 +163,11 @@ export abstract class VideoPlayerImpl { } public onPause (e: Event): void { + this._playing = false; if (this._ignorePause) { this._ignorePause = false; return; } - this._playing = false; this.dispatchEvent(EventType.PAUSED); } @@ -178,6 +178,7 @@ export abstract class VideoPlayerImpl { } public onEnded (e: Event): void { + this._playing = false; this.dispatchEvent(EventType.COMPLETED); } @@ -193,7 +194,6 @@ export abstract class VideoPlayerImpl { } } - // public play (): void { if (this._loadedMeta || this._loaded) { this.canPlay(); From 6d666d2f1dfda58a354efb16892ec0898d7480f4 Mon Sep 17 00:00:00 2001 From: qiuguohua Date: Thu, 20 Jul 2023 17:32:12 +0800 Subject: [PATCH 11/51] Fix the problem of incorrect screen resolution after resize. (#15785) --- native/cocos/engine/Engine.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/native/cocos/engine/Engine.cpp b/native/cocos/engine/Engine.cpp index f376d142c1d..50d34212923 100644 --- a/native/cocos/engine/Engine.cpp +++ b/native/cocos/engine/Engine.cpp @@ -323,10 +323,12 @@ bool Engine::redirectWindowEvent(const WindowEvent &ev) { isHandled = true; } else if (ev.type == WindowEvent::Type::SIZE_CHANGED || ev.type == WindowEvent::Type::RESIZED) { - events::Resize::broadcast(ev.width, ev.height, ev.windowId); auto *w = CC_GET_SYSTEM_WINDOW(ev.windowId); CC_ASSERT(w); w->setViewSize(ev.width, ev.height); + // Because the ts layer calls the getviewsize interface in response to resize. + // So we need to set the view size when sending the message. + events::Resize::broadcast(ev.width, ev.height, ev.windowId); isHandled = true; } else if (ev.type == WindowEvent::Type::HIDDEN || ev.type == WindowEvent::Type::MINIMIZED) { From 9cffcaa84cc21b0470432b76f54d6adc0c40ab92 Mon Sep 17 00:00:00 2001 From: jk20012001 Date: Thu, 20 Jul 2023 19:08:32 +0800 Subject: [PATCH 12/51] add multi-layers lighting model and fix direct specular (#15778) --- .../assets/chunks/common/lighting/brdf.chunk | 27 +- .../assets/chunks/common/lighting/bxdf.chunk | 49 ++- .../lighting-intermediate-data.chunk | 11 +- .../data-structures/lighting-result.chunk | 28 +- .../lighting-flow/common-flow.chunk | 57 ++- .../model-functions/standard.chunk | 105 ++++- .../model-functions/toon.chunk | 18 + .../surfaces/data-structures/standard.chunk | 7 +- .../default-functions/standard-fs.chunk | 45 +- .../effect-macros/common-macros.chunk | 11 +- .../module-functions/debug-view.chunk | 31 +- .../module-functions/standard-fs.chunk | 115 ++++-- .../surfaces/module-functions/toon-fs.chunk | 11 +- .../surfaces/module-functions/unlit-fs.chunk | 6 +- .../assets/effects/advanced/car-paint.effect | 383 ++++++++++++++++++ .../effects/advanced/car-paint.effect.meta | 11 + editor/assets/effects/advanced/glass.effect | 354 ++++++++++++++++ .../assets/effects/advanced/glass.effect.meta | 11 + editor/assets/effects/advanced/hair.effect | 2 +- .../dcc/vat/houdini-fluid-v3-liquid.effect | 2 +- .../util/dcc/vat/zeno-fluid-liquid.effect | 2 +- 21 files changed, 1186 insertions(+), 100 deletions(-) create mode 100644 editor/assets/effects/advanced/car-paint.effect create mode 100644 editor/assets/effects/advanced/car-paint.effect.meta create mode 100644 editor/assets/effects/advanced/glass.effect create mode 100644 editor/assets/effects/advanced/glass.effect.meta diff --git a/editor/assets/chunks/common/lighting/brdf.chunk b/editor/assets/chunks/common/lighting/brdf.chunk index 976a93914bc..ef4fea792a1 100644 --- a/editor/assets/chunks/common/lighting/brdf.chunk +++ b/editor/assets/chunks/common/lighting/brdf.chunk @@ -1,5 +1,6 @@ #include +// for dielectric(non-metal) surfaces float F0ToIor(float F0) { return 2.0f / (1.0f - sqrt(F0)) - 1.0f; @@ -11,9 +12,15 @@ float IorToF0(float ior) return F0_sqrt * F0_sqrt; } -float V_Kelemen(float LoH) +float square(float a) { return a * a;} +vec2 square(vec2 a) { return a * a;} +vec3 square(vec3 a) { return a * a;} +float G_Schlick( float roughness, float NoV, float NoL ) { - return 0.25 / (LoH * LoH); + float k = square( 0.5 + 0.5*roughness ); + float G_SchlickV = NoV * (1.0 - k) + k; + float G_SchlickL = NoL * (1.0 - k) + k; + return 0.25 / ( G_SchlickV * G_SchlickL ); } vec3 F_Schlick( vec3 specularColor, float VoH ) @@ -22,6 +29,12 @@ vec3 F_Schlick( vec3 specularColor, float VoH ) float selfShadowTerm = saturate(50.0 * specularColor.g); return specularColor * (1.0 - Fc) + vec3(selfShadowTerm * Fc); } +vec3 F_SchlickMultiplier( vec3 specularColor, float VoH ) +{ + float Fc = exp2( (-5.55473 * VoH - 6.98316) * VoH ); + float selfShadowTerm = saturate(50.0 * specularColor.g); + return vec3(1.0 - Fc) + vec3(selfShadowTerm * Fc) / (specularColor + vec3(EPSILON)); +} float D_GGX(float roughness, float NoH) { @@ -92,6 +105,16 @@ vec3 IntegratedGFApprox (vec3 specular, float roughness, float NoV) { AB.y *= clamp(50.0 * specular.g, 0.0, 1.0); return max(vec3(0.0), specular * AB.x + AB.y); } +void IntegratedGFMultiplier (out vec3 integratedGF, out vec3 integratedF, vec3 specular, float roughness, float NoV) { + const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022); + const vec4 c1 = vec4(1.0, 0.0425, 1.04, -0.04); + vec4 r = roughness * c0 + c1; + float a004 = min(r.x * r.x, exp2(-9.28 * NoV)) * r.x + r.y; + vec2 AB = vec2(-1.04, 1.04) * a004 + r.zw; + AB.y *= clamp(50.0 * specular.g, 0.0, 1.0); + integratedF = vec3(max(0.0, AB.x)); + integratedGF = max(vec3(0.0), vec3(AB.x) + vec3(AB.y) / (specular + EPSILON_LOWP)); +} //Diffuse_Lambert #define DiffuseCoefficient_EnergyConservation INV_PI diff --git a/editor/assets/chunks/common/lighting/bxdf.chunk b/editor/assets/chunks/common/lighting/bxdf.chunk index b3fd91dfbc7..ba06af07417 100644 --- a/editor/assets/chunks/common/lighting/bxdf.chunk +++ b/editor/assets/chunks/common/lighting/bxdf.chunk @@ -1,5 +1,6 @@ // saturated N dot V +// for env reflection with dielectric(non-metal) and smooth surfaces float CalculateFresnelCoefficient(float ior, float NoVSat) { float g, c, n, prev, next; @@ -13,11 +14,49 @@ float CalculateFresnelCoefficient(float ior, float NoVSat) return 0.5 * prev * (1.0 + next); } +// for arbitary smooth surfaces +float CalculateFresnelCoefficient(float F0, float F90, float NoVSat) +{ + return mix(F90, F0, NoVSat); +} + vec3 CalculateScattering(vec3 unscatteredColor, float distance, float outScatterExtinctCoef, float inScatterExtinctCoef, float inScatterCoef, vec3 inScatterColor, vec3 outScatterColor) { - vec2 e = vec2(outScatterExtinctCoef, inScatterExtinctCoef * inScatterCoef); - vec2 extinction = exp(-e * distance); - vec3 inScattered = (1.0 - extinction.y) * inScatterColor; - vec3 outScattered = unscatteredColor * extinction.x * outScatterColor; - return outScattered + inScattered; + vec2 e = vec2(outScatterExtinctCoef, inScatterExtinctCoef * inScatterCoef); + vec2 extinction = exp(-e * distance); + vec3 inScattered = (1.0 - extinction.y) * inScatterColor; + vec3 outScattered = unscatteredColor * extinction.x * outScatterColor; + return outScattered + inScattered; +} + + +// LastLayerF for temporary use +// S is spec without GF +void InitializeLayerBlending(out vec3 blendedBaseLayerD, out vec3 blendedBaseLayerS, + out vec3 blendedSubLayerD, out vec3 blendedSubLayerS, + out vec3 lastLayerF, + in vec3 baseD, in vec3 baseS + ) +{ + blendedBaseLayerD = baseD; + blendedBaseLayerS = baseS; + blendedSubLayerD = blendedSubLayerS = vec3(0.0); + lastLayerF = vec3(1.0); +} + +// use subLayerF instead of subLayerGF for ior-dependent 0-1 range +void CalculateLayerBlending(inout vec3 blendedBaseLayerD, inout vec3 blendedBaseLayerS, + inout vec3 blendedSubLayerD, inout vec3 blendedSubLayerS, + inout vec3 lastLayerF, + in vec3 subLayerD, in vec3 subLayerDiffuseColor, + in vec3 subLayerS, in vec3 subLayerSpecularColor, + in float subLayerOpacity, inout vec3 subLayerF + ) +{ + subLayerF = saturate(subLayerF * subLayerOpacity); + blendedSubLayerD = blendedSubLayerD * (vec3(1.0) - lastLayerF) + subLayerD * subLayerDiffuseColor * subLayerF; + blendedSubLayerS = blendedSubLayerS *(vec3(1.0) - lastLayerF) + subLayerS * subLayerSpecularColor * subLayerF; + blendedBaseLayerD *= vec3(1.0) - subLayerF; + blendedBaseLayerS *= vec3(1.0) - subLayerF; + lastLayerF = subLayerF; } diff --git a/editor/assets/chunks/lighting-models/data-structures/lighting-intermediate-data.chunk b/editor/assets/chunks/lighting-models/data-structures/lighting-intermediate-data.chunk index 7a4b39bd1a9..54e54b14bbf 100644 --- a/editor/assets/chunks/lighting-models/data-structures/lighting-intermediate-data.chunk +++ b/editor/assets/chunks/lighting-models/data-structures/lighting-intermediate-data.chunk @@ -5,9 +5,9 @@ struct LightingIntermediateData float distToCamera, distToCameraSqr; // pos->camera float angleAttenuation, distAttenuation; - float NoL, NoV, NoH;//, VoH; + float NoL, NoV, NoH, VoH; float NoLSat, NoVSat, NoHSat;//, VoHSat; // clamped to 0-1 - float NoVAbsSat; // abs and clamped to 1 + float NoVAbsSat, VoHAbsSat; // abs and clamped to 1 HIGHP_VALUE_STRUCT_DEFINE(vec3, worldPosition); @@ -16,7 +16,8 @@ struct LightingIntermediateData // material data float specularParam; // roughness or specular power - float ior; + // todo: add F0 & F90 + float ior, layerOpacity; #if CC_SURFACES_LIGHTING_ANISOTROPIC float anisotropyShape; @@ -92,9 +93,11 @@ void CCSurfacesLightingGetIntermediateData_PerLight(inout LightingIntermediateDa // dot data.NoL = dot(data.N, data.L); data.NoH = dot(data.N, data.H); - // data.VoH = dot(data.V, data.H); + data.VoH = dot(data.V, data.H); data.NoLSat = max(data.NoL, 0.0); data.NoHSat = max(data.NoH, 0.0); // data.VoHSat = max(data.VoH, 0.0); + + data.VoHAbsSat = max(abs(data.VoH), 0.0); } diff --git a/editor/assets/chunks/lighting-models/data-structures/lighting-result.chunk b/editor/assets/chunks/lighting-models/data-structures/lighting-result.chunk index 6ab96c09d35..d6310b378a2 100644 --- a/editor/assets/chunks/lighting-models/data-structures/lighting-result.chunk +++ b/editor/assets/chunks/lighting-models/data-structures/lighting-result.chunk @@ -1,18 +1,21 @@ struct LightingResult { // material-dependent lighting data - vec3 diffuseColorWithLighting, specularColorWithLighting, specularColorWithEnvLighting; + vec3 diffuseColorWithLighting, specularColorWithLighting; // pure lighting - vec3 directDiffuse, directSpecular; - vec3 environmentDiffuse, environmentSpecular; + vec3 directDiffuse, directSpecular, directGF; + vec3 environmentDiffuse, environmentSpecular, environmentGF; float shadow, ao; vec3 lightmapColor; vec3 emissive; // advanced -#if CC_SURFACES_LIGHTING_USE_FRESNEL - float fresnel; + vec3 fresnel; // for transmit materials , rim or special effects + +#if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + vec3 directDiffuseSubLayers, directSpecularSubLayers; + vec3 environmentDiffuseSubLayers, environmentSpecularSubLayers; #endif #if CC_SURFACES_LIGHTING_TRANSMIT_SPECULAR @@ -20,10 +23,12 @@ struct LightingResult #endif #if CC_SURFACES_LIGHTING_TRANSMIT_DIFFUSE vec3 directTransmitDiffuse, environmentTransmitDiffuse; -#endif +#endif #if CC_SURFACES_LIGHTING_2ND_LAYER_SPECULAR vec3 direct2ndSpecular, environment2ndSpecular; - vec3 specularColorWithLighting2ndSpecular, specularColorWithEnvLighting2ndSpecular; + vec3 specularColorWithLighting2ndSpecular; + vec3 directGF2ndSpecular, environmentGF2ndSpecular; + vec3 directSubLayerF, environmentSubLayerF; #endif #if CC_SURFACES_LIGHTING_TT vec3 directTT; @@ -31,3 +36,12 @@ struct LightingResult #endif //vec3 scattered; }; + + +/* for multi-layer materials, should define: +struct LightingResultPerLayer +{ + vec3 diffuseColorWithLighting, specularColorWithLighting; + vec3 directDiffuse, directSpecular, directGF; + vec3 environmentDiffuse, environmentSpecular, environmentGF; +}*/ diff --git a/editor/assets/chunks/lighting-models/lighting-flow/common-flow.chunk b/editor/assets/chunks/lighting-models/lighting-flow/common-flow.chunk index a9a6316003a..d21d83c428d 100644 --- a/editor/assets/chunks/lighting-models/lighting-flow/common-flow.chunk +++ b/editor/assets/chunks/lighting-models/lighting-flow/common-flow.chunk @@ -11,16 +11,15 @@ CCSurfacesInitializeLightingIntermediateData(lightingData, surfaceData); LightingResult lightingResult; - CCSurfacesLightingInitializeColorWithLighting(lightingResult.diffuseColorWithLighting, lightingResult.specularColorWithLighting, lightingResult.specularColorWithEnvLighting, surfaceData, lightingData); + CCSurfacesLightingInitializeColorWithLighting(lightingResult.diffuseColorWithLighting, lightingResult.specularColorWithLighting, surfaceData, lightingData); lightingResultAccumulated.diffuseColorWithLighting = lightingResult.diffuseColorWithLighting; lightingResultAccumulated.specularColorWithLighting = lightingResult.specularColorWithLighting; - lightingResultAccumulated.specularColorWithEnvLighting = lightingResult.specularColorWithEnvLighting; #if CC_SURFACES_LIGHTING_2ND_LAYER_SPECULAR vec3 diff; SurfacesMaterialData surfaceData2ndSpecular; CCSurfacesGetSurfacesMaterialData2ndSpecular(surfaceData2ndSpecular, surfaceData); - CCSurfacesLightingInitializeColorWithLighting(diff, lightingResultAccumulated.specularColorWithLighting2ndSpecular, lightingResultAccumulated.specularColorWithEnvLighting2ndSpecular, surfaceData2ndSpecular, lightingData); + CCSurfacesLightingInitializeColorWithLighting(diff, lightingResultAccumulated.specularColorWithLighting2ndSpecular, surfaceData2ndSpecular, lightingData); #endif int numLights = CC_PIPELINE_TYPE == CC_PIPELINE_TYPE_FORWARD ? LIGHTS_PER_PASS : int(cc_lightDir[0].w); @@ -29,15 +28,18 @@ vec3 lightDirWithLength = IS_RANGED_DIRECTIONAL_LIGHT(cc_lightPos[i].w) ? -normalize(cc_lightDir[i].xyz) : cc_lightPos[i].xyz - worldPos; CCSurfacesLightingCalculateIntermediateData_PerLight(lightingData, surfaceData, lightDirWithLength); - CCSurfacesLightingCalculateColorWithLighting(lightingResult.diffuseColorWithLighting, lightingResult.specularColorWithLighting, lightingResult.specularColorWithEnvLighting, surfaceData, lightingData); + CCSurfacesLightingCalculateColorWithLighting(lightingResult.diffuseColorWithLighting, lightingResult.specularColorWithLighting, surfaceData, lightingData); vec3 diffuseLighting, specularLighting; CCSurfacesLightingCalculateDirect(diffuseLighting, specularLighting, lightingData, cc_lightColor[i]); - float fresnel = 1.0; #if CC_SURFACES_LIGHTING_USE_FRESNEL - fresnel = lightingResult.fresnel = CCSurfaceLightingCalculateFresnel(lightingData); + vec3 fresnel = CCSurfaceLightingCalculateExtraFresnel(lightingData); + #else + vec3 fresnel = vec3(1.0); #endif + lightingResult.fresnel = fresnel; + float shadow = 1.0; #if CC_RECEIVE_SHADOW && CC_SHADOW_TYPE == CC_SHADOW_MAP @@ -84,7 +86,8 @@ lightingData.angleAttenuation = angleAtt; lightingData.distAttenuation = distAtt; lightingResult.directDiffuse = diffuseLighting * multiplier; - lightingResult.directSpecular = specularLighting * multiplier * fresnel; + lightingResult.directSpecular = specularLighting * multiplier; + CCSurfaceLightingCalculateDirectFresnel(lightingResult.directGF, lightingData, lightingResult.specularColorWithLighting, vec3(1.0)); vec4 attenuatedLightColorAndIntensity = vec4(cc_lightColor[i].xyz, cc_lightColor[i].w * multiplier); @@ -106,13 +109,18 @@ CCSurfacesInitializeLightingIntermediateData(lightingData2ndSpecular, surfaceData2ndSpecular); CCSurfacesLightingCalculateIntermediateData_PerLight(lightingData2ndSpecular, surfaceData, lightDirWithLength); CCSurfacesLightingCalculateDirect2ndSpecular(lightingResult.direct2ndSpecular, lightingData2ndSpecular, attenuatedLightColorAndIntensity, surfaceData2ndSpecular.intensity2ndSpecular, lightingResult.directSpecular); - lightingResult.direct2ndSpecular *= multiplier * fresnel; + CCSurfaceLightingCalculateDirectFresnel(lightingResult.directGF2ndSpecular, lightingData2ndSpecular, lightingResult.specularColorWithLighting2ndSpecular, vec3(1.0)); + + lightingResult.direct2ndSpecular *= multiplier; #endif #if CC_SURFACES_LIGHTING_TT CCSurfacesLightingCalculateDirectTT(lightingResult, lightingData, attenuatedLightColorAndIntensity); #endif + #if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + CCSurfacesLightingCalculateDirectMultiLayerBlending(lightingResult, lightingData2ndSpecular); + #endif // user-defined lighting model #ifdef CC_SURFACES_LIGHTING_MODIFY_FINAL_RESULT @@ -139,7 +147,7 @@ CCSurfacesInitializeLightingIntermediateData(lightingData, surfaceData); CCSurfacesInitializeLightingResult(lightingResult, surfaceData); - CCSurfacesLightingInitializeColorWithLighting(lightingResult.diffuseColorWithLighting, lightingResult.specularColorWithLighting, lightingResult.specularColorWithEnvLighting, surfaceData, lightingData); + CCSurfacesLightingInitializeColorWithLighting(lightingResult.diffuseColorWithLighting, lightingResult.specularColorWithLighting, surfaceData, lightingData); CCSurfacesLightingCalculateIntermediateData_PerLight(lightingData, surfaceData, -cc_mainLitDir.xyz); @@ -200,20 +208,24 @@ #endif + // apply SSR, local probe & global probe + vec3 unused; + CCSurfacesLightingCalculateEnvironment(lightingResult.environmentDiffuse, lightingResult.environmentSpecular, lightingData, cc_ambientSky.w); + CCSurfaceLightingCalculateEnvironmentFresnel(lightingResult.environmentGF, unused, lightingData, lightingResult.specularColorWithLighting); + // dynamic & stationary dir light lightingResult.directDiffuse = lightingResult.directSpecular = vec3(0.0); #if !CC_DISABLE_DIRECTIONAL_LIGHT && !CC_FORWARD_ADD - CCSurfacesLightingCalculateColorWithLighting(lightingResult.diffuseColorWithLighting, lightingResult.specularColorWithLighting, lightingResult.specularColorWithEnvLighting, surfaceData, lightingData); + CCSurfacesLightingCalculateColorWithLighting(lightingResult.diffuseColorWithLighting, lightingResult.specularColorWithLighting, surfaceData, lightingData); CCSurfacesLightingCalculateDirect(lightingResult.directDiffuse, lightingResult.directSpecular, lightingData, cc_mainLitColor); + CCSurfaceLightingCalculateDirectFresnel(lightingResult.directGF, lightingData, lightingResult.specularColorWithLighting, lightingResult.environmentGF); #endif - // apply SSR, local probe & global probe - CCSurfacesLightingCalculateEnvironment(lightingResult.environmentDiffuse, lightingResult.environmentSpecular, lightingData, cc_ambientSky.w); - - #if CC_SURFACES_LIGHTING_USE_FRESNEL - lightingResult.fresnel = CCSurfaceLightingCalculateFresnel(lightingData); + lightingResult.fresnel = CCSurfaceLightingCalculateExtraFresnel(lightingData); + #else + lightingResult.fresnel = vec3(1.0); #endif #if CC_SURFACES_LIGHTING_TRANSMIT_SPECULAR @@ -236,17 +248,26 @@ LightingIntermediateData lightingData2ndSpecular; CCSurfacesInitializeLightingIntermediateData(lightingData2ndSpecular, surfaceData2ndSpecular); CCSurfacesLightingCalculateIntermediateData_PerLight(lightingData2ndSpecular, surfaceData2ndSpecular, -cc_mainLitDir.xyz); - CCSurfacesLightingCalculateDirect2ndSpecular(lightingResult.direct2ndSpecular, lightingData2ndSpecular, cc_mainLitColor, surfaceData2ndSpecular.intensity2ndSpecular, lightingResult.directSpecular); - CCSurfacesLightingCalculateEnvironment2ndSpecular(lightingResult.environment2ndSpecular, lightingData2ndSpecular, cc_ambientSky.w, surfaceData2ndSpecular.intensity2ndSpecular, lightingResult.environmentSpecular); vec3 diff; - CCSurfacesLightingInitializeColorWithLighting(diff, lightingResult.specularColorWithLighting2ndSpecular, lightingResult.specularColorWithEnvLighting2ndSpecular, surfaceData2ndSpecular, lightingData2ndSpecular); + CCSurfacesLightingInitializeColorWithLighting(diff, lightingResult.specularColorWithLighting2ndSpecular, surfaceData2ndSpecular, lightingData2ndSpecular); + + CCSurfacesLightingCalculateEnvironment2ndSpecular(lightingResult.environment2ndSpecular, lightingData2ndSpecular, cc_ambientSky.w, surfaceData2ndSpecular.intensity2ndSpecular, lightingResult.environmentSpecular); + CCSurfaceLightingCalculateEnvironmentFresnel(lightingResult.environmentGF2ndSpecular, lightingResult.environmentSubLayerF, lightingData2ndSpecular, lightingResult.specularColorWithLighting2ndSpecular); + + CCSurfacesLightingCalculateDirect2ndSpecular(lightingResult.direct2ndSpecular, lightingData2ndSpecular, cc_mainLitColor, surfaceData2ndSpecular.intensity2ndSpecular, lightingResult.directSpecular); + CCSurfaceLightingCalculateDirectFresnel(lightingResult.directGF2ndSpecular, lightingData2ndSpecular, lightingResult.specularColorWithLighting2ndSpecular, lightingResult.environmentGF2ndSpecular); #endif #if CC_SURFACES_LIGHTING_TT CCSurfacesLightingCalculateDirectTT(lightingResult, lightingData, cc_mainLitColor); #endif + #if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + CCSurfacesLightingCalculateDirectMultiLayerBlending(lightingResult, lightingData2ndSpecular); + CCSurfacesLightingCalculateEnvironmentMultiLayerBlending(lightingResult, lightingData2ndSpecular); + #endif + // user-defined lighting model #ifdef CC_SURFACES_LIGHTING_MODIFY_FINAL_RESULT LightingMiscData miscData; diff --git a/editor/assets/chunks/lighting-models/model-functions/standard.chunk b/editor/assets/chunks/lighting-models/model-functions/standard.chunk index 922bc513a21..accd9389b63 100644 --- a/editor/assets/chunks/lighting-models/model-functions/standard.chunk +++ b/editor/assets/chunks/lighting-models/model-functions/standard.chunk @@ -59,9 +59,43 @@ void CCSurfacesLightingCalculateEnvironment(out vec3 lightingDiffuse, out vec3 l } #if CC_SURFACES_LIGHTING_USE_FRESNEL - float CCSurfaceLightingCalculateFresnel(in LightingIntermediateData lightingData) +vec3 CCSurfaceLightingCalculateExtraFresnel(in LightingIntermediateData lightingData) +{ + float fresnel = CalculateFresnelCoefficient(lightingData.ior, lightingData.NoVAbsSat); //NoVSat for single side, and NoVAbsSat for two sided + return vec3(fresnel); +} +#endif + +void CCSurfaceLightingCalculateDirectFresnel(out vec3 directGF, in LightingIntermediateData lightingData, vec3 specularColor, in vec3 environmentGF) +{ + #if CC_SURFACES_USE_LEGACY_COMPATIBLE_LIGHTING + // local lighting also use EnvIntegratedFresnel for estimated GF terms, calculate accurate GF instead in the future, CCSurfacesDebugViewLightingResult also needs modified + directGF = environmentGF; + #else + float roughness = lightingData.specularParam; + directGF = F_SchlickMultiplier(specularColor, lightingData.VoHAbsSat) * G_Schlick(roughness, lightingData.NoVSat, lightingData.NoLSat); + #endif +} + +void CCSurfaceLightingCalculateEnvironmentFresnel(out vec3 integratedGF, vec3 integratedF, in LightingIntermediateData lightingData, vec3 specularColor) +{ + float roughness = lightingData.specularParam; + IntegratedGFMultiplier(integratedGF, integratedF, specularColor, roughness, lightingData.NoVAbsSat); +} + +#if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + void CCSurfaceLightingCalculateDirectSubLayerFresnel(out vec3 subLayerF, in LightingIntermediateData lightingData, vec3 specularColor) + { + float VoH = lightingData.VoHAbsSat; + subLayerF = vec3(exp2( (-5.55473 * VoH - 6.98316) * VoH )); + } + void CCSurfaceLightingCalculateEnvironmentSubLayerFresnel(out vec3 subLayerF, in LightingIntermediateData lightingData, vec3 specularColor) { - return CalculateFresnelCoefficient(lightingData.ior, abs(lightingData.NoV)); //NoVSat for single side, and NoVAbs for two sided + // ior related: + subLayerF = vec3(CalculateFresnelCoefficient(lightingData.ior, lightingData.NoVSat)); + // F0 F90 related: + // if (equalf(lightingData.ior, 0.0)) + // subLayerF = vec3(CalculateFresnelCoefficient(lightingData.F0, lightingData.F90, lightingData.NoVSat)); } #endif @@ -218,3 +252,70 @@ void CCSurfacesLightingCalculateEnvironment(out vec3 lightingDiffuse, out vec3 l lightingResult.directTT = ttLighting * DiffuseCoefficient_EnergyConservation * lightSourceColorAndIntensity.xyz* lightSourceColorAndIntensity.w; } #endif + +#if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + // todo: layer result in LightingResult separate to single structure like LightingResultPerLayer + void CCSurfacesLightingCalculateDirectMultiLayerBlending(inout LightingResult lightingResult + , in LightingIntermediateData lightingData2ndLayer + #if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND > 1 + // add more layers... + #endif + ) + { + vec3 lastLayerF, zeroDiffuse = vec3(0.0); + vec3 blendedBaseD = lightingResult.directDiffuse, blendedBaseS = lightingResult.directSpecular; + InitializeLayerBlending(blendedBaseD, blendedBaseS, + lightingResult.directDiffuseSubLayers, lightingResult.directSpecularSubLayers, + lastLayerF, + lightingResult.directDiffuse, lightingResult.directSpecular + ); + + CCSurfaceLightingCalculateDirectSubLayerFresnel(lightingResult.directSubLayerF, lightingData2ndLayer, lightingResult.specularColorWithLighting2ndSpecular); + CalculateLayerBlending (blendedBaseD, blendedBaseS, + lightingResult.directDiffuseSubLayers, lightingResult.directSpecularSubLayers, + lastLayerF, + zeroDiffuse, zeroDiffuse, + lightingResult.direct2ndSpecular, lightingResult.specularColorWithLighting2ndSpecular, + lightingData2ndLayer.layerOpacity, lightingResult.directSubLayerF + ); + #if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND > 1 + // add more layers... + #endif + + // output + lightingResult.directDiffuse = blendedBaseD; + lightingResult.directSpecular = blendedBaseS; + } + + void CCSurfacesLightingCalculateEnvironmentMultiLayerBlending(inout LightingResult lightingResult + , in LightingIntermediateData lightingData2ndLayer + #if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND > 1 + // add more layers... + #endif + ) + { + vec3 lastLayerF, zeroDiffuse = vec3(0.0); + vec3 blendedBaseD = lightingResult.environmentDiffuse, blendedBaseS = lightingResult.environmentSpecular; + InitializeLayerBlending(blendedBaseD, blendedBaseS, + lightingResult.environmentDiffuseSubLayers, lightingResult.environmentSpecularSubLayers, + lastLayerF, + lightingResult.environmentDiffuse, lightingResult.environmentSpecular + ); + + CCSurfaceLightingCalculateEnvironmentSubLayerFresnel(lightingResult.environmentSubLayerF, lightingData2ndLayer, lightingResult.specularColorWithLighting2ndSpecular); + CalculateLayerBlending (blendedBaseD, blendedBaseS, + lightingResult.environmentDiffuseSubLayers, lightingResult.environmentSpecularSubLayers, + lastLayerF, + zeroDiffuse, zeroDiffuse, + lightingResult.environment2ndSpecular, lightingResult.specularColorWithLighting2ndSpecular, + lightingData2ndLayer.layerOpacity, lightingResult.environmentSubLayerF + ); + #if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND > 1 + // add more layers... + #endif + + // output + lightingResult.environmentDiffuse = blendedBaseD; + lightingResult.environmentSpecular = blendedBaseS; + } +#endif diff --git a/editor/assets/chunks/lighting-models/model-functions/toon.chunk b/editor/assets/chunks/lighting-models/model-functions/toon.chunk index cdea2dff79a..1e4088faae4 100644 --- a/editor/assets/chunks/lighting-models/model-functions/toon.chunk +++ b/editor/assets/chunks/lighting-models/model-functions/toon.chunk @@ -40,3 +40,21 @@ void CCSurfacesLightingCalculateEnvironment(out vec3 lightingDiffuse, out vec3 l lightingDiffuse = vec3(0.0); lightingSpecular = vec3(0.0); } + + +#if CC_SURFACES_LIGHTING_USE_FRESNEL +vec3 CCSurfaceLightingCalculateExtraFresnel(in LightingIntermediateData lightingData) +{ + return vec3(1.0); +} +#endif + +void CCSurfaceLightingCalculateDirectFresnel(out vec3 fresnel, in LightingIntermediateData lightingData, vec3 specularColor, in vec3 environmentGF) +{ + fresnel = vec3(1.0); +} + +void CCSurfaceLightingCalculateEnvironmentFresnel(out vec3 integratedGF, out vec3 integratedF, in LightingIntermediateData lightingData, vec3 specularColor) +{ + integratedF = integratedGF = vec3(1.0); +} diff --git a/editor/assets/chunks/surfaces/data-structures/standard.chunk b/editor/assets/chunks/surfaces/data-structures/standard.chunk index 52cbfb976b9..fd8f052538a 100644 --- a/editor/assets/chunks/surfaces/data-structures/standard.chunk +++ b/editor/assets/chunks/surfaces/data-structures/standard.chunk @@ -27,9 +27,14 @@ struct SurfacesMaterialData vec4 transmitDiffuseParams; #endif #if CC_SURFACES_LIGHTING_2ND_LAYER_SPECULAR + // for storage only, copied with CCSurfacesGetSurfacesMaterialData2ndSpecular vec3 baseColor2ndSpecular, color2ndSpecular; - float intensity2ndSpecular, roughness2ndSpecular; + float intensity2ndSpecular, roughness2ndSpecular, metallic2ndSpecular; vec3 worldNormal2ndSpecular, worldTangent2ndSpecular, worldBinormal2ndSpecular; + #if CC_SURFACES_LIGHTING_ANISOTROPIC + float anisotropyShape2ndSpecular; + #endif + float ior2ndSpecular, opacity2ndSpecular; // for multi-layer #endif #if CC_SURFACES_LIGHTING_TT vec3 baseColorTT; diff --git a/editor/assets/chunks/surfaces/default-functions/standard-fs.chunk b/editor/assets/chunks/surfaces/default-functions/standard-fs.chunk index e7f3446aacd..230cbf6f2bb 100644 --- a/editor/assets/chunks/surfaces/default-functions/standard-fs.chunk +++ b/editor/assets/chunks/surfaces/default-functions/standard-fs.chunk @@ -164,6 +164,18 @@ vec3 SurfacesFragmentModifyTTColor(in vec3 baseColor) } #endif +#ifndef CC_SURFACES_FRAGMENT_MODIFY_SSS_PARAMS +// depends on CC_SURFACES_FRAGMENT_MODIFY_SSS_PARAMS +vec4 SurfacesFragmentModifySSSParams() +{ + // x: sssIntensity, moisture + // y: sssCurvature, for preintegrated sss + // z: sssColoration, for sss transmitted light color with dark area + // w: unused + return vec4(1.0, 0.1, 1.0, 0.0); +} +#endif + #ifndef CC_SURFACES_FRAGMENT_MODIFY_DUAL_LOBE_SPECULAR_PARAMS // depends on CC_SURFACES_FRAGMENT_MODIFY_DUAL_LOBE_SPECULAR_PARAMS vec4 SurfacesFragmentModifyDualLobeSpecularParams(float roughness) @@ -174,15 +186,32 @@ vec4 SurfacesFragmentModifyDualLobeSpecularParams(float roughness) } #endif -#ifndef CC_SURFACES_FRAGMENT_MODIFY_SSS_PARAMS -// depends on CC_SURFACES_FRAGMENT_MODIFY_SSS_PARAMS -vec4 SurfacesFragmentModifySSSParams() +#ifndef CC_SURFACES_FRAGMENT_MODIFY_CLEAR_COAT_PARAMS +// depends on CC_SURFACES_FRAGMENT_MODIFY_CLEAR_COAT_PARAMS +vec4 SurfacesFragmentModifyClearCoatParams() { - // x: sssIntensity, moisture - // y: sssCurvature, for preintegrated sss - // z: sssColoration, for sss transmitted light color with dark area - // w: unused - return vec4(1.0, 0.1, 1.0, 0.0); + //x: coat roughness + //y: coat ior + //z: coat opacity + //w: coat intensity + return vec4(0.2, 1.5, 1.0, 1.0); +} +#endif + +#ifndef CC_SURFACES_FRAGMENT_MODIFY_CLEAR_COAT_COLOR +// depends on CC_SURFACES_FRAGMENT_MODIFY_CLEAR_COAT_COLOR +vec3 SurfacesFragmentModifyClearCoatColor() +{ + // for iridescense color variation + return vec3(1.0, 1.0, 1.0); +} +#endif + +#ifndef CC_SURFACES_FRAGMENT_MODIFY_CLEAR_COAT_WORLD_NORMAL +// depends on CC_SURFACES_FRAGMENT_MODIFY_CLEAR_COAT_WORLD_NORMAL +vec3 SurfacesFragmentModifyClearCoatWorldNormal() +{ + return normalize(FSInput_worldNormal); } #endif diff --git a/editor/assets/chunks/surfaces/effect-macros/common-macros.chunk b/editor/assets/chunks/surfaces/effect-macros/common-macros.chunk index ec593297817..6c8caca0b8d 100644 --- a/editor/assets/chunks/surfaces/effect-macros/common-macros.chunk +++ b/editor/assets/chunks/surfaces/effect-macros/common-macros.chunk @@ -87,11 +87,20 @@ #define CC_SURFACES_LIGHTING_2ND_LAYER_SPECULAR 1 #endif #endif - #ifndef CC_SURFACES_LIGHTING_2ND_LAYER_SPECULAR #define CC_SURFACES_LIGHTING_2ND_LAYER_SPECULAR 0 #endif +// this value should be sub-layers count +#ifndef CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + #if CC_SURFACES_LIGHTING_CLEAR_COAT + #define CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND 1 + #endif +#endif +#ifndef CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + #define CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND 0 +#endif + // render-to-color-map can disable functionality to avoid error data map #ifndef CC_SURFACES_ENABLE_DEBUG_VIEW diff --git a/editor/assets/chunks/surfaces/module-functions/debug-view.chunk b/editor/assets/chunks/surfaces/module-functions/debug-view.chunk index 2ea1d14f81e..5f380b79db6 100644 --- a/editor/assets/chunks/surfaces/module-functions/debug-view.chunk +++ b/editor/assets/chunks/surfaces/module-functions/debug-view.chunk @@ -110,13 +110,13 @@ vec4 CCSurfacesDebugDisplayInvalidInputData(vec4 color, vec3 data) if (IS_DEBUG_VIEW_SINGLE_MODE(CC_SURFACES_DEBUG_VIEW_DIRECT_SPECULAR)) { - color.rgb = lightingResult.directSpecular * lightingResult.specularColorWithEnvLighting; + color.rgb = lightingResult.directSpecular * lightingResult.specularColorWithLighting * lightingResult.directGF; isSRGBColor = true; } if (IS_DEBUG_VIEW_SINGLE_MODE(CC_SURFACES_DEBUG_VIEW_DIRECT_ALL)) { - color.rgb = lightingResult.directDiffuse * lightingResult.diffuseColorWithLighting + lightingResult.directSpecular * lightingResult.specularColorWithLighting; + color.rgb = lightingResult.directDiffuse * lightingResult.diffuseColorWithLighting + lightingResult.directSpecular * lightingResult.specularColorWithLighting * lightingResult.directGF; isSRGBColor = true; } @@ -128,13 +128,13 @@ vec4 CCSurfacesDebugDisplayInvalidInputData(vec4 color, vec3 data) if (IS_DEBUG_VIEW_SINGLE_MODE(CC_SURFACES_DEBUG_VIEW_ENV_SPECULAR)) { - color.rgb = lightingResult.environmentSpecular * lightingResult.specularColorWithEnvLighting; + color.rgb = lightingResult.environmentSpecular * lightingResult.specularColorWithLighting * lightingResult.environmentGF; isSRGBColor = true; } if (IS_DEBUG_VIEW_SINGLE_MODE(CC_SURFACES_DEBUG_VIEW_ENV_ALL)) { - color.rgb = lightingResult.environmentDiffuse * lightingResult.diffuseColorWithLighting + lightingResult.environmentSpecular * lightingResult.specularColorWithLighting; + color.rgb = lightingResult.environmentDiffuse * lightingResult.diffuseColorWithLighting + lightingResult.environmentSpecular * lightingResult.specularColorWithLighting * lightingResult.environmentGF; isSRGBColor = true; } @@ -162,14 +162,11 @@ vec4 CCSurfacesDebugDisplayInvalidInputData(vec4 color, vec3 data) isSRGBColor = false; } - float fresnel = 0.0; + vec3 fresnel = lightingResult.fresnel; vec3 directTransmitSpecular = vec3(0.0), environmentTransmitSpecular = vec3(0.0); vec3 directTransmitDiffuse = vec3(0.0), environmentTransmitDiffuse = vec3(0.0); vec3 diffuseColorWithLightingTT = vec3(0.0), specularColorWithLighting2ndSpecular = vec3(0.0); vec3 direct2ndSpecular = vec3(0.0), environment2ndSpecular = vec3(0.0); - #if CC_SURFACES_LIGHTING_USE_FRESNEL - fresnel = lightingResult.fresnel; - #endif #if CC_SURFACES_LIGHTING_TRANSMIT_SPECULAR directTransmitSpecular = lightingResult.directTransmitSpecular; environmentTransmitSpecular = lightingResult.environmentTransmitSpecular; @@ -179,11 +176,19 @@ vec4 CCSurfacesDebugDisplayInvalidInputData(vec4 color, vec3 data) environmentTransmitDiffuse = lightingResult.environmentTransmitDiffuse; #endif #if CC_SURFACES_LIGHTING_2ND_LAYER_SPECULAR - direct2ndSpecular = lightingResult.direct2ndSpecular; - environment2ndSpecular = lightingResult.environment2ndSpecular; - specularColorWithLighting2ndSpecular = lightingResult.specularColorWithEnvLighting2ndSpecular; + direct2ndSpecular = lightingResult.direct2ndSpecular * lightingResult.directGF2ndSpecular; + environment2ndSpecular = lightingResult.environment2ndSpecular * lightingResult.environmentGF2ndSpecular; + specularColorWithLighting2ndSpecular = lightingResult.specularColorWithLighting2ndSpecular; + #if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + fresnel = lightingResult.environmentSubLayerF; + #endif + #endif + #if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + direct2ndSpecular = lightingResult.directSpecularSubLayers; + environment2ndSpecular = lightingResult.environmentSpecularSubLayers; #endif + if (IS_DEBUG_VIEW_SINGLE_MODE(CC_SURFACES_DEBUG_VIEW_FRESNEL)) { color.rgb = vec3(fresnel); @@ -287,9 +292,7 @@ vec4 CCSurfacesDebugDisplayInvalidInputData(vec4 color, vec3 data) if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_AO) lightingResult.ao = 1.0; - #if CC_SURFACES_LIGHTING_USE_FRESNEL if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_FRESNEL) - lightingResult.fresnel = 1.0; - #endif + lightingResult.fresnel = vec3(1.0); } #endif diff --git a/editor/assets/chunks/surfaces/module-functions/standard-fs.chunk b/editor/assets/chunks/surfaces/module-functions/standard-fs.chunk index ce3c9a81b59..6399cee8adc 100644 --- a/editor/assets/chunks/surfaces/module-functions/standard-fs.chunk +++ b/editor/assets/chunks/surfaces/module-functions/standard-fs.chunk @@ -47,12 +47,18 @@ void CCSurfacesFragmentGetMaterialData(inout SurfacesMaterialData surfaceData) // skip in shader graph, need extra code vec4 trtParams = SurfacesFragmentModifyTRTParams(); surfaceData.roughness2ndSpecular = saturate(surfaceData.roughness + trtParams.x); + surfaceData.metallic2ndSpecular = surfaceData.metallic; surfaceData.intensity2ndSpecular = trtParams.w; surfaceData.baseColor2ndSpecular = vec3(1.0); // specular color use specified trt color only surfaceData.color2ndSpecular = SurfacesFragmentModifyTRTColor(); surfaceData.worldNormal2ndSpecular = surfaceData.worldNormal; surfaceData.worldTangent2ndSpecular = surfaceData.worldTangent; surfaceData.worldBinormal2ndSpecular = surfaceData.worldBinormal; + surfaceData.ior2ndSpecular = surfaceData.ior; //unused + surfaceData.opacity2ndSpecular = 1.0; // unused + #if CC_SURFACES_LIGHTING_ANISOTROPIC + surfaceData.anisotropyShape2ndSpecular = surfaceData.anisotropyShape; + #endif RotateNormalAndBinormal(surfaceData.worldBinormal2ndSpecular, surfaceData.worldNormal2ndSpecular, surfaceData.worldTangent2ndSpecular, trtParams.y, FSInput_mirrorNormal); #endif @@ -67,12 +73,37 @@ void CCSurfacesFragmentGetMaterialData(inout SurfacesMaterialData surfaceData) // skip in shader graph, need extra code vec4 dualLobeParams = SurfacesFragmentModifyDualLobeSpecularParams(surfaceData.roughness); surfaceData.roughness2ndSpecular = saturate(dualLobeParams.x); + surfaceData.metallic2ndSpecular = surfaceData.metallic; surfaceData.intensity2ndSpecular = dualLobeParams.w; surfaceData.baseColor2ndSpecular = surfaceData.baseColor.rgb; surfaceData.color2ndSpecular = vec3(1.0); // no extra coloration surfaceData.worldNormal2ndSpecular = surfaceData.worldNormal; surfaceData.worldTangent2ndSpecular = surfaceData.worldTangent; surfaceData.worldBinormal2ndSpecular = surfaceData.worldBinormal; + surfaceData.ior2ndSpecular = surfaceData.ior; + surfaceData.opacity2ndSpecular = 1.0; // unused + #if CC_SURFACES_LIGHTING_ANISOTROPIC + surfaceData.anisotropyShape2ndSpecular = surfaceData.anisotropyShape; + #endif +#endif + +#if CC_SURFACES_LIGHTING_CLEAR_COAT + // skip in shader graph, need extra code + vec4 clearCoatParams = SurfacesFragmentModifyClearCoatParams(); + surfaceData.roughness2ndSpecular = clearCoatParams.x; + surfaceData.metallic2ndSpecular = 0.0; + surfaceData.ior2ndSpecular = clearCoatParams.y; + surfaceData.opacity2ndSpecular = clearCoatParams.z; + surfaceData.intensity2ndSpecular = clearCoatParams.w; + surfaceData.baseColor2ndSpecular = vec3(1.0); // specular color use specified coat color only + surfaceData.color2ndSpecular = SurfacesFragmentModifyClearCoatColor(); + surfaceData.worldNormal2ndSpecular = SurfacesFragmentModifyClearCoatWorldNormal(); + surfaceData.worldBinormal2ndSpecular = surfaceData.worldBinormal; + surfaceData.worldTangent2ndSpecular = CalculateTangent(surfaceData.worldNormal2ndSpecular, surfaceData.worldBinormal2ndSpecular); + #if CC_SURFACES_LIGHTING_ANISOTROPIC + surfaceData.anisotropyShape2ndSpecular = surfaceData.anisotropyShape; + // float anisoRotation = xxx; RotateNormalAndBinormal(surfaceData.worldBinormal2ndSpecular, surfaceData.worldNormal2ndSpecular, surfaceData.worldTangent2ndSpecular, anisoRotation, FSInput_mirrorNormal); + #endif #endif #if CC_SURFACES_LIGHTING_SSS @@ -114,19 +145,20 @@ vec3 CCSurfacesGetSpecularColor(in SurfacesMaterialData surfaceData) } // Diffuse/Specular Color with BRDF lighting preparation -void CCSurfacesLightingInitializeColorWithLighting(inout vec3 diffuseColorWithLighting, inout vec3 specularColorWithLighting, inout vec3 specularColorWithEnvLighting, in SurfacesMaterialData surfaceData, in LightingIntermediateData lightingData) +void CCSurfacesLightingInitializeColorWithLighting(inout vec3 diffuseColorWithLighting, inout vec3 specularColorWithLighting, in SurfacesMaterialData surfaceData, in LightingIntermediateData lightingData) { diffuseColorWithLighting = CCSurfacesGetDiffuseColor(surfaceData); specularColorWithLighting = CCSurfacesGetSpecularColor(surfaceData).xyz; // (Intergrated) GF/4Pi use approximate value for both direct lighting and environment lighting // accuracy value can be calculated in LightingCalculateDirect/Environment instead of IntegratedGFApprox - specularColorWithEnvLighting = IntegratedGFApprox(specularColorWithLighting, surfaceData.roughness, lightingData.NoVAbsSat); + // specularColorWithEnvLighting = IntegratedGFApprox(specularColorWithLighting, surfaceData.roughness, lightingData.NoVAbsSat); } // Update two colors with BRDF which depend on lights (optional) -void CCSurfacesLightingCalculateColorWithLighting(inout vec3 diffuseColorWithLighting, inout vec3 specularColorWithLighting, inout vec3 specularColorWithEnvLighting, in SurfacesMaterialData surfaceData, in LightingIntermediateData lightingData) +void CCSurfacesLightingCalculateColorWithLighting(inout vec3 diffuseColorWithLighting, inout vec3 specularColorWithLighting, in SurfacesMaterialData surfaceData, in LightingIntermediateData lightingData) { } + // Copy material data to lighting data // such as tangent data for anisotropic materials void CCSurfacesInitializeLightingIntermediateData(inout LightingIntermediateData lightingData, in SurfacesMaterialData surfaceData) @@ -140,6 +172,7 @@ void CCSurfacesInitializeLightingIntermediateData(inout LightingIntermediateData ); lightingData.specularParam = surfaceData.roughness; lightingData.ior = surfaceData.ior; + lightingData.layerOpacity = surfaceData.baseColor.a; #if CC_SURFACES_LIGHTING_TRANSMIT_SPECULAR || CC_SURFACES_LIGHTING_TRANSMIT_DIFFUSE lightingData.transmitScatteringParams = surfaceData.transmitScatteringParams; lightingData.inScatteringColor = surfaceData.inScatteringColor; @@ -178,11 +211,16 @@ void CCSurfacesGetLightingIntermediateDataTransmitDiffuse(inout LightingIntermed void CCSurfacesGetSurfacesMaterialData2ndSpecular(inout SurfacesMaterialData surfaceData2ndSpecular, in SurfacesMaterialData surfaceData) { surfaceData2ndSpecular = surfaceData; - surfaceData2ndSpecular.baseColor = vec4(surfaceData.baseColor2ndSpecular, 1.0); + surfaceData2ndSpecular.baseColor = vec4(surfaceData.baseColor2ndSpecular, surfaceData.opacity2ndSpecular); surfaceData2ndSpecular.roughness = surfaceData.roughness2ndSpecular; + surfaceData2ndSpecular.metallic = surfaceData.metallic2ndSpecular; surfaceData2ndSpecular.worldNormal = surfaceData.worldNormal2ndSpecular; surfaceData2ndSpecular.worldTangent = surfaceData.worldTangent2ndSpecular; surfaceData2ndSpecular.worldBinormal = surfaceData.worldBinormal2ndSpecular; + surfaceData2ndSpecular.ior = surfaceData.ior2ndSpecular; + #if CC_SURFACES_LIGHTING_ANISOTROPIC + surfaceData2ndSpecular.anisotropyShape = surfaceData.anisotropyShape2ndSpecular; + #endif } #endif @@ -191,12 +229,21 @@ void CCSurfacesInitializeLightingResult(inout LightingResult lightingResult, in { lightingResult.ao = surfaceData.ao; lightingResult.emissive = surfaceData.emissive; + lightingResult.directGF = vec3(1.0); +#if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + lightingResult.directDiffuseSubLayers = lightingResult.directSpecularSubLayers = vec3(0.0); + lightingResult.environmentDiffuseSubLayers = lightingResult.environmentSpecularSubLayers = vec3(0.0); +#endif } // Init accumulated lighting results for additive pass void CCSurfacesInitializeLightingResult(inout LightingResult lightingResult) { lightingResult.directDiffuse = lightingResult.directSpecular = vec3(0.0); + lightingResult.directGF = vec3(1.0); +#if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + lightingResult.directDiffuseSubLayers = lightingResult.directSpecularSubLayers = vec3(0.0); +#endif #if CC_SURFACES_LIGHTING_TRANSMIT_SPECULAR lightingResult.directTransmitSpecular = vec3(0.0); @@ -212,20 +259,25 @@ void CCSurfacesInitializeLightingResult(inout LightingResult lightingResult) #endif } -// Accumulated lighting results for additive pass +// Accumulated lighting results for additive pass only void CCSurfacesAccumulateLightingResult(inout LightingResult lightingResultAccumulated, in LightingResult lightingResult) { lightingResultAccumulated.directDiffuse += lightingResult.directDiffuse * lightingResult.shadow; - lightingResultAccumulated.directSpecular += lightingResult.directSpecular * lightingResult.shadow; + lightingResultAccumulated.directSpecular += lightingResult.directSpecular * lightingResult.shadow * lightingResult.directGF * lightingResult.fresnel; + + #if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + lightingResultAccumulated.directDiffuseSubLayers += lightingResult.directDiffuseSubLayers * lightingResult.shadow; + lightingResultAccumulated.directSpecularSubLayers += lightingResult.directSpecularSubLayers * lightingResult.shadow; + #endif #if CC_SURFACES_LIGHTING_TRANSMIT_SPECULAR - lightingResultAccumulated.directTransmitSpecular += lightingResult.directTransmitSpecular; + lightingResultAccumulated.directTransmitSpecular += lightingResult.directTransmitSpecular * (vec3(1.0) - lightingResult.fresnel); #endif #if CC_SURFACES_LIGHTING_TRANSMIT_DIFFUSE lightingResultAccumulated.directTransmitDiffuse += lightingResult.directTransmitDiffuse; #endif #if CC_SURFACES_LIGHTING_2ND_LAYER_SPECULAR - lightingResultAccumulated.direct2ndSpecular += lightingResult.direct2ndSpecular * lightingResult.shadow; + lightingResultAccumulated.direct2ndSpecular += lightingResult.direct2ndSpecular * lightingResult.shadow * lightingResult.directGF2ndSpecular * lightingResult.fresnel; #endif #if CC_SURFACES_LIGHTING_TT lightingResultAccumulated.directTT += lightingResult.directTT * lightingResult.shadow; @@ -256,16 +308,20 @@ vec4 CCSurfacesShading(in SurfacesMaterialData surfaceData, in LightingResult li { vec4 color = vec4(0.0, 0.0, 0.0, surfaceData.baseColor.a); - // todo: local lighting also use EnvLightingSpecularColor for estimated GF terms, calculate accurate GF instead in the future, CCSurfacesDebugViewLightingResult also needs modified #if CC_FORWARD_ADD // shadow and fresnel has already been applied with common flow color.xyz += lightingResult.directDiffuse * lightingResult.diffuseColorWithLighting - + lightingResult.directSpecular * lightingResult.specularColorWithEnvLighting + + lightingResult.directSpecular * lightingResult.specularColorWithLighting * lightingResult.directGF #if CC_SURFACES_LIGHTING_TRANSMIT_SPECULAR - + lightingResult.directTransmitSpecular * lightingResult.specularColorWithEnvLighting + + lightingResult.directTransmitSpecular * lightingResult.specularColorWithLighting * lightingResult.directGF #endif - #if CC_SURFACES_LIGHTING_2ND_LAYER_SPECULAR - + lightingResult.direct2ndSpecular * lightingResult.specularColorWithEnvLighting2ndSpecular * surfaceData.color2ndSpecular + #if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + + lightingResult.directDiffuseSubLayers + + lightingResult.directSpecularSubLayers + #else + #if CC_SURFACES_LIGHTING_2ND_LAYER_SPECULAR + + lightingResult.direct2ndSpecular * lightingResult.specularColorWithLighting2ndSpecular * surfaceData.color2ndSpecular * lightingResult.directGF2ndSpecular + #endif #endif #if CC_SURFACES_LIGHTING_TT + lightingResult.directTT * lightingResult.diffuseColorWithLightingTT @@ -276,20 +332,22 @@ vec4 CCSurfacesShading(in SurfacesMaterialData surfaceData, in LightingResult li ; #else - float fresnel = 1.0; - #if CC_SURFACES_LIGHTING_USE_FRESNEL - fresnel = lightingResult.fresnel; - #endif - float invFresnel = 1.0 - fresnel; + vec3 fresnel = lightingResult.fresnel; + vec3 invFresnel = vec3(1.0) - fresnel; color.xyz += ( lightingResult.directDiffuse * lightingResult.diffuseColorWithLighting - + lightingResult.directSpecular * lightingResult.specularColorWithEnvLighting * fresnel + + lightingResult.directSpecular * lightingResult.specularColorWithLighting * lightingResult.directGF * fresnel #if CC_SURFACES_LIGHTING_TRANSMIT_SPECULAR - + lightingResult.directTransmitSpecular * lightingResult.specularColorWithEnvLighting * invFresnel + + lightingResult.directTransmitSpecular * lightingResult.specularColorWithLighting * lightingResult.directGF * invFresnel #endif - #if CC_SURFACES_LIGHTING_2ND_LAYER_SPECULAR - + lightingResult.direct2ndSpecular * lightingResult.specularColorWithEnvLighting2ndSpecular * surfaceData.color2ndSpecular + #if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + + lightingResult.directDiffuseSubLayers + + lightingResult.directSpecularSubLayers + #else + #if CC_SURFACES_LIGHTING_2ND_LAYER_SPECULAR + + lightingResult.direct2ndSpecular * lightingResult.specularColorWithLighting2ndSpecular * surfaceData.color2ndSpecular * lightingResult.directGF2ndSpecular + #endif #endif #if CC_SURFACES_LIGHTING_TT + lightingResult.directTT * lightingResult.diffuseColorWithLightingTT @@ -309,12 +367,17 @@ vec4 CCSurfacesShading(in SurfacesMaterialData surfaceData, in LightingResult li color.xyz += ( lightingResult.environmentDiffuse * lightingResult.diffuseColorWithLighting - + lightingResult.environmentSpecular * lightingResult.specularColorWithEnvLighting * fresnel + + lightingResult.environmentSpecular * lightingResult.specularColorWithLighting * lightingResult.environmentGF * fresnel #if CC_SURFACES_LIGHTING_TRANSMIT_SPECULAR - + lightingResult.environmentTransmitSpecular * lightingResult.specularColorWithEnvLighting * invFresnel + + lightingResult.environmentTransmitSpecular * lightingResult.specularColorWithLighting * lightingResult.environmentGF * invFresnel #endif - #if CC_SURFACES_LIGHTING_2ND_LAYER_SPECULAR - + lightingResult.environment2ndSpecular * lightingResult.specularColorWithEnvLighting2ndSpecular * surfaceData.color2ndSpecular + #if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + + lightingResult.environmentDiffuseSubLayers + + lightingResult.environmentSpecularSubLayers + #else + #if CC_SURFACES_LIGHTING_2ND_LAYER_SPECULAR + + lightingResult.environment2ndSpecular * lightingResult.specularColorWithLighting2ndSpecular * surfaceData.color2ndSpecular * lightingResult.environmentGF2ndSpecular + #endif #endif ) * lightingResult.ao diff --git a/editor/assets/chunks/surfaces/module-functions/toon-fs.chunk b/editor/assets/chunks/surfaces/module-functions/toon-fs.chunk index 5afc2f508e4..f2019bc22e3 100644 --- a/editor/assets/chunks/surfaces/module-functions/toon-fs.chunk +++ b/editor/assets/chunks/surfaces/module-functions/toon-fs.chunk @@ -50,12 +50,12 @@ vec3 CCSurfacesGetSpecularColor(in SurfacesMaterialData surfaceData) { return surfaceData.specular.xyz; } -void CCSurfacesLightingInitializeColorWithLighting(inout vec3 diffuseColorWithLighting, inout vec3 specularColorWithLighting, inout vec3 specularColorWithEnvLighting, in SurfacesMaterialData surfaceData, in LightingIntermediateData lightingData) +void CCSurfacesLightingInitializeColorWithLighting(inout vec3 diffuseColorWithLighting, inout vec3 specularColorWithLighting, in SurfacesMaterialData surfaceData, in LightingIntermediateData lightingData) { diffuseColorWithLighting = vec3(0.0); - specularColorWithEnvLighting = specularColorWithLighting = surfaceData.specular.xyz * surfaceData.baseStep; + specularColorWithLighting = surfaceData.specular.xyz * surfaceData.baseStep; } -void CCSurfacesLightingCalculateColorWithLighting(inout vec3 diffuseColorWithLighting, inout vec3 specularColorWithLighting, inout vec3 specularColorWithEnvLighting, in SurfacesMaterialData surfaceData, in LightingIntermediateData lightingData) +void CCSurfacesLightingCalculateColorWithLighting(inout vec3 diffuseColorWithLighting, inout vec3 specularColorWithLighting, in SurfacesMaterialData surfaceData, in LightingIntermediateData lightingData) { float NL = 0.5 * lightingData.NoL + 0.5; @@ -68,7 +68,6 @@ void CCSurfacesLightingCalculateColorWithLighting(inout vec3 diffuseColorWithLig diffuseColorWithLighting = diffuse * surfaceData.baseStep; } - // Copy material data to lighting data // such as tangent data for anisotropic materials void CCSurfacesInitializeLightingIntermediateData(inout LightingIntermediateData lightingData, in SurfacesMaterialData surfaceData) @@ -140,8 +139,8 @@ vec4 CCSurfacesShading(in SurfacesMaterialData surfaceData, in LightingResult li LightingIntermediateData lightingData; lightingData.NoL = -1.0; vec3 backLightingDiffuse, backLightingSpecular; - CCSurfacesLightingInitializeColorWithLighting(backLightingDiffuse, backLightingSpecular, backLightingSpecular, surfaceData, lightingData); - CCSurfacesLightingCalculateColorWithLighting(backLightingDiffuse, backLightingSpecular, backLightingSpecular, surfaceData, lightingData); + CCSurfacesLightingInitializeColorWithLighting(backLightingDiffuse, backLightingSpecular, surfaceData, lightingData); + CCSurfacesLightingCalculateColorWithLighting(backLightingDiffuse, backLightingSpecular, surfaceData, lightingData); color.xyz += mix(lightingResult.directDiffuse, lightingResult.lightmapColor, lightmapCoef) * mix(backLightingDiffuse, lightingResult.diffuseColorWithLighting, lightingResult.shadow) diff --git a/editor/assets/chunks/surfaces/module-functions/unlit-fs.chunk b/editor/assets/chunks/surfaces/module-functions/unlit-fs.chunk index edc14d1b03f..ed8a5ce578c 100644 --- a/editor/assets/chunks/surfaces/module-functions/unlit-fs.chunk +++ b/editor/assets/chunks/surfaces/module-functions/unlit-fs.chunk @@ -27,13 +27,13 @@ vec3 CCSurfacesGetSpecularColor(in SurfacesMaterialData surfaceData) } // Diffuse/Specular Color with BRDF lighting preparation -void CCSurfacesLightingInitializeColorWithLighting(inout vec3 diffuseColorWithLighting, inout vec3 specularColorWithLighting, inout vec3 specularColorWithEnvLighting, in SurfacesMaterialData surfaceData, in LightingIntermediateData lightingData) +void CCSurfacesLightingInitializeColorWithLighting(inout vec3 diffuseColorWithLighting, inout vec3 specularColorWithLighting, in SurfacesMaterialData surfaceData, in LightingIntermediateData lightingData) { diffuseColorWithLighting = CCSurfacesGetDiffuseColor(surfaceData); - specularColorWithEnvLighting = specularColorWithLighting = CCSurfacesGetSpecularColor(surfaceData).xyz; + specularColorWithLighting = CCSurfacesGetSpecularColor(surfaceData).xyz; } // Update two colors with BRDF which depend on lights (optional) -void CCSurfacesLightingCalculateColorWithLighting(inout vec3 diffuseColorWithLighting, inout vec3 specularColorWithLighting, inout vec3 specularColorWithEnvLighting, in SurfacesMaterialData surfaceData, in LightingIntermediateData lightingData) +void CCSurfacesLightingCalculateColorWithLighting(inout vec3 diffuseColorWithLighting, inout vec3 specularColorWithLighting, in SurfacesMaterialData surfaceData, in LightingIntermediateData lightingData) { } diff --git a/editor/assets/effects/advanced/car-paint.effect b/editor/assets/effects/advanced/car-paint.effect new file mode 100644 index 00000000000..6e5aede6071 --- /dev/null +++ b/editor/assets/effects/advanced/car-paint.effect @@ -0,0 +1,383 @@ +// Copyright (c) 2017-2022 Xiamen Yaji Software Co., Ltd. + +CCEffect %{ + techniques: + - name: opaque + passes: + - vert: standard-vs + frag: standard-fs + properties: &props + tilingOffset: { value: [1.0, 1.0, 0.0, 0.0] } + mainColor: { value: [1.0, 1.0, 1.0, 1.0], target: albedo, linear: true, editor: { displayName: Albedo, type: color } } + albedoScale: { value: [1.0, 1.0, 1.0], target: albedoScaleAndCutoff.xyz } + alphaThreshold: { value: 0.5, target: albedoScaleAndCutoff.w, editor: { parent: USE_ALPHA_TEST, slide: true, range: [0, 1.0], step: 0.001 } } + occlusion: { value: 0.0, target: pbrParams.x, editor: { slide: true, range: [0, 1.0], step: 0.001 } } + roughness: { value: 0.5, target: pbrParams.y, editor: { slide: true, range: [0, 1.0], step: 0.001 } } + metallic: { value: 0.0, target: pbrParams.z, editor: { slide: true, range: [0, 1.0], step: 0.001 } } + specularIntensity: { value: 0.5, target: pbrParams.w, editor: { slide: true, range: [0.0, 1.0], step: 0.001 } } + normalStrength: { value: 1.0, target: emissiveScaleParam.w, editor: { parent: USE_NORMAL_MAP, slide: true, range: [0, 5.0], step: 0.001 } } + addOnShadowBias: { value: 0.0, target: emissiveScaleParam.z } + coatRoughness: { value: 0.05, target: coatParam.x, editor: { slide : true, range : [0, 1.0] , step : 0.0001 } } + coatIOR: { value: 1.0, target: coatParam.y, editor: { slide : true, range : [1.0, 1.5] , step : 0.0001 } } + coatOpacity: { value: 1.0, target: coatParam.z, editor: { slide : true, range : [0.0, 1.0] , step : 0.0001 } } + coatIntensity: { value: 1.0, target: coatParam.w, editor: { slide : true, range : [0.0, 3.0] , step : 0.0001 } } + coatColor: { value: [1.0, 1.0, 1.0, 1.0], linear: true, editor: { displayName: CoatColor, type: color } } + flakeDensity: { value: 0.5, target: flakeParam.x, editor: { parent: USE_FLAKE, slide: true, range: [0, 1.0], step: 0.001 } } + flakeColorIntensity: { value: 0.2, target: flakeParam.y, editor: { parent: USE_FLAKE, slide: true, range: [0, 1.0], step: 0.001 } } + flakeTiling: { value: 10.0, target: flakeParam.z, editor: { parent: USE_FLAKE, slide: true, range: [1.0, 40.0], step: 0.001 } } + coatNormalStrength: { value: 0.1, target: flakeParam.w, editor: { parent: USE_FLAKE, slide: true, range: [0, 1.0], step: 0.001 } } + gradientColor: { value: [1.0, 1.0, 1.0, 1.0], linear: true, editor: { parent: USE_GRADIENT_COLOR, type: color } } + gradientIntensity: { value: 0.5, target: emissiveScaleParam.y, editor: { parent: USE_GRADIENT_COLOR, slide: true, range: [0, 1.0], step: 0.001 } } + mainTexture: { value: grey, target: albedoMap, editor: { displayName: AlbedoMap } } + normalMap: { value: normal } + coatNormalMap: { value: normal, editor: { parent: USE_FLAKE } } + flakeDataMap: { value: white, editor: { parent: USE_FLAKE } } + pbrMap: { value: grey } + occlusionMap: { value: white } + - &forward-add + vert: standard-vs + frag: standard-fs + phase: forward-add + propertyIndex: 0 + embeddedMacros: { CC_FORWARD_ADD: true } + depthStencilState: + depthFunc: equal + depthTest: true + depthWrite: false + blendState: + targets: + - blend: true + blendSrc: one + blendDst: one + blendSrcAlpha: zero + blendDstAlpha: one + - &shadow-caster + vert: shadow-caster-vs + frag: shadow-caster-fs + phase: shadow-caster + propertyIndex: 0 + rasterizerState: + cullMode: front + properties: + tilingOffset: { value: [1.0, 1.0, 0.0, 0.0] } + mainColor: { value: [1.0, 1.0, 1.0, 1.0], target: albedo, editor: { displayName: Albedo, type: color } } + albedoScale: { value: [1.0, 1.0, 1.0], target: albedoScaleAndCutoff.xyz } + alphaThreshold: { value: 0.5, target: albedoScaleAndCutoff.w, editor: { parent: USE_ALPHA_TEST } } + mainTexture: { value: grey, target: albedoMap, editor: { displayName: AlbedoMap } } + - &reflect-map + vert: standard-vs + frag: reflect-map-fs + phase: reflect-map + propertyIndex: 0 + - &planar-shadow + vert: planar-shadow-vs + frag: planar-shadow-fs + phase: planar-shadow + propertyIndex: 0 + depthStencilState: + depthTest: true + depthWrite: false + stencilTestFront: true + stencilFuncFront: not_equal + stencilPassOpFront: replace + stencilRef: 0x80 # only use the leftmost bit + stencilReadMask: 0x80 + stencilWriteMask: 0x80 + blendState: + targets: + - blend: true + blendSrc: src_alpha + blendDst: one_minus_src_alpha + blendDstAlpha: one_minus_src_alpha + - &deferred + vert: standard-vs + frag: standard-fs + pass: gbuffer + phase: gbuffer + embeddedMacros: { CC_PIPELINE_TYPE: 1 } + propertyIndex: 0 + - name: transparent + passes: + - vert: standard-vs + frag: standard-fs + embeddedMacros: { CC_FORCE_FORWARD_SHADING: true } + depthStencilState: &d1 + depthTest: true + depthWrite: false + blendState: &b1 + targets: + - blend: true + blendSrc: src_alpha + blendDst: one_minus_src_alpha + blendDstAlpha: one_minus_src_alpha + properties: *props + - *forward-add + - *shadow-caster + - *planar-shadow + - &deferred-forward + vert: standard-vs + frag: standard-fs + phase: deferred-forward + embeddedMacros: { CC_PIPELINE_TYPE: 0 } + propertyIndex: 0 + depthStencilState: *d1 + blendState: *b1 +}% + +CCProgram shared-ubos %{ + uniform Constants { + vec4 tilingOffset; + vec4 albedo; + vec4 albedoScaleAndCutoff; + vec4 pbrParams; + vec4 emissiveScaleParam; + vec4 coatParam; + vec4 coatColor; + vec4 flakeParam; + vec4 gradientColor; + }; +}% + +CCProgram macro-remapping %{ + // ui displayed macros + #pragma define-meta HAS_SECOND_UV + #pragma define-meta USE_TWOSIDE + #pragma define-meta USE_VERTEX_COLOR + #pragma define-meta USE_FLAKE + + #define CC_SURFACES_USE_SECOND_UV HAS_SECOND_UV + #define CC_SURFACES_USE_TWO_SIDED USE_TWOSIDE + #define CC_SURFACES_USE_VERTEX_COLOR USE_VERTEX_COLOR + #define CC_SURFACES_LIGHTING_CLEAR_COAT 1 + + // depend on UI macros +#if USE_NORMAL_MAP || USE_FLAKE + #define CC_SURFACES_USE_TANGENT_SPACE 1 +#endif +}% + +CCProgram surface-vertex %{ + #define CC_SURFACES_VERTEX_MODIFY_SHADOW_BIAS + vec2 SurfacesVertexModifyShadowBias(in SurfacesStandardVertexIntermediate In, vec2 originShadowBias) + { + return originShadowBias + vec2(emissiveScaleParam.z, 0.0); + } + + #define CC_SURFACES_VERTEX_MODIFY_UV + void SurfacesVertexModifyUV(inout SurfacesStandardVertexIntermediate In) + { + In.texCoord = In.texCoord * tilingOffset.xy + tilingOffset.zw; + #if CC_SURFACES_USE_SECOND_UV + In.texCoord1 = In.texCoord1 * tilingOffset.xy + tilingOffset.zw; + #endif + } +}% + +CCProgram surface-fragment %{ + #if USE_ALBEDO_MAP + uniform sampler2D albedoMap; + #pragma define-meta ALBEDO_UV options([v_uv, v_uv1]) + #endif + #if USE_NORMAL_MAP + uniform sampler2D normalMap; + #pragma define-meta NORMAL_UV options([v_uv, v_uv1]) + #endif + #pragma define-meta DEFAULT_UV options([v_uv, v_uv1]) + #if USE_PBR_MAP + uniform sampler2D pbrMap; + #endif + #if USE_OCCLUSION_MAP + uniform sampler2D occlusionMap; + #endif + #if USE_FLAKE + uniform sampler2D coatNormalMap; + uniform sampler2D flakeDataMap; + #endif + + #pragma define OCCLUSION_CHANNEL r + #pragma define ROUGHNESS_CHANNEL g + #pragma define METALLIC_CHANNEL b + #pragma define SPECULAR_INTENSITY_CHANNEL a + + #if USE_ALPHA_TEST + #pragma define-meta ALPHA_TEST_CHANNEL options([a, r]) + #endif + + #define CC_SURFACES_FRAGMENT_MODIFY_CLEAR_COAT_PARAMS + vec4 SurfacesFragmentModifyClearCoatParams() + { + return vec4(coatParam.x, coatParam.y - 0.99, coatParam.z, coatParam.w * 2.0); + } + + #define CC_SURFACES_FRAGMENT_MODIFY_CLEAR_COAT_COLOR + vec3 SurfacesFragmentModifyClearCoatColor() + { + return coatColor.xyz; + } + + vec4 sampleFlake(sampler2D tex, vec2 uv) + { + vec4 blurred = texture(tex, uv); + vec4 detailed = fragTextureLod(tex, uv, 1.0); + return lerp(blurred, detailed, 0.3); + } + + #define CC_SURFACES_FRAGMENT_MODIFY_CLEAR_COAT_WORLD_NORMAL + vec3 SurfacesFragmentModifyClearCoatWorldNormal() + { + vec3 normal = FSInput_worldNormal; + #if USE_FLAKE + float density = flakeParam.x, densityMin = 0.25, flakeTiling = flakeParam.z; + vec2 uv = FSInput_texcoord * flakeTiling; + vec4 data = sampleFlake(flakeDataMap, uv); + vec3 nmmp = (sampleFlake(coatNormalMap, uv).xyz - vec3(0.5)) * 2.0; + float C = (data.a - 1.0) / density + 1.0; + float bumpIntensity = saturate(max(densityMin, C)); + nmmp = lerp(vec3(0.0, 0.0, 1.0), nmmp, bumpIntensity); + normal = CalculateNormalFromTangentSpace(nmmp, flakeParam.w, normalize(normal.xyz), normalize(FSInput_worldTangent), FSInput_mirrorNormal); + #endif + + return normalize(normal); + } + + #include + + + #include + #define CC_SURFACES_FRAGMENT_MODIFY_SHARED_DATA + void SurfacesFragmentModifySharedData(inout SurfacesMaterialData surfaceData) + { + #if USE_GRADIENT_COLOR + vec3 viewDir = normalize(cc_cameraPos.xyz - surfaceData.worldPos); + float NoVSat = saturate(dot(surfaceData.worldNormal, viewDir)); + surfaceData.baseColor.rgb = lerp(gradientColor, surfaceData.baseColor, pow(NoVSat, emissiveScaleParam.y)).rgb; + #endif + + #if USE_FLAKE + float density = flakeParam.x, flakeColorIntensity = flakeParam.y, flakeTiling = flakeParam.z; + vec2 uv = FSInput_texcoord * flakeTiling; + + vec4 data = sampleFlake(flakeDataMap, uv); + float C = (data.a - 1.0) / density + 1.0; + float flakeTintWeight = 1.0; + float flakeWeight = saturate(C) * flakeTintWeight * flakeColorIntensity; + + // color + vec4 flakeA = vec4(0.972,0.96,0.915,1); + vec4 flakeB = vec4(1.0,0.78,0.344,1); + vec4 flakeColor = lerp(flakeA, flakeB, data.r); + + vec4 color = surfaceData.baseColor; + color = lerp(color, flakeColor, flakeWeight); + color = lerp(surfaceData.baseColor, color, surfaceData.metallic); + surfaceData.baseColor = color; + surfaceData.roughness *= lerp(1.0, 0.5, flakeWeight); + #endif + } +}% + +CCProgram standard-vs %{ + precision highp float; + + // 1. surface internal macros, for technique usage or remapping some user (material) macros to surface internal macros + #include + #include + + // 2. common include with corresponding shader stage, include before surface functions + #include + + // 3. user surface functions that can use user (effect) parameters (ubo Constants) + // see surfaces/default-functions/xxx.chunk + #include + #include + + // 4. surface include with corresponding shader stage and shading-model (optional) + #include + + // 5. shader entry with corresponding shader stage and technique usage/type + #include +}% + + +CCProgram shadow-caster-vs %{ + precision highp float; + #include + #include + #include + #include + #include + #include +}% + +CCProgram planar-shadow-vs %{ + precision highp float; + #include + #include + #include + #include + #include + #include +}% + + +CCProgram standard-fs %{ + // shading-model : standard + // lighting-model : standard (isotropy / anisotropy pbr) + // shader stage : fs + // technique usage/type : render-to-scene + + precision highp float; + // 1. surface internal macros, for technique usage or remapping some user (material) macros to surface internal macros + #include + #include + + // 2. common include with corresponding shader stage, include before surface functions + #include + + // 3. user surface functions that can use user (effect) parameters (ubo Constants) + // see surfaces/default-functions/xxx.chunk + #include + #include + + // 4. lighting-model (optional) + #include + + // 5. surface include with corresponding shader stage and shading-model (optional) + #include + + // 6. shader entry with corresponding shader stage and technique usage/type + #include +}% + +CCProgram shadow-caster-fs %{ + precision highp float; + #include + #include + #include + #include + #include + #include +}% + +CCProgram planar-shadow-fs %{ + precision highp float; + #include + #include + #include + #include + #include + #include +}% + +CCProgram reflect-map-fs %{ + precision highp float; + #include + #include + #include + #include + #include + #include + #include + #include +}% + diff --git a/editor/assets/effects/advanced/car-paint.effect.meta b/editor/assets/effects/advanced/car-paint.effect.meta new file mode 100644 index 00000000000..ab9bcd058f7 --- /dev/null +++ b/editor/assets/effects/advanced/car-paint.effect.meta @@ -0,0 +1,11 @@ +{ + "ver": "1.7.0", + "importer": "effect", + "imported": true, + "uuid": "304a12db-3955-46e4-b712-e5e26f45258b", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": {} +} diff --git a/editor/assets/effects/advanced/glass.effect b/editor/assets/effects/advanced/glass.effect new file mode 100644 index 00000000000..f8c76e0ce2e --- /dev/null +++ b/editor/assets/effects/advanced/glass.effect @@ -0,0 +1,354 @@ +// Copyright (c) 2017-2022 Xiamen Yaji Software Co., Ltd. + +CCEffect %{ + techniques: + - name: opaque + passes: + - vert: standard-vs + frag: standard-fs + properties: &props + tilingOffset: { value: [1.0, 1.0, 0.0, 0.0] } + mainColor: { value: [0.05, 0.05, 0.05, 1.0], target: albedo, linear: true, editor: { displayName: Albedo, type: color } } + albedoScale: { value: [1.0, 1.0, 1.0], target: albedoScaleAndCutoff.xyz } + roughness: { value: 0.0, target: pbrParams.y, editor: { slide: true, range: [0, 1.0], step: 0.001 } } + metallic: { value: 0.0, target: pbrParams.z, editor: { slide: true, range: [0, 1.0], step: 0.001 } } + specularIntensity: { value: 0.2, target: pbrParams.w, editor: { slide: true, range: [0.0, 1.0], step: 0.001 } } + F0: { value: 0.7, target: emissiveScaleParam.x, editor: { slide: true, range: [0, 1.0], step: 0.001 } } + F90: { value: 0.9, target: emissiveScaleParam.y, editor: { slide: true, range: [0.0, 1.0], step: 0.001 } } + gradientColor: { value: [0.0, 0.05, 0.0, 1.0], linear: true, editor: { parent: USE_GRADIENT_COLOR, type: color } } + gradientIntensity: { value: 0.2, target: emissiveScaleParam.z, editor: { parent: USE_GRADIENT_COLOR, slide: true, range: [0, 1.0], step: 0.001 } } + normalStrength: { value: 1.0, target: emissiveScaleParam.w, editor: { parent: USE_NORMAL_MAP, slide: true, range: [0, 5.0], step: 0.001 } } + mainTexture: { value: grey, target: albedoMap, editor: { displayName: AlbedoMap } } + normalMap: { value: normal } + pbrMap: { value: grey } + - &forward-add + vert: standard-vs + frag: standard-fs + phase: forward-add + propertyIndex: 0 + embeddedMacros: { CC_FORWARD_ADD: true } + depthStencilState: + depthFunc: equal + depthTest: true + depthWrite: false + blendState: + targets: + - blend: true + blendSrc: one + blendDst: one + blendSrcAlpha: zero + blendDstAlpha: one + - &shadow-caster + vert: shadow-caster-vs + frag: shadow-caster-fs + phase: shadow-caster + propertyIndex: 0 + rasterizerState: + cullMode: front + properties: + tilingOffset: { value: [1.0, 1.0, 0.0, 0.0] } + mainColor: { value: [1.0, 1.0, 1.0, 1.0], target: albedo, editor: { displayName: Albedo, type: color } } + albedoScale: { value: [1.0, 1.0, 1.0], target: albedoScaleAndCutoff.xyz } + mainTexture: { value: grey, target: albedoMap, editor: { displayName: AlbedoMap } } + - &reflect-map + vert: standard-vs + frag: reflect-map-fs + phase: reflect-map + propertyIndex: 0 + - &planar-shadow + vert: planar-shadow-vs + frag: planar-shadow-fs + phase: planar-shadow + propertyIndex: 0 + depthStencilState: + depthTest: true + depthWrite: false + stencilTestFront: true + stencilFuncFront: not_equal + stencilPassOpFront: replace + stencilRef: 0x80 # only use the leftmost bit + stencilReadMask: 0x80 + stencilWriteMask: 0x80 + blendState: + targets: + - blend: true + blendSrc: src_alpha + blendDst: one_minus_src_alpha + blendDstAlpha: one_minus_src_alpha + - &deferred + vert: standard-vs + frag: standard-fs + pass: gbuffer + phase: gbuffer + embeddedMacros: { CC_PIPELINE_TYPE: 1 } + propertyIndex: 0 + - name: transparent + passes: + - vert: standard-vs + frag: standard-fs + embeddedMacros: { CC_FORCE_FORWARD_SHADING: true } + depthStencilState: &d1 + depthTest: true + depthWrite: false + blendState: &b1 + targets: + - blend: true + blendSrc: src_alpha + blendDst: one_minus_src_alpha + blendDstAlpha: one_minus_src_alpha + properties: *props + - *forward-add + - *shadow-caster + - *planar-shadow + - &deferred-forward + vert: standard-vs + frag: standard-fs + phase: deferred-forward + embeddedMacros: { CC_PIPELINE_TYPE: 0 } + propertyIndex: 0 + depthStencilState: *d1 + blendState: *b1 +}% + +CCProgram shared-ubos %{ + uniform Constants { + vec4 tilingOffset; + vec4 albedo; + vec4 albedoScaleAndCutoff; + vec4 pbrParams; + vec4 emissiveScaleParam; + vec4 gradientColor; + }; +}% + +CCProgram macro-remapping %{ + // ui displayed macros + #pragma define-meta USE_TWOSIDE + #pragma define-meta USE_VERTEX_COLOR + #pragma define-meta USE_PROBE_REFRACTION editor({ tooltip: 'Use transparency technique when disabled, otherwise use opaque technique' }) + + #define CC_SURFACES_USE_TWO_SIDED USE_TWOSIDE + #define CC_SURFACES_USE_VERTEX_COLOR USE_VERTEX_COLOR + #define CC_SURFACES_LIGHTING_TRANSMIT_SPECULAR USE_PROBE_REFRACTION + #define CC_SURFACES_LIGHTING_USE_FRESNEL USE_PROBE_REFRACTION + + // depend on UI macros +#if USE_NORMAL_MAP + #define CC_SURFACES_USE_TANGENT_SPACE 1 +#endif +}% + +CCProgram surface-vertex %{ + #define CC_SURFACES_VERTEX_MODIFY_UV + void SurfacesVertexModifyUV(inout SurfacesStandardVertexIntermediate In) + { + In.texCoord = In.texCoord * tilingOffset.xy + tilingOffset.zw; + #if CC_SURFACES_USE_SECOND_UV + In.texCoord1 = In.texCoord1 * tilingOffset.xy + tilingOffset.zw; + #endif + } +}% + +CCProgram surface-fragment %{ + #if USE_ALBEDO_MAP + uniform sampler2D albedoMap; + #pragma define-meta ALBEDO_UV options([v_uv, v_uv1]) + #endif + #if USE_NORMAL_MAP + uniform sampler2D normalMap; + #pragma define-meta NORMAL_UV options([v_uv, v_uv1]) + #endif + #if USE_PBR_MAP + uniform sampler2D pbrMap; + #endif + #pragma define-meta DEFAULT_UV options([v_uv, v_uv1]) + + #define CC_SURFACES_FRAGMENT_MODIFY_BASECOLOR_AND_TRANSPARENCY + vec4 SurfacesFragmentModifyBaseColorAndTransparency() + { + vec4 baseColor = albedo; + + #if USE_VERTEX_COLOR + baseColor.rgb *= SRGBToLinear(FSInput_vertexColor.rgb); // use linear + baseColor.a *= FSInput_vertexColor.a; + #endif + + #if USE_ALBEDO_MAP + vec4 texColor = texture(albedoMap, ALBEDO_UV); + texColor.rgb = SRGBToLinear(texColor.rgb); + baseColor *= texColor; + #endif + + baseColor.rgb *= albedoScaleAndCutoff.xyz; + return baseColor; + } + + #define CC_SURFACES_FRAGMENT_MODIFY_WORLD_NORMAL + vec3 SurfacesFragmentModifyWorldNormal() + { + vec3 normal = FSInput_worldNormal; + #if USE_NORMAL_MAP + vec3 nmmp = texture(normalMap, NORMAL_UV).xyz - vec3(0.5); + normal = CalculateNormalFromTangentSpace(nmmp, emissiveScaleParam.w, normalize(normal.xyz), normalize(FSInput_worldTangent), FSInput_mirrorNormal); + #endif + + return normalize(normal); + } + + #define CC_SURFACES_FRAGMENT_MODIFY_PBRPARAMS + vec4 SurfacesFragmentModifyPBRParams() + { + vec4 pbr = pbrParams; + pbr.x = 1.0; + #if USE_PBR_MAP + vec4 res = texture(pbrMap, DEFAULT_UV); + pbr.yzw *= res.yzw; + #endif + + return pbr; + } + + #include + #include + #define CC_SURFACES_FRAGMENT_MODIFY_SHARED_DATA + void SurfacesFragmentModifySharedData(inout SurfacesMaterialData surfaceData) + { + vec3 viewDir = normalize(cc_cameraPos.xyz - surfaceData.worldPos); + float NoVSat = saturate(dot(surfaceData.worldNormal, viewDir)); + + #if !USE_PROBE_REFRACTION + // fresnel for alpha blend + float F0 = emissiveScaleParam.x, F90 = emissiveScaleParam.y; + surfaceData.baseColor.a = CalculateFresnelCoefficient(min(F0, F90), F90, NoVSat); + #endif + + #if USE_GRADIENT_COLOR + surfaceData.baseColor.rgb = lerp(gradientColor * albedoScaleAndCutoff, surfaceData.baseColor, pow(NoVSat, emissiveScaleParam.z)).rgb; + #endif + } + + #include + #define CC_SURFACES_LIGHTING_MODIFY_FINAL_RESULT + void SurfacesLightingModifyFinalResult(inout LightingResult result, in LightingIntermediateData lightingData, in SurfacesMaterialData surfaceData, in LightingMiscData miscData) + { + #if USE_PROBE_REFRACTION + // fresnel for refraction + vec3 viewDir = normalize(cc_cameraPos.xyz - surfaceData.worldPos); + float NoVSat = saturate(dot(surfaceData.worldNormal, viewDir)); + float F0 = emissiveScaleParam.x, F90 = emissiveScaleParam.y; + float fresnel = CalculateFresnelCoefficient(min(F0, F90), F90, NoVSat); + result.fresnel = vec3(fresnel); + #else + // simply fix oit depth issue for bright color alpha blending + float threshold = 0.5, bright = dot(result.environmentSpecular, vec3(0.33333)); + if (bright > threshold) + result.environmentSpecular = result.environmentSpecular / bright * threshold; + #endif + } +}% + +CCProgram standard-vs %{ + precision highp float; + + // 1. surface internal macros, for technique usage or remapping some user (material) macros to surface internal macros + #include + #include + + // 2. common include with corresponding shader stage, include before surface functions + #include + + // 3. user surface functions that can use user (effect) parameters (ubo Constants) + // see surfaces/default-functions/xxx.chunk + #include + #include + + // 4. surface include with corresponding shader stage and shading-model (optional) + #include + + // 5. shader entry with corresponding shader stage and technique usage/type + #include +}% + + +CCProgram shadow-caster-vs %{ + precision highp float; + #include + #include + #include + #include + #include + #include +}% + +CCProgram planar-shadow-vs %{ + precision highp float; + #include + #include + #include + #include + #include + #include +}% + + +CCProgram standard-fs %{ + // shading-model : standard + // lighting-model : standard (isotropy / anisotropy pbr) + // shader stage : fs + // technique usage/type : render-to-scene + + precision highp float; + // 1. surface internal macros, for technique usage or remapping some user (material) macros to surface internal macros + #include + #include + + // 2. common include with corresponding shader stage, include before surface functions + #include + + // 3. user surface functions that can use user (effect) parameters (ubo Constants) + // see surfaces/default-functions/xxx.chunk + #include + #include + + // 4. lighting-model (optional) + #include + + // 5. surface include with corresponding shader stage and shading-model (optional) + #include + + // 6. shader entry with corresponding shader stage and technique usage/type + #include +}% + +CCProgram shadow-caster-fs %{ + precision highp float; + #include + #include + #include + #include + #include + #include +}% + +CCProgram planar-shadow-fs %{ + precision highp float; + #include + #include + #include + #include + #include + #include +}% + +CCProgram reflect-map-fs %{ + precision highp float; + #include + #include + #include + #include + #include + #include + #include + #include +}% + diff --git a/editor/assets/effects/advanced/glass.effect.meta b/editor/assets/effects/advanced/glass.effect.meta new file mode 100644 index 00000000000..ff18657e4e4 --- /dev/null +++ b/editor/assets/effects/advanced/glass.effect.meta @@ -0,0 +1,11 @@ +{ + "ver": "1.7.0", + "importer": "effect", + "imported": true, + "uuid": "f288f946-150b-443d-b4b3-0227c5117c93", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": {} +} diff --git a/editor/assets/effects/advanced/hair.effect b/editor/assets/effects/advanced/hair.effect index 3a2d18e2b2e..9c500f38a29 100644 --- a/editor/assets/effects/advanced/hair.effect +++ b/editor/assets/effects/advanced/hair.effect @@ -26,7 +26,7 @@ CCEffect %{ anisotropyMap: { value: black } roughnessTRT: { value: 0.2, target: trtParams.x, editor: { displayName: TRT Roughness Offset, slide: true, range: [0, 1.0], step: 0.001, tooltip: 'The extend range of internal reflection lighting around the direct specular' } } offsetTRT: { value: 0.0, target: trtParams.y, editor: { displayName: TRT Lighting Offset, slide: true, range: [-0.5, 0.5], step: 0.001, tooltip: 'The position offset of internal reflection lighting compared to direct specular' } } - IntensityTRT: { value: 1.0, target: trtParams.w, editor: { displayName: TRT Intensity, slide: true, range: [0, 5.0], step: 0.01 } } + IntensityTRT: { value: 2.0, target: trtParams.w, editor: { displayName: TRT Intensity, slide: true, range: [0, 10.0], step: 0.01 } } baseColorTRT: { value: [0.5, 0.33, 0.18, 1.0], target: trtColor, linear: true, editor: { displayName: TRT Albedo, type: color, tooltip: 'The color of internal reflection lighting' } } ScatterCoefTT: { value: 0.0, target: ttParams.x, editor: { displayName: TT Scatter Coef, slide: true, range: [0, 1.0], step: 0.01, tooltip: 'The saturation of internal transmit lighting color' } } IntensityTT: { value: 1.0, target: ttParams.w, editor: { displayName: TT Intensity, slide: true, range: [0, 1.0], step: 0.01 } } diff --git a/editor/assets/effects/util/dcc/vat/houdini-fluid-v3-liquid.effect b/editor/assets/effects/util/dcc/vat/houdini-fluid-v3-liquid.effect index 25d9e5c09f8..2a4d39a1e9a 100644 --- a/editor/assets/effects/util/dcc/vat/houdini-fluid-v3-liquid.effect +++ b/editor/assets/effects/util/dcc/vat/houdini-fluid-v3-liquid.effect @@ -301,7 +301,7 @@ CCProgram surface-fragment %{ return normalize(CalculateNormalFromTangentSpace(nmmp, normalIntensity, N, T, FSInput_mirrorNormal)); } - float GetFresnel(float fresnel) + vec3 GetFresnel(vec3 fresnel) { return saturate(fresnel * 1.5); } diff --git a/editor/assets/effects/util/dcc/vat/zeno-fluid-liquid.effect b/editor/assets/effects/util/dcc/vat/zeno-fluid-liquid.effect index fb1af249d9d..e553d178eda 100644 --- a/editor/assets/effects/util/dcc/vat/zeno-fluid-liquid.effect +++ b/editor/assets/effects/util/dcc/vat/zeno-fluid-liquid.effect @@ -226,7 +226,7 @@ CCProgram surface-fragment %{ return normalize(CalculateNormalFromTangentSpace(nmmp, normalIntensity, N, T, FSInput_mirrorNormal)); } - float GetFresnel(float fresnel) + vec3 GetFresnel(vec3 fresnel) { return saturate(fresnel * 1.5); } From d83d2ac3f11eeb5e81e91562d405c3574d19406c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=85=B5?= <49358166+xubing0906@users.noreply.github.com> Date: Thu, 20 Jul 2023 22:03:11 +0800 Subject: [PATCH 13/51] fix reflection probe type for skin and instancing (#15789) --- cocos/3d/framework/mesh-renderer.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cocos/3d/framework/mesh-renderer.ts b/cocos/3d/framework/mesh-renderer.ts index 00d82bb0e8d..2132c568b88 100644 --- a/cocos/3d/framework/mesh-renderer.ts +++ b/cocos/3d/framework/mesh-renderer.ts @@ -901,10 +901,11 @@ export class MeshRenderer extends ModelRenderer { // because the lighting map will influence the model's shader this._model.initLightingmap(this.bakeSettings.texture, this.bakeSettings.uvParam); this._updateUseLightProbe(); - this._updateUseReflectionProbe(); + this._updateUseReflectionProbeType(); this._updateModelParams(); this._onUpdateLightingmap(); this._onUpdateLocalShadowBiasAndProbeId(); + this._updateUseReflectionProbe(); this._updateReceiveDirLight(); this._onUpdateReflectionProbeDataMap(); this._onUpdateLocalReflectionProbeData(); @@ -1185,6 +1186,11 @@ export class MeshRenderer extends ModelRenderer { this._updateReflectionProbeTexture(); } + protected _updateUseReflectionProbeType () { + if (!this._model) return; + this._model.reflectionProbeType = this.bakeSettings.reflectionProbe; + } + protected _updateBakeToReflectionProbe () { if (!this._model) { return; } this._model.bakeToReflectionProbe = this.bakeSettings.bakeToReflectionProbe; From aacc0d7261ba3fc9b6c0018e4205ef7290aff592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=85=B5?= <49358166+xubing0906@users.noreply.github.com> Date: Fri, 21 Jul 2023 11:48:57 +0800 Subject: [PATCH 14/51] add help for reflection probe and rename Fxaa (#15790) --- cocos/3d/reflection-probe/reflection-probe-component.ts | 3 ++- cocos/rendering/post-process/components/fxaa.ts | 8 ++++---- cocos/rendering/post-process/passes/fxaa-pass.ts | 4 ++-- editor/i18n/en/localization.js | 3 ++- editor/i18n/zh/localization.js | 3 ++- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/cocos/3d/reflection-probe/reflection-probe-component.ts b/cocos/3d/reflection-probe/reflection-probe-component.ts index eb24ff03c03..3a125488251 100644 --- a/cocos/3d/reflection-probe/reflection-probe-component.ts +++ b/cocos/3d/reflection-probe/reflection-probe-component.ts @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import { ccclass, executeInEditMode, menu, playOnFocus, serializable, tooltip, type, visible } from 'cc.decorator'; +import { ccclass, executeInEditMode, help, menu, playOnFocus, serializable, tooltip, type, visible } from 'cc.decorator'; import { EDITOR, EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { CCBoolean, CCObject, Color, Enum, Vec3 } from '../../core'; @@ -62,6 +62,7 @@ export enum ProbeResolution { @menu('Rendering/ReflectionProbe') @executeInEditMode @playOnFocus +@help('i18n:cc.ReflectionProbe') export class ReflectionProbe extends Component { protected static readonly DEFAULT_CUBE_SIZE: Readonly = new Vec3(1, 1, 1); protected static readonly DEFAULT_PLANER_SIZE: Readonly = new Vec3(5, 0.5, 5); diff --git a/cocos/rendering/post-process/components/fxaa.ts b/cocos/rendering/post-process/components/fxaa.ts index 8f1c8a23d86..41fb51f05cc 100644 --- a/cocos/rendering/post-process/components/fxaa.ts +++ b/cocos/rendering/post-process/components/fxaa.ts @@ -1,10 +1,10 @@ import { ccclass, disallowMultiple, executeInEditMode, help, menu } from '../../../core/data/decorators'; import { PostProcessSetting } from './post-process-setting'; -@ccclass('cc.Fxaa') -@help('cc.Fxaa') -@menu('PostProcess/Fxaa') +@ccclass('cc.FXAA') +@help('cc.FXAA') +@menu('PostProcess/FXAA') @disallowMultiple @executeInEditMode -export class Fxaa extends PostProcessSetting { +export class FXAA extends PostProcessSetting { } diff --git a/cocos/rendering/post-process/passes/fxaa-pass.ts b/cocos/rendering/post-process/passes/fxaa-pass.ts index 64419cad668..80a774571a9 100644 --- a/cocos/rendering/post-process/passes/fxaa-pass.ts +++ b/cocos/rendering/post-process/passes/fxaa-pass.ts @@ -6,10 +6,10 @@ import { getCameraUniqueID } from '../../custom/define'; import { passContext } from '../utils/pass-context'; import { getSetting, SettingPass } from './setting-pass'; -import { Fxaa } from '../components/fxaa'; +import { FXAA } from '../components/fxaa'; export class FxaaPass extends SettingPass { - get setting () { return getSetting(Fxaa); } + get setting () { return getSetting(FXAA); } name = 'FxaaPass' effectName = 'pipeline/post-process/fxaa-hq'; diff --git a/editor/i18n/en/localization.js b/editor/i18n/en/localization.js index 1ba99832758..7b238392b84 100755 --- a/editor/i18n/en/localization.js +++ b/editor/i18n/en/localization.js @@ -137,12 +137,13 @@ module.exports = link(mixin({ BlitScreen: `${url}/${version}/manual/en/render-pipeline/post-process/blit-screen.html`, TAA: `${url}/${version}/manual/en/render-pipeline/post-process/index.html`, FSR: `${url}/${version}/manual/en/render-pipeline/post-process/index.html`, - Fxaa: `${url}/${version}/manual/en/render-pipeline/post-process/index.html`, + FXAA: `${url}/${version}/manual/en/render-pipeline/post-process/index.html`, Bloom: `${url}/${version}/manual/en/render-pipeline/post-process/index.html`, HBAO: `${url}/${version}/manual/en/render-pipeline/post-process/index.html`, ColorGrading: `${url}/${version}/manual/en/render-pipeline/post-process/index.html`, Skin: `${url}/${version}/manual/en/shader/advanced-shader/skin.html`, RenderRoot2D: `${url}/${version}/manual/en/ui-system/components/editor/renderroot2d.html`, + ReflectionProbe: `${url}/${version}/manual/en/concepts/scene/light/probe/reflection-art-workflow.html`, }, assets: { javascript: `${url}/${version}/manual/en/concepts/scene/node-component.html`, diff --git a/editor/i18n/zh/localization.js b/editor/i18n/zh/localization.js index 2e51cd91d3d..9e562d57c3d 100755 --- a/editor/i18n/zh/localization.js +++ b/editor/i18n/zh/localization.js @@ -137,12 +137,13 @@ module.exports = link(mixin({ BlitScreen: `${url}/${version}/manual/zh/render-pipeline/post-process/blit-screen.html`, TAA: `${url}/${version}/manual/zh/render-pipeline/post-process/index.html`, FSR: `${url}/${version}/manual/zh/render-pipeline/post-process/index.html`, - Fxaa: `${url}/${version}/manual/zh/render-pipeline/post-process/index.html`, + FXAA: `${url}/${version}/manual/zh/render-pipeline/post-process/index.html`, Bloom: `${url}/${version}/manual/zh/render-pipeline/post-process/index.html`, HBAO: `${url}/${version}/manual/zh/render-pipeline/post-process/index.html`, ColorGrading: `${url}/${version}/manual/zh/render-pipeline/post-process/index.html`, Skin: `${url}/${version}/manual/zh/shader/advanced-shader/skin.html`, RenderRoot2D: `${url}/${version}/manual/zh/ui-system/components/editor/renderroot2d.html`, + ReflectionProbe: `${url}/${version}/manual/zh/concepts/scene/light/probe/reflection-art-workflow.html`, }, assets: { javascript: `${url}/${version}/manual/zh/concepts/scene/node-component.html`, From 775b794aa9f079da75a16b3836bd0f07804cce8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leslie=20Leigh=20=28=E6=9D=8E=E7=9A=84=E5=BA=8F=29?= Date: Fri, 21 Jul 2023 11:54:54 +0800 Subject: [PATCH 15/51] Fix clip visiting in animation controller; fix typo (#15791) --- editor/src/marionette/preview.ts | 1 - editor/src/marionette/visit.ts | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/editor/src/marionette/preview.ts b/editor/src/marionette/preview.ts index 42566e88fc7..c7b8d2f16ce 100644 --- a/editor/src/marionette/preview.ts +++ b/editor/src/marionette/preview.ts @@ -88,7 +88,6 @@ class AnimationGraphPartialPreviewer { const bindingContext = new AnimationGraphBindingContext( this._root, this._poseLayoutMaintainer, this._varInstances, this._dummyAnimationController, - new EventTarget(), ); poseLayoutMaintainer.startBind(); diff --git a/editor/src/marionette/visit.ts b/editor/src/marionette/visit.ts index a6e4e8dc512..12bf082ece7 100644 --- a/editor/src/marionette/visit.ts +++ b/editor/src/marionette/visit.ts @@ -15,6 +15,7 @@ import { PoseNodeStateMachine } from '../../../cocos/animation/marionette/pose-g import { PoseNodePlayMotion } from "../../../cocos/animation/marionette/pose-graph/pose-nodes/play-motion"; import { PoseNodeSampleMotion } from "../../../cocos/animation/marionette/pose-graph/pose-nodes/sample-motion"; import { PoseGraph } from "../../../cocos/animation/marionette/pose-graph/pose-graph"; +import { AnimationGraphVariant } from "../../../cocos/animation/marionette/animation-graph-variant"; export function* visitAnimationGraphEditorExtras(animationGraph: AnimationGraph): Generator { for (const layer of animationGraph.layers) { @@ -112,7 +113,17 @@ export function* visitAnimationClipsInController(animationController: AnimationC const { graph, } = animationController; - if (graph) { - yield* visitAnimationClips(graph as AnimationGraph); + if (graph instanceof AnimationGraph) { + yield* visitAnimationClips(graph); + } else if (graph instanceof AnimationGraphVariant) { + const { + original, + clipOverrides, + } = graph; + if (original) { + for (const clip of visitAnimationClips(original)) { + yield clipOverrides.get(clip) ?? clip; + } + } } } From 3ca7d08db3694437a93e97f65aca6266435312e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leslie=20Leigh=20=28=E6=9D=8E=E7=9A=84=E5=BA=8F=29?= Date: Fri, 21 Jul 2023 14:32:12 +0800 Subject: [PATCH 16/51] Animation components localization (#15701) Fix --- .../skeletal-animation/skeletal-animation.ts | 6 +-- cocos/animation/animation-component.ts | 6 +-- editor/i18n/en/animation.js | 40 +++++++++++++++++++ editor/i18n/zh/animation.js | 37 +++++++++++++++++ editor/i18n/zh/localization.js | 7 ---- 5 files changed, 82 insertions(+), 14 deletions(-) diff --git a/cocos/3d/skeletal-animation/skeletal-animation.ts b/cocos/3d/skeletal-animation/skeletal-animation.ts index 62f980eb51c..a53df4e3ffc 100644 --- a/cocos/3d/skeletal-animation/skeletal-animation.ts +++ b/cocos/3d/skeletal-animation/skeletal-animation.ts @@ -23,7 +23,7 @@ */ import { - ccclass, executeInEditMode, executionOrder, help, menu, tooltip, type, serializable, editable, + ccclass, executeInEditMode, executionOrder, help, menu, type, serializable, editable, } from 'cc.decorator'; import { SkinnedMeshRenderer } from '../skinned-mesh-renderer'; import { Mat4, cclegacy, js, assertIsTrue } from '../../core'; @@ -107,7 +107,7 @@ export class SkeletalAnimation extends Animation { * 当前动画组件维护的挂点数组。要挂载自定义节点到受动画驱动的骨骼上,必须先在此注册挂点。 */ @type([Socket]) - @tooltip('i18n:animation.sockets') + @editable get sockets (): Socket[] { return this._sockets; } @@ -131,7 +131,7 @@ export class SkeletalAnimation extends Animation { * 是否使用预烘焙动画,默认启用,可以大幅提高运行效时率,但所有动画效果会被彻底固定,不支持任何形式的编辑和混合。
* 运行时动态修改此选项会在播放下一条动画片段时生效。 */ - @tooltip('i18n:animation.use_baked_animation') + @editable get useBakedAnimation (): boolean { return this._useBakedAnimation; } diff --git a/cocos/animation/animation-component.ts b/cocos/animation/animation-component.ts index 0c1045fc680..ced9b78886e 100644 --- a/cocos/animation/animation-component.ts +++ b/cocos/animation/animation-component.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { ccclass, executeInEditMode, executionOrder, help, menu, tooltip, type, serializable } from 'cc.decorator'; +import { ccclass, executeInEditMode, executionOrder, help, menu, type, serializable, editable } from 'cc.decorator'; import { EDITOR_NOT_IN_PREVIEW, TEST } from 'internal:constants'; import { Component } from '../scene-graph/component'; import { Eventify, warnID, js, cclegacy } from '../core'; @@ -60,7 +60,6 @@ export class Animation extends Eventify(Component) { * 设置时,已有剪辑关联的动画状态将被停止;若默认剪辑不在新的动画剪辑中,将被重置为空。 */ @type([AnimationClip]) - @tooltip('i18n:animation.clips') get clips (): (AnimationClip | null)[] { return this._clips; } @@ -103,7 +102,6 @@ export class Animation extends Eventify(Component) { * @see [[playOnLoad]] */ @type(AnimationClip) - @tooltip('i18n:animation.default_clip') get defaultClip (): AnimationClip | null { return this._defaultClip; } @@ -131,7 +129,7 @@ export class Animation extends Eventify(Component) { * 注意,若在组件开始运行前调用了 `crossFade` 或 `play()`,此字段将不会生效。 */ @serializable - @tooltip('i18n:animation.play_on_load') + @editable public playOnLoad = false; /** diff --git a/editor/i18n/en/animation.js b/editor/i18n/en/animation.js index 7d5f7e45433..055ec951478 100644 --- a/editor/i18n/en/animation.js +++ b/editor/i18n/en/animation.js @@ -18,7 +18,47 @@ module.exports = { classes: { 'cc': { + 'Animation': { + 'properties': { + 'clips': { + displayName: 'Clips', + tooltip: 'All clips this component governs.', + }, + 'defaultClip': { + displayName: 'Default Clip', + tooltip: 'The default clip to play.', + }, + 'playOnLoad': { + displayName: 'Play On Load', + tooltip: 'Whether automatically play the default clip after component loaded.', + }, + }, + }, + 'SkeletalAnimation': { + 'properties': { + __extends__: 'classes.cc.Animation.properties', + 'sockets': { + displayName: 'Sockets', + tooltip: 'The joint sockets this animation component maintains. ' + + 'Sockets have to be registered here before attaching custom nodes to animated joints.', + }, + 'useBakedAnimation': { + displayName: 'Use Baked Animation', + tooltip: `Whether to bake animations. Default to true, ` + + `which substantially increases performance while making all animations completely fixed.` + + `Dynamically changing this property will take effect when playing the next animation clip.`, + }, + }, + }, 'animation': { + 'AnimationController': { + properties: { + 'graph': { + displayName: 'Graph', + tooltip: 'The animation graph or animation graph variant associated with this animation controller.', + }, + }, + }, 'PoseGraphOutputNode': { displayName: 'Output Pose', }, diff --git a/editor/i18n/zh/animation.js b/editor/i18n/zh/animation.js index 08fe6073151..a164ef8588a 100644 --- a/editor/i18n/zh/animation.js +++ b/editor/i18n/zh/animation.js @@ -18,7 +18,44 @@ module.exports = { classes: { 'cc': { + 'Animation': { + 'properties': { + 'clips': { + displayName: '剪辑列表', + tooltip: '此组件管理的所有剪辑。', + }, + 'defaultClip': { + displayName: '默认剪辑', + tooltip: '默认播放的剪辑。', + }, + 'playOnLoad': { + displayName: '加载后播放', + tooltip: '是否在组件加载完成后自动播放默认剪辑。', + }, + }, + }, + 'SkeletalAnimation': { + 'properties': { + __extends__: 'classes.cc.Animation.properties', + 'sockets': { + displayName: '挂点列表', + tooltip: '当前动画组件维护的挂点列表。要挂载自定义节点到受动画驱动的骨骼上,必须先在此注册挂点。', + }, + 'useBakedAnimation': { + displayName: '预烘培动画', + tooltip: '是否预烘焙动画,默认启用,可以大幅提高运行效时率,但所有动画效果会被彻底固定,不支持任何形式的编辑和混合。', + }, + }, + }, 'animation': { + 'AnimationController': { + properties: { + 'graph': { + displayName: '图', + tooltip: '此动画控制器所关联的动画图或动画图变体。', + }, + }, + }, 'PoseGraphOutputNode': { displayName: '输出姿态', }, diff --git a/editor/i18n/zh/localization.js b/editor/i18n/zh/localization.js index 2e51cd91d3d..ae59472f96f 100755 --- a/editor/i18n/zh/localization.js +++ b/editor/i18n/zh/localization.js @@ -225,13 +225,6 @@ module.exports = link(mixin({ shadowMapSize: '阴影贴图分辨率,目前支持 Low_256x256、Medium_512x512、High_1024x1024、Ultra_2048x2048 四种精度的纹理', maxReceived: '产生阴影的有效光源数量', }, - animation: { - default_clip: '在勾选自动播放或调用 play() 时默认播放的动画 clip。', - clips: '通过脚本可以访问并播放的 AnimationClip 列表', - play_on_load: '是否在运行游戏后自动播放默认动画 clip。', - use_baked_animation: '是否使用预烘焙动画,默认启用,可以大幅提高运行效时率,
但所有动画效果会被彻底固定,不支持任何形式的编辑', - sockets: '当前动画组件维护的挂点数组。要挂载自定义节点到受动画驱动的骨骼上,必须先在此注册挂点', - }, audio: { clip: '通过该组件播放的默认 AudioClip 引用', volume: '音频的音量', From 72db3322bdfed3af3f5cee355b64d3dea057bac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=90=89=E6=9E=97?= <798080536@qq.com> Date: Fri, 21 Jul 2023 15:19:24 +0800 Subject: [PATCH 17/51] add light probe group help (#15797) --- cocos/core/math/vec2.ts | 8 +------- cocos/gi/light-probe/light-probe-group.ts | 2 ++ editor/i18n/en/localization.js | 1 + editor/i18n/zh/localization.js | 1 + native/cocos/math/Vec2.h | 1 - 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/cocos/core/math/vec2.ts b/cocos/core/math/vec2.ts index b3d9aa33150..4513d732f6c 100644 --- a/cocos/core/math/vec2.ts +++ b/cocos/core/math/vec2.ts @@ -297,13 +297,10 @@ export class Vec2 extends ValueType { * @override (a:Vec2, b:Vec2) => number * @override [deprecated] (out:Vec3, a:Vec2, b:Vec2) => Vec3 */ - /** - * @deprecated since v3.8.0, There is no physical meaning. - */ public static cross (a: IVec2Like, b: IVec2Like): number; /** - * @deprecated since v3.8.0, There is no physical meaning. + * @deprecated Consider use another overrides please. */ public static cross (out: Vec3, a: Out, b: Out): Vec3; @@ -719,9 +716,6 @@ export class Vec2 extends ValueType { * @param other specified vector * @return `out` */ - /** - * @deprecated since v3.8.0, There is no physical meaning. - */ public cross (other: Vec2): number { return this.x * other.y - this.y * other.x; } diff --git a/cocos/gi/light-probe/light-probe-group.ts b/cocos/gi/light-probe/light-probe-group.ts index 4da0e6bbad3..1e993cdb9d0 100644 --- a/cocos/gi/light-probe/light-probe-group.ts +++ b/cocos/gi/light-probe/light-probe-group.ts @@ -28,6 +28,7 @@ import { displayName, editable, executeInEditMode, + help, menu, range, serializable, @@ -46,6 +47,7 @@ import { AutoPlacement, PlaceMethod } from './auto-placement'; * @zh 光照探针组组件。 */ @ccclass('cc.LightProbeGroup') +@help('i18n:cc.LightProbeGroup') @menu('Rendering/LightProbeGroup') @disallowMultiple @executeInEditMode diff --git a/editor/i18n/en/localization.js b/editor/i18n/en/localization.js index 1ba99832758..922eb971dae 100755 --- a/editor/i18n/en/localization.js +++ b/editor/i18n/en/localization.js @@ -71,6 +71,7 @@ module.exports = link(mixin({ DirectionalLight: `${url}/${version}/manual/en/concepts/scene/light/lightType/dir-light.html`, SphereLight: `${url}/${version}/manual/en/concepts/scene/light/lightType/sphere-light.html`, SpotLight: `${url}/${version}/manual/en/concepts/scene/light/lightType/spot-light.html`, + LightProbeGroup: `${url}/${version}/manual/en/concepts/scene/light/probe/light-probe.html`, UICoordinateTracker: `${url}/${version}/manual/en/ui-system/components/editor/ui-coordinate-tracker.html`, Animation: `${url}/${version}/manual/en/animation/animation-component.html`, SkeletalAnimation: `${url}/${version}/manual/en/animation/skeletal-animation.html`, diff --git a/editor/i18n/zh/localization.js b/editor/i18n/zh/localization.js index ae59472f96f..7e0569856a5 100755 --- a/editor/i18n/zh/localization.js +++ b/editor/i18n/zh/localization.js @@ -71,6 +71,7 @@ module.exports = link(mixin({ DirectionalLight: `${url}/${version}/manual/zh/concepts/scene/light/lightType/dir-light.html`, SphereLight: `${url}/${version}/manual/zh/concepts/scene/light/lightType/sphere-light.html`, SpotLight: `${url}/${version}/manual/zh/concepts/scene/light/lightType/spot-light.html`, + LightProbeGroup: `${url}/${version}/manual/zh/concepts/scene/light/probe/light-probe.html`, UICoordinateTracker: `${url}/${version}/manual/zh/ui-system/components/editor/ui-coordinate-tracker.html`, Animation: `${url}/${version}/manual/zh/animation/animation-component.html`, SkeletalAnimation: `${url}/${version}/manual/zh/animation/skeletal-animation.html`, diff --git a/native/cocos/math/Vec2.h b/native/cocos/math/Vec2.h index 163c3350c67..dcf5abaac9c 100644 --- a/native/cocos/math/Vec2.h +++ b/native/cocos/math/Vec2.h @@ -510,7 +510,6 @@ class CC_DLL Vec2 { /** Calculates cross product of two points. @return float @since v2.1.4 - @deprecated since v3.8.0, There is no physical meaning. */ inline float cross(const Vec2 &other) const { return x * other.y - y * other.x; From acab20f3482fb82f1770e99c2acffe497aff1f11 Mon Sep 17 00:00:00 2001 From: bofeng-song Date: Mon, 24 Jul 2023 10:21:39 +0800 Subject: [PATCH 18/51] fix multi touch cause crash on Android platform (#15796) --- .../cocos/platform/android/AndroidPlatform.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/native/cocos/platform/android/AndroidPlatform.cpp b/native/cocos/platform/android/AndroidPlatform.cpp index d39df1f0d16..fc8d213420a 100644 --- a/native/cocos/platform/android/AndroidPlatform.cpp +++ b/native/cocos/platform/android/AndroidPlatform.cpp @@ -422,7 +422,8 @@ class GameInputProxy { if (actionMasked == AMOTION_EVENT_ACTION_DOWN || actionMasked == AMOTION_EVENT_ACTION_POINTER_DOWN) { if (actionMasked == AMOTION_EVENT_ACTION_POINTER_DOWN) { - eventChangedIndex = action >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; + eventChangedIndex = ((action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) + >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT); } else { eventChangedIndex = 0; } @@ -431,7 +432,8 @@ class GameInputProxy { actionMasked == AMOTION_EVENT_ACTION_POINTER_UP) { touchEvent.type = cc::TouchEvent::Type::ENDED; if (actionMasked == AMOTION_EVENT_ACTION_POINTER_UP) { - eventChangedIndex = action >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; + eventChangedIndex = ((action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) + >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT); } else { eventChangedIndex = 0; } @@ -443,8 +445,9 @@ class GameInputProxy { return false; } + bool touchHandled = true; if (eventChangedIndex >= 0) { - addTouchEvent(touchEvent, eventChangedIndex, motionEvent); + touchHandled = addTouchEvent(touchEvent, eventChangedIndex, motionEvent); } else { for (int i = 0; i < motionEvent->pointerCount; i++) { addTouchEvent(touchEvent, i, motionEvent); @@ -452,7 +455,7 @@ class GameInputProxy { } events::Touch::broadcast(touchEvent); touchEvent.touches.clear(); - return true; + return touchHandled; } return false; } @@ -670,14 +673,15 @@ class GameInputProxy { } private: - static void addTouchEvent(cc::TouchEvent &touchEvent, int index, GameActivityMotionEvent *motionEvent) { + static bool addTouchEvent(cc::TouchEvent &touchEvent, int index, GameActivityMotionEvent *motionEvent) { if (index < 0 || index >= motionEvent->pointerCount) { - ABORT_IF(false); + return false; } int id = motionEvent->pointers[index].id; float x = GameActivityPointerAxes_getX(&motionEvent->pointers[index]); float y = GameActivityPointerAxes_getY(&motionEvent->pointers[index]); touchEvent.touches.emplace_back(x, y, id); + return true; } static void setMousePosition(cc::MouseEvent &mouseEvent, GameActivityMotionEvent *motionEvent) { From 069557388ac9994193c20fcd0c0052d7634ebca7 Mon Sep 17 00:00:00 2001 From: jk20012001 Date: Tue, 25 Jul 2023 10:01:24 +0800 Subject: [PATCH 19/51] sky effect support blend and fog (#15801) --- .../lighting-flow/common-flow.chunk | 2 ++ .../model-functions/standard.chunk | 2 +- .../main-functions/misc/sky-fs.chunk | 9 ++++- .../assets/effects/advanced/car-paint.effect | 2 +- editor/assets/effects/advanced/glass.effect | 2 +- editor/assets/effects/advanced/sky.effect | 35 +++++++++++++++---- 6 files changed, 41 insertions(+), 11 deletions(-) diff --git a/editor/assets/chunks/lighting-models/lighting-flow/common-flow.chunk b/editor/assets/chunks/lighting-models/lighting-flow/common-flow.chunk index d21d83c428d..ad2dc2efcae 100644 --- a/editor/assets/chunks/lighting-models/lighting-flow/common-flow.chunk +++ b/editor/assets/chunks/lighting-models/lighting-flow/common-flow.chunk @@ -119,6 +119,7 @@ #endif #if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + lightingResult.specularColorWithLighting2ndSpecular *= surfaceData.color2ndSpecular; //temporary coloration CCSurfacesLightingCalculateDirectMultiLayerBlending(lightingResult, lightingData2ndSpecular); #endif @@ -264,6 +265,7 @@ #endif #if CC_SURFACES_LIGHTING_USE_MULTIPLE_LAYER_BLEND + lightingResult.specularColorWithLighting2ndSpecular *= surfaceData.color2ndSpecular; //temporary coloration CCSurfacesLightingCalculateDirectMultiLayerBlending(lightingResult, lightingData2ndSpecular); CCSurfacesLightingCalculateEnvironmentMultiLayerBlending(lightingResult, lightingData2ndSpecular); #endif diff --git a/editor/assets/chunks/lighting-models/model-functions/standard.chunk b/editor/assets/chunks/lighting-models/model-functions/standard.chunk index accd9389b63..74d1afe399f 100644 --- a/editor/assets/chunks/lighting-models/model-functions/standard.chunk +++ b/editor/assets/chunks/lighting-models/model-functions/standard.chunk @@ -123,7 +123,7 @@ void CCSurfaceLightingCalculateEnvironmentFresnel(out vec3 integratedGF, vec3 in #if CC_USE_REFLECTION_PROBE == REFLECTION_PROBE_TYPE_CUBE envSpec = EnvReflection(cc_reflectionProbeCubemap, R, roughness, cc_ambientGround.w); #endif - //todo: planar refraction from scene color + // todo: planar refraction from scene color when use planar probe or no probe #endif #if CC_USE_IBL && CC_USE_REFLECTION_PROBE != REFLECTION_PROBE_TYPE_CUBE diff --git a/editor/assets/chunks/shading-entries/main-functions/misc/sky-fs.chunk b/editor/assets/chunks/shading-entries/main-functions/misc/sky-fs.chunk index 74e5b4de8ea..ec31cee9515 100644 --- a/editor/assets/chunks/shading-entries/main-functions/misc/sky-fs.chunk +++ b/editor/assets/chunks/shading-entries/main-functions/misc/sky-fs.chunk @@ -22,5 +22,12 @@ void main() { color.rgb = LinearToSRGB(color.rgb); #endif - fragColorX = color; + //todo: LDR fogging in gamma space, HDR fogging should move before tone mapping + #if CC_USE_FOG != CC_FOG_NONE + float fogFactor = 1.0; + CC_TRANSFER_FOG_BASE(vec4(FSInput_worldPos, 1.0), fogFactor); + CC_APPLY_FOG_BASE(color, fogFactor); + #endif + + fragColorX = color; } diff --git a/editor/assets/effects/advanced/car-paint.effect b/editor/assets/effects/advanced/car-paint.effect index 6e5aede6071..186e6b5276f 100644 --- a/editor/assets/effects/advanced/car-paint.effect +++ b/editor/assets/effects/advanced/car-paint.effect @@ -24,7 +24,7 @@ CCEffect %{ coatColor: { value: [1.0, 1.0, 1.0, 1.0], linear: true, editor: { displayName: CoatColor, type: color } } flakeDensity: { value: 0.5, target: flakeParam.x, editor: { parent: USE_FLAKE, slide: true, range: [0, 1.0], step: 0.001 } } flakeColorIntensity: { value: 0.2, target: flakeParam.y, editor: { parent: USE_FLAKE, slide: true, range: [0, 1.0], step: 0.001 } } - flakeTiling: { value: 10.0, target: flakeParam.z, editor: { parent: USE_FLAKE, slide: true, range: [1.0, 40.0], step: 0.001 } } + flakeTiling: { value: 10.0, target: flakeParam.z, editor: { parent: USE_FLAKE, slide: true, range: [1.0, 50.0], step: 0.001 } } coatNormalStrength: { value: 0.1, target: flakeParam.w, editor: { parent: USE_FLAKE, slide: true, range: [0, 1.0], step: 0.001 } } gradientColor: { value: [1.0, 1.0, 1.0, 1.0], linear: true, editor: { parent: USE_GRADIENT_COLOR, type: color } } gradientIntensity: { value: 0.5, target: emissiveScaleParam.y, editor: { parent: USE_GRADIENT_COLOR, slide: true, range: [0, 1.0], step: 0.001 } } diff --git a/editor/assets/effects/advanced/glass.effect b/editor/assets/effects/advanced/glass.effect index f8c76e0ce2e..8fd1228902a 100644 --- a/editor/assets/effects/advanced/glass.effect +++ b/editor/assets/effects/advanced/glass.effect @@ -239,7 +239,7 @@ CCProgram surface-fragment %{ float fresnel = CalculateFresnelCoefficient(min(F0, F90), F90, NoVSat); result.fresnel = vec3(fresnel); #else - // simply fix oit depth issue for bright color alpha blending + // simply fix single blend source issue for bright color alpha blending float threshold = 0.5, bright = dot(result.environmentSpecular, vec3(0.33333)); if (bright > threshold) result.environmentSpecular = result.environmentSpecular / bright * threshold; diff --git a/editor/assets/effects/advanced/sky.effect b/editor/assets/effects/advanced/sky.effect index d8c9f59d29d..b7e2e59ff2f 100644 --- a/editor/assets/effects/advanced/sky.effect +++ b/editor/assets/effects/advanced/sky.effect @@ -7,7 +7,10 @@ CCEffect %{ - vert: sky-vs frag: sky-fs properties: &props - environmentMap: { value: grey } + environmentMap: { value: grey } + positionScaling: { value: 1.0, target: params.w, editor: { tooltip: 'Set a smaller value (such as less than 1.0) to remove the effects of fog' } } + blendEnvironmentMap: { value: grey, editor: { parent: BLEND_ENV_MAP } } + blendWeight: { value: 0.0, target: params.x, editor: { parent: BLEND_ENV_MAP } } priority : max - 10 rasterizerState : &r1 cullMode : none @@ -24,30 +27,46 @@ CCEffect %{ depthStencilState: *d1 }% +CCProgram shared-ubos %{ + uniform Constants { + vec4 params; + }; +}% CCProgram surface-vertex %{ #define CC_SURFACES_VERTEX_MODIFY_WORLD_POS vec3 SurfacesVertexModifyWorldPos(in SurfacesStandardVertexIntermediate In) { // Apply uniform scaling for atmosphere effects - return In.worldPos; + return In.worldPos * params.w; } }% CCProgram surface-fragment %{ - uniform samplerCube environmentMap; + #if BLEND_ENV_MAP + uniform samplerCube blendEnvironmentMap; + #endif #define CC_SURFACES_FRAGMENT_MODIFY_BASECOLOR_AND_TRANSPARENCY + vec3 sampleEnvMap(samplerCube tex, vec3 R) + { + vec3 c = vec3(1.0); + #if USE_RGBE_CUBEMAP + c *= unpackRGBE(fragTextureLod(tex, R, 0.0)); + #else + c *= SRGBToLinear(fragTextureLod(tex, R, 0.0).rgb); + #endif + return c; + } vec4 SurfacesFragmentModifyBaseColorAndTransparency() { vec3 c = vec3(1.0); #if CC_USE_IBL vec3 normal = normalize(FSInput_worldNormal); vec3 rotationDir = RotationVecFromAxisY(normal.xyz, cc_surfaceTransform.z, cc_surfaceTransform.w); - #if USE_RGBE_CUBEMAP - c *= unpackRGBE(fragTextureLod(environmentMap, rotationDir.xyz, 0.0)); - #else - c *= SRGBToLinear(fragTextureLod(environmentMap, rotationDir.xyz, 0.0).rgb); + c = sampleEnvMap(environmentMap, rotationDir); + #if BLEND_ENV_MAP + c = mix(c, sampleEnvMap(blendEnvironmentMap, rotationDir), params.x); #endif #endif return vec4(c * cc_ambientSky.w, 1.0); @@ -59,6 +78,7 @@ CCProgram sky-vs %{ #include #include + #include #include #include }% @@ -69,6 +89,7 @@ CCProgram sky-fs %{ #include #include + #include #include #include }% From d97d3c655a28cdaec52882921a3a60f5eb2f343f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=85=B5?= <49358166+xubing0906@users.noreply.github.com> Date: Tue, 25 Jul 2023 15:40:55 +0800 Subject: [PATCH 20/51] add global post settings (#15558) --- cocos/native-binding/decorators.ts | 20 ++++- cocos/render-scene/scene/index.jsb.ts | 10 +++ cocos/render-scene/scene/index.ts | 1 + cocos/render-scene/scene/post-settings.ts | 37 +++++++++ cocos/rendering/pipeline-scene-data.ts | 11 ++- cocos/scene-graph/scene-globals.jsb.ts | 24 +++++- cocos/scene-graph/scene-globals.ts | 46 +++++++++++- editor/i18n/en/localization.js | 3 + editor/i18n/zh/localization.js | 3 + editor/inspector/contributions/node.js | 7 ++ native/CMakeLists.txt | 2 + .../cocos/core/scene-graph/SceneGlobals.cpp | 10 +++ native/cocos/core/scene-graph/SceneGlobals.h | 4 + .../renderer/pipeline/PipelineSceneData.cpp | 4 + .../renderer/pipeline/PipelineSceneData.h | 4 + native/cocos/scene/PostSettings.cpp | 75 +++++++++++++++++++ native/cocos/scene/PostSettings.h | 67 +++++++++++++++++ native/tools/swig-config/pipeline.i | 1 + native/tools/swig-config/scene.i | 6 ++ 19 files changed, 328 insertions(+), 7 deletions(-) create mode 100644 cocos/render-scene/scene/post-settings.ts create mode 100644 native/cocos/scene/PostSettings.cpp create mode 100644 native/cocos/scene/PostSettings.h diff --git a/cocos/native-binding/decorators.ts b/cocos/native-binding/decorators.ts index fb4dc49c7c9..cfdfc74d5c9 100644 --- a/cocos/native-binding/decorators.ts +++ b/cocos/native-binding/decorators.ts @@ -792,6 +792,21 @@ export function patch_cc_PointLight(ctx: cc_PointLight_Context_Args, apply = def apply(() => { $.ccclass('cc.PointLight')(PointLight); }, 'ccclass', null); } // end of patch_cc_PointLight +//---- class cc_PostSettingsInfo +interface cc_PostSettingsInfo_Context_Args { + PostSettingsInfo: any; + ToneMappingType: any; +} +export function patch_cc_PostSettingsInfo(ctx: cc_PostSettingsInfo_Context_Args, apply = defaultExec) { + const { PostSettingsInfo, ToneMappingType } = { ...ctx }; + const toneMappingTypeDescriptor = Object.getOwnPropertyDescriptor(PostSettingsInfo.prototype, 'toneMappingType'); + apply(() => { $.tooltip('i18n:tone_mapping.toneMappingType')(PostSettingsInfo.prototype, 'toneMappingType', toneMappingTypeDescriptor); }, 'tooltip', 'toneMappingType'); + apply(() => { $.type(ToneMappingType)(PostSettingsInfo.prototype, 'toneMappingType', toneMappingTypeDescriptor); }, 'type', 'toneMappingType'); + apply(() => { $.editable(PostSettingsInfo.prototype, 'toneMappingType', toneMappingTypeDescriptor); }, 'editable', 'toneMappingType'); + apply(() => { $.serializable(PostSettingsInfo.prototype, '_toneMappingType', () => { return ToneMappingType.DEFAULT; }); }, 'serializable', '_toneMappingType'); + apply(() => { $.ccclass('cc.PostSettingsInfo')(PostSettingsInfo); }, 'ccclass', null); +} // end of patch_cc_PostSettingsInfo + //---- class cc_RangedDirectionalLight interface cc_RangedDirectionalLight_Context_Args { RangedDirectionalLight: any; @@ -874,9 +889,10 @@ interface cc_SceneGlobals_Context_Args { OctreeInfo: any; SkinInfo: any; LightProbeInfo: any; + PostSettingsInfo: any; } export function patch_cc_SceneGlobals(ctx: cc_SceneGlobals_Context_Args, apply = defaultExec) { - const { SceneGlobals, AmbientInfo, ShadowsInfo, SkyboxInfo, FogInfo, OctreeInfo, SkinInfo, LightProbeInfo } = { ...ctx }; + const { SceneGlobals, AmbientInfo, ShadowsInfo, SkyboxInfo, FogInfo, OctreeInfo, SkinInfo, LightProbeInfo, PostSettingsInfo } = { ...ctx }; const skyboxDescriptor = Object.getOwnPropertyDescriptor(SceneGlobals.prototype, 'skybox'); apply(() => { $.editable(SceneGlobals.prototype, 'ambient', () => { return new AmbientInfo(); }); }, 'editable', 'ambient'); apply(() => { $.serializable(SceneGlobals.prototype, 'ambient', () => { return new AmbientInfo(); }); }, 'serializable', 'ambient'); @@ -893,6 +909,8 @@ export function patch_cc_SceneGlobals(ctx: cc_SceneGlobals_Context_Args, apply = apply(() => { $.editable(SceneGlobals.prototype, 'skin', () => { return new SkinInfo(); }); }, 'editable', 'skin'); apply(() => { $.serializable(SceneGlobals.prototype, 'lightProbeInfo', () => { return new LightProbeInfo(); }); }, 'serializable', 'lightProbeInfo'); apply(() => { $.editable(SceneGlobals.prototype, 'lightProbeInfo', () => { return new LightProbeInfo(); }); }, 'editable', 'lightProbeInfo'); + apply(() => { $.serializable(SceneGlobals.prototype, 'postSettings', () => { return new PostSettingsInfo(); }); }, 'serializable', 'postSettings'); + apply(() => { $.editable(SceneGlobals.prototype, 'postSettings', () => { return new PostSettingsInfo(); }); }, 'editable', 'postSettings'); apply(() => { $.serializable(SceneGlobals.prototype, 'bakedWithStationaryMainLight', () => { return false; }); }, 'serializable', 'bakedWithStationaryMainLight'); apply(() => { $.editable(SceneGlobals.prototype, 'bakedWithStationaryMainLight', () => { return false; }); }, 'editable', 'bakedWithStationaryMainLight'); apply(() => { $.serializable(SceneGlobals.prototype, 'bakedWithHighpLightmap', () => { return false; }); }, 'serializable', 'bakedWithHighpLightmap'); diff --git a/cocos/render-scene/scene/index.jsb.ts b/cocos/render-scene/scene/index.jsb.ts index 87d7cff567e..9cdfcdbacc9 100644 --- a/cocos/render-scene/scene/index.jsb.ts +++ b/cocos/render-scene/scene/index.jsb.ts @@ -40,6 +40,7 @@ import type { Fog as JsbFog, Shadows as JsbShadows, Skybox as JsbSkybox, + PostSettings as JsbPostSettings } from './index'; // NOTE: why don't we export FogInfo and ShadowInfo from 'index.ts' @@ -339,6 +340,11 @@ export const EnvironmentLightingType = Enum({ DIFFUSEMAP_WITH_REFLECTION: 2, }); +export const ToneMappingType = Enum({ + DEFAULT: 0, + LINEAR: 1, +}); + export const ShadowsInfo: typeof JsbShadowsInfo = jsb.ShadowsInfo; export type ShadowsInfo = JsbShadowsInfo; export const Shadows: typeof JsbShadows = jsb.Shadows; @@ -377,6 +383,10 @@ export const Skybox: typeof JsbSkybox = jsb.Skybox; export type Skybox = JsbSkybox; cclegacy.Skybox = Skybox; +export const PostSettings: typeof JsbPostSettings = jsb.PostSettings; +export type PostSettings = JsbPostSettings; +cclegacy.PostSettings = PostSettings; + export * from './model'; export * from './submodel'; export * from './camera'; diff --git a/cocos/render-scene/scene/index.ts b/cocos/render-scene/scene/index.ts index f16cab46bd9..51843260cb6 100644 --- a/cocos/render-scene/scene/index.ts +++ b/cocos/render-scene/scene/index.ts @@ -39,3 +39,4 @@ export * from './point-light'; export * from './ranged-directional-light'; export * from './reflection-probe'; export * from './lod-group'; +export * from './post-settings'; diff --git a/cocos/render-scene/scene/post-settings.ts b/cocos/render-scene/scene/post-settings.ts new file mode 100644 index 00000000000..9d124385770 --- /dev/null +++ b/cocos/render-scene/scene/post-settings.ts @@ -0,0 +1,37 @@ +import { Enum, cclegacy } from '../../core'; +import { PostSettingsInfo } from '../../scene-graph/scene-globals'; + +export const ToneMappingType = Enum({ + DEFAULT: 0, + LINEAR: 1, +}); + +export class PostSettings { + protected _toneMappingType = ToneMappingType.DEFAULT; + protected _activated = false; + + set toneMappingType (val) { + this._toneMappingType = val; + this._updatePipeline(); + } + get toneMappingType (): number { + return this._toneMappingType; + } + public initialize (postSettingsInfo: PostSettingsInfo): void { + this._toneMappingType = postSettingsInfo.toneMappingType; + } + + public activate (): void { + this._updatePipeline(); + this._activated = true; + } + + protected _updatePipeline (): void { + const root = cclegacy.director.root; + const pipeline = root.pipeline; + pipeline.macros.CC_TONE_MAPPING_TYPE = this._toneMappingType; + if (this._activated) { + root.onGlobalPipelineStateChanged(); + } + } +} diff --git a/cocos/rendering/pipeline-scene-data.ts b/cocos/rendering/pipeline-scene-data.ts index ccee5477714..529d6c44cb9 100644 --- a/cocos/rendering/pipeline-scene-data.ts +++ b/cocos/rendering/pipeline-scene-data.ts @@ -34,7 +34,7 @@ import { Pass } from '../render-scene/core/pass'; import { CSMLayers } from './shadow/csm-layers'; import { cclegacy } from '../core'; import { Skin } from '../render-scene/scene/skin'; -import { Model } from '../render-scene/scene'; +import { Model, PostSettings } from '../render-scene/scene'; import { MeshRenderer } from '../3d/framework/mesh-renderer'; const GEOMETRY_RENDERER_TECHNIQUE_COUNT = 6; @@ -108,6 +108,7 @@ export class PipelineSceneData { public csmLayers: CSMLayers = new CSMLayers(); public octree: Octree = new Octree(); public skin: Skin = new Skin(); + public postSettings: PostSettings = new PostSettings(); public lightProbes = cclegacy.internal.LightProbes ? new cclegacy.internal.LightProbes() : null; /** @@ -224,7 +225,9 @@ export class PipelineSceneData { const vbSize = vbStride * 8; this._occlusionQueryVertexBuffer = device.createBuffer(new BufferInfo( BufferUsageBit.VERTEX | BufferUsageBit.TRANSFER_DST, - MemoryUsageBit.DEVICE, vbSize, vbStride, + MemoryUsageBit.DEVICE, + vbSize, + vbStride, )); this._occlusionQueryVertexBuffer.update(vertices); @@ -234,7 +237,9 @@ export class PipelineSceneData { const ibSize = ibStride * 36; this._occlusionQueryIndicesBuffer = device.createBuffer(new BufferInfo( BufferUsageBit.INDEX | BufferUsageBit.TRANSFER_DST, - MemoryUsageBit.DEVICE, ibSize, ibStride, + MemoryUsageBit.DEVICE, + ibSize, + ibStride, )); this._occlusionQueryIndicesBuffer.update(indices); diff --git a/cocos/scene-graph/scene-globals.jsb.ts b/cocos/scene-graph/scene-globals.jsb.ts index 36421dd2515..fc00e60db45 100644 --- a/cocos/scene-graph/scene-globals.jsb.ts +++ b/cocos/scene-graph/scene-globals.jsb.ts @@ -24,7 +24,7 @@ import { legacyCC } from '../core/global-exports'; import { CCFloat, CCInteger } from '../core/data'; import { TextureCube } from '../asset/assets/texture-cube'; import { Enum } from '../core/value-types'; -import { Ambient, EnvironmentLightingType } from '../render-scene/scene'; +import { Ambient, EnvironmentLightingType, ToneMappingType } from '../render-scene/scene'; import { Material } from '../asset/assets/material'; import { Vec2, Vec3, Color, Vec4 } from '../core/math'; import * as decros from '../native-binding/decorators'; @@ -37,6 +37,7 @@ import type { SceneGlobals as JsbSceneGlobals, LightProbeInfo as JsbLightProbeInfo, SkinInfo as JsbSkinInfo, + PostSettingsInfo as JsbPostSettingsInfo, } from './scene-globals'; declare const jsb: any; @@ -181,6 +182,10 @@ export const SkinInfo: typeof JsbSkinInfo = jsb.SkinInfo; export type SkinInfo = JsbSkinInfo; legacyCC.SkinInfo = SkinInfo; +export const PostSettingsInfo: typeof JsbPostSettingsInfo = jsb.PostSettingsInfo; +export type PostSettingsInfo = JsbPostSettingsInfo; +legacyCC.PostSettingsInfo = PostSettingsInfo; + (function () { const sceneGlobalsProto: any = SceneGlobals.prototype; @@ -192,6 +197,7 @@ legacyCC.SkinInfo = SkinInfo; this._octreeRef = this.getOctreeInfo(); this._lightProbeRef = this.getLightProbeInfo(); this._skinRef = this.getSkinInfo(); + this._postSettingsRef = this.getPostSettingsInfo(); }; Object.defineProperty(sceneGlobalsProto, 'ambient', { @@ -290,13 +296,25 @@ legacyCC.SkinInfo = SkinInfo; }, }); + Object.defineProperty(sceneGlobalsProto, 'postSettings', { + enumerable: true, + configurable: true, + get() { + return this._postSettingsRef; + }, + set(v) { + this._postSettingsRef = v; + this.setPostSettingsInfo(v); + }, + }); + })(); // handle meta data, it is generated automatically -decros.patch_cc_SceneGlobals({SceneGlobals, AmbientInfo, SkyboxInfo, FogInfo, ShadowsInfo, LightProbeInfo, OctreeInfo, SkinInfo}); +decros.patch_cc_SceneGlobals({SceneGlobals, AmbientInfo, SkyboxInfo, FogInfo, ShadowsInfo, LightProbeInfo, OctreeInfo, SkinInfo, PostSettingsInfo}); decros.patch_cc_OctreeInfo({OctreeInfo, CCInteger, Vec3, DEFAULT_WORLD_MAX_POS, DEFAULT_WORLD_MIN_POS, DEFAULT_OCTREE_DEPTH}); @@ -311,3 +329,5 @@ decros.patch_cc_AmbientInfo({AmbientInfo, Vec4, Ambient, CCFloat, legacyCC}); decros.patch_cc_LightProbeInfo({LightProbeInfo, CCFloat, CCInteger}); decros.patch_cc_SkinInfo({SkinInfo, CCFloat}); + +decros.patch_cc_PostSettingsInfo({PostSettingsInfo, ToneMappingType}); diff --git a/cocos/scene-graph/scene-globals.ts b/cocos/scene-graph/scene-globals.ts index 158b717febe..f3d97b259d5 100644 --- a/cocos/scene-graph/scene-globals.ts +++ b/cocos/scene-graph/scene-globals.ts @@ -45,6 +45,7 @@ import { cclegacy, macro } from '../core'; import { Scene } from './scene'; import { NodeEventType } from './node-event'; import { property } from '../core/data/class-decorator'; +import { PostSettings, ToneMappingType } from '../render-scene/scene/post-settings'; const _up = new Vec3(0, 1, 0); const _v3 = new Vec3(); @@ -1183,6 +1184,40 @@ export class SkinInfo { } legacyCC.SkinInfo = SkinInfo; +@ccclass('cc.PostSettingsInfo') +export class PostSettingsInfo { + /** + * @zh 色调映射类型 + * @en Tone mapping type + */ + @editable + @type(ToneMappingType) + @tooltip('i18n:tone_mapping.toneMappingType') + set toneMappingType (val) { + this._toneMappingType = val; + if (this._resource) { + this._resource.toneMappingType = val; + } + } + + get toneMappingType (): number { + return this._toneMappingType; + } + + @serializable + protected _toneMappingType = ToneMappingType.DEFAULT; + + protected _resource: PostSettings | null = null; + + public activate (resource: PostSettings): void { + this._resource = resource; + this._resource.initialize(this); + this._resource.activate(); + } +} + +legacyCC.PostSettingsInfo = PostSettingsInfo; + export interface ILightProbeNode { node: Node; probes: Vec3[] | null; @@ -1613,6 +1648,14 @@ export class SceneGlobals { @serializable public lightProbeInfo = new LightProbeInfo(); + /** + * @en Tone mapping related configuration + * @zh 色调映射相关配置 + */ + @editable + @serializable + public postSettings = new PostSettingsInfo(); + /** * @en bake with stationary main light * @zh 主光源是否以静止状态烘培 @@ -1648,8 +1691,9 @@ export class SceneGlobals { this.fog.activate(sceneData.fog); this.octree.activate(sceneData.octree); this.skin.activate(sceneData.skin); + this.postSettings.activate(sceneData.postSettings); if (this.lightProbeInfo && sceneData.lightProbes) { - this.lightProbeInfo.activate(scene, sceneData.lightProbes); + this.lightProbeInfo.activate(scene, sceneData.lightProbes as LightProbes); } const root = legacyCC.director.root as Root; diff --git a/editor/i18n/en/localization.js b/editor/i18n/en/localization.js index 922eb971dae..4afe3536027 100755 --- a/editor/i18n/en/localization.js +++ b/editor/i18n/en/localization.js @@ -1318,6 +1318,9 @@ module.exports = link(mixin({ shadingScale: 'Rendering resolution.', enableShadingScaleInEditor: 'Enable Shading Scale In Editor', }, + tone_mapping: { + toneMappingType: 'Tone mapping type,valid only when HDR is enabled.', + }, }, require('./animation'), diff --git a/editor/i18n/zh/localization.js b/editor/i18n/zh/localization.js index 7e0569856a5..9a3d870375a 100755 --- a/editor/i18n/zh/localization.js +++ b/editor/i18n/zh/localization.js @@ -1292,6 +1292,9 @@ module.exports = link(mixin({ shadingScale: '渲染分辨率', enableShadingScaleInEditor: '是否在编辑器中缩放渲染分辨率', }, + tone_mapping: { + toneMappingType: '色调映射方式,只在启用HDR时生效。', + }, }, require('./animation'), diff --git a/editor/inspector/contributions/node.js b/editor/inspector/contributions/node.js index fb0dbce8e80..bf17bebb444 100644 --- a/editor/inspector/contributions/node.js +++ b/editor/inspector/contributions/node.js @@ -381,6 +381,7 @@ exports.template = /* html*/` + @@ -453,6 +454,7 @@ exports.$ = { sceneSkyboxAfter: '.container > .body > .scene > .skybox > .after', sceneOctree: '.container > .body > .scene > .octree', sceneSkin: '.container > .body > .scene > .skin', + scenePostSettings: '.scene > .postSettings', node: '.container > .body > .node', nodeHeader: '.container > .body > .node > .component-header', @@ -953,6 +955,9 @@ const Elements = { panel.dump._globals.skin.help = panel.getHelpUrl({ help: 'i18n:cc.Skin' }); panel.$.sceneSkin.render(panel.dump._globals.skin); + panel.dump._globals.postSettings.displayName = 'PostSettings'; + panel.$.scenePostSettings.render(panel.dump._globals.postSettings); + const $skyProps = panel.$.sceneSkybox.querySelectorAll('ui-prop[type="dump"]'); $skyProps.forEach(($prop) => { if ($prop.dump.name === 'envLightingType') { @@ -1089,6 +1094,8 @@ const Elements = { const $prop = useHDR ? panel.$.sceneSkyboxEnvmapHDR : panel.$.sceneSkyboxEnvmapLDR; const uuid = $prop.dump.value.uuid; Elements.scene.setEnvMapAndConvolutionMap.call(panel, uuid); + + panel.$.scenePostSettings.style.display = useHDR ? 'inline-flex' : 'none'; }, skyboxEnvmapChange(useHDR, event) { const panel = this; diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index bf1218beb9c..a1c3dacce9b 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -1536,6 +1536,8 @@ cocos_source_files( cocos/scene/ReflectionProbeManager.h cocos/scene/Skin.h cocos/scene/Skin.cpp + cocos/scene/PostSettings.h + cocos/scene/PostSettings.cpp ) ##### primitive diff --git a/native/cocos/core/scene-graph/SceneGlobals.cpp b/native/cocos/core/scene-graph/SceneGlobals.cpp index d198e627d6c..6947fcbb5b6 100644 --- a/native/cocos/core/scene-graph/SceneGlobals.cpp +++ b/native/cocos/core/scene-graph/SceneGlobals.cpp @@ -33,6 +33,7 @@ #include "scene/Shadow.h" #include "scene/Skin.h" #include "scene/Skybox.h" +#include "scene/PostSettings.h" namespace cc { @@ -46,6 +47,7 @@ SceneGlobals::SceneGlobals() { _bakedWithStationaryMainLight = false; _bakedWithHighpLightmap = false; _skinInfo = ccnew scene::SkinInfo(); + _postSettingsInfo = ccnew scene::PostSettingsInfo(); } void SceneGlobals::activate(Scene *scene) { @@ -78,6 +80,10 @@ void SceneGlobals::activate(Scene *scene) { _skinInfo->activate(sceneData->getSkin()); } + if (_postSettingsInfo != nullptr && sceneData->getPostSettings()) { + _postSettingsInfo->activate(sceneData->getPostSettings()); + } + Root::getInstance()->onGlobalPipelineStateChanged(); } @@ -117,4 +123,8 @@ void SceneGlobals::setSkinInfo(scene::SkinInfo *info) { _skinInfo = info; } +void SceneGlobals::setPostSettingsInfo(scene::PostSettingsInfo *info) { + _postSettingsInfo = info; +} + } // namespace cc diff --git a/native/cocos/core/scene-graph/SceneGlobals.h b/native/cocos/core/scene-graph/SceneGlobals.h index 802151fbc65..b16f688cf02 100644 --- a/native/cocos/core/scene-graph/SceneGlobals.h +++ b/native/cocos/core/scene-graph/SceneGlobals.h @@ -36,6 +36,7 @@ class SkyboxInfo; class FogInfo; class OctreeInfo; class SkinInfo; +class PostSettingsInfo; } // namespace scene namespace gi { @@ -58,6 +59,7 @@ class SceneGlobals : public RefCounted { inline bool getBakedWithStationaryMainLight() const { return _bakedWithStationaryMainLight; } inline bool getBakedWithHighpLightmap() const { return _bakedWithHighpLightmap; } inline scene::SkinInfo *getSkinInfo() const { return _skinInfo.get(); } + inline scene::PostSettingsInfo *getPostSettingsInfo() const { return _postSettingsInfo.get(); } void setAmbientInfo(scene::AmbientInfo *info); void setShadowsInfo(scene::ShadowsInfo *info); @@ -68,6 +70,7 @@ class SceneGlobals : public RefCounted { void setBakedWithStationaryMainLight(bool value); void setBakedWithHighpLightmap(bool value); void setSkinInfo(scene::SkinInfo *info); + void setPostSettingsInfo(scene::PostSettingsInfo *info); private: IntrusivePtr _ambientInfo; @@ -77,6 +80,7 @@ class SceneGlobals : public RefCounted { IntrusivePtr _octreeInfo; IntrusivePtr _lightProbeInfo; IntrusivePtr _skinInfo; + IntrusivePtr _postSettingsInfo; bool _bakedWithStationaryMainLight; bool _bakedWithHighpLightmap; }; diff --git a/native/cocos/renderer/pipeline/PipelineSceneData.cpp b/native/cocos/renderer/pipeline/PipelineSceneData.cpp index 6383ee2032a..3a0db2f82ec 100644 --- a/native/cocos/renderer/pipeline/PipelineSceneData.cpp +++ b/native/cocos/renderer/pipeline/PipelineSceneData.cpp @@ -38,6 +38,8 @@ #include "scene/Shadow.h" #include "scene/Skin.h" #include "scene/Skybox.h" +#include "scene/Model.h" +#include "scene/PostSettings.h" namespace cc { namespace pipeline { @@ -51,6 +53,7 @@ PipelineSceneData::PipelineSceneData() { _octree = ccnew scene::Octree(); _lightProbes = ccnew gi::LightProbes(); _skin = ccnew scene::Skin(); + _postSettings = ccnew scene ::PostSettings(); } PipelineSceneData::~PipelineSceneData() { @@ -62,6 +65,7 @@ PipelineSceneData::~PipelineSceneData() { CC_SAFE_DELETE(_csmLayers); CC_SAFE_DELETE(_lightProbes); CC_SAFE_DELETE(_skin); + CC_SAFE_DELETE(_postSettings); } void PipelineSceneData::activate(gfx::Device *device) { diff --git a/native/cocos/renderer/pipeline/PipelineSceneData.h b/native/cocos/renderer/pipeline/PipelineSceneData.h index cb9e9eeab0a..1b2867a0b49 100644 --- a/native/cocos/renderer/pipeline/PipelineSceneData.h +++ b/native/cocos/renderer/pipeline/PipelineSceneData.h @@ -44,6 +44,7 @@ class Fog; class Octree; class Light; class Skin; +class PostSettings; } // namespace scene namespace gi { class LightProbes; @@ -76,6 +77,7 @@ class CC_DLL PipelineSceneData : public RefCounted { inline scene::Octree *getOctree() const { return _octree; } inline gi::LightProbes *getLightProbes() const { return _lightProbes; } inline scene::Skin *getSkin() const { return _skin; } + inline scene::PostSettings *getPostSettings() const { return _postSettings; } inline gfx::InputAssembler *getOcclusionQueryInputAssembler() const { return _occlusionQueryInputAssembler; } inline scene::Pass *getOcclusionQueryPass() const { return _occlusionQueryPass; } inline gfx::Shader *getOcclusionQueryShader() const { return _occlusionQueryShader; } @@ -134,6 +136,8 @@ class CC_DLL PipelineSceneData : public RefCounted { scene::Skin *_skin{nullptr}; // manage memory manually CSMLayers *_csmLayers{nullptr}; + // manage memory manually + scene::PostSettings *_postSettings{nullptr}; bool _isHDR{true}; bool _csmSupported{true}; diff --git a/native/cocos/scene/PostSettings.cpp b/native/cocos/scene/PostSettings.cpp new file mode 100644 index 00000000000..b83bb044a50 --- /dev/null +++ b/native/cocos/scene/PostSettings.cpp @@ -0,0 +1,75 @@ +/**************************************************************************** + Copyright (c) 2023 Xiamen Yaji Software Co., Ltd. + + http://www.cocos.com + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +****************************************************************************/ + +#include "scene/PostSettings.h" +#include "core/Root.h" +#include "renderer/pipeline/custom/RenderInterfaceTypes.h" +namespace cc { +namespace scene { + +void PostSettingsInfo::activate(PostSettings *resource) { + _resource = resource; + if (_resource != nullptr) { + _resource->initialize(*this); + _resource->activate(); + } +} +void PostSettingsInfo::setToneMappingType(ToneMappingType toneMappingType) { + _toneMappingType = toneMappingType; + + if (_resource != nullptr) { + _resource->setToneMappingType(toneMappingType); + } +} + +void PostSettings::activate() { + _activated = true; + updatePipeline(); +} + +void PostSettings::initialize(const PostSettingsInfo &postSettingsInfo) { + _activated = false; + _toneMappingType = postSettingsInfo.getToneMappingType(); +} + +void PostSettings::setToneMappingType(ToneMappingType toneMappingType) { + _toneMappingType = toneMappingType; + updatePipeline(); +} + +void PostSettings::updatePipeline() const { + + Root *root = Root::getInstance(); + auto *pipeline = root->getPipeline(); + + pipeline->setValue("CC_TONE_MAPPING_TYPE", static_cast(_toneMappingType)); + + if (_activated) + { + root->onGlobalPipelineStateChanged(); + } +} + +} // namespace scene +} // namespace cc diff --git a/native/cocos/scene/PostSettings.h b/native/cocos/scene/PostSettings.h new file mode 100644 index 00000000000..f81d4106a29 --- /dev/null +++ b/native/cocos/scene/PostSettings.h @@ -0,0 +1,67 @@ +/**************************************************************************** + Copyright (c) 2023 Xiamen Yaji Software Co., Ltd. + + http://www.cocos.com + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +****************************************************************************/ + +#pragma once + +#include "base/RefCounted.h" + +namespace cc { + namespace scene { + enum class ToneMappingType { + DEFAULT = 0, + LINEAR = 1, + }; + + class PostSettings; + class PostSettingsInfo : public RefCounted { + public: + PostSettingsInfo() = default; + ~PostSettingsInfo() override = default; + + inline ToneMappingType getToneMappingType() const { return _toneMappingType; } + void setToneMappingType(ToneMappingType toneMappingType); + + void activate(PostSettings *resource); + PostSettings *_resource{nullptr}; + ToneMappingType _toneMappingType{ ToneMappingType::DEFAULT }; + }; + + class PostSettings final { + public: + PostSettings() = default; + ~PostSettings() = default; + void activate(); + + void initialize(const PostSettingsInfo &postSettingsInfo); + inline ToneMappingType getToneMappingType() const { return _toneMappingType; } + void setToneMappingType(ToneMappingType toneMappingType); + private: + void updatePipeline() const; + bool _activated{ false }; + ToneMappingType _toneMappingType{ ToneMappingType::DEFAULT }; + }; + + + }// namespace scene +} // namespace cc diff --git a/native/tools/swig-config/pipeline.i b/native/tools/swig-config/pipeline.i index 9df3b14f6a9..130145affda 100644 --- a/native/tools/swig-config/pipeline.i +++ b/native/tools/swig-config/pipeline.i @@ -169,6 +169,7 @@ using namespace cc; %attribute(cc::pipeline::PipelineSceneData, cc::scene::Skybox*, skybox, getSkybox); %attribute(cc::pipeline::PipelineSceneData, cc::scene::Shadows*, shadows, getShadows); %attribute(cc::pipeline::PipelineSceneData, cc::scene::Skin*, skin, getSkin); +%attribute(cc::pipeline::PipelineSceneData, cc::scene::PostSettings*, postSettings, getPostSettings); %attribute(cc::pipeline::PipelineSceneData, cc::gi::LightProbes*, lightProbes, getLightProbes); %attribute(cc::pipeline::PipelineSceneData, ccstd::vector, validPunctualLights, getValidPunctualLights, setValidPunctualLights); %attribute(cc::pipeline::PipelineSceneData, bool, csmSupported, getCSMSupported); diff --git a/native/tools/swig-config/scene.i b/native/tools/swig-config/scene.i index 946c8fab6df..73b03f4ddd3 100644 --- a/native/tools/swig-config/scene.i +++ b/native/tools/swig-config/scene.i @@ -23,6 +23,7 @@ #include "scene/Shadow.h" #include "scene/Skybox.h" #include "scene/Skin.h" +#include "scene/PostSettings.h" #include "scene/DirectionalLight.h" #include "scene/SpotLight.h" #include "scene/SphereLight.h" @@ -478,6 +479,8 @@ using namespace cc; %attribute(cc::scene::Skin, float, blurRadius, getBlurRadius, setBlurRadius); %attribute(cc::scene::Skin, float, sssIntensity, getSSSIntensity, setSSSIntensity); +%attribute(cc::scene::PostSettings, cc::scene::ToneMappingType, toneMappingType, getToneMappingType, setToneMappingType); + %attribute(cc::scene::Model, cc::scene::RenderScene*, scene, getScene, setScene); %attribute(cc::scene::Model, ccstd::vector> &, _subModels, getSubModels); %attribute(cc::scene::Model, ccstd::vector> &, subModels, getSubModels); @@ -578,6 +581,8 @@ using namespace cc; %attribute(cc::scene::OctreeInfo, cc::Vec3&, maxPos, getMaxPos, setMaxPos); %attribute(cc::scene::OctreeInfo, uint32_t, depth, getDepth, setDepth); +%attribute(cc::scene::PostSettingsInfo, cc::scene::ToneMappingType, toneMappingType, getToneMappingType, setToneMappingType); + %attribute(cc::Scene, bool, autoReleaseAssets, isAutoReleaseAssets, setAutoReleaseAssets); %attribute(cc::scene::ReflectionProbe, cc::scene::ReflectionProbe::ProbeType, probeType, getProbeType, setProbeType); @@ -678,6 +683,7 @@ using namespace cc; %include "scene/Shadow.h" %include "scene/Skybox.h" %include "scene/Skin.h" +%include "scene/PostSettings.h" %include "scene/DirectionalLight.h" %include "scene/SpotLight.h" %include "scene/SphereLight.h" From 32245a2e20ec4e6c5a6573c0c811796483930d1b Mon Sep 17 00:00:00 2001 From: dogeFu <609075410@qq.com> Date: Tue, 25 Jul 2023 18:17:28 +0800 Subject: [PATCH 21/51] fix : node._instantiate has different behavior in native scene (#15816) --- cocos/scene-graph/node.jsb.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cocos/scene-graph/node.jsb.ts b/cocos/scene-graph/node.jsb.ts index 15f31c4beee..3f4308293ce 100644 --- a/cocos/scene-graph/node.jsb.ts +++ b/cocos/scene-graph/node.jsb.ts @@ -1304,20 +1304,13 @@ nodeProto._instantiate = function (cloned: Node, isSyncedNode: boolean) { const newPrefabInfo = (cloned as any)._prefab; if (EDITOR && newPrefabInfo) { if (cloned === newPrefabInfo.root) { + EditorExtends.PrefabUtils.addPrefabInstance?.(cloned); // newPrefabInfo.fileId = ''; } else { // var PrefabUtils = Editor.require('scene://utils/prefab'); // PrefabUtils.unlinkPrefab(cloned); } } - if (EDITOR_NOT_IN_PREVIEW) { - // TODO: Property 'sync' does not exist on type 'PrefabInfo'. - // issue: https://github.com/cocos/cocos-engine/issues/14643 - const syncing = newPrefabInfo && cloned === newPrefabInfo.root && (newPrefabInfo as any).sync; - if (!syncing) { - cloned.name += ' (Clone)'; - } - } // reset and init // NOTE: access protected property From b6bcc12b7ecbece9712a0d045d4e0df2520143ad Mon Sep 17 00:00:00 2001 From: qiuguohua Date: Wed, 26 Jul 2023 10:15:45 +0800 Subject: [PATCH 22/51] Solve unchecked websocket link failure issue (#15799) --- native/external-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/external-config.json b/native/external-config.json index 143079286e8..082f542393f 100644 --- a/native/external-config.json +++ b/native/external-config.json @@ -3,6 +3,6 @@ "type": "github", "owner": "cocos-creator", "name": "engine-native-external", - "checkout": "v3.8.1-6" + "checkout": "v3.8.1-8" } } From 31342c46334ec7380c72b3ee4bc8580324022a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leslie=20Leigh=20=28=E6=9D=8E=E7=9A=84=E5=BA=8F=29?= Date: Wed, 26 Jul 2023 11:09:38 +0800 Subject: [PATCH 23/51] Update editable.ts (#15820) --- cocos/core/data/decorators/editable.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cocos/core/data/decorators/editable.ts b/cocos/core/data/decorators/editable.ts index 75ab976b2f0..bf8d59df181 100644 --- a/cocos/core/data/decorators/editable.ts +++ b/cocos/core/data/decorators/editable.ts @@ -289,11 +289,7 @@ export const displayOrder: (order: number) => LegacyPropertyDecorator = !DEV * 设置该属性在编辑器中的计量单位。 * @param name 计量单位的名称。 */ -export const unit: (name: -| 'lm' -| 'lx' -| 'cd/m²' -) => LegacyPropertyDecorator = !DEV +export const unit: (name: string) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn : setPropertyStashVar1WithImplicitVisible('unit'); From b9c259eb2aa5a1c0b466c36d31e9c186ef82b3a3 Mon Sep 17 00:00:00 2001 From: jk20012001 Date: Wed, 26 Jul 2023 11:11:41 +0800 Subject: [PATCH 24/51] add shader functions (#15814) --- .../chunks/common/math/coordinates.chunk | 10 +++++++ editor/assets/chunks/common/math/number.chunk | 11 ++++++++ .../assets/effects/advanced/car-paint.effect | 28 ++++++++++++------- 3 files changed, 39 insertions(+), 10 deletions(-) diff --git a/editor/assets/chunks/common/math/coordinates.chunk b/editor/assets/chunks/common/math/coordinates.chunk index 08c05a227c9..c994cfc699d 100644 --- a/editor/assets/chunks/common/math/coordinates.chunk +++ b/editor/assets/chunks/common/math/coordinates.chunk @@ -101,6 +101,16 @@ vec3 RotationVecFromAxisY(vec3 v, float rotateAngleArc) return RotationVecFromAxisY(v, cos(rotateAngleArc), sin(rotateAngleArc)); } +vec3 RotationVecFromAxis(vec3 v, vec3 axis, float rotateAngleArc) +{ + float cosAngle = cos(rotateAngleArc); + float sinAngle = sin(rotateAngleArc); + vec3 crossProd = cross(axis, v); + float dotProd = dot(axis, v); + vec3 axisScaled = axis * dotProd * (1.0 - cosAngle); + return v * cosAngle + crossProd * sinAngle + axisScaled; +} + // rotationAngle: radians, 0-2Pi void RotateTangentAndBinormal(inout vec3 tangent, inout vec3 binormal, vec3 normal, float rotationAngle) { diff --git a/editor/assets/chunks/common/math/number.chunk b/editor/assets/chunks/common/math/number.chunk index cec08efffa7..843fa2ba750 100644 --- a/editor/assets/chunks/common/math/number.chunk +++ b/editor/assets/chunks/common/math/number.chunk @@ -51,3 +51,14 @@ vec4 rsqrt(vec4 value) { return vec4(1.0) / sqrt(value); } float rand(vec2 seeds_zero_to_one) { return fract(sin(dot(seeds_zero_to_one.xy, vec2(12.9898, 78.233))) * 43758.5453); } + +#if __VERSION__ <= 100 + mat4 transpose(mat4 v) { + mat4 tmp; + tmp[0] = vec4(v[0].x, v[1].x, v[2].x, v[3].x); + tmp[1] = vec4(v[0].y, v[1].y, v[2].y, v[3].y); + tmp[2] = vec4(v[0].z, v[1].z, v[2].z, v[3].z); + tmp[3] = vec4(v[0].w, v[1].w, v[2].w, v[3].w); + return tmp; + } +#endif diff --git a/editor/assets/effects/advanced/car-paint.effect b/editor/assets/effects/advanced/car-paint.effect index 186e6b5276f..457fd1d97c5 100644 --- a/editor/assets/effects/advanced/car-paint.effect +++ b/editor/assets/effects/advanced/car-paint.effect @@ -24,7 +24,7 @@ CCEffect %{ coatColor: { value: [1.0, 1.0, 1.0, 1.0], linear: true, editor: { displayName: CoatColor, type: color } } flakeDensity: { value: 0.5, target: flakeParam.x, editor: { parent: USE_FLAKE, slide: true, range: [0, 1.0], step: 0.001 } } flakeColorIntensity: { value: 0.2, target: flakeParam.y, editor: { parent: USE_FLAKE, slide: true, range: [0, 1.0], step: 0.001 } } - flakeTiling: { value: 10.0, target: flakeParam.z, editor: { parent: USE_FLAKE, slide: true, range: [1.0, 50.0], step: 0.001 } } + flakeTiling: { value: 10.0, target: flakeParam.z, editor: { parent: USE_FLAKE, slide: true, range: [1.0, 100.0], step: 0.001 } } coatNormalStrength: { value: 0.1, target: flakeParam.w, editor: { parent: USE_FLAKE, slide: true, range: [0, 1.0], step: 0.001 } } gradientColor: { value: [1.0, 1.0, 1.0, 1.0], linear: true, editor: { parent: USE_GRADIENT_COLOR, type: color } } gradientIntensity: { value: 0.5, target: emissiveScaleParam.y, editor: { parent: USE_GRADIENT_COLOR, slide: true, range: [0, 1.0], step: 0.001 } } @@ -215,12 +215,20 @@ CCProgram surface-fragment %{ return coatColor.xyz; } - vec4 sampleFlake(sampler2D tex, vec2 uv) - { - vec4 blurred = texture(tex, uv); - vec4 detailed = fragTextureLod(tex, uv, 1.0); - return lerp(blurred, detailed, 0.3); - } + #if USE_FLAKE + vec4 sampleFlakeData(vec2 uv) + { + vec4 blurred = texture(flakeDataMap, uv); + vec4 detailed = fragTextureLod(flakeDataMap, uv, 1.0); + return lerp(blurred, detailed, 0.3); + } + vec4 sampleFlakeNormal(vec2 uv) + { + vec4 blurred = texture(coatNormalMap, uv); + vec4 detailed = fragTextureLod(coatNormalMap, uv, 1.0); + return lerp(blurred, detailed, 0.3); + } + #endif #define CC_SURFACES_FRAGMENT_MODIFY_CLEAR_COAT_WORLD_NORMAL vec3 SurfacesFragmentModifyClearCoatWorldNormal() @@ -229,8 +237,8 @@ CCProgram surface-fragment %{ #if USE_FLAKE float density = flakeParam.x, densityMin = 0.25, flakeTiling = flakeParam.z; vec2 uv = FSInput_texcoord * flakeTiling; - vec4 data = sampleFlake(flakeDataMap, uv); - vec3 nmmp = (sampleFlake(coatNormalMap, uv).xyz - vec3(0.5)) * 2.0; + vec4 data = sampleFlakeData(uv); + vec3 nmmp = (sampleFlakeNormal(uv).xyz - vec3(0.5)) * 2.0; float C = (data.a - 1.0) / density + 1.0; float bumpIntensity = saturate(max(densityMin, C)); nmmp = lerp(vec3(0.0, 0.0, 1.0), nmmp, bumpIntensity); @@ -257,7 +265,7 @@ CCProgram surface-fragment %{ float density = flakeParam.x, flakeColorIntensity = flakeParam.y, flakeTiling = flakeParam.z; vec2 uv = FSInput_texcoord * flakeTiling; - vec4 data = sampleFlake(flakeDataMap, uv); + vec4 data = sampleFlakeData(uv); float C = (data.a - 1.0) / density + 1.0; float flakeTintWeight = 1.0; float flakeWeight = saturate(C) * flakeTintWeight * flakeColorIntensity; From 2e2b7ec03206f5b187bd5949c5c95e1fa5462c84 Mon Sep 17 00:00:00 2001 From: yinkaile <501251991@qq.com> Date: Wed, 26 Jul 2023 11:12:42 +0800 Subject: [PATCH 25/51] fixed fsr input/output size (#15798) --- .../rendering/post-process/passes/fsr-pass.ts | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/cocos/rendering/post-process/passes/fsr-pass.ts b/cocos/rendering/post-process/passes/fsr-pass.ts index eedfed677df..1231470b58e 100644 --- a/cocos/rendering/post-process/passes/fsr-pass.ts +++ b/cocos/rendering/post-process/passes/fsr-pass.ts @@ -10,12 +10,14 @@ import { FSR } from '../components/fsr'; import { getSetting, SettingPass } from './setting-pass'; import { game } from '../../../game'; +const tempVec4 = new Vec4(); + export class FSRPass extends SettingPass { get setting (): FSR { return getSetting(FSR); } - name = 'FSRPass' + name = 'FSRPass'; effectName = 'pipeline/post-process/fsr'; - outputNames = ['FSRColor'] + outputNames = ['FSRColor']; checkEnable (camera: Camera): boolean { let enable = super.checkEnable(camera); @@ -31,20 +33,16 @@ export class FSRPass extends SettingPass { passContext.material = this.material; passContext.clearBlack(); - passContext.updatePassViewPort(1 / passContext.shadingScale); + passContext.updatePassViewPort(1 / passContext.shadingScale, 0); - const inputWidth = Math.floor(game.canvas!.width * passContext.shadingScale); - const inputHeight = Math.floor(game.canvas!.height * passContext.shadingScale); - const outWidth = Math.floor(game.canvas!.width); - const outHeight = Math.floor(game.canvas!.height); + const inputWidth = Math.floor(passContext.passViewport.width * passContext.shadingScale); + const inputHeight = Math.floor(passContext.passViewport.height * passContext.shadingScale); + const outWidth = Math.floor(passContext.passViewport.width); + const outHeight = Math.floor(passContext.passViewport.height); const setting = this.setting; - this.material.setProperty('fsrParams', new Vec4(clamp(1.0 - setting.sharpness, 0.02, 0.98), 0, 0, 0)); - this.material.setProperty('texSize', - new Vec4( - inputWidth, inputHeight, - outWidth, outHeight, - )); + this.material.setProperty('fsrParams', tempVec4.set(clamp(1.0 - setting.sharpness, 0.02, 0.98), 0, 0, 0)); + this.material.setProperty('texSize', tempVec4.set(inputWidth, inputHeight, outWidth, outHeight)); const input0 = this.lastPass!.slotName(camera, 0); const easu = `FSR_EASU${cameraID}`; From e8e704cf184e87848b2a94845bedc96689b186cd Mon Sep 17 00:00:00 2001 From: yinkaile <501251991@qq.com> Date: Wed, 26 Jul 2023 11:13:14 +0800 Subject: [PATCH 26/51] fixed fsr/fxaa alpha (#15800) --- editor/assets/effects/pipeline/post-process/fsr.effect | 6 ++++-- editor/assets/effects/pipeline/post-process/fxaa-hq.effect | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/editor/assets/effects/pipeline/post-process/fsr.effect b/editor/assets/effects/pipeline/post-process/fsr.effect index 90728255e88..d7afb9fcc6a 100644 --- a/editor/assets/effects/pipeline/post-process/fsr.effect +++ b/editor/assets/effects/pipeline/post-process/fsr.effect @@ -80,7 +80,8 @@ CCProgram fs-easu %{ rendersize, rendersize, texSize.zw ); FsrEasuF(c, gl_FragCoord.xy, con0, con1, con2, con3); - fragColor = vec4(c.xyz, 1.); + float alpha = texture(outputResultMap, v_uv).a; + fragColor = vec4(c.xyz, alpha); } }% @@ -115,6 +116,7 @@ CCProgram fs-rcas %{ // Perform RCAS pass vec3 col = FsrRcasF(gl_FragCoord.xy, con); - fragColor = vec4(col, 1.); + float alpha = texture(outputResultMap, v_uv).a; + fragColor = vec4(col, alpha); } }% diff --git a/editor/assets/effects/pipeline/post-process/fxaa-hq.effect b/editor/assets/effects/pipeline/post-process/fxaa-hq.effect index 3f894f98fc2..1312f6e0508 100644 --- a/editor/assets/effects/pipeline/post-process/fxaa-hq.effect +++ b/editor/assets/effects/pipeline/post-process/fxaa-hq.effect @@ -35,7 +35,8 @@ CCProgram fxaa-edge-fs %{ vec4 frag () { vec3 color = FxaaPixelShader(v_uv, sceneColorMap, texSize.zw); - return vec4(color, 1.0); + float alpha = texture(sceneColorMap, v_uv).a; + return vec4(color, alpha); } }% From 41a16d73224e1e8f5ad52dfe690a4f78b09a11b2 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Wed, 26 Jul 2023 12:07:22 +0800 Subject: [PATCH 27/51] Fix ci --- cocos/2d/components/ui-opacity.ts | 5 +- cocos/render-scene/scene/reflection-probe.ts | 9 +- cocos/rendering/custom/define.ts | 472 +++++++++++++----- .../post-process/passes/fxaa-pass.ts | 4 +- cocos/spine/assembler/simple.ts | 28 +- cocos/spine/skeleton.ts | 21 +- 6 files changed, 381 insertions(+), 158 deletions(-) diff --git a/cocos/2d/components/ui-opacity.ts b/cocos/2d/components/ui-opacity.ts index 68d2052b247..2990cf854c9 100644 --- a/cocos/2d/components/ui-opacity.ts +++ b/cocos/2d/components/ui-opacity.ts @@ -68,12 +68,11 @@ export class UIOpacity extends Component { this.setEntityLocalOpacityDirtyRecursively(true); - if(EDITOR_NOT_IN_PREVIEW) { - setTimeout(()=>{ + if (EDITOR_NOT_IN_PREVIEW) { + setTimeout(() => { EditorExtends.Node.emit('change', this.node.uuid, this.node); }, 200); } - } private setEntityLocalOpacityDirtyRecursively (dirty: boolean): void { diff --git a/cocos/render-scene/scene/reflection-probe.ts b/cocos/render-scene/scene/reflection-probe.ts index ea7a32e481c..43bc0526fe0 100644 --- a/cocos/render-scene/scene/reflection-probe.ts +++ b/cocos/render-scene/scene/reflection-probe.ts @@ -29,6 +29,7 @@ import { CAMERA_DEFAULT_MASK } from '../../rendering/define'; import { ClearFlagBit, Framebuffer } from '../../gfx'; import { TextureCube } from '../../asset/assets/texture-cube'; import { RenderTexture } from '../../asset/assets/render-texture'; +import { view } from '../../ui/view'; export enum ProbeClearFlag { SKYBOX = SKYBOX_FLAG | ClearFlagBit.DEPTH_STENCIL, @@ -125,10 +126,10 @@ export class ReflectionProbe { * @en Set probe type,cube or planar. * @zh 设置探针类型,cube或者planar */ - set probeType (value: number) { + set probeType (value: ProbeType) { this._probeType = value; } - get probeType (): number { + get probeType (): ProbeType { return this._probeType; } @@ -308,7 +309,7 @@ export class ReflectionProbe { public renderPlanarReflection (sourceCamera: Camera): void { if (!sourceCamera) return; if (!this.realtimePlanarTexture) { - const canvasSize = cclegacy.view.getDesignResolutionSize(); + const canvasSize = view.getDesignResolutionSize(); this.realtimePlanarTexture = this._createTargetTexture(canvasSize.width, canvasSize.height); cclegacy.internal.reflectionProbeManager.updatePlanarMap(this, this.realtimePlanarTexture.getGFXTexture()); } @@ -317,7 +318,7 @@ export class ReflectionProbe { this._needRender = true; } - public switchProbeType (type: number, sourceCamera: Camera | null): void { + public switchProbeType (type: ProbeType, sourceCamera: Camera | null): void { if (type === ProbeType.CUBE) { this._needRender = false; } else if (sourceCamera !== null) { diff --git a/cocos/rendering/custom/define.ts b/cocos/rendering/custom/define.ts index 83cebdd8e45..21769f3a145 100644 --- a/cocos/rendering/custom/define.ts +++ b/cocos/rendering/custom/define.ts @@ -44,6 +44,8 @@ import { WebPipeline } from './web-pipeline'; import { DescriptorSetData } from './layout-graph'; import { AABB } from '../../core/geometry'; import { DebugViewCompositeType, DebugViewSingleType } from '../debug-view'; +import { ReflectionProbeManager } from '../../3d/reflection-probe/reflection-probe-manager'; +import { director } from '../../game/director'; const _rangedDirLightBoundingBox = new AABB(0.0, 0.0, 0.0, 0.5, 0.5, 0.5); const _tmpBoundingBox = new AABB(); @@ -148,7 +150,14 @@ export function getLoadOpOfClearFlag (clearFlag: ClearFlagBit, attachment: Attac return loadOp; } -export function getRenderArea (camera: Camera, width: number, height: number, light: Light | null = null, level = 0, out?: Rect): Rect { +export function getRenderArea ( + camera: Camera, + width: number, + height: number, + light: Light | null = null, + level = 0, + out: Rect | undefined = undefined, +): Rect { out = out || new Rect(); const vp = camera ? camera.viewport : new Rect(0, 0, 1, 1); const w = width; @@ -222,10 +231,12 @@ export function buildCopyPass (ppl: BasicPipeline, inOuts: CopyPair[]): void { } let fxaaData: FxaaData | null = null; -export function buildFxaaPass (camera: Camera, +export function buildFxaaPass ( + camera: Camera, ppl: BasicPipeline, inputRT: string, - inputDS: string): { rtName: string; dsName: string; } { + inputDS: string, +): { rtName: string; dsName: string; } { if (!fxaaData) { fxaaData = new FxaaData(); } @@ -262,7 +273,9 @@ export function buildFxaaPass (camera: Camera, fxaaPass.addRenderTarget(fxaaPassRTName, LoadOp.CLEAR, StoreOp.STORE, clearColor); fxaaData.fxaaMaterial.setProperty('texSize', new Vec4(width, height, 1.0 / width, 1.0 / height), fxaaPassIdx); fxaaPass.addQueue(QueueHint.RENDER_TRANSPARENT).addCameraQuad( - camera, fxaaData.fxaaMaterial, fxaaPassIdx, + camera, + fxaaData.fxaaMaterial, + fxaaPassIdx, SceneFlags.NONE, ); return { rtName: fxaaPassRTName, dsName: inputDS }; @@ -318,12 +331,14 @@ class BloomData { } } let bloomData: BloomData | null = null; -export function buildBloomPass (camera: Camera, +export function buildBloomPass ( + camera: Camera, ppl: BasicPipeline, inputRT: string, threshold = 0.6, iterations = 2, - intensity = 2.0): { rtName: string; dsName: string; } { + intensity = 2.0, +): { rtName: string; dsName: string; } { if (!bloomData) { bloomData = new BloomData(); } @@ -366,7 +381,9 @@ export function buildBloomPass (camera: Camera, bloomPrefilterPass.addRenderTarget(bloomPassPrefilterRTName, LoadOp.CLEAR, StoreOp.STORE, bloomClearColor); bloomData.bloomMaterial.setProperty('texSize', new Vec4(0, 0, bloomData.threshold, 0), 0); bloomPrefilterPass.addQueue(QueueHint.RENDER_TRANSPARENT).addCameraQuad( - camera, bloomData.bloomMaterial, 0, + camera, + bloomData.bloomMaterial, + 0, SceneFlags.NONE, ); // === Bloom downSampler === @@ -393,7 +410,9 @@ export function buildBloomPass (camera: Camera, bloomDownSamplePass.addRenderTarget(bloomPassDownSampleRTName, LoadOp.CLEAR, StoreOp.STORE, bloomClearColor); bloomData.bloomMaterial.setProperty('texSize', texSize, BLOOM_DOWNSAMPLEPASS_INDEX + i); bloomDownSamplePass.addQueue(QueueHint.RENDER_TRANSPARENT).addCameraQuad( - camera, bloomData.bloomMaterial, BLOOM_DOWNSAMPLEPASS_INDEX + i, + camera, + bloomData.bloomMaterial, + BLOOM_DOWNSAMPLEPASS_INDEX + i, SceneFlags.NONE, ); } @@ -421,7 +440,9 @@ export function buildBloomPass (camera: Camera, bloomUpSamplePass.addRenderTarget(bloomPassUpSampleRTName, LoadOp.CLEAR, StoreOp.STORE, bloomClearColor); bloomData.bloomMaterial.setProperty('texSize', texSize, BLOOM_UPSAMPLEPASS_INDEX + i); bloomUpSamplePass.addQueue(QueueHint.RENDER_TRANSPARENT).addCameraQuad( - camera, bloomData.bloomMaterial, BLOOM_UPSAMPLEPASS_INDEX + i, + camera, + bloomData.bloomMaterial, + BLOOM_UPSAMPLEPASS_INDEX + i, SceneFlags.NONE, ); } @@ -445,7 +466,9 @@ export function buildBloomPass (camera: Camera, bloomCombinePass.addRenderTarget(bloomPassCombineRTName, LoadOp.CLEAR, StoreOp.STORE, bloomClearColor); bloomData.bloomMaterial.setProperty('texSize', new Vec4(0, 0, 0, bloomData.intensity), BLOOM_COMBINEPASS_INDEX); bloomCombinePass.addQueue(QueueHint.RENDER_TRANSPARENT).addCameraQuad( - camera, bloomData.bloomMaterial, BLOOM_COMBINEPASS_INDEX, + camera, + bloomData.bloomMaterial, + BLOOM_COMBINEPASS_INDEX, SceneFlags.NONE, ); return { rtName: bloomPassCombineRTName, dsName: bloomPassCombineDSName }; @@ -476,9 +499,11 @@ export class PostInfo { let postInfo: PostInfo; -export function buildPostprocessPass (camera: Camera, +export function buildPostprocessPass ( + camera: Camera, ppl: BasicPipeline, - inputTex: string): { rtName: string; dsName: string; } { + inputTex: string, +): { rtName: string; dsName: string; } { if (!postInfo) { postInfo = new PostInfo(); } @@ -506,24 +531,38 @@ export function buildPostprocessPass (camera: Camera, postClearColor.y = camera.clearColor.y; postClearColor.z = camera.clearColor.z; } - postprocessPass.addRenderTarget(postprocessPassRTName, - getLoadOpOfClearFlag(camera.clearFlag, AttachmentType.RENDER_TARGET), StoreOp.STORE, postClearColor); - postprocessPass.addDepthStencil(postprocessPassDS, + postprocessPass.addRenderTarget( + postprocessPassRTName, + getLoadOpOfClearFlag(camera.clearFlag, AttachmentType.RENDER_TARGET), + + StoreOp.STORE, + + postClearColor, + ); + postprocessPass.addDepthStencil( + postprocessPassDS, getLoadOpOfClearFlag(camera.clearFlag, AttachmentType.DEPTH_STENCIL), - StoreOp.STORE, camera.clearDepth, camera.clearStencil, camera.clearFlag); - postprocessPass.addQueue(QueueHint.NONE).addFullscreenQuad( - postInfo.postMaterial, 0, SceneFlags.NONE, + StoreOp.STORE, + + camera.clearDepth, + + camera.clearStencil, + + camera.clearFlag, ); + postprocessPass.addQueue(QueueHint.NONE).addFullscreenQuad(postInfo.postMaterial, 0, SceneFlags.NONE); if (getProfilerCamera() === camera) { postprocessPass.showStatistics = true; } return { rtName: postprocessPassRTName, dsName: postprocessPassDS }; } -export function buildForwardPass (camera: Camera, +export function buildForwardPass ( + camera: Camera, ppl: BasicPipeline, isOffScreen: boolean, - enabledAlpha = true): { rtName: string; dsName: string; } { + enabledAlpha = true, +): { rtName: string; dsName: string; } { if (EDITOR) { ppl.setMacroInt('CC_PIPELINE_TYPE', 0); } @@ -564,22 +603,29 @@ export function buildForwardPass (camera: Camera, forwardPass.addTexture(spotShadowName, 'cc_spotShadowMap'); } } - forwardPass.addRenderTarget(forwardPassRTName, + forwardPass.addRenderTarget( + forwardPassRTName, isOffScreen ? LoadOp.CLEAR : getLoadOpOfClearFlag(camera.clearFlag, AttachmentType.RENDER_TARGET), StoreOp.STORE, - new Color(camera.clearColor.x, camera.clearColor.y, camera.clearColor.z, camera.clearColor.w)); - forwardPass.addDepthStencil(forwardPassDSName, + new Color(camera.clearColor.x, camera.clearColor.y, camera.clearColor.z, camera.clearColor.w), + ); + forwardPass.addDepthStencil( + forwardPassDSName, isOffScreen ? LoadOp.CLEAR : getLoadOpOfClearFlag(camera.clearFlag, AttachmentType.DEPTH_STENCIL), // If the depth texture is used by subsequent passes, it must be set to store. isOffScreen ? StoreOp.DISCARD : StoreOp.STORE, camera.clearDepth, camera.clearStencil, - camera.clearFlag); + camera.clearFlag, + ); forwardPass .addQueue(QueueHint.RENDER_OPAQUE) - .addSceneOfCamera(camera, new LightInfo(), + .addSceneOfCamera( + camera, + new LightInfo(), SceneFlags.OPAQUE_OBJECT | SceneFlags.PLANAR_SHADOW | SceneFlags.CUTOUT_OBJECT - | SceneFlags.DEFAULT_LIGHTING | SceneFlags.DRAW_INSTANCING); + | SceneFlags.DEFAULT_LIGHTING | SceneFlags.DRAW_INSTANCING, + ); let sceneFlags = SceneFlags.TRANSPARENT_OBJECT | SceneFlags.GEOMETRY; if (!isOffScreen) { sceneFlags |= SceneFlags.UI; @@ -594,10 +640,15 @@ export function buildForwardPass (camera: Camera, } let shadowPass; -export function buildShadowPass (passName: Readonly, +export function buildShadowPass ( + passName: Readonly, ppl: BasicPipeline, - camera: Camera, light: Light, level: number, - width: Readonly, height: Readonly): void { + camera: Camera, + light: Light, + level: number, + width: Readonly, + height: Readonly, +): void { const fboW = width; const fboH = height; const area = getRenderArea(camera, width, height, light, level); @@ -617,25 +668,37 @@ export function buildShadowPass (passName: Readonly, shadowPass.name = passName; shadowPass.setViewport(new Viewport(0, 0, fboW, fboH)); shadowPass.addRenderTarget(shadowMapName, LoadOp.CLEAR, StoreOp.STORE, new Color(1, 1, 1, camera.clearColor.w)); - shadowPass.addDepthStencil(`${shadowMapName}Depth`, LoadOp.CLEAR, StoreOp.DISCARD, - camera.clearDepth, camera.clearStencil, ClearFlagBit.DEPTH_STENCIL); + shadowPass.addDepthStencil( + `${shadowMapName}Depth`, + LoadOp.CLEAR, + StoreOp.DISCARD, + camera.clearDepth, + camera.clearStencil, + ClearFlagBit.DEPTH_STENCIL, + ); } const queue = shadowPass.addQueue(QueueHint.RENDER_OPAQUE, 'shadow-caster'); - queue.addSceneOfCamera(camera, new LightInfo(light, level), - SceneFlags.SHADOW_CASTER); + queue.addSceneOfCamera( + camera, + new LightInfo(light, level), + SceneFlags.SHADOW_CASTER, + ); queue.setViewport(new Viewport(area.x, area.y, area.width, area.height)); } -export function buildReflectionProbePasss (camera: Camera, - ppl: BasicPipeline): void { - if (!cclegacy.internal.reflectionProbeManager) return; - const probes = cclegacy.internal.reflectionProbeManager.getProbes(); +export function buildReflectionProbePasss ( + camera: Camera, + ppl: BasicPipeline, +): void { + const reflectionProbeManager = cclegacy.internal.reflectionProbeManager as ReflectionProbeManager; + if (!reflectionProbeManager) return; + const probes = reflectionProbeManager.getProbes(); if (probes.length === 0) return; for (let i = 0; i < probes.length; i++) { const probe = probes[i]; if (probe.needRender) { if (probes[i].probeType === ProbeType.PLANAR) { - buildReflectionProbePass(camera, ppl, probe, probe.realtimePlanarTexture.window!, 0); + buildReflectionProbePass(camera, ppl, probe, probe.realtimePlanarTexture!.window!, 0); } else if (EDITOR) { for (let faceIdx = 0; faceIdx < probe.bakedCubeTextures.length; faceIdx++) { probe.updateCameraDir(faceIdx); @@ -647,8 +710,13 @@ export function buildReflectionProbePasss (camera: Camera, } } -export function buildReflectionProbePass (camera: Camera, - ppl: BasicPipeline, probe: ReflectionProbe, renderWindow: RenderWindow, faceIdx: number): void { +export function buildReflectionProbePass ( + camera: Camera, + ppl: BasicPipeline, + probe: ReflectionProbe, + renderWindow: RenderWindow, + faceIdx: number, +): void { const cameraName = `Camera${faceIdx}`; const area = probe.renderArea(); const width = area.x; @@ -668,10 +736,20 @@ export function buildReflectionProbePass (camera: Camera, const probePass = ppl.addRenderPass(width, height, 'default'); probePass.name = `ReflectionProbePass${faceIdx}`; probePass.setViewport(new Viewport(0, 0, width, height)); - probePass.addRenderTarget(probePassRTName, getLoadOpOfClearFlag(probeCamera.clearFlag, AttachmentType.RENDER_TARGET), - StoreOp.STORE, new Color(probeCamera.clearColor.x, probeCamera.clearColor.y, probeCamera.clearColor.z, probeCamera.clearColor.w)); - probePass.addDepthStencil(probePassDSName, getLoadOpOfClearFlag(probeCamera.clearFlag, AttachmentType.DEPTH_STENCIL), - StoreOp.STORE, probeCamera.clearDepth, probeCamera.clearStencil, probeCamera.clearFlag); + probePass.addRenderTarget( + probePassRTName, + getLoadOpOfClearFlag(probeCamera.clearFlag, AttachmentType.RENDER_TARGET), + StoreOp.STORE, + new Color(probeCamera.clearColor.x, probeCamera.clearColor.y, probeCamera.clearColor.z, probeCamera.clearColor.w), + ); + probePass.addDepthStencil( + probePassDSName, + getLoadOpOfClearFlag(probeCamera.clearFlag, AttachmentType.DEPTH_STENCIL), + StoreOp.STORE, + probeCamera.clearDepth, + probeCamera.clearStencil, + probeCamera.clearFlag, + ); const passBuilder = probePass.addQueue(QueueHint.RENDER_OPAQUE); passBuilder.addSceneOfCamera(camera, new LightInfo(), SceneFlags.REFLECTION_PROBE); updateCameraUBO(passBuilder as unknown as any, probeCamera, ppl); @@ -720,14 +798,28 @@ export function buildShadowPasses (cameraName: string, camera: Camera, ppl: Basi if (mainLight && mainLight.shadowEnabled) { shadowInfo.mainLightShadowNames[0] = `MainLightShadow${cameraName}`; if (mainLight.shadowFixedArea) { - buildShadowPass(shadowInfo.mainLightShadowNames[0], ppl, - camera, mainLight, 0, mapWidth, mapHeight); + buildShadowPass( + shadowInfo.mainLightShadowNames[0], + ppl, + camera, + mainLight, + 0, + mapWidth, + mapHeight, + ); } else { const csmLevel = pipeline.pipelineSceneData.csmSupported ? mainLight.csmLevel : 1; shadowInfo.mainLightShadowNames[0] = `MainLightShadow${cameraName}`; for (let i = 0; i < csmLevel; i++) { - buildShadowPass(shadowInfo.mainLightShadowNames[0], ppl, - camera, mainLight, i, mapWidth, mapHeight); + buildShadowPass( + shadowInfo.mainLightShadowNames[0], + ppl, + camera, + mainLight, + i, + mapWidth, + mapHeight, + ); } } } @@ -736,8 +828,15 @@ export function buildShadowPasses (cameraName: string, camera: Camera, ppl: Basi const light = shadowInfo.validLights[l]; const passName = `SpotLightShadow${l.toString()}${cameraName}`; shadowInfo.spotLightShadowNames[l] = passName; - buildShadowPass(passName, ppl, - camera, light, 0, mapWidth, mapHeight); + buildShadowPass( + passName, + ppl, + camera, + light, + 0, + mapWidth, + mapHeight, + ); } return shadowInfo; } @@ -750,8 +849,10 @@ export class GBufferInfo { ds!: string; } // deferred passes -export function buildGBufferPass (camera: Camera, - ppl: BasicPipeline): GBufferInfo { +export function buildGBufferPass ( + camera: Camera, + ppl: BasicPipeline, +): GBufferInfo { const cameraID = getCameraUniqueID(camera); const area = getRenderArea(camera, camera.window.width, camera.window.height); const width = area.width; @@ -869,7 +970,9 @@ export function buildLightingPass (camera: Camera, ppl: BasicPipeline, gBuffer: lightingClearColor.w = 0; lightingPass.addRenderTarget(deferredLightingPassRTName, LoadOp.CLEAR, StoreOp.STORE, lightingClearColor); lightingPass.addQueue(QueueHint.RENDER_TRANSPARENT).addCameraQuad( - camera, lightingInfo.deferredLightingMaterial, 0, + camera, + lightingInfo.deferredLightingMaterial, + 0, SceneFlags.VOLUMETRIC_LIGHTING, ); // lightingPass.addQueue(QueueHint.RENDER_TRANSPARENT).addSceneOfCamera(camera, new LightInfo(), @@ -899,8 +1002,10 @@ function getClearFlags (attachment: AttachmentType, clearFlag: ClearFlagBit, loa } } -export function buildUIPass (camera: Camera, - ppl: BasicPipeline): void { +export function buildUIPass ( + camera: Camera, + ppl: BasicPipeline, +): void { const cameraID = getCameraUniqueID(camera); const cameraName = `Camera${cameraID}`; const area = getRenderArea(camera, camera.window.width, camera.window.height); @@ -918,14 +1023,22 @@ export function buildUIPass (camera: Camera, const uiAndProfilerPass = ppl.addRenderPass(width, height, 'default'); uiAndProfilerPass.name = `CameraUIAndProfilerPass${cameraID}`; uiAndProfilerPass.setViewport(new Viewport(area.x, area.y, width, height)); - uiAndProfilerPass.addRenderTarget(dsUIAndProfilerPassRTName, + uiAndProfilerPass.addRenderTarget( + dsUIAndProfilerPassRTName, getLoadOpOfClearFlag(camera.clearFlag, AttachmentType.RENDER_TARGET), StoreOp.STORE, - new Color(camera.clearColor.x, camera.clearColor.y, camera.clearColor.z, camera.clearColor.w)); - uiAndProfilerPass.addDepthStencil(dsUIAndProfilerPassDSName, + new Color(camera.clearColor.x, camera.clearColor.y, camera.clearColor.z, camera.clearColor.w), + ); + uiAndProfilerPass.addDepthStencil( + dsUIAndProfilerPassDSName, getLoadOpOfClearFlag(camera.clearFlag, AttachmentType.DEPTH_STENCIL), StoreOp.STORE, - camera.clearDepth, camera.clearStencil, camera.clearFlag); + camera.clearDepth, + + camera.clearStencil, + + camera.clearFlag, + ); const sceneFlags = SceneFlags.UI; uiAndProfilerPass .addQueue(QueueHint.RENDER_TRANSPARENT) @@ -936,7 +1049,7 @@ export function buildUIPass (camera: Camera, } export function updateCameraUBO (setter: any, camera: Readonly, ppl: Readonly): void { - const pipeline = cclegacy.director.root.pipeline; + const pipeline = director.root!.pipeline as WebPipeline; const sceneData = ppl.pipelineSceneData; const skybox = sceneData.skybox; setter.addConstant('CCCamera'); @@ -986,7 +1099,7 @@ export function getDescBindingFromName (bindingName: string): number { const layoutGraph = pipeline.layoutGraph; const vertIds = layoutGraph.vertices(); const descId = layoutGraph.attributeIndex.get(bindingName); - let currDesData; + let currDesData: DescriptorSetData; for (const i of vertIds) { const layout = layoutGraph.getLayout(i); for (const [k, descData] of layout.descriptorSets) { @@ -1020,10 +1133,12 @@ function applyGlobalDescBinding (data: RenderData, layout: string, isUpdate = fa let buffer = descriptorSet.getBuffer(bindId); let haveBuff = true; if (!buffer && !isUpdate) { - buffer = device.createBuffer(new BufferInfo(BufferUsageBit.UNIFORM | BufferUsageBit.TRANSFER_DST, + buffer = device.createBuffer(new BufferInfo( + BufferUsageBit.UNIFORM | BufferUsageBit.TRANSFER_DST, MemoryUsageBit.HOST | MemoryUsageBit.DEVICE, value.length * 4, - value.length * 4)); + value.length * 4, + )); haveBuff = false; } if (isUpdate) { @@ -1198,7 +1313,7 @@ class SSSSBlurData { const o = -range + i * step; const sign = o < 0.0 ? -1.0 : 1.0; // eslint-disable-next-line no-restricted-properties - this._kernel[i].w = range * sign * Math.abs(Math.pow(o, EXPONENT)) / Math.pow(range, EXPONENT); + this._kernel[i].w = range * sign * Math.abs(o ** EXPONENT) / range ** EXPONENT; } // Calculate the weights: @@ -1295,10 +1410,12 @@ export function hasSkinObject (ppl: BasicPipeline): boolean { return sceneData.skin.enabled && sceneData.standardSkinModel !== null; } -function _buildSSSSBlurPass (camera: Camera, +function _buildSSSSBlurPass ( + camera: Camera, ppl: BasicPipeline, inputRT: string, - inputDS: string): { rtName: string; dsName: string; } { + inputDS: string, +): { rtName: string; dsName: string; } { const sceneData = ppl.pipelineSceneData; const skin = sceneData.skin; const standardSkinModel = sceneData.standardSkinModel; @@ -1350,10 +1467,18 @@ function _buildSSSSBlurPass (camera: Camera, sampler.mipFilter = Filter.NONE; copyInputDSPass.addTexture(inputDS, 'depthRaw'); } - copyInputDSPass.addRenderTarget(ssssBlurDSName, - LoadOp.CLEAR, StoreOp.STORE, new Color(1.0, 0.0, 0.0, 0.0)); + copyInputDSPass.addRenderTarget( + ssssBlurDSName, + LoadOp.CLEAR, + + StoreOp.STORE, + + new Color(1.0, 0.0, 0.0, 0.0), + ); copyInputDSPass.addQueue(QueueHint.RENDER_OPAQUE | QueueHint.RENDER_TRANSPARENT).addCameraQuad( - camera, ssssBlurData.ssssBlurMaterial, COPY_INPUT_DS_PASS_INDEX, + camera, + ssssBlurData.ssssBlurMaterial, + COPY_INPUT_DS_PASS_INDEX, SceneFlags.NONE, ); @@ -1378,13 +1503,25 @@ function _buildSSSSBlurPass (camera: Camera, ssssblurXPass.addTexture(ssssBlurDSName, 'depthTex'); } ssssblurXPass.addRenderTarget(ssssBlurRTName, LoadOp.CLEAR, StoreOp.STORE, ssssBlurClearColor); - ssssblurXPass.addDepthStencil(inputDS, LoadOp.LOAD, StoreOp.STORE, - camera.clearDepth, camera.clearStencil, camera.clearFlag); - ssssBlurData.ssssBlurMaterial.setProperty('blurInfo', new Vec4(ssssBlurData.ssssFov, ssssBlurData.ssssWidth, - ssssBlurData.boundingBox, ssssBlurData.ssssScale), SSSS_BLUR_X_PASS_INDEX); + ssssblurXPass.addDepthStencil( + inputDS, + LoadOp.LOAD, + StoreOp.STORE, + camera.clearDepth, + camera.clearStencil, + camera.clearFlag, + ); + ssssBlurData.ssssBlurMaterial.setProperty('blurInfo', new Vec4( + ssssBlurData.ssssFov, + ssssBlurData.ssssWidth, + ssssBlurData.boundingBox, + ssssBlurData.ssssScale, + ), SSSS_BLUR_X_PASS_INDEX); ssssBlurData.ssssBlurMaterial.setProperty('kernel', ssssBlurData.kernel, SSSS_BLUR_X_PASS_INDEX); ssssblurXPass.addQueue(QueueHint.RENDER_OPAQUE | QueueHint.RENDER_TRANSPARENT).addCameraQuad( - camera, ssssBlurData.ssssBlurMaterial, SSSS_BLUR_X_PASS_INDEX, + camera, + ssssBlurData.ssssBlurMaterial, + SSSS_BLUR_X_PASS_INDEX, SceneFlags.NONE, ); @@ -1409,13 +1546,25 @@ function _buildSSSSBlurPass (camera: Camera, ssssblurYPass.addTexture(ssssBlurDSName, 'depthTex'); } ssssblurYPass.addRenderTarget(inputRT, LoadOp.LOAD, StoreOp.STORE, ssssBlurClearColor); - ssssblurYPass.addDepthStencil(inputDS, LoadOp.LOAD, StoreOp.STORE, - camera.clearDepth, camera.clearStencil, camera.clearFlag); - ssssBlurData.ssssBlurMaterial.setProperty('blurInfo', new Vec4(ssssBlurData.ssssFov, ssssBlurData.ssssWidth, - ssssBlurData.boundingBox, ssssBlurData.ssssScale), SSSS_BLUR_Y_PASS_INDEX); + ssssblurYPass.addDepthStencil( + inputDS, + LoadOp.LOAD, + StoreOp.STORE, + camera.clearDepth, + camera.clearStencil, + camera.clearFlag, + ); + ssssBlurData.ssssBlurMaterial.setProperty('blurInfo', new Vec4( + ssssBlurData.ssssFov, + ssssBlurData.ssssWidth, + ssssBlurData.boundingBox, + ssssBlurData.ssssScale, + ), SSSS_BLUR_Y_PASS_INDEX); ssssBlurData.ssssBlurMaterial.setProperty('kernel', ssssBlurData.kernel, SSSS_BLUR_Y_PASS_INDEX); ssssblurYPass.addQueue(QueueHint.RENDER_OPAQUE | QueueHint.RENDER_TRANSPARENT).addCameraQuad( - camera, ssssBlurData.ssssBlurMaterial, SSSS_BLUR_Y_PASS_INDEX, + camera, + ssssBlurData.ssssBlurMaterial, + SSSS_BLUR_Y_PASS_INDEX, SceneFlags.NONE, ); return { rtName: inputRT, dsName: inputDS }; @@ -1439,10 +1588,12 @@ class ToneMappingInfo { } let toneMappingInfo: ToneMappingInfo | null = null; -export function buildToneMappingPass (camera: Camera, +export function buildToneMappingPass ( + camera: Camera, ppl: BasicPipeline, inputRT: string, - inputDS: string): { rtName: string; dsName: string; } { + inputDS: string, +): { rtName: string; dsName: string; } { if (!ppl.pipelineSceneData.isHDR || !ppl.getMacroBool('CC_USE_FLOAT_OUTPUT')) return { rtName: inputRT, dsName: inputDS }; if (!toneMappingInfo) { toneMappingInfo = new ToneMappingInfo(); @@ -1474,29 +1625,42 @@ export function buildToneMappingPass (camera: Camera, if (ppl.containsResource(inputRT)) { toneMappingPass.addTexture(inputRT, 'u_texSampler'); } - toneMappingPass.addRenderTarget(toneMappingPassRTName, + toneMappingPass.addRenderTarget( + toneMappingPassRTName, getLoadOpOfClearFlag(camera.clearFlag, AttachmentType.RENDER_TARGET), - StoreOp.STORE, toneMappingClearColor); - toneMappingPass.addDepthStencil(toneMappingPassDS, + StoreOp.STORE, + + toneMappingClearColor, + ); + toneMappingPass.addDepthStencil( + toneMappingPassDS, getLoadOpOfClearFlag(camera.clearFlag, AttachmentType.DEPTH_STENCIL), StoreOp.STORE, - camera.clearDepth, camera.clearStencil, camera.clearFlag); - toneMappingPass.addQueue(QueueHint.NONE).addFullscreenQuad( - toneMappingInfo.toneMappingMaterial, 0, SceneFlags.NONE, + camera.clearDepth, + + camera.clearStencil, + + camera.clearFlag, + ); + toneMappingPass.addQueue(QueueHint.NONE).addFullscreenQuad(toneMappingInfo.toneMappingMaterial, 0, SceneFlags.NONE); + toneMappingPass.addQueue(QueueHint.RENDER_TRANSPARENT).addSceneOfCamera( + camera, + new LightInfo(), + SceneFlags.UI, ); - toneMappingPass.addQueue(QueueHint.RENDER_TRANSPARENT).addSceneOfCamera(camera, new LightInfo(), - SceneFlags.UI); if (getProfilerCamera() === camera) { toneMappingPass.showStatistics = true; } return { rtName: toneMappingPassRTName, dsName: toneMappingPassDS }; } -export function buildTransparencyPass (camera: Camera, +export function buildTransparencyPass ( + camera: Camera, ppl: BasicPipeline, inputRT: string, inputDS: string, - hasDeferredTransparencyObject: boolean): { rtName: string; dsName: string; } { + hasDeferredTransparencyObject: boolean, +): { rtName: string; dsName: string; } { if (hasDeferredTransparencyObject) return { rtName: inputRT, dsName: inputDS }; const cameraID = getCameraUniqueID(camera); @@ -1519,22 +1683,36 @@ export function buildTransparencyPass (camera: Camera, alphaPass.addTexture(spotShadowName, 'cc_spotShadowMap'); } } - alphaPass.addRenderTarget(inputRT, - LoadOp.LOAD, StoreOp.STORE, - new Color(camera.clearDepth, camera.clearStencil, 0, 0)); - alphaPass.addDepthStencil(inputDS, - LoadOp.LOAD, StoreOp.STORE, - camera.clearDepth, camera.clearStencil, camera.clearFlag); + alphaPass.addRenderTarget( + inputRT, + LoadOp.LOAD, + + StoreOp.STORE, + new Color(camera.clearDepth, camera.clearStencil, 0, 0), + ); + alphaPass.addDepthStencil( + inputDS, + LoadOp.LOAD, + + StoreOp.STORE, + camera.clearDepth, + + camera.clearStencil, + + camera.clearFlag, + ); alphaPass .addQueue(QueueHint.RENDER_TRANSPARENT) .addSceneOfCamera(camera, new LightInfo(), SceneFlags.TRANSPARENT_OBJECT | SceneFlags.GEOMETRY); return { rtName: inputRT, dsName: inputDS }; } -function _buildSpecularPass (camera: Camera, +function _buildSpecularPass ( + camera: Camera, ppl: BasicPipeline, inputRT: string, - inputDS: string): { rtName: string; dsName: string; } { + inputDS: string, +): { rtName: string; dsName: string; } { if (EDITOR) { ppl.setMacroInt('CC_PIPELINE_TYPE', 0); } @@ -1558,29 +1736,49 @@ function _buildSpecularPass (camera: Camera, specalurPass.addTexture(spotShadowName, 'cc_spotShadowMap'); } } - specalurPass.addRenderTarget(inputRT, - LoadOp.LOAD, StoreOp.STORE, - new Color(camera.clearColor.x, camera.clearColor.y, camera.clearColor.z, camera.clearColor.w)); - specalurPass.addDepthStencil(inputDS, - LoadOp.LOAD, StoreOp.STORE, - camera.clearDepth, camera.clearStencil, camera.clearFlag); + specalurPass.addRenderTarget( + inputRT, + LoadOp.LOAD, + + StoreOp.STORE, + new Color(camera.clearColor.x, camera.clearColor.y, camera.clearColor.z, camera.clearColor.w), + ); + specalurPass.addDepthStencil( + inputDS, + LoadOp.LOAD, + + StoreOp.STORE, + camera.clearDepth, + + camera.clearStencil, + + camera.clearFlag, + ); specalurPass .addQueue(QueueHint.RENDER_OPAQUE, 'default') - .addSceneOfCamera(camera, new LightInfo(), + .addSceneOfCamera( + camera, + new LightInfo(), SceneFlags.TRANSPARENT_OBJECT | SceneFlags.DEFAULT_LIGHTING | SceneFlags.PLANAR_SHADOW - | SceneFlags.CUTOUT_OBJECT | SceneFlags.DRAW_INSTANCING | SceneFlags.GEOMETRY); + | SceneFlags.CUTOUT_OBJECT | SceneFlags.DRAW_INSTANCING | SceneFlags.GEOMETRY, + ); specalurPass .addQueue(QueueHint.RENDER_TRANSPARENT, 'forward-add') - .addSceneOfCamera(camera, new LightInfo(), + .addSceneOfCamera( + camera, + new LightInfo(), SceneFlags.TRANSPARENT_OBJECT | SceneFlags.DEFAULT_LIGHTING | SceneFlags.PLANAR_SHADOW - | SceneFlags.CUTOUT_OBJECT | SceneFlags.DRAW_INSTANCING | SceneFlags.GEOMETRY); + | SceneFlags.CUTOUT_OBJECT | SceneFlags.DRAW_INSTANCING | SceneFlags.GEOMETRY, + ); return { rtName: inputRT, dsName: inputDS }; } -export function buildSSSSPass (camera: Camera, +export function buildSSSSPass ( + camera: Camera, ppl: BasicPipeline, inputRT: string, - inputDS: string): { rtName: string; dsName: string; } { + inputDS: string, +): { rtName: string; dsName: string; } { if (hasSkinObject(ppl)) { forceEnableFloatOutput(ppl); const blurInfo = _buildSSSSBlurPass(camera, ppl, inputRT, inputDS); @@ -1736,10 +1934,12 @@ class HBAOParams { let _hbaoParams: HBAOParams | null = null; const vec2 = new Vec2(); -function _buildHBAOPass (camera: Camera, +function _buildHBAOPass ( + camera: Camera, ppl: BasicPipeline, inputRT: string, - inputDS: string): { rtName: string; dsName: string; } { + inputDS: string, +): { rtName: string; dsName: string; } { if (!_hbaoParams) return { rtName: inputRT, dsName: inputDS }; const cameraID = getCameraUniqueID(camera); @@ -1780,17 +1980,21 @@ function _buildHBAOPass (camera: Camera, _hbaoParams.hbaoMaterial.setProperty('randomTexSize', new Vec4(_hbaoParams.randomTexture.width, _hbaoParams.randomTexture.height, 1.0 / _hbaoParams.randomTexture.width, 1.0 / _hbaoParams.randomTexture.height), passIdx); _hbaoParams.hbaoMaterial.setProperty('blurParam', _hbaoParams.blurParam, passIdx); hbaoPass.addQueue(QueueHint.RENDER_TRANSPARENT | QueueHint.RENDER_OPAQUE).addCameraQuad( - camera, _hbaoParams.hbaoMaterial, passIdx, + camera, + _hbaoParams.hbaoMaterial, + passIdx, SceneFlags.NONE, ); return { rtName: hbaoRTName, dsName: inputDS }; } -function _buildHBAOBlurPass (camera: Camera, +function _buildHBAOBlurPass ( + camera: Camera, ppl: BasicPipeline, inputRT: string, inputDS: string, - isYPass: boolean): { rtName: string; dsName: string; } { + isYPass: boolean, +): { rtName: string; dsName: string; } { if (!_hbaoParams) return { rtName: inputRT, dsName: inputDS }; const cameraID = getCameraUniqueID(camera); @@ -1848,17 +2052,21 @@ function _buildHBAOBlurPass (camera: Camera, _hbaoParams.hbaoMaterial.setProperty('miscParam', _hbaoParams.miscParam, passIdx); _hbaoParams.hbaoMaterial.setProperty('blurParam', _hbaoParams.blurParam, passIdx); blurPass.addQueue(QueueHint.RENDER_TRANSPARENT | QueueHint.RENDER_OPAQUE).addCameraQuad( - camera, _hbaoParams.hbaoMaterial, passIdx, + camera, + _hbaoParams.hbaoMaterial, + passIdx, SceneFlags.NONE, ); return { rtName: outputRTName, dsName: inputDS }; } -function _buildHBAOCombinedPass (camera: Camera, +function _buildHBAOCombinedPass ( + camera: Camera, ppl: BasicPipeline, inputRT: string, inputDS: string, - outputRT: string): { rtName: string; dsName: string; } { + outputRT: string, +): { rtName: string; dsName: string; } { if (!_hbaoParams) return { rtName: inputRT, dsName: inputDS }; const cameraID = getCameraUniqueID(camera); @@ -1900,13 +2108,16 @@ function _buildHBAOCombinedPass (camera: Camera, _hbaoParams.hbaoMaterial.setProperty('miscParam', _hbaoParams.miscParam, passIdx); _hbaoParams.hbaoMaterial.setProperty('blurParam', _hbaoParams.blurParam, passIdx); hbaoPass.addQueue(QueueHint.RENDER_TRANSPARENT | QueueHint.RENDER_OPAQUE).addCameraQuad( - camera, _hbaoParams.hbaoMaterial, passIdx, + camera, + _hbaoParams.hbaoMaterial, + passIdx, SceneFlags.NONE, ); return { rtName: outputRTName, dsName: inputDS }; } -export function buildHBAOPasses (camera: Camera, +export function buildHBAOPasses ( + camera: Camera, ppl: BasicPipeline, inputRT: string, inputDS: string, @@ -1915,7 +2126,8 @@ export function buildHBAOPasses (camera: Camera, blurSharpness = 3, aoSaturation = 1.0, aoStrength = 1.0, - needBlur = true): { rtName: string; dsName: string; } { + needBlur = true, +): { rtName: string; dsName: string; } { const area = getRenderArea(camera, camera.window.width, camera.window.height); const width = area.width; const height = area.height; @@ -1967,7 +2179,7 @@ export const CLUSTER_COUNT = CLUSTERS_X * CLUSTERS_Y * CLUSTERS_Z; class ClusterLightData { declare clusterBuildCS: Material; - declare clusterLightCullingCS: Material + declare clusterLightCullingCS: Material; clusters_x_threads = 16; clusters_y_threads = 8; clusters_z_threads = 1; @@ -2000,8 +2212,11 @@ class ClusterLightData { } let _clusterLightData: ClusterLightData | null = null; -export function buildLightClusterBuildPass (camera: Camera, clusterData: ClusterLightData, - ppl: Pipeline): void { +export function buildLightClusterBuildPass ( + camera: Camera, + clusterData: ClusterLightData, + ppl: Pipeline, +): void { const cameraID = getCameraUniqueID(camera); const clusterBufferName = `clusterBuffer${cameraID}`; @@ -2025,8 +2240,11 @@ export function buildLightClusterBuildPass (camera: Camera, clusterData: Cluster clusterPass.setMat4('cc_matProjInv', camera.matProjInv); } -export function buildLightClusterCullingPass (camera: Camera, clusterData: ClusterLightData, - ppl: Pipeline): void { +export function buildLightClusterCullingPass ( + camera: Camera, + clusterData: ClusterLightData, + ppl: Pipeline, +): void { const cameraID = getCameraUniqueID(camera); const clusterBufferName = `clusterBuffer${cameraID}`; const clusterLightBufferName = `clusterLightBuffer${cameraID}`; diff --git a/cocos/rendering/post-process/passes/fxaa-pass.ts b/cocos/rendering/post-process/passes/fxaa-pass.ts index 41baed363e7..1689fa22e81 100644 --- a/cocos/rendering/post-process/passes/fxaa-pass.ts +++ b/cocos/rendering/post-process/passes/fxaa-pass.ts @@ -11,9 +11,9 @@ import { FXAA } from '../components/fxaa'; export class FxaaPass extends SettingPass { get setting (): FXAA { return getSetting(FXAA); } - name = 'FxaaPass' + name = 'FxaaPass'; effectName = 'pipeline/post-process/fxaa-hq'; - outputNames = ['FxaaColor'] + outputNames = ['FxaaColor']; public render (camera: Camera, ppl: Pipeline): void { const cameraID = getCameraUniqueID(camera); diff --git a/cocos/spine/assembler/simple.ts b/cocos/spine/assembler/simple.ts index 4dfd998eb1d..f7e853bc516 100644 --- a/cocos/spine/assembler/simple.ts +++ b/cocos/spine/assembler/simple.ts @@ -98,11 +98,11 @@ export const simple: IAssembler = { const batcher = director.root!.batcher2D; const attributes = useTint ? vfmtPosUvTwoColor4B : vfmtPosUvColor4B; if (useTint) { - accessor = _tintAccessor = new StaticVBAccessor(device, attributes, this.vCount); + accessor = _tintAccessor = new StaticVBAccessor(device, attributes, this.vCount as number); // Register to batcher so that batcher can upload buffers after batching process batcher.registerBufferAccessor(Number.parseInt('SPINETINT', 36), _tintAccessor); } else { - accessor = _accessor = new StaticVBAccessor(device, attributes, this.vCount); + accessor = _accessor = new StaticVBAccessor(device, attributes, this.vCount as number); // Register to batcher so that batcher can upload buffers after batching process batcher.registerBufferAccessor(Number.parseInt('SPINE', 36), _accessor); } @@ -148,8 +148,8 @@ function realTimeTraverse (comp: Skeleton): void { const floatStride = (_useTint ? _byteStrideTwoColor : _byteStrideOneColor) / Float32Array.BYTES_PER_ELEMENT; const model = comp.updateRenderData(); if (!model) return; - const vc = model.vCount; - const ic = model.iCount; + const vc = model.vCount as number; + const ic = model.iCount as number; const rd = comp.renderData!; if (rd.vertexCount !== vc || rd.indexCount !== ic) { @@ -165,7 +165,7 @@ function realTimeTraverse (comp: Skeleton): void { const vLength = vc * Float32Array.BYTES_PER_ELEMENT * floatStride; // eslint-disable-next-line @typescript-eslint/restrict-plus-operands const vData = spine.wasmUtil.wasm.HEAPU8.subarray(vPtr, vPtr + vLength); - vUint8Buf.set(vData); + vUint8Buf.set(vData as TypedArray); const iPtr = model.iPtr; const ibuf = rd.indices!; @@ -173,7 +173,7 @@ function realTimeTraverse (comp: Skeleton): void { // eslint-disable-next-line @typescript-eslint/restrict-plus-operands const iData = spine.wasmUtil.wasm.HEAPU8.subarray(iPtr, iPtr + iLength); const iUint8Buf = new Uint8Array(ibuf.buffer); - iUint8Buf.set(iData); + iUint8Buf.set(iData as TypedArray); const chunkOffset = rd.chunk.vertexOffset; for (let i = 0; i < ic; i++) { ibuf[i] += chunkOffset; @@ -185,8 +185,8 @@ function realTimeTraverse (comp: Skeleton): void { let indexCount = 0; for (let i = 0; i < count; i++) { const mesh = meshes.get(i); - const material = _getSlotMaterial(mesh.blendMode, comp); - const textureID = mesh.textureID; + const material = _getSlotMaterial(mesh.blendMode as number, comp); + const textureID = mesh.textureID as number; indexCount = mesh.iCount; comp.requestDrawData(material, textureID, indexOffset, indexCount); indexOffset += indexCount; @@ -278,8 +278,8 @@ function cacheTraverse (comp: Skeleton): void { const model = comp.updateRenderData(); if (!model) return; - const vc = model.vCount; - const ic = model.iCount; + const vc = model.vCount as number; + const ic = model.iCount as number; const rd = comp.renderData!; if (rd.vertexCount !== vc || rd.indexCount !== ic) { rd.resize(vc, ic); @@ -289,7 +289,7 @@ function cacheTraverse (comp: Skeleton): void { const vbuf = rd.chunk.vb; const vUint8Buf = new Uint8Array(vbuf.buffer, vbuf.byteOffset, Float32Array.BYTES_PER_ELEMENT * vbuf.length); - vUint8Buf.set(model.vData); + vUint8Buf.set(model.vData as TypedArray); const nodeColor = comp.color; if (nodeColor._val !== 0xffffffff || _premultipliedAlpha) { @@ -318,7 +318,7 @@ function cacheTraverse (comp: Skeleton): void { } const iUint16Buf = rd.indices!; - iUint16Buf.set(model.iData); + iUint16Buf.set(model.iData as TypedArray); const chunkOffset = rd.chunk.vertexOffset; for (let i = 0; i < ic; i++) { iUint16Buf[i] += chunkOffset; @@ -330,10 +330,10 @@ function cacheTraverse (comp: Skeleton): void { let indexCount = 0; for (let i = 0; i < count; i++) { const mesh = meshes[i]; - const material = _getSlotMaterial(mesh.blendMode, comp); + const material = _getSlotMaterial(mesh.blendMode as number, comp); const textureID = mesh.textureID; indexCount = mesh.iCount; - comp.requestDrawData(material, textureID, indexOffset, indexCount); + comp.requestDrawData(material, textureID as number, indexOffset, indexCount); indexOffset += indexCount; } diff --git a/cocos/spine/skeleton.ts b/cocos/spine/skeleton.ts index 6844673b69c..691702d985a 100644 --- a/cocos/spine/skeleton.ts +++ b/cocos/spine/skeleton.ts @@ -25,7 +25,7 @@ import { EDITOR_NOT_IN_PREVIEW, JSB } from 'internal:constants'; import { ccclass, executeInEditMode, help, menu, serializable, type, displayName, override, displayOrder, editable, tooltip } from 'cc.decorator'; import { Material, Texture2D } from '../asset/assets'; import { error, logID, warn } from '../core/platform/debug'; -import { Enum, ccenum } from '../core/value-types/enum'; +import { Enum, EnumType, ccenum } from '../core/value-types/enum'; import { Node } from '../scene-graph'; import { CCObject, Color, RecyclePool, js } from '../core'; import { SkeletonData } from './skeleton-data'; @@ -65,6 +65,11 @@ export const timeScale = 1.0; * @zh Spine 动画缓存类型。 */ export enum AnimationCacheMode { + /** + * @en Unset mode. + * @zh 未设置模式。 + */ + UNSET = -1, /** * @en The realtime mode. * @zh 实时计算模式。 @@ -207,7 +212,7 @@ export class Skeleton extends UIRenderer { @serializable protected _timeScale = 1; @serializable - protected _preCacheMode = -1; + protected _preCacheMode: AnimationCacheMode = AnimationCacheMode.UNSET; @serializable protected _cacheMode = AnimationCacheMode.REALTIME; @serializable @@ -241,8 +246,8 @@ export class Skeleton extends UIRenderer { }), 1); protected _materialCache: { [key: string]: MaterialInstance } = {} as any; public paused = false; - protected _enumSkins: any = Enum({}); - protected _enumAnimations: any = Enum({}); + protected _enumSkins: EnumType = Enum({}); + protected _enumAnimations: EnumType = Enum({}); protected attachUtil: AttachUtil; protected _socketNodes: Map = new Map(); protected _cachedSockets: Map = new Map(); @@ -725,7 +730,7 @@ export class Skeleton extends UIRenderer { if (this.debugBones || this.debugSlots) { warn('Debug bones or slots is invalid in cached mode'); } - const skeletonInfo = this._skeletonCache!.getSkeletonCache((this.skeletonData as any).uuid, skeletonData); + const skeletonInfo = this._skeletonCache!.getSkeletonCache(this.skeletonData!.uuid, skeletonData); this._skeleton = skeletonInfo.skeleton; } else { this._skeleton = this._instance.initSkeleton(skeletonData); @@ -1396,9 +1401,9 @@ export class Skeleton extends UIRenderer { } this._cachedSockets.clear(); const bones = this._skeleton.bones; - const getBoneName = (bone: spine.Bone): any => { + const getBoneName = (bone: spine.Bone): string => { if (bone.parent == null) return bone.data.name || ''; - return `${getBoneName(bones[bone.parent.data.index]) as string}/${bone.data.name}`; + return `${getBoneName(bones[bone.parent.data.index])}/${bone.data.name}`; }; for (let i = 0, l = bones.length; i < l; i++) { const bd = bones[i].data; @@ -1494,7 +1499,7 @@ export class Skeleton extends UIRenderer { /** * @engineInternal */ - protected _updateColor (): void { + public _updateColor (): void { this.node._uiProps.colorDirty = true; const r = this._color.r / 255.0; const g = this._color.g / 255.0; From 546b36209fcd0a7e981843e797fe8d07def3a978 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Wed, 26 Jul 2023 13:16:34 +0800 Subject: [PATCH 28/51] Fix circular dependencies --- cocos/rendering/deferred/lighting-stage.ts | 13 ++++-- cocos/rendering/forward/forward-pipeline.ts | 6 +++ cocos/rendering/index.ts | 8 +--- cocos/rendering/pipeline-scene-data.ts | 7 ++-- .../reflection-probe/reflection-probe-flow.ts | 7 ++-- .../rendering/render-additive-light-queue.ts | 16 +++++-- .../render-reflection-probe-queue.ts | 8 ++-- cocos/rendering/shadow/csm-layers.ts | 42 +++++++++++++++---- cocos/rendering/shadow/shadow-stage.ts | 24 ++++++++--- cocos/root.ts | 14 +++++-- 10 files changed, 105 insertions(+), 40 deletions(-) diff --git a/cocos/rendering/deferred/lighting-stage.ts b/cocos/rendering/deferred/lighting-stage.ts index ebb09a9efc7..e420c39ab2a 100644 --- a/cocos/rendering/deferred/lighting-stage.ts +++ b/cocos/rendering/deferred/lighting-stage.ts @@ -28,7 +28,8 @@ */ import { ccclass, displayOrder, type, serializable } from 'cc.decorator'; -import { Camera, LightType } from '../../render-scene/scene'; +import { Camera } from '../../render-scene/scene/camera'; +import { LightType } from '../../render-scene/scene/light'; import { UBODeferredLight, SetIndex, UBOForwardLight, UBOLocal } from '../define'; import { getPhaseID } from '../pass-phase'; import { Color, Rect, Buffer, BufferUsageBit, MemoryUsageBit, BufferInfo, BufferViewInfo, DescriptorSet, @@ -355,8 +356,14 @@ export class LightingStage extends RenderStage { pipeline.pipelineUBO.updateShadowUBO(camera); - cmdBuff.beginRenderPass(renderPass, framebuffer, this._renderArea, - colors, camera.clearDepth, camera.clearStencil); + cmdBuff.beginRenderPass( + renderPass, + framebuffer, + this._renderArea, + colors, + camera.clearDepth, + camera.clearStencil, + ); cmdBuff.setScissor(pipeline.generateScissor(camera)); cmdBuff.setViewport(pipeline.generateViewport(camera)); cmdBuff.bindDescriptorSet(SetIndex.GLOBAL, pipeline.descriptorSet); diff --git a/cocos/rendering/forward/forward-pipeline.ts b/cocos/rendering/forward/forward-pipeline.ts index a8bdcaf1832..48322d0c130 100644 --- a/cocos/rendering/forward/forward-pipeline.ts +++ b/cocos/rendering/forward/forward-pipeline.ts @@ -39,6 +39,12 @@ import { ReflectionProbeFlow } from '../reflection-probe/reflection-probe-flow'; const PIPELINE_TYPE = 0; +export function createDefaultPipeline (): ForwardPipeline { + const rppl = new ForwardPipeline(); + rppl.initialize({ flows: [] }); + return rppl; +} + /** * @en The forward render pipeline * @zh 前向渲染管线。 diff --git a/cocos/rendering/index.ts b/cocos/rendering/index.ts index 68a0d0434a8..df06cd7656e 100644 --- a/cocos/rendering/index.ts +++ b/cocos/rendering/index.ts @@ -35,7 +35,7 @@ export { RenderFlow } from './render-flow'; export { RenderStage } from './render-stage'; export { PipelineSceneData } from './pipeline-scene-data'; -export { ForwardPipeline } from './forward/forward-pipeline'; +export { ForwardPipeline, createDefaultPipeline } from './forward/forward-pipeline'; export { ForwardFlow } from './forward/forward-flow'; export { ForwardStage } from './forward/forward-stage'; export { DeferredPipeline } from './deferred/deferred-pipeline'; @@ -55,9 +55,3 @@ export { DebugView } from './debug-view'; export { ReflectionProbeFlow } from './reflection-probe/reflection-probe-flow'; export { ReflectionProbeStage } from './reflection-probe/reflection-probe-stage'; - -export function createDefaultPipeline (): ForwardPipeline { - const rppl = new ForwardPipeline(); - rppl.initialize({ flows: [] }); - return rppl; -} diff --git a/cocos/rendering/pipeline-scene-data.ts b/cocos/rendering/pipeline-scene-data.ts index 529d6c44cb9..314539ec16a 100644 --- a/cocos/rendering/pipeline-scene-data.ts +++ b/cocos/rendering/pipeline-scene-data.ts @@ -32,9 +32,10 @@ import { Light } from '../render-scene/scene/light'; import { Material } from '../asset/assets'; import { Pass } from '../render-scene/core/pass'; import { CSMLayers } from './shadow/csm-layers'; -import { cclegacy } from '../core'; +import { legacyCC } from '../core/global-exports'; import { Skin } from '../render-scene/scene/skin'; -import { Model, PostSettings } from '../render-scene/scene'; +import { Model } from '../render-scene/scene/model'; +import { PostSettings } from '../render-scene/scene/post-settings'; import { MeshRenderer } from '../3d/framework/mesh-renderer'; const GEOMETRY_RENDERER_TECHNIQUE_COUNT = 6; @@ -109,7 +110,7 @@ export class PipelineSceneData { public octree: Octree = new Octree(); public skin: Skin = new Skin(); public postSettings: PostSettings = new PostSettings(); - public lightProbes = cclegacy.internal.LightProbes ? new cclegacy.internal.LightProbes() : null; + public lightProbes = legacyCC.internal.LightProbes ? new legacyCC.internal.LightProbes() : null; /** * @en The list for valid punctual Lights, only available after the scene culling of the current frame. diff --git a/cocos/rendering/reflection-probe/reflection-probe-flow.ts b/cocos/rendering/reflection-probe/reflection-probe-flow.ts index 20611207a19..3ceabf5a832 100644 --- a/cocos/rendering/reflection-probe/reflection-probe-flow.ts +++ b/cocos/rendering/reflection-probe/reflection-probe-flow.ts @@ -26,8 +26,9 @@ import { ccclass } from 'cc.decorator'; import { IRenderFlowInfo, RenderFlow } from '../render-flow'; import { ReflectionProbeStage } from './reflection-probe-stage'; import { RenderFlowTag } from '../pipeline-serialization'; -import { RenderPipeline } from '..'; -import { Camera, ProbeType, ReflectionProbe } from '../../render-scene/scene'; +import { RenderPipeline } from '../render-pipeline'; +import { Camera } from '../../render-scene/scene/camera'; +import { ProbeType, ReflectionProbe } from '../../render-scene/scene/reflection-probe'; import { cclegacy } from '../../core'; /** @@ -61,7 +62,7 @@ export class ReflectionProbeFlow extends RenderFlow { if (!cclegacy.internal.reflectionProbeManager) { return; } - const probes = cclegacy.internal.reflectionProbeManager.getProbes(); + const probes = cclegacy.internal.reflectionProbeManager.getProbes() as ReflectionProbe[]; for (let i = 0; i < probes.length; i++) { if (probes[i].needRender) { if (EDITOR || probes[i].probeType === ProbeType.PLANAR) { diff --git a/cocos/rendering/render-additive-light-queue.ts b/cocos/rendering/render-additive-light-queue.ts index 94b8e02841e..ce569f7260e 100644 --- a/cocos/rendering/render-additive-light-queue.ts +++ b/cocos/rendering/render-additive-light-queue.ts @@ -38,7 +38,8 @@ import { getPhaseID } from './pass-phase'; import { Light, LightType } from '../render-scene/scene/light'; import { SetIndex, UBOForwardLight, UBOShadow, UNIFORM_SHADOWMAP_BINDING, UNIFORM_SPOT_SHADOW_MAP_TEXTURE_BINDING, supportsR32FloatTexture, isEnableEffect } from './define'; -import { Camera, ShadowType } from '../render-scene/scene'; +import { Camera } from '../render-scene/scene/camera'; +import { ShadowType } from '../render-scene/scene/shadows'; import { GlobalDSManager } from './global-descriptor-set-manager'; import { PipelineUBO } from './pipeline-ubo'; import { PipelineRuntime } from './custom/pipeline'; @@ -386,8 +387,17 @@ export class RenderAdditiveLightQueue { Mat4.invert(_matShadowView, (light as SpotLight).node!.getWorldMatrix()); // light proj - Mat4.perspective(_matShadowViewProj, (light as SpotLight).angle, 1.0, 0.001, (light as SpotLight).range, - true, cap.clipSpaceMinZ, cap.clipSpaceSignY, 0); + Mat4.perspective( + _matShadowViewProj, + (light as SpotLight).angle, + 1.0, + 0.001, + (light as SpotLight).range, + true, + cap.clipSpaceMinZ, + cap.clipSpaceSignY, + 0, + ); matShadowProj = _matShadowViewProj.clone(); matShadowInvProj = _matShadowViewProj.clone().invert(); diff --git a/cocos/rendering/render-reflection-probe-queue.ts b/cocos/rendering/render-reflection-probe-queue.ts index 725b4a4ec6f..4f78db4a021 100644 --- a/cocos/rendering/render-reflection-probe-queue.ts +++ b/cocos/rendering/render-reflection-probe-queue.ts @@ -27,11 +27,11 @@ import { isEnableEffect, SetIndex } from './define'; import { Device, RenderPass, Shader, CommandBuffer } from '../gfx'; import { getPhaseID } from './pass-phase'; import { PipelineStateManager } from './pipeline-state-manager'; -import { Pass, BatchingSchemes } from '../render-scene/core/pass'; +import { Pass, BatchingSchemes, IMacroPatch } from '../render-scene/core/pass'; import { Model } from '../render-scene/scene/model'; -import { Camera, ProbeType, ReflectionProbe, SKYBOX_FLAG } from '../render-scene/scene'; +import { ProbeType, ReflectionProbe } from '../render-scene/scene/reflection-probe'; +import { Camera, SKYBOX_FLAG } from '../render-scene/scene/camera'; import { PipelineRuntime } from './custom/pipeline'; -import { IMacroPatch, RenderScene } from '../render-scene'; import { RenderInstancedQueue } from './render-instanced-queue'; import { cclegacy, geometry } from '../core'; import { Layers } from '../scene-graph/layers'; @@ -77,7 +77,7 @@ export class RenderReflectionProbeQueue { private _subModelsArray: SubModel[] = []; private _passArray: Pass[] = []; private _shaderArray: Shader[] = []; - private _rgbeSubModelsArray: SubModel[]=[] + private _rgbeSubModelsArray: SubModel[] = []; private _instancedQueue: RenderInstancedQueue; private _patches: IMacroPatch[] = []; diff --git a/cocos/rendering/shadow/csm-layers.ts b/cocos/rendering/shadow/csm-layers.ts index fcf74e54312..bed455e4bbe 100644 --- a/cocos/rendering/shadow/csm-layers.ts +++ b/cocos/rendering/shadow/csm-layers.ts @@ -20,7 +20,9 @@ THE SOFTWARE. */ -import { DirectionalLight, Camera, Shadows, CSMLevel, CSMOptimizationMode } from '../../render-scene/scene'; +import { Shadows, CSMLevel, CSMOptimizationMode } from '../../render-scene/scene/shadows'; +import { DirectionalLight } from '../../render-scene/scene/directional-light'; +import { Camera } from '../../render-scene/scene/camera'; import { Mat4, Vec3, Vec2, Vec4 } from '../../core/math'; import { Frustum, AABB } from '../../core/geometry'; import { IRenderObject } from '../define'; @@ -186,8 +188,17 @@ export class ShadowLayerVolume { // snap to whole texels const halfOrthoSizeWidth = orthoSizeWidth * 0.5; const halfOrthoSizeHeight = orthoSizeHeight * 0.5; - Mat4.ortho(_matShadowProj, -halfOrthoSizeWidth, halfOrthoSizeWidth, -halfOrthoSizeHeight, halfOrthoSizeHeight, - 0.1, this._shadowCameraFar, device.capabilities.clipSpaceMinZ, device.capabilities.clipSpaceSignY); + Mat4.ortho( + _matShadowProj, + -halfOrthoSizeWidth, + halfOrthoSizeWidth, + -halfOrthoSizeHeight, + halfOrthoSizeHeight, + 0.1, + this._shadowCameraFar, + device.capabilities.clipSpaceMinZ, + device.capabilities.clipSpaceSignY, + ); Mat4.multiply(_matShadowViewProjArbitaryPos, _matShadowProj, shadowViewArbitaryPos); Vec3.transformMat4(_projPos, _shadowPos, _matShadowViewProjArbitaryPos); @@ -209,8 +220,14 @@ export class ShadowLayerVolume { Mat4.copy(this._matShadowViewProj, _matShadowViewProj); } - Frustum.createOrtho(this._validFrustum, orthoSizeWidth, orthoSizeHeight, - 0.1, this._shadowCameraFar, _matShadowTrans); + Frustum.createOrtho( + this._validFrustum, + orthoSizeWidth, + orthoSizeHeight, + 0.1, + this._shadowCameraFar, + _matShadowTrans, + ); } } export class CSMShadowLayer extends ShadowLayerVolume { @@ -335,8 +352,17 @@ export class CSMLayers { const far = dirLight.shadowFar; Mat4.fromRT(_matShadowTrans, dirLight.node!.getWorldRotation(), dirLight.node!.getWorldPosition()); Mat4.invert(_matShadowView, _matShadowTrans); - Mat4.ortho(_matShadowProj, -x, x, -y, y, near, far, - device.capabilities.clipSpaceMinZ, device.capabilities.clipSpaceSignY); + Mat4.ortho( + _matShadowProj, + -x, + x, + -y, + y, + near, + far, + device.capabilities.clipSpaceMinZ, + device.capabilities.clipSpaceSignY, + ); Mat4.multiply(_matShadowViewProj, _matShadowProj, _matShadowView); this._specialLayer.matShadowView = _matShadowView; this._specialLayer.matShadowProj = _matShadowProj; @@ -356,7 +382,7 @@ export class CSMLayers { // i ÷ numbers of level const si = i / level; // eslint-disable-next-line no-restricted-properties - const preNear = lambda * (nd * Math.pow(ratio, si)) + (1 - lambda) * (nd + (fd - nd) * si); + const preNear = lambda * (nd * ratio ** si) + (1 - lambda) * (nd + (fd - nd) * si); // Slightly increase the overlap to avoid fracture const nextFar = preNear * 1.005; this._layers[i].splitCameraNear = preNear; diff --git a/cocos/rendering/shadow/shadow-stage.ts b/cocos/rendering/shadow/shadow-stage.ts index edae01d16ac..020bd72715e 100644 --- a/cocos/rendering/shadow/shadow-stage.ts +++ b/cocos/rendering/shadow/shadow-stage.ts @@ -31,7 +31,9 @@ import { ForwardPipeline } from '../forward/forward-pipeline'; import { SetIndex } from '../define'; import { Light, LightType } from '../../render-scene/scene/light'; import { ShadowFlow } from './shadow-flow'; -import { Camera, CSMLevel, DirectionalLight } from '../../render-scene/scene'; +import { DirectionalLight } from '../../render-scene/scene/directional-light'; +import { CSMLevel } from '../../render-scene/scene/shadows'; +import { Camera } from '../../render-scene/scene/camera'; const colors: Color[] = [new Color(1, 1, 1, 1)]; @@ -98,8 +100,14 @@ export class ShadowStage extends RenderStage { const cmdBuff = pipeline.commandBuffers[0]; const renderPass = this._shadowFrameBuffer.renderPass; - cmdBuff.beginRenderPass(renderPass, this._shadowFrameBuffer, this._renderArea, - colors, camera.clearDepth, camera.clearStencil); + cmdBuff.beginRenderPass( + renderPass, + this._shadowFrameBuffer, + this._renderArea, + colors, + camera.clearDepth, + camera.clearStencil, + ); cmdBuff.endRenderPass(); this._isShadowMapCleared = true; } @@ -151,8 +159,14 @@ export class ShadowStage extends RenderStage { const renderPass = this._shadowFrameBuffer.renderPass; - cmdBuff.beginRenderPass(renderPass, this._shadowFrameBuffer, this._renderArea, - colors, camera.clearDepth, camera.clearStencil); + cmdBuff.beginRenderPass( + renderPass, + this._shadowFrameBuffer, + this._renderArea, + colors, + camera.clearDepth, + camera.clearStencil, + ); cmdBuff.bindDescriptorSet(SetIndex.GLOBAL, descriptorSet); this._additiveShadowQueue.recordCommandBuffer(device, renderPass, cmdBuff); diff --git a/cocos/root.ts b/cocos/root.ts index efab7abacb0..99c2d28dd60 100644 --- a/cocos/root.ts +++ b/cocos/root.ts @@ -23,7 +23,9 @@ */ import { Pool, cclegacy, warnID, settings, Settings, macro } from './core'; -import { RenderPipeline, createDefaultPipeline, DeferredPipeline } from './rendering'; +import type { RenderPipeline } from './rendering/render-pipeline'; +import { DeferredPipeline } from './rendering/deferred/deferred-pipeline'; +import { createDefaultPipeline } from './rendering/forward/forward-pipeline'; import { DebugView } from './rendering/debug-view'; import { Camera, CameraType, Light, Model, TrackingType } from './render-scene/scene'; import type { DataPoolManager } from './3d/skeletal-animation/data-pool-manager'; @@ -41,6 +43,7 @@ import { Batcher2D } from './2d/renderer/batcher-2d'; import { IPipelineEvent } from './rendering/pipeline-event'; import { localDescriptorSetLayout_ResizeMaxJoints, UBOCamera, UBOGlobal, UBOLocal, UBOShadow, UBOWorldBound } from './rendering/define'; import { XREye, XRPoseType } from './xr/xr-enums'; +import { ICustomJointTextureLayout } from './3d/skeletal-animation/skeletal-animation-utils'; /** * @en Initialization information for the Root @@ -311,7 +314,10 @@ export class Root { swapchain, }); this._curWindow = this._mainWindow; - const customJointTextureLayouts = settings.querySettings(Settings.Category.ANIMATION, 'customJointTextureLayouts') || []; + const customJointTextureLayouts = settings.querySettings( + Settings.Category.ANIMATION, + 'customJointTextureLayouts', + ) as ICustomJointTextureLayout[] || []; this._dataPoolMgr?.jointTexturePool.registerCustomTextureLayouts(customJointTextureLayouts); this._resizeMaxJointForDS(); } @@ -717,7 +723,7 @@ export class Root { let allcameras: Camera[] = []; const webxrHmdPoseInfos = xr.webxrHmdPoseInfos; - for (let xrEye = 0; xrEye < viewCount; xrEye++) { + for (let xrEye: XREye = 0; xrEye < viewCount; xrEye++) { for (const window of windows) { allcameras = allcameras.concat(window.cameras); if (window.swapchain) { @@ -789,7 +795,7 @@ export class Root { if (this._pipeline && cameraList.length > 0) { this._device.acquire([deviceManager.swapchain]); const scenes = this._scenes; - const stamp = director.getTotalFrames(); + const stamp = director.getTotalFrames() as number; if (this._batcher) { this._batcher.update(); From e0bfd7e1cf46979ac85b735794ce83a180b165c7 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Wed, 26 Jul 2023 13:16:46 +0800 Subject: [PATCH 29/51] Fix DS_Store ignore in tempaltes --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4dfa79f089c..229c3ea39a6 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ native/external/ scripts/typedoc-plugin/lib/ !templates/**/* +templates/**/.DS_Store @types/consts.d.ts From 61422450d3bb76e4f40881d2d70ab4ba68391bfa Mon Sep 17 00:00:00 2001 From: pandamicro Date: Wed, 26 Jul 2023 13:50:04 +0800 Subject: [PATCH 30/51] Fix circular dependencies --- cocos/render-scene/scene/reflection-probe.ts | 10 ++++----- cocos/rendering/custom/define.ts | 16 +++++++++----- .../global-descriptor-set-manager.ts | 3 +-- .../reflection-probe-stage.ts | 22 ++++++++++++++----- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/cocos/render-scene/scene/reflection-probe.ts b/cocos/render-scene/scene/reflection-probe.ts index 43bc0526fe0..9c794c75172 100644 --- a/cocos/render-scene/scene/reflection-probe.ts +++ b/cocos/render-scene/scene/reflection-probe.ts @@ -24,12 +24,11 @@ import { EDITOR } from 'internal:constants'; import { Camera, CameraAperture, CameraFOVAxis, CameraISO, CameraProjection, CameraShutter, CameraType, SKYBOX_FLAG, TrackingType } from './camera'; import { Node } from '../../scene-graph/node'; -import { Color, Quat, Rect, toRadian, Vec2, Vec3, geometry, cclegacy, Vec4 } from '../../core'; +import { Color, Quat, Rect, toRadian, Vec2, Vec3, geometry, cclegacy, Vec4, Size } from '../../core'; import { CAMERA_DEFAULT_MASK } from '../../rendering/define'; import { ClearFlagBit, Framebuffer } from '../../gfx'; import { TextureCube } from '../../asset/assets/texture-cube'; import { RenderTexture } from '../../asset/assets/render-texture'; -import { view } from '../../ui/view'; export enum ProbeClearFlag { SKYBOX = SKYBOX_FLAG | ClearFlagBit.DEPTH_STENCIL, @@ -309,7 +308,7 @@ export class ReflectionProbe { public renderPlanarReflection (sourceCamera: Camera): void { if (!sourceCamera) return; if (!this.realtimePlanarTexture) { - const canvasSize = view.getDesignResolutionSize(); + const canvasSize = cclegacy.view.getDesignResolutionSize() as Size; this.realtimePlanarTexture = this._createTargetTexture(canvasSize.width, canvasSize.height); cclegacy.internal.reflectionProbeManager.updatePlanarMap(this, this.realtimePlanarTexture.getGFXTexture()); } @@ -422,14 +421,13 @@ export class ReflectionProbe { private _createCamera (cameraNode: Node): Camera | null { const root = cclegacy.director.root; if (!this._camera) { - this._camera = (cclegacy.director.root).createCamera(); + this._camera = root.createCamera(); if (!this._camera) return null; this._camera.initialize({ name: cameraNode.name, node: cameraNode, projection: CameraProjection.PERSPECTIVE, - window: EDITOR ? cclegacy.director.root && cclegacy.director.root.mainWindow - : cclegacy.director.root && cclegacy.director.root.tempWindow, + window: EDITOR ? root && root.mainWindow : root && root.tempWindow, priority: 0, cameraType: CameraType.DEFAULT, trackingType: TrackingType.NO_TRACKING, diff --git a/cocos/rendering/custom/define.ts b/cocos/rendering/custom/define.ts index 21769f3a145..a2a983c9b3b 100644 --- a/cocos/rendering/custom/define.ts +++ b/cocos/rendering/custom/define.ts @@ -25,10 +25,15 @@ import { EDITOR } from 'internal:constants'; import { BufferInfo, Buffer, BufferUsageBit, ClearFlagBit, Color, DescriptorSet, LoadOp, Format, Rect, Sampler, StoreOp, Texture, Viewport, MemoryUsageBit, Filter, Address } from '../../gfx'; -import { - Camera, CSMLevel, DirectionalLight, Light, LightType, ProbeType, ReflectionProbe, - ShadowType, SKYBOX_FLAG, SpotLight, PointLight, RangedDirectionalLight, SphereLight, -} from '../../render-scene/scene'; +import { ProbeType, ReflectionProbe } from '../../render-scene/scene/reflection-probe'; +import { Camera, SKYBOX_FLAG } from '../../render-scene/scene/camera'; +import { CSMLevel, ShadowType } from '../../render-scene/scene/shadows'; +import { Light, LightType } from '../../render-scene/scene/light'; +import { DirectionalLight } from '../../render-scene/scene/directional-light'; +import { RangedDirectionalLight } from '../../render-scene/scene/ranged-directional-light'; +import { PointLight } from '../../render-scene/scene/point-light'; +import { SphereLight } from '../../render-scene/scene/sphere-light'; +import { SpotLight } from '../../render-scene/scene/spot-light'; import { supportsR32FloatTexture, supportsRGBA16HalfFloatTexture } from '../define'; import { BasicPipeline, Pipeline } from './pipeline'; import { @@ -45,7 +50,6 @@ import { DescriptorSetData } from './layout-graph'; import { AABB } from '../../core/geometry'; import { DebugViewCompositeType, DebugViewSingleType } from '../debug-view'; import { ReflectionProbeManager } from '../../3d/reflection-probe/reflection-probe-manager'; -import { director } from '../../game/director'; const _rangedDirLightBoundingBox = new AABB(0.0, 0.0, 0.0, 0.5, 0.5, 0.5); const _tmpBoundingBox = new AABB(); @@ -1049,7 +1053,7 @@ export function buildUIPass ( } export function updateCameraUBO (setter: any, camera: Readonly, ppl: Readonly): void { - const pipeline = director.root!.pipeline as WebPipeline; + const pipeline = cclegacy.director.root!.pipeline as WebPipeline; const sceneData = ppl.pipelineSceneData; const skybox = sceneData.skybox; setter.addConstant('CCCamera'); diff --git a/cocos/rendering/global-descriptor-set-manager.ts b/cocos/rendering/global-descriptor-set-manager.ts index aff3b5a0798..e0c2a27ef58 100644 --- a/cocos/rendering/global-descriptor-set-manager.ts +++ b/cocos/rendering/global-descriptor-set-manager.ts @@ -22,10 +22,9 @@ THE SOFTWARE. */ -import { cclegacy } from '../core'; import { Device, BufferUsageBit, MemoryUsageBit, BufferInfo, Filter, Address, Sampler, DescriptorSet, DescriptorSetInfo, Buffer, Texture, DescriptorSetLayoutInfo, DescriptorSetLayout, SamplerInfo } from '../gfx'; -import { Light } from '../render-scene/scene'; +import { Light } from '../render-scene/scene/light'; import { getDescBindingFromName, getDescriptorSetDataFromLayout } from './custom/define'; import { UBOShadow, globalDescriptorSetLayout, PipelineGlobalBindings, isEnableEffect } from './define'; diff --git a/cocos/rendering/reflection-probe/reflection-probe-stage.ts b/cocos/rendering/reflection-probe/reflection-probe-stage.ts index beacaacb375..1514374938d 100644 --- a/cocos/rendering/reflection-probe/reflection-probe-stage.ts +++ b/cocos/rendering/reflection-probe/reflection-probe-stage.ts @@ -29,7 +29,7 @@ import { ForwardStagePriority } from '../enum'; import { ForwardPipeline } from '../forward/forward-pipeline'; import { SetIndex } from '../define'; import { ReflectionProbeFlow } from './reflection-probe-flow'; -import { Camera, ProbeType, ReflectionProbe } from '../../render-scene/scene'; +import { Camera, ReflectionProbe } from '../../render-scene/scene'; import { RenderReflectionProbeQueue } from '../render-reflection-probe-queue'; import { Vec3 } from '../../core'; import { packRGBE } from '../../core/math/color'; @@ -90,8 +90,14 @@ export class ReflectionProbeStage extends RenderStage { const cmdBuff = pipeline.commandBuffers[0]; const renderPass = this._frameBuffer.renderPass; - cmdBuff.beginRenderPass(renderPass, this._frameBuffer, this._renderArea, - colors, camera.clearDepth, camera.clearStencil); + cmdBuff.beginRenderPass( + renderPass, + this._frameBuffer, + this._renderArea, + colors, + camera.clearDepth, + camera.clearStencil, + ); cmdBuff.endRenderPass(); } @@ -119,8 +125,14 @@ export class ReflectionProbeStage extends RenderStage { colors[0].w = rgbe.w; } const device = pipeline.device; - cmdBuff.beginRenderPass(renderPass, this._frameBuffer!, this._renderArea, - colors, this._probe!.camera.clearDepth, this._probe!.camera.clearStencil); + cmdBuff.beginRenderPass( + renderPass, + this._frameBuffer!, + this._renderArea, + colors, + this._probe!.camera.clearDepth, + this._probe!.camera.clearStencil, + ); cmdBuff.bindDescriptorSet(SetIndex.GLOBAL, pipeline.descriptorSet); this._probeRenderQueue.recordCommandBuffer(device, renderPass, cmdBuff); From 0d4e5497e242ddec11e960290d2579ee90eabde4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=A3=AE=E6=96=8C?= Date: Wed, 26 Jul 2023 17:25:33 +0800 Subject: [PATCH 31/51] [Bug] fix widget undo bug (#15741) * fix widget undo bug * next tick snapshot --- editor/inspector/components/widget.js | 28 ++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/editor/inspector/components/widget.js b/editor/inspector/components/widget.js index 2b6fafc7193..8c7b0b371a0 100644 --- a/editor/inspector/components/widget.js +++ b/editor/inspector/components/widget.js @@ -565,6 +565,12 @@ exports.methods = { this.$refs.summitProp.dispatch('change-dump'); }, + snapshot() { + // next tick snapshot + setTimeout(() => { + this.$refs.summitProp.dispatch('confirm-dump'); + }); + }, getUnit(type) { const data = this.dump.value; @@ -661,6 +667,7 @@ exports.methods = { const { dump } = update(this.dump, true); this.$refs.summitProp.dump = dump; this.$refs.summitProp.dispatch('change-dump'); + this.snapshot(); }, select(event) { @@ -892,7 +899,7 @@ exports.methods = { this.dimensionVertical = this.getDimensionVertical(); } - this.$refs.summitProp.dispatch('confirm-dump'); + this.snapshot(); }, toggleLock(direction) { @@ -931,6 +938,7 @@ exports.methods = { } this.$refs.summitProp.dispatch('change-dump'); + this.snapshot(); }, isLock(direction) { const lockValue = this.dump.value._lockFlags.value; @@ -1046,7 +1054,9 @@ const template = /* html*/` @@ -1065,6 +1075,7 @@ const template = /* html*/` :disabled="!dump.value.isAlignHorizontalCenter.value" :value="dump.value.editorHorizontalCenter.value" @change="change('editorHorizontalCenter', $event.target.value)" + @confirm="snapshot()" @unit-click="changeUnit('editorHorizontalCenter')"> @@ -1078,7 +1089,9 @@ const template = /* html*/` @@ -1121,7 +1134,9 @@ const template = /* html*/` @@ -1139,6 +1154,7 @@ const template = /* html*/` @@ -1153,7 +1169,9 @@ const template = /* html*/` From a9ffcad7ea774793e50a184f4d996c1bade09317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=A3=AE=E6=96=8C?= Date: Wed, 26 Jul 2023 17:26:01 +0800 Subject: [PATCH 32/51] =?UTF-8?q?[Bug]=20when=20editor=20change=20language?= =?UTF-8?q?=EF=BC=8Cupdate=20fbx=20editing=20interface=20(#15762)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * when editor change language,update fbx editing interface * update --- editor/inspector/assets/fbx/model.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/editor/inspector/assets/fbx/model.js b/editor/inspector/assets/fbx/model.js index 63c6561fb2a..6fac16493b2 100644 --- a/editor/inspector/assets/fbx/model.js +++ b/editor/inspector/assets/fbx/model.js @@ -889,6 +889,27 @@ const Elements = { }, }, // lods end + // when lang change + i18n: { + ready() { + const panel = this; + + Elements.i18n.changeBind = Elements.i18n.change.bind(panel); + Editor.Message.addBroadcastListener('i18n:change', Elements.i18n.changeBind); + }, + close() { + Editor.Message.removeBroadcastListener('i18n:change', Elements.i18n.changeBind); + Elements.i18n.changeBind = undefined; + }, + change() { + const panel = this; + + Elements.normals.update.call(panel); + Elements.tangents.update.call(panel); + Elements.morphNormals.update.call(panel); + Elements.meshOptimizerAlgorithm.update.call(panel); + }, + }, }; exports.methods = { From 30061b151dafb76ec940f2f3d08d5266630f0528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=85=B5?= <49358166+xubing0906@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:59:31 +0800 Subject: [PATCH 33/51] reflectionprobe manager add function for users (#15824) --- .../reflection-probe-component.ts | 18 +++++++------ .../reflection-probe-manager.ts | 26 +++++++++++++++---- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/cocos/3d/reflection-probe/reflection-probe-component.ts b/cocos/3d/reflection-probe/reflection-probe-component.ts index dcd2f840c9a..2f3c06e53d6 100644 --- a/cocos/3d/reflection-probe/reflection-probe-component.ts +++ b/cocos/3d/reflection-probe/reflection-probe-component.ts @@ -326,12 +326,14 @@ export class ReflectionProbe extends Component { ReflectionProbeManager.probeManager.onUpdateProbes(true); this._probe.enable(); } + this.node.on(Node.EventType.TRANSFORM_CHANGED, this._onProbeTransformChanged, this); } onDisable (): void { if (this._probe) { ReflectionProbeManager.probeManager.unregister(this._probe); this._probe.disable(); } + this.node.off(Node.EventType.TRANSFORM_CHANGED, this._onProbeTransformChanged); } public start (): void { @@ -363,14 +365,6 @@ export class ReflectionProbe extends Component { } } } - - if (this.node.hasChangedFlags) { - this.probe.updateBoundingBox(); - } - if (this.node.hasChangedFlags & TransformBit.POSITION) { - ReflectionProbeManager.probeManager.onUpdateProbes(true); - ReflectionProbeManager.probeManager.updateProbeData(); - } } if (this.probeType === ProbeType.PLANAR && this.sourceCamera) { if ((this.sourceCamera.node.hasChangedFlags & TransformBit.TRS) @@ -391,6 +385,14 @@ export class ReflectionProbe extends Component { ReflectionProbeManager.probeManager.updatePreviewSphere(this.probe); } + private _onProbeTransformChanged (type: TransformBit): void { + this.probe.updateBoundingBox(); + if (type & Node.TransformBit.POSITION) { + ReflectionProbeManager.probeManager.onUpdateProbes(true); + ReflectionProbeManager.probeManager.updateProbeData(); + } + } + private _createProbe (): void { if (this._probeId === -1 || ReflectionProbeManager.probeManager.exists(this._probeId)) { this._probeId = ReflectionProbeManager.probeManager.getNewReflectionProbeId(); diff --git a/cocos/3d/reflection-probe/reflection-probe-manager.ts b/cocos/3d/reflection-probe/reflection-probe-manager.ts index 9b114aff0f4..88dc20c07d3 100644 --- a/cocos/3d/reflection-probe/reflection-probe-manager.ts +++ b/cocos/3d/reflection-probe/reflection-probe-manager.ts @@ -86,7 +86,7 @@ export class ReflectionProbeManager { if (!scene || !scene.renderScene) { return; } - const models = scene.renderScene.models; + const models = scene.renderScene.models as Model[]; for (let i = 0; i < models.length; i++) { const model = models[i]; if (!model.node) continue; @@ -106,7 +106,7 @@ export class ReflectionProbeManager { if (!scene || !scene.renderScene) { return; } - const models = scene.renderScene.models; + const models = scene.renderScene.models as Model[]; for (let i = 0; i < models.length; i++) { const model = models[i]; if (!model.node) continue; @@ -441,6 +441,22 @@ export class ReflectionProbeManager { return null; } + /** + * @en Set reflection probe used by the model. + * @zh 手动设置模型使用的反射探针。 + * @param model set the probe for this model + * @param probe reflection probe to be set + * @param blendProbe reflection probe for blend + */ + public setReflectionProbe (model: Model, probe: ReflectionProbe, blendProbe: ReflectionProbe | null = null): void { + if (!probe) return; + this._useCubeModels.set(model, probe); + this._updateCubemapOfModel(model, probe); + if (blendProbe) { + this._updateBlendProbeInfo(model, probe, blendProbe); + } + } + /** * @en * select the probe with the nearest distance. @@ -535,7 +551,8 @@ export class ReflectionProbeManager { if (probe) { meshRender.updateReflectionProbeDataMap(this._dataTexture); if (this._isUsedBlending(model)) { - this._updateBlendProbeInfo(model, probe); + const blendProbe = this._getBlendProbe(model); + this._updateBlendProbeInfo(model, probe, blendProbe); } } } @@ -559,7 +576,7 @@ export class ReflectionProbeManager { return false; } - private _updateBlendProbeInfo (model: Model, probe: ReflectionProbe): void { + private _updateBlendProbeInfo (model: Model, probe: ReflectionProbe, blendProbe: ReflectionProbe | null): void { const node = model.node; if (!node) { return; @@ -568,7 +585,6 @@ export class ReflectionProbeManager { if (!meshRender) { return; } - const blendProbe = this._getBlendProbe(model); if (blendProbe) { meshRender.updateReflectionProbeBlendId(blendProbe.getProbeId()); meshRender.updateProbeBlendCubemap(blendProbe.cubemap); From cd90419f2e453872f60877bf66ccd8a8d294f265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=A3=AE=E6=96=8C?= Date: Wed, 26 Jul 2023 18:00:51 +0800 Subject: [PATCH 34/51] fix editing fbx animation events interface bug (#15718) * fix the bug of changing select fbx, the preview interface did not update * fix editing fbx animation events interface bug --- .../assets/fbx/event-editor/editor.js | 70 ++++++++------ .../assets/fbx/event-editor/event-item.js | 27 +----- .../assets/fbx/event-editor/index.js | 15 ++- editor/inspector/assets/fbx/events/events.js | 95 +++++++------------ editor/inspector/assets/fbx/events/index.js | 95 +++++++++++++++---- editor/inspector/assets/fbx/preview.js | 63 ++++++++---- 6 files changed, 212 insertions(+), 153 deletions(-) diff --git a/editor/inspector/assets/fbx/event-editor/editor.js b/editor/inspector/assets/fbx/event-editor/editor.js index ecf08c083d8..a7f3af354d0 100644 --- a/editor/inspector/assets/fbx/event-editor/editor.js +++ b/editor/inspector/assets/fbx/event-editor/editor.js @@ -6,15 +6,15 @@ const eventItem = require('./event-item'); exports.template = `
- - + +
:index="index" :key="index" @update="updateValue" + @delete="deleteValue" >
@@ -50,8 +51,8 @@ exports.data = function() { dirty: false, debounceSave: null, // time value - frame: 0, - RealFrame: 0, + frame: -1, + RealFrame: -1, show: false, }; }; @@ -71,26 +72,27 @@ exports.methods = { that.showToast(Editor.I18n.t('animator.event.enter_func_name')); return; } - that.value.push({ - func: that.newFuncName, - params: [], - frame: that.frame, + that.$emit('addFunc', that.frame, that.newFuncName); + setTimeout(() => { + that.newFuncName = ''; }); - that.dirty = true; - that.debounceSave(); }, updateValue(eventInfo, index) { const that = this; - if (!eventInfo) { - that.value.splice(index, 1); - } else { - that.value[index] = eventInfo; - } + that.value[index] = eventInfo; that.dirty = true; that.debounceSave(); }, + deleteValue(index) { + const that = this; + const eventInfo = that.value[index]; + if (eventInfo) { + that.$emit('delFunc', eventInfo.frame, eventInfo); + } + }, + showToast(msg, time = 800) { const that = this; if (that.toast) { @@ -106,23 +108,37 @@ exports.methods = { }, time); }, - async saveData() { + saveData() { const that = this; - that.$emit('update', that.frame, that.value); + that.$emit('update', that.value); that.dirty = false; }, - refresh() { + refresh(events) { const that = this; - let data = that.events.filter((item) => { - return item.frame === that.frame; - }); - if (data.length < 1) { - that.value = []; - return; + const infos = []; + + if (Array.isArray(events)) { + if (!events.length) { + this.frame = -1; + } + + events.forEach((item) => { + if (item.info.frame === that.frame) { + infos.push(item.info); + } + }); } - that.value = JSON.parse(JSON.stringify(data)); - that.newFuncName = ''; + + that.value = infos; + that.show = !!infos.length; + + }, + hide() { + this.$emit('hide'); + }, + unselect() { + this.show = false; }, }; diff --git a/editor/inspector/assets/fbx/event-editor/event-item.js b/editor/inspector/assets/fbx/event-editor/event-item.js index 65c525958cb..88865cd5e69 100644 --- a/editor/inspector/assets/fbx/event-editor/event-item.js +++ b/editor/inspector/assets/fbx/event-editor/event-item.js @@ -80,16 +80,6 @@ exports.props = [ 'index', ]; -exports.computed = { - selectEvent() { - const that = this; - if (!that.selectInfo) { - return null; - } - return that.selectInfo.data; - }, -}; - exports.methods = { onConfirm(event) { const that = this; @@ -126,27 +116,20 @@ exports.methods = { const that = this; const name = event.target.getAttribute('name'); let index = event.target.getAttribute('index'); - const eventInfo = that.event; - let dirty = false; switch (name) { case 'delFunc': - that.$emit('update', null, that.index); + that.$emit('delete', that.index); return; case 'addParams': - dirty = true; - eventInfo.params.splice(eventInfo.params.length - 1, 0, 'param'); + that.event.params.splice(that.event.params.length - 1, 0, 'param'); break; case 'delParams': - dirty = true; - eventInfo.params.splice(index, 1); + that.event.params.splice(index, 1); break; case 'clearParams': - if (eventInfo.params.length) { - dirty = true; - eventInfo.params = []; - } + that.event.params = []; break; } - dirty && that.$emit('update', that.event, that.index); + that.$emit('update', that.event, that.index); }, }; diff --git a/editor/inspector/assets/fbx/event-editor/index.js b/editor/inspector/assets/fbx/event-editor/index.js index 1e549ac1983..c15d4562a38 100644 --- a/editor/inspector/assets/fbx/event-editor/index.js +++ b/editor/inspector/assets/fbx/event-editor/index.js @@ -14,8 +14,19 @@ exports.ready = function() { components: eventEditor.components, mounted: eventEditor.mounted, }); - this.eventEditorVm.$on('update', (frame, eventInfos) => { - this.events.updateEventInfo.call(this, frame, eventInfos); + this.eventEditorVm.$on('update', (eventInfos) => { + this.events.updateEventInfo.call(this, eventInfos); + }); + + this.eventEditorVm.$on('addFunc', (frame, newFuncName) => { + this.events.addEvent.call(this, frame, newFuncName); + }); + + this.eventEditorVm.$on('delFunc', (frame, eventInfo) => { + this.events.delEvent.call(this, frame, eventInfo); + }); + this.eventEditorVm.$on('hide', (frame, eventInfo) => { + this.events.unselect.call(this, frame, eventInfo); }); }; diff --git a/editor/inspector/assets/fbx/events/events.js b/editor/inspector/assets/fbx/events/events.js index 8d476c3a8c6..71bc60abc97 100644 --- a/editor/inspector/assets/fbx/events/events.js +++ b/editor/inspector/assets/fbx/events/events.js @@ -4,25 +4,16 @@ exports.template = /* html */`
-
@@ -31,18 +22,7 @@ exports.template = /* html */` exports.data = { events: [], offset: 0, - selectEvent: [], - eventEditorInfo: { - frame: 0, - events: [{ - func: '', - params: [], - frame: 0, - }], - }, - selectInfo: { - frames: [], - }, + frame: -1, }; exports.methods = { @@ -53,45 +33,40 @@ exports.methods = { onPopMenu(event, eventInfo) { const that = this; const menu = [{ - label: Editor.I18n.t(`animator.event.edit`), - click() { - that.openEventEditor(eventInfo); - }, - }, { label: Editor.I18n.t(`animator.event.delete`), click() { that.$emit('del', eventInfo); }, - }, - ]; + }]; Editor.Menu.popup({ - x: event.pageX, - y: event.pageY, menu, }); }, - onMouseDown(event, info) { + onMouseDown(event, item) { const that = this; event.stopPropagation(); - const data = JSON.parse(JSON.stringify(info)); - let selectIndex = that.selectInfo && that.selectInfo.frames.indexOf(info.frame); - if (typeof selectIndex !== 'number' || selectIndex === -1) { - that.selectInfo = { - startX: event.x, - data: [data], - offset: 0, - offsetFrame: 0, - frames: [info.frame], - }; - } else { - that.selectInfo.startX = event.x; + this.frame = item.info.frame; + + const clientX = event.clientX; + const startX = item.x; + function mousemove(event) { + const timelineX = startX + (event.clientX - clientX); + that.$emit('move', item, timelineX); + } + + function mouseup() { + that.$emit('moveEnd', item); + document.removeEventListener('mousemove', mousemove); + document.removeEventListener('mouseup', mouseup); } + document.addEventListener('mousemove', mousemove); + document.addEventListener('mouseup', mouseup); }, openEventEditor(eventInfo) { - // HACK 目前的事件帧会有重复关键帧重叠的情况 - this.selectInfo.frames = [eventInfo.frame]; + // 目前的事件帧会有重复关键帧重叠的情况 + this.frame = eventInfo.frame; this.$emit('edit', eventInfo); }, @@ -99,17 +74,15 @@ exports.methods = { return `transform: translateX(${x || 0}px);`; }, - onDomMouseDown() { - this.selectInfo = { - frames: [], - }; + refresh(eventInfos) { + this.events = eventInfos; + if (!eventInfos.some((item) => item.info.frame === this.frame)) { + this.unselect(); + } }, -}; -exports.mounted = function() { - document.addEventListener('mousedown', this.onDomMouseDown); + unselect() { + this.frame = -1; + }, }; -exports.beforeDestroy = function() { - document.removeEventListener('mousedown', this.onDomMouseDown); -}; diff --git a/editor/inspector/assets/fbx/events/index.js b/editor/inspector/assets/fbx/events/index.js index 29e11f4c141..18e64467ee2 100644 --- a/editor/inspector/assets/fbx/events/index.js +++ b/editor/inspector/assets/fbx/events/index.js @@ -20,11 +20,9 @@ exports.ready = function() { if (this.checkDisabledEditEvent()) { return; } - this.eventEditorVm.events = this.eventVm.events; this.eventEditorVm.frame = eventInfo.frame; this.eventEditorVm.RealFrame = Math.round(eventInfo && eventInfo.frame * this.curEditClipInfo.fps || 0); - this.eventEditorVm.refresh(); - this.eventEditorVm.show = true; + this.eventEditorVm.refresh(this.eventVm.events); }); this.eventVm.$on('del', (eventInfo) => { if (this.checkDisabledEditEvent()) { @@ -32,10 +30,26 @@ exports.ready = function() { } this.events.delEvent.call(this, eventInfo.frame); }); + + this.eventVm.$on('move', (eventItem, timelineX) => { + if (this.checkDisabledEditEvent()) { + return; + } + this.events.moveEvent.call(this, eventItem, timelineX); + }); + + this.eventVm.$on('moveEnd', (eventItem) => { + if (this.checkDisabledEditEvent()) { + return; + } + this.eventVm.openEventEditor(eventItem.info); + this.dispatch('snapshot'); + }); }; -exports.update = function(eventInfo) { - this.eventVm.events = eventInfo; +exports.update = function(eventInfos) { + this.eventVm.refresh(eventInfos); + this.eventEditorVm.refresh(eventInfos); }; exports.apply = async function() { @@ -52,45 +66,84 @@ exports.apply = async function() { this.events.eventsMap = {}; }; -exports.addNewEvent = function(time) { +exports.addEvent = function(time, newFuncName = '') { const newInfo = { + // 注意: frame 是时间 frame: time, - func: '', + func: newFuncName, params: [], }; + const userData = this.curEditClipInfo.userData; if (!userData.events) { userData.events = [newInfo]; } else { - userData.events.push(newInfo); - userData.events.sort((a, b) => a.frame - b.frame); + // 已经存在空记录 + if (!newFuncName && userData.events.some(event => event.frame === time && event.func === newFuncName)) { + return; + } + + let exist = false; + for (const event of userData.events) { + if (event.frame === time && event.func === '') { + event.func = newFuncName; + exist = true; + break; + } + } + + if (!exist) { + userData.events.push(newInfo); + userData.events.sort((a, b) => a.frame - b.frame); + } } - this.events.eventsMap[this.curEditClipInfo.clipUUID] = userData.events; + this.updateEventInfo(); this.dispatch('change'); this.dispatch('snapshot'); + + this.eventVm.openEventEditor(newInfo); }; -exports.delEvent = function(time) { +exports.delEvent = function(frame, info) { const userData = this.curEditClipInfo.userData; - userData.events = userData.events.filter((item) => item.frame !== time); - this.events.eventsMap[this.curEditClipInfo.clipUUID] = userData.events; + if (info) { + userData.events = userData.events.filter((item) => item !== info); + } else { + // 删除多个 + userData.events = userData.events.filter((item) => item.frame !== frame); + } + this.updateEventInfo(); this.dispatch('change'); this.dispatch('snapshot'); }; -exports.updateEventInfo = function(time, eventInfos) { +exports.moveEvent = function(eventItem, timelineX) { + const frame = Math.min(this.$.animationTime._config.max, Math.max(0, Math.round(this.$.animationTime.pixelToValue(timelineX)))); + + eventItem.info.frame = frame / this.curEditClipInfo.fps; + eventItem.x = this.$.animationTime.valueToPixel(frame); + + this.dispatch('change'); +}; + +exports.unselect = function() { + this.eventVm.unselect(); + this.eventEditorVm.unselect(); +}; + +exports.updateEventInfo = function(eventInfos) { const userData = this.curEditClipInfo.userData; - let newEvents = []; - if (userData.events) { - newEvents = userData.events.filter((item) => item.frame !== time); + if (userData && userData.events && Array.isArray(eventInfos)) { + eventInfos.forEach((eventInfo) => { + if (!userData.events.includes(eventInfo)) { + userData.events.push(eventInfo); + } + }); } - newEvents.push(...eventInfos); - userData.events = newEvents; - this.events.eventsMap[this.curEditClipInfo.clipUUID] = newEvents; this.updateEventInfo(); this.dispatch('change'); - this.dispatch('update'); + this.dispatch('snapshot'); }; diff --git a/editor/inspector/assets/fbx/preview.js b/editor/inspector/assets/fbx/preview.js index 0937b7c346e..8b4fed5d2bb 100644 --- a/editor/inspector/assets/fbx/preview.js +++ b/editor/inspector/assets/fbx/preview.js @@ -27,7 +27,7 @@ exports.template = /* html */`
- +
@@ -168,6 +168,7 @@ ui-icon { background: var(--color-normal-fill); } #event-editor { + position: relative; line-height: 20px; width: 100%; height: 70%; @@ -186,6 +187,9 @@ ui-icon { background: var(--color-normal-fill-emphasis); padding: 2px 4px; } + #event-editor > header .title { + color: var(--color-focus-fill); + } #event-editor > .header .name { margin: 0 4px; } @@ -194,7 +198,6 @@ ui-icon { margin: 0 2px; } #event-editor > .functions { - padding: 4px; overflow-y: auto; flex: 1; height: 100%; @@ -234,6 +237,7 @@ ui-icon { #event-editor ui-checkbox, #event-editor ui-num-input { flex: 1; + margin-left: 4px; } #event-editor ui-section { width: 100%; @@ -259,6 +263,15 @@ ui-icon { font-style: italic; text-align: center; } + #event-editor .toast { + position: absolute; + top: 54px; + right: 4px; + z-index: 1; + padding: 0 4px; + background-color: var(--color-normal-fill-emphasis); + color: var(--color-warn-fill); + } `; exports.$ = { @@ -484,7 +497,11 @@ exports.methods = { async onTabChanged(activeTab) { if (typeof activeTab === 'string') { this.activeTab = activeTab; - this.$.animationInfo.style.display = this.activeTab === 'animation' ? 'block' : 'none'; + const isAnimationTab = this.activeTab === 'animation'; + this.$.animationInfo.style.display = isAnimationTab ? 'block' : 'none'; + if (!isAnimationTab) { + this.eventEditorVm.show = false; + } this.$.modelInfo.style.display = this.activeTab === 'model' ? 'block' : 'none'; await this.stopAnimation(); } @@ -534,19 +551,22 @@ exports.methods = { }, addEventToCurTime() { - this.events.addNewEvent.call(this, this.$.animationTime.value / this.curEditClipInfo.fps); + this.events.addEvent.call(this, this.$.animationTime.value / this.curEditClipInfo.fps); }, updateEventInfo() { let eventInfos = []; - const events = this.curEditClipInfo.userData.events; - if (Array.isArray(events)) { - eventInfos = events.map((info) => { - return { - ...info, - x: this.$.animationTime.valueToPixel(info.frame * this.curEditClipInfo.fps), - }; - }); + + if (this.curEditClipInfo && this.curEditClipInfo.userData) { + const events = this.curEditClipInfo.userData.events; + if (Array.isArray(events)) { + eventInfos = events.map((info) => { + return { + info, + x: this.$.animationTime.valueToPixel(info.frame * this.curEditClipInfo.fps), + }; + }); + } } this.events.update.call(this, eventInfos); @@ -633,22 +653,16 @@ exports.methods = { }, async setCurEditClipInfo(clipInfo) { this.curEditClipInfo = clipInfo; + this.curTotalFrames = 0; if (clipInfo) { this.curTotalFrames = Math.round(clipInfo.duration * clipInfo.fps); - this.$.animationTime.setConfig({ - max: this.curTotalFrames, - }); - this.$.duration.innerHTML = `Duration: ${this.curTotalFrames}`; + // update animation events, clipInfo.clipUUID may be undefined if (clipInfo.clipUUID) { const subId = clipInfo.clipUUID.match(/@(.*)/)[1]; this.curEditClipInfo.userData = this.meta.subMetas[subId] && this.meta.subMetas[subId].userData || {}; - this.updateEventInfo(); } - if (this.$.animationTimeSlider) { - this.$.animationTimeSlider.max = this.curTotalFrames; - } await callModelPreviewFunction( 'setPlaybackRange', clipInfo.from, @@ -665,6 +679,12 @@ exports.methods = { await this.stopAnimation(); } + + this.$.animationTime.setConfig({ + max: this.curTotalFrames, + }); + this.$.duration.innerHTML = `Totals: ${this.curTotalFrames}`; + this.updateEventInfo(); }, onAnimationPlayStateChanged(state) { this.setCurPlayState(state); @@ -757,7 +777,10 @@ exports.update = async function(assetList, metaList) { this.splitClipIndex = 0; const clipInfo = animation.methods.getCurClipInfo.call(this); await this.onEditClipInfoChanged(clipInfo); + } else { + await this.setCurEditClipInfo(); } + this.eventEditorVm.show = false; this.setCurPlayState(PLAY_STATE.STOP); this.isPreviewDataDirty = true; this.refreshPreview(); From f20bf8ce110a04c69489f3f392f7e423a57f7b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=85=B5?= <49358166+xubing0906@users.noreply.github.com> Date: Fri, 28 Jul 2023 16:24:35 +0800 Subject: [PATCH 35/51] init reflection probe id with native engine (#15829) --- native/cocos/scene/Model.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/cocos/scene/Model.h b/native/cocos/scene/Model.h index 07b953f6910..7085d355383 100644 --- a/native/cocos/scene/Model.h +++ b/native/cocos/scene/Model.h @@ -298,7 +298,7 @@ class Model : public RefCounted { Vec3 _lastWorldBoundCenter{INFINITY, INFINITY, INFINITY}; - Vec4 _shadowBias; + Vec4 _shadowBias{0.F, 0.F, -1.F, -1.F}; Vec4 _lightmapUVParam; // For JS From 44795e465ff034d3b51338f70f7b538f405db2f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leslie=20Leigh=20=28=E6=9D=8E=E7=9A=84=E5=BA=8F=29?= Date: Mon, 31 Jul 2023 10:54:17 +0800 Subject: [PATCH 36/51] Workflow: fix interface check workflow comment (#15795) --- .../web-interface-check-pr-comment.yml | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/web-interface-check-pr-comment.yml b/.github/workflows/web-interface-check-pr-comment.yml index ec549062ed7..79816558b63 100644 --- a/.github/workflows/web-interface-check-pr-comment.yml +++ b/.github/workflows/web-interface-check-pr-comment.yml @@ -14,14 +14,29 @@ jobs: if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - - name: Download artifacts + - name: 'Get source run informations' + uses: potiuk/get-workflow-origin@v1_1 + id: source_run_info + with: + token: ${{ secrets.GITHUB_TOKEN }} + sourceRunId: ${{ github.event.workflow_run.id }} + + - name: 'Debug' + run: | + Write-Host "Source PR Number: ${{ github.event.workflow_run.pull_requests[0].number }}" + shell: pwsh + + - name: Download artifacts env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} RUN_ID: ${{ github.event.workflow_run.id }} run: | - gh run download -R "${{ github.repository }}" --name "interface-diff.txt" "$RUN_ID" + gh run download -R "${{ github.repository }}" --name "interface-diff.txt" "$RUN_ID" + - name: Post interface-diff.txt as comment uses: marocchino/sticky-pull-request-comment@v2 with: - path: interface-diff.txt - number: ${{ github.event.workflow_run.pull_requests[0].number }} \ No newline at end of file + path: interface-diff.txt + number: ${{ steps.source_run_info.outputs.pullRequestNumber }} + # The following matters, see: https://github.com/orgs/community/discussions/25220 + # number: ${{ github.event.workflow_run.pull_requests[0].number }} \ No newline at end of file From 75add41002db8be9ea1f9dcf8553a343bf92a43d Mon Sep 17 00:00:00 2001 From: PP Date: Mon, 31 Jul 2023 11:33:59 +0800 Subject: [PATCH 37/51] fix: asm.js subpackage without spine module (#15822) # Conflicts: # pal/wasm/wasm-minigame.ts --- pal/wasm/wasm-minigame.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pal/wasm/wasm-minigame.ts b/pal/wasm/wasm-minigame.ts index a7527f15235..cd5e2c88f06 100644 --- a/pal/wasm/wasm-minigame.ts +++ b/pal/wasm/wasm-minigame.ts @@ -26,6 +26,7 @@ import { HUAWEI, TAOBAO_MINIGAME, WASM_SUBPACKAGE, XIAOMI } from 'internal:const import { minigame } from 'pal/minigame'; import { basename } from '../../cocos/core/utils/path'; import { checkPalIntegrity, withImpl } from '../integrity-check'; +import { log } from '../../cocos/core/platform/debug'; export function instantiateWasm (wasmUrl: string, importObject: WebAssembly.Imports): Promise { return getPlatformBinaryUrl(wasmUrl).then((url) => WebAssembly.instantiate(url, importObject)); @@ -55,7 +56,8 @@ function loadSubpackage (name: string): Promise { resolve(); }, fail (err) { - reject(err); + log(`Load subpacakge '${name}' failed, maybe we don't need this subpacakge or it's an engine build issue, for detailed: `, err); + resolve(); }, }); } else { From da25afce01596081b9df6cc8af0082e7b68da745 Mon Sep 17 00:00:00 2001 From: bofeng-song Date: Mon, 31 Jul 2023 11:34:43 +0800 Subject: [PATCH 38/51] Modify compileType's default value to minigame (#15815) --- templates/taobao-mini-game/mini.project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/taobao-mini-game/mini.project.json b/templates/taobao-mini-game/mini.project.json index c0457aca825..9dd8e2c19d2 100644 --- a/templates/taobao-mini-game/mini.project.json +++ b/templates/taobao-mini-game/mini.project.json @@ -1,7 +1,7 @@ { "miniprogramRoot": "client", "pluginRoot": "widget", - "compileType": "plugin", + "compileType": "minigame", "enableAppxNg": true, "widgetRuntimeVersion": "3.0-vue" } From 715d5d11b943e43e3c3f4c511e78604a1674cb16 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 31 Jul 2023 11:36:12 +0800 Subject: [PATCH 39/51] fixed scene._instantiate on native platforms. (#15771) * fixed scene._instantiate/updateWorldTransform on native platforms. --- cocos/scene-graph/scene.jsb.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cocos/scene-graph/scene.jsb.ts b/cocos/scene-graph/scene.jsb.ts index 2b94ca35c48..65365bda651 100644 --- a/cocos/scene-graph/scene.jsb.ts +++ b/cocos/scene-graph/scene.jsb.ts @@ -138,5 +138,7 @@ sceneProto._activate = function (active: boolean) { } }; +sceneProto._instantiate = function(): void {}; + // handle meta data, it is generated automatically patch_cc_Scene({Scene, SceneGlobals}); From 45926d262c0125bb801ab674ad3de68122e1ff6d Mon Sep 17 00:00:00 2001 From: jk20012001 Date: Mon, 31 Jul 2023 14:12:30 +0800 Subject: [PATCH 40/51] fix shader lighting flow (#15833) * fix shader lighting flow * code --- editor/assets/chunks/common/math/number.chunk | 7 +++++++ .../data-structures/lighting-result.chunk | 1 + .../lighting-models/lighting-flow/common-flow.chunk | 3 ++- .../chunks/surfaces/data-structures/standard.chunk | 13 +++++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/editor/assets/chunks/common/math/number.chunk b/editor/assets/chunks/common/math/number.chunk index 843fa2ba750..f4a840be943 100644 --- a/editor/assets/chunks/common/math/number.chunk +++ b/editor/assets/chunks/common/math/number.chunk @@ -52,6 +52,13 @@ float rand(vec2 seeds_zero_to_one) { return fract(sin(dot(seeds_zero_to_one.xy, vec2(12.9898, 78.233))) * 43758.5453); } +// like smoothstep, but it's linear interpolation +float linearstep(float minValue, float maxValue, float value) { return saturate((value - minValue) / (maxValue - minValue)); } +vec2 linearstep(vec2 minValue, vec2 maxValue, vec2 value) { return saturate((value - minValue) / (maxValue - minValue)); } +vec3 linearstep(vec3 minValue, vec3 maxValue, vec3 value) { return saturate((value - minValue) / (maxValue - minValue)); } +vec4 linearstep(vec4 minValue, vec4 maxValue, vec4 value) { return saturate((value - minValue) / (maxValue - minValue)); } + + #if __VERSION__ <= 100 mat4 transpose(mat4 v) { mat4 tmp; diff --git a/editor/assets/chunks/lighting-models/data-structures/lighting-result.chunk b/editor/assets/chunks/lighting-models/data-structures/lighting-result.chunk index d6310b378a2..fd148768dde 100644 --- a/editor/assets/chunks/lighting-models/data-structures/lighting-result.chunk +++ b/editor/assets/chunks/lighting-models/data-structures/lighting-result.chunk @@ -44,4 +44,5 @@ struct LightingResultPerLayer vec3 diffuseColorWithLighting, specularColorWithLighting; vec3 directDiffuse, directSpecular, directGF; vec3 environmentDiffuse, environmentSpecular, environmentGF; + vec3 directSubLayerF, environmentSubLayerF; }*/ diff --git a/editor/assets/chunks/lighting-models/lighting-flow/common-flow.chunk b/editor/assets/chunks/lighting-models/lighting-flow/common-flow.chunk index ad2dc2efcae..4bce62ff3eb 100644 --- a/editor/assets/chunks/lighting-models/lighting-flow/common-flow.chunk +++ b/editor/assets/chunks/lighting-models/lighting-flow/common-flow.chunk @@ -19,7 +19,8 @@ vec3 diff; SurfacesMaterialData surfaceData2ndSpecular; CCSurfacesGetSurfacesMaterialData2ndSpecular(surfaceData2ndSpecular, surfaceData); - CCSurfacesLightingInitializeColorWithLighting(diff, lightingResultAccumulated.specularColorWithLighting2ndSpecular, surfaceData2ndSpecular, lightingData); + CCSurfacesLightingInitializeColorWithLighting(diff, lightingResult.specularColorWithLighting2ndSpecular, surfaceData2ndSpecular, lightingData); + lightingResultAccumulated.specularColorWithLighting2ndSpecular = lightingResult.specularColorWithLighting2ndSpecular; #endif int numLights = CC_PIPELINE_TYPE == CC_PIPELINE_TYPE_FORWARD ? LIGHTS_PER_PASS : int(cc_lightDir[0].w); diff --git a/editor/assets/chunks/surfaces/data-structures/standard.chunk b/editor/assets/chunks/surfaces/data-structures/standard.chunk index fd8f052538a..a45f0309095 100644 --- a/editor/assets/chunks/surfaces/data-structures/standard.chunk +++ b/editor/assets/chunks/surfaces/data-structures/standard.chunk @@ -44,3 +44,16 @@ struct SurfacesMaterialData vec4 sssParams; #endif }; + +/* +struct SurfacesMaterialDataPerLayer +{ + vec3 baseColor, layerColoration; + float intensity, roughness, metallic; + vec3 worldNormal, worldTangent, worldBinormal; + #if CC_SURFACES_LIGHTING_ANISOTROPIC + float anisotropyShape; + #endif + float ior, opacity; +} +*/ \ No newline at end of file From d73096a1c5d5e19513a69e830aa300268fed1ea1 Mon Sep 17 00:00:00 2001 From: bofeng-song Date: Mon, 31 Jul 2023 14:13:03 +0800 Subject: [PATCH 41/51] Fix the problem of noise when playing web audio for more than 5 minutes. (#15807) * Fix the problem of noise when playing web audio for more than 5 minutes. --- pal/audio/minigame/player-web.ts | 3 +++ pal/audio/web/player-web.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pal/audio/minigame/player-web.ts b/pal/audio/minigame/player-web.ts index 5d972be780c..869da1306cb 100644 --- a/pal/audio/minigame/player-web.ts +++ b/pal/audio/minigame/player-web.ts @@ -81,6 +81,7 @@ export class OneShotAudioWeb { this._bufferSourceNode.onended = null; // stop will call ended callback audioBufferManager.tryReleasingCache(this._url); this._bufferSourceNode.stop(); + this._bufferSourceNode.disconnect(); this._bufferSourceNode.buffer = null; } } @@ -278,7 +279,9 @@ export class AudioPlayerWeb implements OperationQueueable { if (this._sourceNode) { this._sourceNode.onended = null; // stop will call ended callback this._sourceNode.stop(); + this._sourceNode.disconnect(); this._sourceNode.buffer = null; + this._sourceNode = undefined; } } catch (e) { // sourceNode can't be stopped twice, especially on Safari. diff --git a/pal/audio/web/player-web.ts b/pal/audio/web/player-web.ts index 7b7a0bc1d5f..5d703d35d63 100644 --- a/pal/audio/web/player-web.ts +++ b/pal/audio/web/player-web.ts @@ -206,6 +206,7 @@ export class OneShotAudioWeb { clearTimeout(this._currentTimer); audioBufferManager.tryReleasingCache(this._url); this._bufferSourceNode.stop(); + this._bufferSourceNode.disconnect(); this._bufferSourceNode.buffer = null; } } @@ -438,7 +439,9 @@ export class AudioPlayerWeb implements OperationQueueable { try { if (this._sourceNode) { this._sourceNode.stop(); + this._sourceNode.disconnect(); this._sourceNode.buffer = null; + this._sourceNode = undefined; } } catch (e) { // sourceNode can't be stopped twice, especially on Safari. From 74872602b9df40d08540a44ab1bf02400ccc62fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leslie=20Leigh=20=28=E6=9D=8E=E7=9A=84=E5=BA=8F=29?= Date: Mon, 31 Jul 2023 14:19:28 +0800 Subject: [PATCH 42/51] Eslint: fix indent rule for decorators (#15735) --- .eslintrc.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 6b0db3f8be9..839c15e7fa4 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -70,7 +70,14 @@ rules: import/extensions: off # typescript doesn't support this import/no-unresolved: off # TODO: fix internal modules import/prefer-default-export: off # prefer named exports - indent: off # use @typescript-eslint/indent instead for better compatibility + indent: [error, 4, { + SwitchCase: 0, + ignoredNodes: [ # https://stackoverflow.com/a/72897089 + "FunctionExpression > .params[decorators.length > 0]", + "FunctionExpression > .params > :matches(Decorator, :not(:first-child))", + "ClassBody.body > PropertyDefinition[decorators.length > 0] > .key", + ] + }] lines-between-class-members: off # be more lenient on member declarations max-classes-per-file: off # helper classes are common @@ -103,9 +110,6 @@ rules: 'ts-nocheck': true, 'ts-check': false, }] - '@typescript-eslint/indent': [warn, 4, { - SwitchCase: 0 - }] '@typescript-eslint/no-unused-expressions': warn # TODO: this is just too much work From 762fd501c7cf991f8a24c25eb4c1273431ae6851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leslie=20Leigh=20=28=E6=9D=8E=E7=9A=84=E5=BA=8F=29?= Date: Mon, 31 Jul 2023 14:20:52 +0800 Subject: [PATCH 43/51] Eslint: off default-case-last (#15733) --- .eslintrc.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 839c15e7fa4..09f5032bf31 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -101,6 +101,7 @@ rules: prefer-destructuring: off # auto-fix is not smart enough to merge different instances linebreak-style: off # we don't enforce this on everyone's dev environment for now spaced-comment: off # for license declarations + default-case-last: off # Place default case clause to first make it more clear that this switch statement has handled all cases ##### TYPESCRIPT-SPECIFIC RULE OVERRIDES ##### From 95cd245055658c14df3e36a2570aeb60883d6dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leslie=20Leigh=20=28=E6=9D=8E=E7=9A=84=E5=BA=8F=29?= Date: Mon, 31 Jul 2023 14:21:36 +0800 Subject: [PATCH 44/51] ESLint: replace no-empty-function with typescript version (#15732) --- .eslintrc.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 09f5032bf31..397a8ee08d4 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -61,6 +61,7 @@ rules: quotes: [warn, single, { allowTemplateLiterals: true }] # force single, but allow template literal no-else-return: off # else-return is a common pattern which clearly expresses the control flow no-unused-expressions: off # taken over by '@typescript-eslint/no-unused-expressions' + no-empty-function: off # taken over by '@typescript-eslint/no-empty-function' ##### AIRBNB-SPECIFIC RULE OVERRIDES ##### @@ -126,7 +127,16 @@ rules: '@typescript-eslint/unbound-method': off # we exploit prototype methods sometimes to acheive better performace '@typescript-eslint/no-explicit-any': off # still relevant for some heavily templated usages - '@typescript-eslint/no-empty-function': off # may become useful in some parent classes + + '@typescript-eslint/no-empty-function': [error, { + allow: [ + private-constructors, + protected-constructors, + decoratedFunctions, + overrideMethods, + ] + }] + '@typescript-eslint/no-unused-vars': off # may become useful in some parent classes '@typescript-eslint/no-non-null-assertion': off # sometimes we just know better than the compiler '@typescript-eslint/no-namespace': [warn, { # we need to declare static properties From 54c81416ec928d8fd6607f0ca22312a83af1e087 Mon Sep 17 00:00:00 2001 From: dogeFu <609075410@qq.com> Date: Mon, 31 Jul 2023 14:42:25 +0800 Subject: [PATCH 45/51] refactor : call safeMeasureText when needed (#15754) --- cocos/2d/utils/font-loader.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/utils/font-loader.ts b/cocos/2d/utils/font-loader.ts index 5ede5e34ca5..a4940d8a903 100644 --- a/cocos/2d/utils/font-loader.ts +++ b/cocos/2d/utils/font-loader.ts @@ -167,7 +167,6 @@ export function loadFont (url: string, options: Record, onComplete: // Default width reference to test whether new font is loaded correctly const fontDesc = `40px ${fontFamilyName}`; - const refWidth = safeMeasureText(_canvasContext!, _testString, fontDesc); // Setup font face style const fontStyle = ccdocument.createElement('style'); @@ -195,6 +194,7 @@ export function loadFont (url: string, options: Record, onComplete: if (useNativeCheck()) { nativeCheckFontLoaded(Date.now(), fontFamilyName, onComplete); } else { + const refWidth = safeMeasureText(_canvasContext!, _testString, fontDesc); // Save loading font const fontLoadHandle = { fontFamilyName, From 4a2f290516dca33675bb3219fe2133238e0fbbed Mon Sep 17 00:00:00 2001 From: bofeng-song Date: Tue, 1 Aug 2023 11:34:40 +0800 Subject: [PATCH 46/51] Fix audio can not be paused & resume on mini game platform (#15811) * Fix audio can not be paused & resume on mini game platform --- pal/audio/minigame/player-minigame.ts | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/pal/audio/minigame/player-minigame.ts b/pal/audio/minigame/player-minigame.ts index 88e03a50be9..a5cc67e40e6 100644 --- a/pal/audio/minigame/player-minigame.ts +++ b/pal/audio/minigame/player-minigame.ts @@ -30,7 +30,6 @@ import { AudioEvent, AudioPCMDataView, AudioState, AudioType } from '../type'; import { clamp, clamp01 } from '../../../cocos/core'; import { enqueueOperation, OperationInfo, OperationQueueable } from '../operation-queue'; import { OS } from '../../system-info/enum-type'; -import { Game, game } from '../../../cocos/game'; export class OneShotAudioMinigame { private _innerAudioContext: InnerAudioContext; @@ -58,6 +57,8 @@ export class OneShotAudioMinigame { }); const endCallback = (): void => { if (this._innerAudioContext) { + systemInfo.off('hide', this._onInterruptedBegin, this); + systemInfo.off('show', this._onInterruptedEnd, this); this._onEndCb?.(); nativeAudio.destroy(); // NOTE: Type 'null' is not assignable to type 'InnerAudioContext'. @@ -66,6 +67,18 @@ export class OneShotAudioMinigame { }; nativeAudio.onEnded(endCallback); nativeAudio.onStop(endCallback);//OneShotAudio can not be reused. + + // event + systemInfo.on('hide', this._onInterruptedBegin, this); + systemInfo.on('show', this._onInterruptedEnd, this); + } + + private _onInterruptedBegin (): void { + this._innerAudioContext.pause(); + } + + private _onInterruptedEnd (): void { + this._innerAudioContext.play(); } public play (): void { @@ -109,8 +122,8 @@ export class AudioPlayerMinigame implements OperationQueueable { this._eventTarget = new EventTarget(); // event - game.on(Game.EVENT_PAUSE, this._onInterruptedBegin, this); - game.on(Game.EVENT_RESUME, this._onInterruptedEnd, this); + systemInfo.on('hide', this._onInterruptedBegin, this); + systemInfo.on('show', this._onInterruptedEnd, this); const eventTarget = this._eventTarget; this._onPlay = (): void => { this._state = AudioState.PLAYING; @@ -171,8 +184,8 @@ export class AudioPlayerMinigame implements OperationQueueable { innerAudioContext.onEnded(this._onEnded); } destroy (): void { - game.off(Game.EVENT_PAUSE, this._onInterruptedBegin, this); - game.off(Game.EVENT_RESUME, this._onInterruptedEnd, this); + systemInfo.off('hide', this._onInterruptedBegin, this); + systemInfo.off('show', this._onInterruptedEnd, this); if (this._innerAudioContext) { ['Play', 'Pause', 'Stop', 'Seeked', 'Ended'].forEach((event) => { this._offEvent(event); @@ -196,7 +209,7 @@ export class AudioPlayerMinigame implements OperationQueueable { private _onInterruptedEnd (): void { // We don't know whether onShow or resolve callback in pause promise is called at first. if (!this._readyToHandleOnShow) { - this._eventTarget.once(AudioEvent.INTERRUPTION_BEGIN, this._onInterruptedEnd, this); + this._eventTarget.once(AudioEvent.INTERRUPTION_END, this._onInterruptedEnd, this); return; } if (this._state === AudioState.INTERRUPTED) { From 22388ba7019b3b95b33c1d26f1acaf7f1c08cdc2 Mon Sep 17 00:00:00 2001 From: bofeng-song Date: Tue, 1 Aug 2023 14:24:27 +0800 Subject: [PATCH 47/51] The Taobao platform has improved the implementation of innerAudioContext. (#15839) --- pal/audio/minigame/player-minigame.ts | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/pal/audio/minigame/player-minigame.ts b/pal/audio/minigame/player-minigame.ts index a5cc67e40e6..e363567f403 100644 --- a/pal/audio/minigame/player-minigame.ts +++ b/pal/audio/minigame/player-minigame.ts @@ -151,9 +151,14 @@ export class AudioPlayerMinigame implements OperationQueueable { // Reset all properties this._resetSeekCache(); eventTarget.emit(AudioEvent.STOPPED); - const currentTime = this._innerAudioContext ? this._innerAudioContext.currentTime : 0; - if (currentTime !== 0) { - this._innerAudioContext.seek(0); + if (TAOBAO || TAOBAO_MINIGAME) { + /**Unable to seek again after stop; After stop, regardless of whether the starttime has been set, + the playback will always start from 0 again**/ + } else { + const currentTime = this._innerAudioContext ? this._innerAudioContext.currentTime : 0; + if (currentTime !== 0) { + this._innerAudioContext.seek(0); + } } }; innerAudioContext.onStop(this._onStop); @@ -168,12 +173,6 @@ export class AudioPlayerMinigame implements OperationQueueable { this._needSeek = false; } } - - // TaoBao iOS: After calling pause or stop, when seek is called, it will automatically play and call onPlay. - if ((TAOBAO || TAOBAO_MINIGAME) && systemInfo.os === OS.IOS - && (this._state === AudioState.PAUSED || this._state === AudioState.STOPPED)) { - innerAudioContext.pause(); - } }; innerAudioContext.onSeeked(this._onSeeked); this._onEnded = (): void => { @@ -350,14 +349,6 @@ export class AudioPlayerMinigame implements OperationQueueable { @enqueueOperation stop (): Promise { - // NOTE: on Taobao, it is designed that innerAudioContext is useless after calling stop. - // so we implement stop as pase + seek. - if (TAOBAO || TAOBAO_MINIGAME) { - this._innerAudioContext.pause(); - this._innerAudioContext.seek(0); - this._onStop?.(); - return Promise.resolve(); - } return new Promise((resolve) => { this._eventTarget.once(AudioEvent.STOPPED, resolve); this._innerAudioContext.stop(); From 5eddce91f13526e43496d8ad97cd363b1cc22419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leslie=20Leigh=20=28=E6=9D=8E=E7=9A=84=E5=BA=8F=29?= Date: Tue, 1 Aug 2023 14:50:45 +0800 Subject: [PATCH 48/51] PoseGraph: support editor decorators on node inputs (#15819) * PoseGraph: support editor decorators on node inputs * Fix lint error --- .../marionette/pose-graph/decorator/input.ts | 25 ++++++++++++++++--- .../pose-graph/graph-output-node.ts | 7 ++---- .../pose-graph/pose-nodes/additively-blend.ts | 3 ++- .../pose-graph/pose-nodes/apply-transform.ts | 7 +++--- .../pose-nodes/blend-in-proportion.ts | 3 ++- .../pose-nodes/blend-two-pose-base.ts | 3 ++- .../pose-nodes/ik/two-bone-ik-solver.ts | 8 +++--- .../pose-nodes/intensity-specification.ts | 3 ++- .../pose-graph/pose-nodes/play-motion.ts | 5 ++-- .../src/marionette/pose-graph-editor-api.ts | 12 +++++++++ .../pose-graph/pose-graph-authoring.test.ts | 17 +++++++++++++ 11 files changed, 72 insertions(+), 21 deletions(-) diff --git a/cocos/animation/marionette/pose-graph/decorator/input.ts b/cocos/animation/marionette/pose-graph/decorator/input.ts index 38e2f2135af..2c223606ccb 100644 --- a/cocos/animation/marionette/pose-graph/decorator/input.ts +++ b/cocos/animation/marionette/pose-graph/decorator/input.ts @@ -1,6 +1,8 @@ /* eslint-disable @typescript-eslint/ban-types */ import { error, js } from '../../../../core'; +import { PropertyStashInternalFlag } from '../../../../core/data/class-stash'; +import { getOrCreatePropertyStash } from '../../../../core/data/decorators/property'; import { PoseGraphNodeInputMappingOptions, globalPoseGraphNodeInputManager } from '../foundation/authoring/input-authoring'; import { PoseGraphType } from '../foundation/type-system'; import { PoseNode } from '../pose-node'; @@ -38,10 +40,6 @@ export type { PoseGraphNodeInputMappingOptions }; */ export function input (options: PoseGraphNodeInputMappingOptions): PropertyDecorator { return (target, propertyKey): void => { - if (typeof propertyKey !== 'string') { - error(`@input can be only applied to string-named fields.`); - return; - } const targetConstructor = target.constructor; if (options.type === PoseGraphType.POSE) { if (!js.isChildClassOf(targetConstructor, PoseNode)) { @@ -55,6 +53,25 @@ export function input (options: PoseGraphNodeInputMappingOptions): PropertyDecor error(`@input can be only applied to fields of subclasses of PoseNode or PureValueNode.`); return; } + inputUnchecked(options)(target, propertyKey); + }; +} + +/** + * Unchecked version of `@input()`. + * @internal + */ +export function inputUnchecked (options: PoseGraphNodeInputMappingOptions): PropertyDecorator { + return (target, propertyKey) => { + if (typeof propertyKey !== 'string') { + error(`@input can be only applied to string-named fields.`); + return; + } + + const targetConstructor = target.constructor; globalPoseGraphNodeInputManager.setPropertyNodeInputRecord(targetConstructor, propertyKey, options); + + const propertyStash = getOrCreatePropertyStash(target, propertyKey); + propertyStash.__internalFlags |= (PropertyStashInternalFlag.STANDALONE | PropertyStashInternalFlag.IMPLICIT_VISIBLE); }; } diff --git a/cocos/animation/marionette/pose-graph/graph-output-node.ts b/cocos/animation/marionette/pose-graph/graph-output-node.ts index 6c8711eca18..422f14103a2 100644 --- a/cocos/animation/marionette/pose-graph/graph-output-node.ts +++ b/cocos/animation/marionette/pose-graph/graph-output-node.ts @@ -4,8 +4,8 @@ import { CLASS_NAME_PREFIX_ANIM } from '../../define'; import { PoseNode } from './pose-node'; import { PoseGraphType } from './foundation/type-system'; import { PoseGraphNode } from './foundation/pose-graph-node'; -import { globalPoseGraphNodeInputManager } from './foundation/authoring/input-authoring'; import { poseGraphNodeAppearance } from './decorator/node'; +import { inputUnchecked } from './decorator/input'; @ccclass(`${CLASS_NAME_PREFIX_ANIM}PoseGraphOutputNode`) @poseGraphNodeAppearance({ @@ -15,9 +15,6 @@ import { poseGraphNodeAppearance } from './decorator/node'; export class PoseGraphOutputNode extends PoseGraphNode { // Don't use @input since it requires the owner class being subclass of `PoseNode`. @serializable + @inputUnchecked({ type: PoseGraphType.POSE }) pose: PoseNode | null = null; } - -globalPoseGraphNodeInputManager.setPropertyNodeInputRecord(PoseGraphOutputNode, 'pose', { - type: PoseGraphType.POSE, -}); diff --git a/cocos/animation/marionette/pose-graph/pose-nodes/additively-blend.ts b/cocos/animation/marionette/pose-graph/pose-nodes/additively-blend.ts index 77cffebd07f..81c9d200c47 100644 --- a/cocos/animation/marionette/pose-graph/pose-nodes/additively-blend.ts +++ b/cocos/animation/marionette/pose-graph/pose-nodes/additively-blend.ts @@ -1,4 +1,4 @@ -import { ccclass, serializable } from '../../../../core/data/decorators'; +import { ccclass, range, serializable } from '../../../../core/data/decorators'; import { Pose, applyDeltaPose } from '../../../core/pose'; import { CLASS_NAME_PREFIX_ANIM } from '../../../define'; import { poseGraphNodeAppearance, poseGraphNodeCategory } from '../decorator/node'; @@ -29,6 +29,7 @@ export class PoseNodeAdditivelyBlend extends PoseNode { @serializable @input({ type: PoseGraphType.FLOAT }) + @range([0.0, 1.0, 0.01]) public ratio = 1.0; public bind (context: AnimationGraphBindingContext): void { diff --git a/cocos/animation/marionette/pose-graph/pose-nodes/apply-transform.ts b/cocos/animation/marionette/pose-graph/pose-nodes/apply-transform.ts index 2909c1f2bcc..fb3e2eb4e45 100644 --- a/cocos/animation/marionette/pose-graph/pose-nodes/apply-transform.ts +++ b/cocos/animation/marionette/pose-graph/pose-nodes/apply-transform.ts @@ -1,5 +1,5 @@ import { EDITOR } from 'internal:constants'; -import { ccclass, editable, serializable, type, visible } from '../../../../core/data/decorators'; +import { ccclass, editable, range, serializable, type, visible } from '../../../../core/data/decorators'; import { CLASS_NAME_PREFIX_ANIM } from '../../../define'; import { PoseNode, PoseTransformSpaceRequirement } from '../pose-node'; import { @@ -47,7 +47,7 @@ export class PoseNodeApplyTransform extends PoseNodeModifyPoseBase { @serializable @editable @input({ type: PoseGraphType.VEC3 }) - @visible(function visible(this: PoseNodeApplyTransform) { return this.positionOperation !== TransformOperation.LEAVE_UNCHANGED; }) + @visible(function visible (this: PoseNodeApplyTransform) { return this.positionOperation !== TransformOperation.LEAVE_UNCHANGED; }) public position = new Vec3(); @serializable @@ -58,11 +58,12 @@ export class PoseNodeApplyTransform extends PoseNodeModifyPoseBase { @serializable @editable @input({ type: PoseGraphType.QUAT }) - @visible(function visible(this: PoseNodeApplyTransform) { return this.rotationOperation !== TransformOperation.LEAVE_UNCHANGED; }) + @visible(function visible (this: PoseNodeApplyTransform) { return this.rotationOperation !== TransformOperation.LEAVE_UNCHANGED; }) public rotation = new Quat(); @serializable @editable + @range([0.0, 1.0, 0.01]) public intensity = new IntensitySpecification(); @serializable diff --git a/cocos/animation/marionette/pose-graph/pose-nodes/blend-in-proportion.ts b/cocos/animation/marionette/pose-graph/pose-nodes/blend-in-proportion.ts index ed84d2a146e..e7f2d732048 100644 --- a/cocos/animation/marionette/pose-graph/pose-nodes/blend-in-proportion.ts +++ b/cocos/animation/marionette/pose-graph/pose-nodes/blend-in-proportion.ts @@ -1,5 +1,5 @@ import { EDITOR } from 'internal:constants'; -import { ccclass, serializable } from '../../../../core/data/decorators'; +import { ccclass, range, serializable } from '../../../../core/data/decorators'; import { blendPoseInto, Pose } from '../../../core/pose'; import { CLASS_NAME_PREFIX_ANIM } from '../../../define'; import { PoseNode, PoseTransformSpaceRequirement } from '../pose-node'; @@ -29,6 +29,7 @@ export class PoseNodeBlendInProportion extends PoseNode { arraySyncGroup: 'blend-item', arraySyncGroupFollower: true, }) + @range([0.0, Number.POSITIVE_INFINITY]) public readonly proportions: number[] = []; public bind (context: AnimationGraphBindingContext): void { diff --git a/cocos/animation/marionette/pose-graph/pose-nodes/blend-two-pose-base.ts b/cocos/animation/marionette/pose-graph/pose-nodes/blend-two-pose-base.ts index e87ce7e4b8e..dc8e30b1cfd 100644 --- a/cocos/animation/marionette/pose-graph/pose-nodes/blend-two-pose-base.ts +++ b/cocos/animation/marionette/pose-graph/pose-nodes/blend-two-pose-base.ts @@ -1,4 +1,4 @@ -import { ccclass, editable, serializable, type } from '../../../../core/data/decorators'; +import { ccclass, editable, range, serializable, type } from '../../../../core/data/decorators'; import { Pose } from '../../../core/pose'; import { CLASS_NAME_PREFIX_ANIM } from '../../../define'; import { PoseNode, PoseTransformSpaceRequirement } from '../pose-node'; @@ -22,6 +22,7 @@ export abstract class PoseNodeBlendTwoPoseBase extends PoseNode { @serializable @input({ type: PoseGraphType.FLOAT }) + @range([0.0, 1.0, 0.01]) ratio = 1.0; public bind (context: AnimationGraphBindingContext): void { diff --git a/cocos/animation/marionette/pose-graph/pose-nodes/ik/two-bone-ik-solver.ts b/cocos/animation/marionette/pose-graph/pose-nodes/ik/two-bone-ik-solver.ts index 5e92050e114..fa0006bb10a 100644 --- a/cocos/animation/marionette/pose-graph/pose-nodes/ik/two-bone-ik-solver.ts +++ b/cocos/animation/marionette/pose-graph/pose-nodes/ik/two-bone-ik-solver.ts @@ -56,18 +56,18 @@ class TargetSpecification { @serializable @editable - @visible(function visible(this: TargetSpecification) { return this.type === TargetSpecificationType.VALUE; }) + @visible(function visible (this: TargetSpecification) { return this.type === TargetSpecificationType.VALUE; }) public targetPosition = new Vec3(); @serializable @editable @type(TransformSpace) - @visible(function visible(this: TargetSpecification) { return this.type === TargetSpecificationType.VALUE; }) + @visible(function visible (this: TargetSpecification) { return this.type === TargetSpecificationType.VALUE; }) public targetPositionSpace = TransformSpace.WORLD; @serializable @editable - @visible(function visible(this: TargetSpecification) { return this.type === TargetSpecificationType.BONE; }) + @visible(function visible (this: TargetSpecification) { return this.type === TargetSpecificationType.BONE; }) public targetBone = ''; public bind (context: AnimationGraphBindingContext, sourceBoneHandle: TransformHandle): void { @@ -117,6 +117,7 @@ export class PoseNodeTwoBoneIKSolver extends PoseNodeModifyPoseBase { public readonly endEffectorTarget = new TargetSpecification(TargetSpecificationType.VALUE); @input({ type: PoseGraphType.VEC3 }) + @visible(function visible (this: PoseNodeTwoBoneIKSolver) { return this.endEffectorTarget.type === TargetSpecificationType.VALUE; }) get endEffectorTargetPosition (): Vec3 { return this.endEffectorTarget.targetPosition; } @@ -130,6 +131,7 @@ export class PoseNodeTwoBoneIKSolver extends PoseNodeModifyPoseBase { public readonly poleTarget = new TargetSpecification(TargetSpecificationType.NONE); @input({ type: PoseGraphType.VEC3 }) + @visible(function visible (this: PoseNodeTwoBoneIKSolver) { return this.poleTarget.type === TargetSpecificationType.VALUE; }) get poleTargetPosition (): Vec3 { return this.poleTarget.targetPosition; } diff --git a/cocos/animation/marionette/pose-graph/pose-nodes/intensity-specification.ts b/cocos/animation/marionette/pose-graph/pose-nodes/intensity-specification.ts index 36a779ba580..85922a169b4 100644 --- a/cocos/animation/marionette/pose-graph/pose-nodes/intensity-specification.ts +++ b/cocos/animation/marionette/pose-graph/pose-nodes/intensity-specification.ts @@ -1,5 +1,5 @@ import { ccenum } from '../../../../core'; -import { ccclass, editable, serializable, type, visible } from '../../../../core/data/decorators'; +import { ccclass, editable, range, serializable, type, visible } from '../../../../core/data/decorators'; import { AuxiliaryCurveHandle } from '../../../core/animation-handle'; import { Pose } from '../../../core/pose'; import { CLASS_NAME_PREFIX_ANIM } from '../../../define'; @@ -22,6 +22,7 @@ export class IntensitySpecification { @serializable @editable @visible(function visible (this: IntensitySpecification): boolean { return this.type === IntensityType.VALUE; }) + @range([0.0, 1.0, 0.01]) public value = 1.0; @serializable diff --git a/cocos/animation/marionette/pose-graph/pose-nodes/play-motion.ts b/cocos/animation/marionette/pose-graph/pose-nodes/play-motion.ts index a93d7606d64..78e8b8b3c5f 100644 --- a/cocos/animation/marionette/pose-graph/pose-nodes/play-motion.ts +++ b/cocos/animation/marionette/pose-graph/pose-nodes/play-motion.ts @@ -1,5 +1,5 @@ import { EDITOR } from 'internal:constants'; -import { ccclass, displayName, editable, serializable } from '../../../../core/data/decorators'; +import { ccclass, displayName, editable, serializable, unit } from '../../../../core/data/decorators'; import { CLASS_NAME_PREFIX_ANIM } from '../../../define'; import { ClipMotion } from '../../motion/clip-motion'; import { createEval } from '../../create-eval'; @@ -43,6 +43,7 @@ export class PoseNodePlayMotion extends PoseNode { @serializable @input({ type: PoseGraphType.FLOAT }) + @unit('s') public startTime = 0.0; @serializable @@ -79,7 +80,7 @@ export class PoseNodePlayMotion extends PoseNode { } public settle (context: AnimationGraphSettleContext): void { - + // override } public reenter (): void { diff --git a/editor/src/marionette/pose-graph-editor-api.ts b/editor/src/marionette/pose-graph-editor-api.ts index 8cfc4354570..cbd1cb20487 100644 --- a/editor/src/marionette/pose-graph-editor-api.ts +++ b/editor/src/marionette/pose-graph-editor-api.ts @@ -13,6 +13,7 @@ import { PoseGraphStash, StateMachine } from "../../../cocos/animation/marionett import { PoseNodeLocation, visitPoseNodeInLayer } from "./visit/visit-pose-node"; import { PoseGraph } from '../../../cocos/animation/marionette/pose-graph/pose-graph'; import { PoseNodeStateMachine } from "../../../cocos/animation/marionette/pose-graph/pose-nodes/state-machine"; +import { attr } from "../../../cocos/core/data/utils/attribute"; type Constructor = new (...args: any[]) => T; @@ -92,6 +93,17 @@ export function getInputDefaultDisplayName(inputKey: poseGraphOp.InputKey) { } } +export function getPoseGraphNodeInputAttrs(node: PoseGraphNode, inputKey: poseGraphOp.InputKey) { + const [propertyName] = inputKey; + const attrs = attr(node.constructor, propertyName); + delete attrs.type; + delete attrs.ctor; + if (Array.isArray(node[propertyName])) { + delete attrs['default']; + } + return attrs; +} + function clonePoseGraphNode(node: PoseGraphNode) { return instantiate(node); } diff --git a/tests/animation/new-gen-anim/pose-graph/pose-graph-authoring.test.ts b/tests/animation/new-gen-anim/pose-graph/pose-graph-authoring.test.ts index 1400fcce30d..ce29bd5dbb8 100644 --- a/tests/animation/new-gen-anim/pose-graph/pose-graph-authoring.test.ts +++ b/tests/animation/new-gen-anim/pose-graph/pose-graph-authoring.test.ts @@ -13,6 +13,9 @@ import { poseGraphCreateNodeFactory, poseGraphNodeAppearance, poseGraphNodeHide, import { PoseGraphNodeEditorMetadata, getPoseGraphNodeEditorMetadata } from "../../../../cocos/animation/marionette/pose-graph/foundation/authoring/node-authoring"; import { composeInputKeyInternally, createPoseGraph, getTheOnlyInputKey, getTheOnlyOutputKey, normalizeNodeInputMetadata, UnimplementedPoseNode, UnimplementedPVNode } from "./utils/misc"; import { PoseNode } from "../../../../cocos/animation/marionette/pose-graph/pose-node"; +import { ccclass } from "../../../../cocos/core/data/class-decorator"; +import { unregisterClass } from "../../../../cocos/core/utils/js-typed"; +import { attr } from "../../../../cocos/core/data/utils/attribute"; describe(`Class PoseGraph`, () => { test(`Default`, () => { @@ -162,6 +165,20 @@ describe(`Input decorator @input`, () => { return _Node; } }); + + test(`@input implies default visibility`, () => { + @ccclass('C') + class Node extends UnimplementedPoseNode { + @input({ type: PoseGraphType.FLOAT }) + p = 0.0; + } + + expect(attr(Node, 'p')).toStrictEqual(expect.objectContaining({ + visible: true, + })); + + unregisterClass(Node); + }); }); describe(`Node editor decorators`, () => { From 06341f3037ce74068f6612d1dc5b578a5ab4ec9c Mon Sep 17 00:00:00 2001 From: qiuguohua Date: Wed, 2 Aug 2023 14:20:24 +0800 Subject: [PATCH 49/51] Uncapture global mouse events. (#15834) --- native/cocos/platform/SDLHelper.cpp | 4 ---- native/external-config.json | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/native/cocos/platform/SDLHelper.cpp b/native/cocos/platform/SDLHelper.cpp index b588395f33d..56e71618b8c 100644 --- a/native/cocos/platform/SDLHelper.cpp +++ b/native/cocos/platform/SDLHelper.cpp @@ -198,10 +198,6 @@ void SDLHelper::dispatchWindowEvent(uint32_t windowId, const SDL_WindowEvent &we events::WindowEvent::broadcast(ev); break; } - case SDL_WINDOWEVENT_ENTER: { - SDL_CaptureMouse(SDL_TRUE); - break; - } case SDL_WINDOWEVENT_CLOSE: { ev.type = WindowEvent::Type::CLOSE; events::WindowEvent::broadcast(ev); diff --git a/native/external-config.json b/native/external-config.json index 082f542393f..5427b2b8bfa 100644 --- a/native/external-config.json +++ b/native/external-config.json @@ -3,6 +3,6 @@ "type": "github", "owner": "cocos-creator", "name": "engine-native-external", - "checkout": "v3.8.1-8" + "checkout": "v3.8.1-9" } } From 326ba66a9a4334cd4d592fd974c55b5790219159 Mon Sep 17 00:00:00 2001 From: mmyduckx <308303735@qq.com> Date: Wed, 2 Aug 2023 14:34:50 +0800 Subject: [PATCH 50/51] implement some wechat splashScreen features (#15827) * implement some wechat splashScreen features * fix unit-test may not get logo&background condition * fix eslint --- cocos/game/splash-screen.ts | 299 ++++++++++++++++---------- templates/wechatgame/first-screen.ejs | 61 ++++-- 2 files changed, 227 insertions(+), 133 deletions(-) diff --git a/cocos/game/splash-screen.ts b/cocos/game/splash-screen.ts index fb85f3f1c59..87ee4f71ff3 100644 --- a/cocos/game/splash-screen.ts +++ b/cocos/game/splash-screen.ts @@ -28,7 +28,7 @@ import { clamp01, Mat4, Vec2, Settings, settings, sys, cclegacy, easing, preTran import { Sampler, SamplerInfo, Shader, Texture, TextureInfo, Device, InputAssembler, InputAssemblerInfo, Attribute, Buffer, BufferInfo, Rect, Color, BufferTextureCopy, CommandBuffer, BufferUsageBit, Format, - MemoryUsageBit, TextureType, TextureUsageBit, Address, Swapchain, + MemoryUsageBit, TextureType, TextureUsageBit, Address, Swapchain, Framebuffer, } from '../gfx'; import { PipelineStateManager } from '../rendering'; import { SetIndex } from '../rendering/define'; @@ -36,7 +36,8 @@ import { ccwindow, legacyCC } from '../core/global-exports'; import { XREye } from '../xr/xr-enums'; const v2_0 = new Vec2(); -type SplashEffectType = 'default' | 'custom' | 'off'; +type SplashLogoType = 'default' | 'none' | 'custom'; +type SplashBackgroundType = 'default' | 'color' | 'custom'; type WatermarkLocationType = 'default' | 'topLeft' | 'topRight' | 'topCenter' | 'bottomLeft' | 'bottomCenter' | 'bottomRight'; interface ISplashSetting { @@ -44,12 +45,21 @@ interface ISplashSetting { totalTime: number; watermarkLocation: WatermarkLocationType; autoFit: boolean; + logo?: SplashLogo; + background?: SplashBackground; +} - url?: string; - type?: SplashEffectType; +interface SplashBackground { + type: SplashBackgroundType; + color?: Color; + image?: string; + base64?: string; +} - bgBase64: string; - base64src: string; +interface SplashLogo { + type: SplashLogoType; + image?: string; + base64?: string; } export class SplashScreen { @@ -117,14 +127,12 @@ export class SplashScreen { totalTime: settings.querySettings(Settings.Category.SPLASH_SCREEN, 'totalTime') ?? 3000, watermarkLocation: settings.querySettings(Settings.Category.SPLASH_SCREEN, 'watermarkLocation') ?? 'default', autoFit: settings.querySettings(Settings.Category.SPLASH_SCREEN, 'autoFit') ?? true, - url: settings.querySettings(Settings.Category.SPLASH_SCREEN, 'url') ?? '', - type: settings.querySettings(Settings.Category.SPLASH_SCREEN, 'type') ?? 'default', - bgBase64: settings.querySettings(Settings.Category.SPLASH_SCREEN, 'bgBase64') ?? '', - base64src: settings.querySettings(Settings.Category.SPLASH_SCREEN, 'base64src') ?? '', + logo: settings.querySettings(Settings.Category.SPLASH_SCREEN, 'logo') ?? undefined, + background: settings.querySettings(Settings.Category.SPLASH_SCREEN, 'background') ?? undefined, }; this._curTime = 0; - if (EDITOR || this.settings.base64src === '' || this.settings.totalTime <= 0) { + if (EDITOR || this.settings.totalTime <= 0 || this.settings.logo === undefined || this.settings.background === undefined) { this.settings.totalTime = 0; } else { this.device = cclegacy.director.root!.device; @@ -133,36 +141,45 @@ export class SplashScreen { this.preInit(); this.initLayout(); - this.initWaterMark(); - const bgPromise = new Promise((resolve, reject): void => { - this.bgImage = new ccwindow.Image(); - this.bgImage.onload = (): void => { - this.initBG(); - resolve(); - }; - this.bgImage.onerror = (): void => { - reject(); - }; - this.bgImage.src = this.settings.bgBase64; - }); - const logoPromise = new Promise((resolve, reject): void => { - this.logoImage = new ccwindow.Image(); - this.logoImage.onload = (): void => { - this.initLogo(); - resolve(); - }; - this.logoImage.onerror = (): void => { - reject(); - }; - this.logoImage.src = this.settings.base64src; - }); + if (this.settings.logo.type === 'default') { + this.initWaterMark(); + } + let bgPromise = Promise.resolve(); + let logoPromise = Promise.resolve(); + if (this.settings.background.type === 'custom') { + bgPromise = new Promise((resolve, reject): void => { + this.bgImage = new ccwindow.Image(); + this.bgImage.onload = (): void => { + this.initBG(); + resolve(); + }; + this.bgImage.onerror = (): void => { + reject(); + }; + this.bgImage.src = this.settings.background!.base64!; + }); + } + if (this.settings.logo.type !== 'none') { + logoPromise = new Promise((resolve, reject): void => { + this.logoImage = new ccwindow.Image(); + this.logoImage.onload = (): void => { + this.initLogo(); + resolve(); + }; + this.logoImage.onerror = (): void => { + reject(); + }; + this.logoImage.src = this.settings.logo!.base64!; + }); + } return Promise.all([bgPromise, logoPromise]); } return Promise.resolve([]); } private preInit (): void { - this.clearColors = [new Color(0, 0, 0, 255)]; // clean to black + const clearColor = this.settings.background?.color; + this.clearColors = clearColor ? [new Color(clearColor.x, clearColor.y, clearColor.z, clearColor.w)] : [new Color(0, 0, 0, 1)]; const { device, swapchain } = this; this.renderArea = new Rect(0, 0, swapchain.width, swapchain.height); this.cmdBuff = device.commandBuffer; @@ -174,7 +191,9 @@ export class SplashScreen { const vbSize = vbStride * 4; this.vertexBuffers = device.createBuffer(new BufferInfo( BufferUsageBit.VERTEX | BufferUsageBit.TRANSFER_DST, - MemoryUsageBit.DEVICE, vbSize, vbStride, + MemoryUsageBit.DEVICE, + vbSize, + vbStride, )); this.vertexBuffers.update(verts); @@ -184,7 +203,9 @@ export class SplashScreen { const ibSize = ibStride * 6; this.indicesBuffers = device.createBuffer(new BufferInfo( BufferUsageBit.INDEX | BufferUsageBit.TRANSFER_DST, - MemoryUsageBit.DEVICE, ibSize, ibStride, + MemoryUsageBit.DEVICE, + ibSize, + ibStride, )); this.indicesBuffers.update(indices); @@ -196,8 +217,18 @@ export class SplashScreen { this.quadAssmebler = device.createInputAssembler(IAInfo); this.projection = new Mat4(); - Mat4.ortho(this.projection, -1, 1, -1, 1, -1, 1, device.capabilities.clipSpaceMinZ, - device.capabilities.clipSpaceSignY, swapchain.surfaceTransform); + Mat4.ortho( + this.projection, + -1, + 1, + -1, + 1, + -1, + 1, + device.capabilities.clipSpaceMinZ, + device.capabilities.clipSpaceSignY, + swapchain.surfaceTransform, + ); this.isMobile = sys.isMobile; } @@ -250,8 +281,18 @@ export class SplashScreen { public update (deltaTime: number): void { const settings = this.settings; const { device, swapchain } = this; - Mat4.ortho(this.projection, -1, 1, -1, 1, -1, 1, device.capabilities.clipSpaceMinZ, - device.capabilities.clipSpaceSignY, swapchain.surfaceTransform); + Mat4.ortho( + this.projection, + -1, + 1, + -1, + 1, + -1, + 1, + device.capabilities.clipSpaceMinZ, + device.capabilities.clipSpaceSignY, + swapchain.surfaceTransform, + ); const dw = swapchain.width; const dh = swapchain.height; this.initScale(); @@ -259,40 +300,41 @@ export class SplashScreen { const percent = clamp01(this._curTime / settings.totalTime); const u_p = easing.cubicOut(percent); - // update bg uniform let scaleX = 1; let scaleY = 1; - if (dw < dh) { - scaleX = dh * this.bgRatio; - scaleY = dh; - } else { - scaleX = dw; - scaleY = dw * this.bgRatio; - } - - this.bgMat.setProperty('resolution', v2_0.set(dw, dh), 0); - this.bgMat.setProperty('scale', v2_0.set(scaleX, scaleY), 0); - this.bgMat.setProperty('translate', v2_0.set(dw * 0.5, dh * 0.5), 0); - this.bgMat.setProperty('percent', 1.0); - this.bgMat.setProperty('u_projection', this.projection); - this.bgMat.passes[0].update(); + // update bg uniform + if (this.settings.background!.type === 'custom') { + if (dw < dh) { + scaleX = dh * this.bgRatio; + scaleY = dh; + } else { + scaleX = dw; + scaleY = dw * this.bgRatio; + } + this.bgMat.setProperty('resolution', v2_0.set(dw, dh), 0); + this.bgMat.setProperty('scale', v2_0.set(scaleX, scaleY), 0); + this.bgMat.setProperty('translate', v2_0.set(dw * 0.5, dh * 0.5), 0); + this.bgMat.setProperty('percent', 1.0); + this.bgMat.setProperty('u_projection', this.projection); + this.bgMat.passes[0].update(); + } // update logo uniform - scaleX = 1; - scaleY = 1; - scaleX = this.logoWidth * this.scaleSize * settings.displayRatio; - scaleY = this.logoHeight * this.scaleSize * settings.displayRatio; const logoYTrans = dh * this.logoYTrans; - - this.logoMat.setProperty('resolution', v2_0.set(dw, dh), 0); - this.logoMat.setProperty('scale', v2_0.set(scaleX, scaleY), 0); - this.logoMat.setProperty('translate', v2_0.set(dw * this.logoXTrans, logoYTrans), 0); - this.logoMat.setProperty('percent', u_p); - this.logoMat.setProperty('u_projection', this.projection); - this.logoMat.passes[0].update(); + if (this.settings.logo!.type !== 'none') { + scaleX = this.logoWidth * this.scaleSize * settings.displayRatio; + scaleY = this.logoHeight * this.scaleSize * settings.displayRatio; + + this.logoMat.setProperty('resolution', v2_0.set(dw, dh), 0); + this.logoMat.setProperty('scale', v2_0.set(scaleX, scaleY), 0); + this.logoMat.setProperty('translate', v2_0.set(dw * this.logoXTrans, logoYTrans), 0); + this.logoMat.setProperty('percent', u_p); + this.logoMat.setProperty('u_projection', this.projection); + this.logoMat.passes[0].update(); + } // update watermark uniform - if (this.watermarkMat) { + if (this.settings.logo!.type === 'default' && this.watermarkMat) { const watermarkTW = this.watermarkTexture.width; const watermarkTH = this.watermarkTexture.height; scaleX = watermarkTW; scaleY = watermarkTH; @@ -406,8 +448,11 @@ export class SplashScreen { region.texExtent.height = watermarkImg.height; region.texExtent.depth = 1; this.watermarkTexture = this.device.createTexture(new TextureInfo( - TextureType.TEX2D, TextureUsageBit.SAMPLED | TextureUsageBit.TRANSFER_DST, - Format.RGBA8, watermarkImg.width, watermarkImg.height, + TextureType.TEX2D, + TextureUsageBit.SAMPLED | TextureUsageBit.TRANSFER_DST, + Format.RGBA8, + watermarkImg.width, + watermarkImg.height, )); this.device.copyTexImagesToTexture([watermarkImg], this.watermarkTexture, [region]); // create material @@ -431,13 +476,23 @@ export class SplashScreen { // device's fov may be asymmetry let radioLeft = 1.0; let radioRight = 1.0; - if (xrEye === XREye.LEFT) { - radioLeft = Math.abs(Math.tan(xrFov[0])) / Math.abs(Math.tan(xrFov[1])); - } else if (xrEye === XREye.RIGHT) { - radioRight = Math.abs(Math.tan(xrFov[1])) / Math.abs(Math.tan(xrFov[0])); + if (xrEye === XREye.LEFT as number) { + radioLeft = Math.abs(Math.tan(xrFov[0] as number)) / Math.abs(Math.tan(xrFov[1] as number)); + } else if (xrEye === XREye.RIGHT as number) { + radioRight = Math.abs(Math.tan(xrFov[1] as number)) / Math.abs(Math.tan(xrFov[0] as number)); } - Mat4.ortho(this.projection, -radioLeft, radioRight, -1, 1, -1, 1, device.capabilities.clipSpaceMinZ, - device.capabilities.clipSpaceSignY, swapchain.surfaceTransform); + Mat4.ortho( + this.projection, + -radioLeft, + radioRight, + -1, + 1, + -1, + 1, + device.capabilities.clipSpaceMinZ, + device.capabilities.clipSpaceSignY, + swapchain.surfaceTransform, + ); // keep scale to [-1, 1] only use offset this.projection.m00 = preTransforms[swapchain.surfaceTransform][0]; this.projection.m05 = preTransforms[swapchain.surfaceTransform][3] * device.capabilities.clipSpaceSignY; @@ -457,7 +512,7 @@ export class SplashScreen { device.acquire([swapchain]); // record command const cmdBuff = this.cmdBuff; - const framebuffer = cclegacy.director.root!.mainWindow!.framebuffer; + const framebuffer = cclegacy.director.root!.mainWindow!.framebuffer as Framebuffer; const renderArea = this.renderArea; renderArea.width = swapchain.width; @@ -466,28 +521,48 @@ export class SplashScreen { cmdBuff.begin(); cmdBuff.beginRenderPass(framebuffer.renderPass, framebuffer, renderArea, this.clearColors, 1.0, 0); - const bgPass = this.bgMat.passes[0]; - const bgPso = PipelineStateManager.getOrCreatePipelineState(device, bgPass, this.shader, framebuffer.renderPass, - this.quadAssmebler); - - cmdBuff.bindPipelineState(bgPso); - cmdBuff.bindDescriptorSet(SetIndex.MATERIAL, bgPass.descriptorSet); - cmdBuff.bindInputAssembler(this.quadAssmebler); - cmdBuff.draw(this.quadAssmebler); - - const logoPass = this.logoMat.passes[0]; - const logoPso = PipelineStateManager.getOrCreatePipelineState(device, logoPass, this.shader, framebuffer.renderPass, - this.quadAssmebler); + if (this.settings.background!.type === 'custom') { + const bgPass = this.bgMat.passes[0]; + const bgPso = PipelineStateManager.getOrCreatePipelineState( + device, + bgPass, + this.shader, + framebuffer.renderPass, + this.quadAssmebler, + ); + + cmdBuff.bindPipelineState(bgPso); + cmdBuff.bindDescriptorSet(SetIndex.MATERIAL, bgPass.descriptorSet); + cmdBuff.bindInputAssembler(this.quadAssmebler); + cmdBuff.draw(this.quadAssmebler); + } - cmdBuff.bindPipelineState(logoPso); - cmdBuff.bindDescriptorSet(SetIndex.MATERIAL, logoPass.descriptorSet); - cmdBuff.bindInputAssembler(this.quadAssmebler); - cmdBuff.draw(this.quadAssmebler); + if (this.settings.logo!.type !== 'none') { + const logoPass = this.logoMat.passes[0]; + const logoPso = PipelineStateManager.getOrCreatePipelineState( + device, + logoPass, + this.shader, + framebuffer.renderPass, + this.quadAssmebler, + ); + + cmdBuff.bindPipelineState(logoPso); + cmdBuff.bindDescriptorSet(SetIndex.MATERIAL, logoPass.descriptorSet); + cmdBuff.bindInputAssembler(this.quadAssmebler); + cmdBuff.draw(this.quadAssmebler); + } - if (this.watermarkMat) { + if (this.settings.logo!.type === 'default' && this.watermarkMat) { const wartermarkPass = this.watermarkMat.passes[0]; - const watermarkPso = PipelineStateManager.getOrCreatePipelineState(device, - wartermarkPass, this.shader, framebuffer.renderPass, this.quadAssmebler); + const watermarkPso = PipelineStateManager.getOrCreatePipelineState( + device, + wartermarkPass, + this.shader, + framebuffer.renderPass, + this.quadAssmebler, + ); + cmdBuff.bindPipelineState(watermarkPso); cmdBuff.bindDescriptorSet(SetIndex.MATERIAL, wartermarkPass.descriptorSet); cmdBuff.bindInputAssembler(this.quadAssmebler); @@ -512,21 +587,25 @@ export class SplashScreen { this.device = null!; this.swapchain = null!; this.clearColors = null!; - if ((this.bgImage as any).destroy) (this.bgImage as any).destroy(); - this.bgImage = null!; - this.bgMat.destroy(); - this.bgMat = null!; - this.bgTexture.destroy(); - this.bgTexture = null!; - if ((this.logoImage as any).destroy) (this.logoImage as any).destroy(); - this.logoImage = null!; + if (this.settings.background!.type === 'custom') { + if ((this.bgImage as any).destroy) (this.bgImage as any).destroy(); + this.bgImage = null!; + this.bgMat.destroy(); + this.bgMat = null!; + this.bgTexture.destroy(); + this.bgTexture = null!; + } + if (this.settings.logo!.type !== 'none') { + if ((this.logoImage as any).destroy) (this.logoImage as any).destroy(); + this.logoImage = null!; + this.logoMat.destroy(); + this.logoMat = null!; + this.logoTexture.destroy(); + this.logoTexture = null!; + } this.renderArea = null!; this.cmdBuff = null!; this.shader = null!; - this.logoMat.destroy(); - this.logoMat = null!; - this.logoTexture.destroy(); - this.logoTexture = null!; this.quadAssmebler.destroy(); this.quadAssmebler = null!; this.vertexBuffers.destroy(); @@ -536,7 +615,7 @@ export class SplashScreen { this.sampler = null!; /** text */ - if (this.watermarkTexture) { + if (this.settings.logo!.type === 'default' && this.watermarkTexture) { this.watermarkMat.destroy(); this.watermarkMat = null!; this.watermarkTexture.destroy(); @@ -554,7 +633,7 @@ export class SplashScreen { } return SplashScreen._ins; } - + // eslint-disable-next-line no-empty-function private constructor () {} } diff --git a/templates/wechatgame/first-screen.ejs b/templates/wechatgame/first-screen.ejs index 1e25ee187fe..1025e60e115 100644 --- a/templates/wechatgame/first-screen.ejs +++ b/templates/wechatgame/first-screen.ejs @@ -27,9 +27,14 @@ void main() { const FS_BG = ` precision mediump float; uniform sampler2D u_Sampler; +uniform float u_flip; varying vec2 v_TexCoord; void main() { - gl_FragColor = texture2D(u_Sampler, v_TexCoord); + vec2 texCoord = v_TexCoord; + if(u_flip > 0.5) { + texCoord.y = 1.0 - texCoord.y; + } + gl_FragColor = texture2D(u_Sampler, texCoord); }`; const VS_PROGRESSBAR = ` @@ -82,7 +87,14 @@ let progress = 0.0; let progressBarColor = [61 / 255, 197 / 255, 222 / 255, 1]; let progressBackground = [100 / 255, 111 / 255, 118 / 255, 1]; let afterTick = null; +let backgroundFilp = 1.0; // set 0 to not flip let displayRatio = <%= displayRatio%>; +let bgColor = [<%= bgColor%>]; +let useCustomBg = <%= useCustomBg%>; +let useLogo = <%= useLogo%>; +let useDefaultLogo = <%= useDefaultLogo%>; +let logoName = '<%= logoName %>'; +let bgName = '<%= bgName %>'; function initShaders(vshader, fshader) { return createProgram(vshader, fshader); @@ -333,6 +345,8 @@ function drawTexture(gl, program, texture, vertexBuffer, vertexFormatLength) { gl.bindTexture(gl.TEXTURE_2D, texture); var uSampler = gl.getUniformLocation(program, 'u_Sampler'); gl.uniform1i(uSampler, 0); + var uFlip = gl.getUniformLocation(program, 'u_flip'); + gl.uniform1f(uFlip, backgroundFilp); gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); var aPosition = gl.getAttribLocation(program, 'a_Position'); gl.enableVertexAttribArray(aPosition); @@ -363,20 +377,16 @@ function drawProgressBar(gl, program, vertexBuffer, vertexFormatLength, progress } function draw() { - gl.disable(gl.SCISSOR_TEST); - gl.disable(gl.CULL_FACE); - gl.disable(gl.DEPTH_TEST); - gl.enable(gl.BLEND); gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); - gl.clearColor(0.0, 0.0, 0.0, 0.0); + gl.clearColor(bgColor[0], bgColor[1], bgColor[2], bgColor[3]); gl.clear(gl.COLOR_BUFFER_BIT); // draw background - drawTexture(gl, programBg, bgTexture, bgVertexBuffer, 4); + useCustomBg && drawTexture(gl, programBg, bgTexture, bgVertexBuffer, 4); // draw logo - drawTexture(gl, program, logoTexture, vertexBuffer, 4); + useLogo && drawTexture(gl, program, logoTexture, vertexBuffer, 4); // draw slogan - drawTexture(gl, program, sloganTexture, sloganVertexBuffer, 4); + useLogo && useDefaultLogo && drawTexture(gl, program, sloganTexture, sloganVertexBuffer, 4); // draw progress bar drawProgressBar(gl, programProgress, vertexBufferProgress, 3, progress, progressBarColor, progressBackground); } @@ -398,12 +408,12 @@ function end() { gl.useProgram(null); gl.bindTexture(gl.TEXTURE_2D, null); gl.bindBuffer(gl.ARRAY_BUFFER, null); - gl.deleteTexture(logoTexture); - gl.deleteTexture(sloganTexture); - gl.deleteTexture(bgTexture); + useLogo && gl.deleteTexture(logoTexture); + useLogo && useDefaultLogo && gl.deleteTexture(sloganTexture); + useCustomBg && gl.deleteTexture(bgTexture); gl.deleteBuffer(vertexBuffer); - gl.deleteBuffer(bgVertexBuffer); - gl.deleteBuffer(sloganVertexBuffer); + useCustomBg && gl.deleteBuffer(bgVertexBuffer); + useLogo && useDefaultLogo && gl.deleteBuffer(sloganVertexBuffer); gl.deleteBuffer(vertexBufferProgress); gl.deleteProgram(program); gl.deleteProgram(programBg); @@ -434,30 +444,35 @@ function start(alpha, antialias, useWebgl2) { gl = window.canvas.getContext("webgl", options); } initVertexBuffer(); - initBgVertexBuffer(); - initSloganVertexBuffer(); + useCustomBg && initBgVertexBuffer(); + useLogo && useDefaultLogo && initSloganVertexBuffer(); initProgressVertexBuffer(); initLogoTexture(); - initBgTexture(); - initSloganTexture(); + useCustomBg && initBgTexture(); + useLogo && useDefaultLogo && initSloganTexture(); - program = initShaders(VS_LOGO, FS_LOGO); - programBg = initShaders(VS_BG, FS_BG); + if (useLogo) { + program = initShaders(VS_LOGO, FS_LOGO); + } + if (useCustomBg) { + programBg = initShaders(VS_BG, FS_BG); + } programProgress = initShaders(VS_PROGRESSBAR, FS_PROGRESSBAR); tick(); + return Promise.all([ //logo should be loaded earlier than slogan - loadImage('logo.png').then(() => { + useLogo && loadImage(logoName).then(() => { updateVertexBuffer(); updateLogoTexture(); }).then(() => { - return loadSlogan('slogan.png').then(() => { + return useLogo && useDefaultLogo && loadSlogan('slogan.png').then(() => { updateSloganVertexBuffer(); updateSloganTexture(); }); }), - loadBackground('background.png').then(() => { + useCustomBg && loadBackground(bgName).then(() => { updateBgVertexBuffer(); updateBgTexture(); }) From 3c6a84934e0df9b3474921c64a7d675ec84754f9 Mon Sep 17 00:00:00 2001 From: PP Date: Thu, 3 Aug 2023 10:29:33 +0800 Subject: [PATCH 51/51] fix some bugs for cyberpunk demo on OH platform (#15846) * fix: bug on Destructuring Assignment syntax on OH * [AOT] workaround skip Storage type checking on OH * reuse fullscreen on OH platform --- .../marionette/animation-graph-animation-clip-binding.ts | 4 +++- cocos/core/platform/sys.ts | 7 +++++-- .../entry/src/main/ets/MainAbility/MainAbility.ts | 6 +++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cocos/animation/marionette/animation-graph-animation-clip-binding.ts b/cocos/animation/marionette/animation-graph-animation-clip-binding.ts index 298a61777a5..0c2ab2d0297 100644 --- a/cocos/animation/marionette/animation-graph-animation-clip-binding.ts +++ b/cocos/animation/marionette/animation-graph-animation-clip-binding.ts @@ -356,8 +356,10 @@ class AnimationClipAGEvaluationRegular implements AnimationClipAGEvaluation { const { tracks, - [exoticAnimationTag]: exoticAnimation, + // NOTE: on OH platform, there is a bug on Destructuring Assignment syntax. + // [exoticAnimationTag]: exoticAnimation, } = clip; + const exoticAnimation = clip[exoticAnimationTag]; for (const track of tracks) { if (track instanceof UntypedTrack) { diff --git a/cocos/core/platform/sys.ts b/cocos/core/platform/sys.ts index 8c475705488..3a6dbeebcb6 100644 --- a/cocos/core/platform/sys.ts +++ b/cocos/core/platform/sys.ts @@ -33,6 +33,9 @@ import { warnID, log } from './debug'; import { NetworkType, Language, OS, Platform, BrowserType, Feature } from '../../../pal/system-info/enum-type'; import { screen } from './screen'; +// TODO: the type Storage conflicts with the one on OH platform. +type Storage = any; + export declare namespace sys { /** * @en @@ -292,7 +295,7 @@ export const sys = { * @zh 尝试打开一个 web 页面,并非在所有平台都有效。 * @param url @zh 访问的链接。 @en Visited links. */ - openURL (url): void { + openURL (url: string): void { systemInfo.openURL(url); }, @@ -304,7 +307,7 @@ export const sys = { .then((): any => systemInfo.init()) .then((): void => { try { - let localStorage: Storage | null = sys.localStorage = window.localStorage; + let localStorage: Storage = sys.localStorage = window.localStorage; localStorage.setItem('storage', ''); localStorage.removeItem('storage'); localStorage = null; diff --git a/templates/openharmony/entry/src/main/ets/MainAbility/MainAbility.ts b/templates/openharmony/entry/src/main/ets/MainAbility/MainAbility.ts index 5f9c7db98b5..51b6bbd2d4f 100644 --- a/templates/openharmony/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/templates/openharmony/entry/src/main/ets/MainAbility/MainAbility.ts @@ -61,9 +61,9 @@ export default class MainAbility extends UIAbility { } }); // Set full screen - //windowStage.getMainWindow().then((window: window.Window) => { - // window.setFullScreen(true); - //}); + windowStage.getMainWindow().then((window: window.Window) => { + window.setWindowSystemBarEnable([]); + }); nativeContext.writablePathInit(this.context.cacheDir); }