diff --git a/EngineErrorMap.md b/EngineErrorMap.md index 3269cafad4..b707f1cf3d 100644 --- a/EngineErrorMap.md +++ b/EngineErrorMap.md @@ -3286,4 +3286,8 @@ The native folder may be generated from older versions, please refer https://doc ### 16003 -'%s' is removed since v%s, please use '%s' instead. \ No newline at end of file +'%s' is removed since v%s, please use '%s' instead. + +### 16101 + +The effect('%s') you are looking for does not exist, please confirm the effect name in the editor. NOTE: Since 3.6, the name of the built-in effect has been changed to its name in the editor, please check it out. More information please refer to https://docs.cocos.com/creator/manual/en/shader/effect-inspector.html \ No newline at end of file diff --git a/cc.config.json b/cc.config.json index b7a4593140..77dc2c8ec8 100644 --- a/cc.config.json +++ b/cc.config.json @@ -7,7 +7,8 @@ "970b0598-bcb0-4714-91fb-2e81440dccd8", "bcd64cc6-2dd9-43f6-abbe-66318d332032", "d930590d-bb92-4cc8-8bd1-23cd027f9edf", - "a3cd009f-0ab0-420d-9278-b9fdab939bbc" + "a3cd009f-0ab0-420d-9278-b9fdab939bbc", + "9361fd90-ba52-4f84-aa93-6e878fd576ca" ]}, "gfx-webgl": { "modules": [ "gfx-webgl" ] }, "gfx-webgl2": { "modules": [ "gfx-webgl2" ] }, @@ -15,7 +16,6 @@ "modules": [ "3d" ], "dependentAssets": [ "1baf0fc9-befa-459c-8bdd-af1a450a0319", - "9361fd90-ba52-4f84-aa93-6e878fd576ca", "511d2633-09a7-4bdd-ac42-f778032124b3", "5d45aa00-e064-4938-b314-4265f0c2258c", "28d6d6b8-3f66-4a73-9795-17a0852ba2d4", diff --git a/cocos/core/assets/effect-asset.ts b/cocos/core/assets/effect-asset.ts index 1f4438c0ce..4f020585f0 100644 --- a/cocos/core/assets/effect-asset.ts +++ b/cocos/core/assets/effect-asset.ts @@ -33,6 +33,7 @@ import { MacroRecord } from '../renderer/core/pass-utils'; import { programLib } from '../renderer/core/program-lib'; import { Asset } from './asset'; import { legacyCC } from '../global-exports'; +import { warnID } from '../platform/debug'; export declare namespace EffectAsset { export interface IPropertyInfo { @@ -163,6 +164,30 @@ export declare namespace EffectAsset { } } +const legacyBuiltinEffectNames = [ + 'planar-shadow', + 'skybox', + 'deferred-lighting', + 'bloom', + 'post-process', + 'profiler', + 'splash-screen', + 'standard', + 'unlit', + 'sprite', + 'particle', + 'particle-gpu', + 'particle-trail', + 'billboard', + 'terrain', + 'graphics', + 'clear-stencil', + 'spine', + 'occlusion-query', + 'geometry-renderer', + 'debug-renderer', +]; + /** * @en Effect asset is the base template for instantiating material, all effects should be unique globally. * All effects are managed in a static map of EffectAsset. @@ -211,6 +236,9 @@ export class EffectAsset extends Asset { return EffectAsset._effects[n]; } } + if (legacyBuiltinEffectNames.includes(name)) { + warnID(16101, name); + } return null; } diff --git a/native/cocos/core/assets/EffectAsset.cpp b/native/cocos/core/assets/EffectAsset.cpp index 0e5cdf907c..895a38a7e5 100644 --- a/native/cocos/core/assets/EffectAsset.cpp +++ b/native/cocos/core/assets/EffectAsset.cpp @@ -28,6 +28,7 @@ #include "core/Root.h" #include "engine/BaseEngine.h" #include "renderer/core/ProgramLib.h" +#include "core/platform/Debug.h" namespace cc { @@ -132,6 +133,35 @@ EffectAsset *EffectAsset::get(const ccstd::string &name) { return iter->second; } } + static ccstd::vector legacyBuiltinEffectNames{ + "planar-shadow", + "skybox", + "deferred-lighting", + "bloom", + "post-process", + "profiler", + "splash-screen", + "standard", + "unlit", + "sprite", + "particle", + "particle-gpu", + "particle-trail", + "billboard", + "terrain", + "graphics", + "clear-stencil", + "spine", + "occlusion-query", + "geometry-renderer", + "debug-renderer" + }; + for (auto &legacyName : legacyBuiltinEffectNames) { + if (name == legacyName) { + debug::warnID(16101, name); + } + } + return nullptr; } diff --git a/native/cocos/core/builtin/DebugInfos.cpp b/native/cocos/core/builtin/DebugInfos.cpp index 7ad38a21d3..fe37b0cdf0 100644 --- a/native/cocos/core/builtin/DebugInfos.cpp +++ b/native/cocos/core/builtin/DebugInfos.cpp @@ -451,6 +451,7 @@ ccstd::unordered_map debugInfos = { { 16001, "'%s' is deprecated since v%s, please use '%s' instead." }, { 16002, "'%s' is removed since v%s." }, { 16003, "'%s' is removed since v%s, please use '%s' instead." }, +{ 16101, "The effect('%s') you are looking for does not exist, please confirm the effect name in the editor. NOTE: Since 3.6, the name of the built-in effect has been changed to its name in the editor, please check it out. More information please refer to https://docs.cocos.com/creator/manual/en/shader/effect-inspector.html" }, }; }//namespace cc