Skip to content

Commit

Permalink
add Root::getPhase
Browse files Browse the repository at this point in the history
  • Loading branch information
2youyou2 committed May 20, 2024
1 parent 45d1661 commit 3bc6111
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
continue;
}

// 裁剪
vec3 lightDirWithLength = IS_RANGED_DIRECTIONAL_LIGHT(cc_lightPos[i].w) ? -normalize(cc_lightDir[i].xyz) : cc_lightPos[i].xyz - worldPos;

float distToLightSqr = dot(lightDirWithLength, lightDirWithLength);
Expand Down
4 changes: 4 additions & 0 deletions native/cocos/core/Root.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,10 @@ void Root::updateGlobalLightsUBOs(ccstd::vector<scene::Light*>& lights)
ubo->updateGlobalLightsUBOs(lights);
}

uint32_t Root::getPhase(const ccstd::string &phase) {
return cc::pipeline::getPhaseID(phase);
}

void Root::onGlobalPipelineStateChanged() {
for (const auto &scene : _scenes) {
scene->onGlobalPipelineStateChanged();
Expand Down
2 changes: 2 additions & 0 deletions native/cocos/core/Root.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ class Root final {

void updateGlobalLightsUBOs(ccstd::vector<scene::Light *>& lights);

uint32_t getPhase(const ccstd::string &phase);

private:
void frameMoveBegin();
void frameMoveProcess(bool isNeedUpdateScene, int32_t totalFrames);
Expand Down

0 comments on commit 3bc6111

Please sign in to comment.