From bde33a6367b09b7ea3a3faaac15ababcc18a11ad Mon Sep 17 00:00:00 2001 From: oahc09 Date: Mon, 27 Feb 2023 09:30:05 +0800 Subject: [PATCH] fix:xr skip shadowCulling when camera culling enable is false (#14343) if not right eye will not show shadow --- native/cocos/renderer/pipeline/ShadowMapBatchedQueue.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.cpp b/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.cpp index cc414e985a..2937efdd9d 100644 --- a/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.cpp +++ b/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.cpp @@ -70,7 +70,10 @@ void ShadowMapBatchedQueue::gatherLightPasses(const scene::Camera *camera, const } else { layer = csmLayers->getLayers()[level]; } - shadowCulling(_pipeline, camera, layer); + bool isCullingEnable = camera->isCullingEnabled(); + if (isCullingEnable) { + shadowCulling(_pipeline, camera, layer); + } const RenderObjectList &dirShadowObjects = layer->getShadowObjects(); for (const auto &ro : dirShadowObjects) { add(ro.model);