Skip to content

Commit

Permalink
spot light shadow map added
Browse files Browse the repository at this point in the history
  • Loading branch information
star-e committed Sep 22, 2023
1 parent 47e4794 commit 6fdba8a
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions native/cocos/renderer/pipeline/custom/NativeRenderGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,11 +779,18 @@ void NativeSceneBuilder::useLightFrustum(
return;
}

const auto *pLight = dynamic_cast<const scene::DirectionalLight *>(light.get());
if (pLight) {
setBuiltinDirectionalLightFrustumConstants(sceneData.camera, pLight, csmLevel);
} else {
CC_EXPECTS(false);
switch (light->getType()) {
case scene::LightType::DIRECTIONAL: {
setBuiltinDirectionalLightFrustumConstants(
sceneData.camera, dynamic_cast<const scene::DirectionalLight *>(light.get()), csmLevel);
} break;
case scene::LightType::SPOT: {
setBuiltinSpotLightFrustumConstants(
dynamic_cast<const scene::SpotLight *>(light.get()));
} break;
default:
// noop
break;
}
}

Expand Down

0 comments on commit 6fdba8a

Please sign in to comment.