diff --git a/cocos/core/pipeline/scene-culling.ts b/cocos/core/pipeline/scene-culling.ts index 8a9c70dc3f..eb6228a225 100644 --- a/cocos/core/pipeline/scene-culling.ts +++ b/cocos/core/pipeline/scene-culling.ts @@ -149,7 +149,7 @@ export function sceneCulling (pipeline: RenderPipeline, camera: Camera) { if ((camera.clearFlag & SKYBOX_FLAG)) { if (skybox.enabled && skybox.model) { renderObjects.push(getRenderObject(skybox.model, camera)); - } else { + } else if(camera.clearFlag === SKYBOX_FLAG) { legacyCC.warnID(15100, camera.name); } } diff --git a/native/cocos/renderer/pipeline/SceneCulling.cpp b/native/cocos/renderer/pipeline/SceneCulling.cpp index 86f639395a..630d2b2dac 100644 --- a/native/cocos/renderer/pipeline/SceneCulling.cpp +++ b/native/cocos/renderer/pipeline/SceneCulling.cpp @@ -147,10 +147,11 @@ void sceneCulling(const RenderPipeline *pipeline, scene::Camera *camera) { csmLayers->clearCastShadowObjects(); csmLayers->clearLayerObjects(); - if (static_cast(camera->getClearFlag()) & skyboxFlag) { + auto clearFlagValue = static_cast(camera->getClearFlag()); + if (clearFlagValue & skyboxFlag) { if (skyBox != nullptr && skyBox->isEnabled() && skyBox->getModel()) { sceneData->addRenderObject(genRenderObject(skyBox->getModel(), camera)); - } else { + } else if(clearFlagValue == skyboxFlag) { debug::warnID(15100, camera->getName()); } }