mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 11:43:16 +02:00
fixing warnings and the debug of shadows
This commit is contained in:
parent
8fba8062c3
commit
21577ba311
3 changed files with 11 additions and 14 deletions
|
@ -203,7 +203,7 @@ void ExtractFrustums::run(const render::RenderContextPointer& renderContext, con
|
|||
|
||||
RenderArgs* args = renderContext->args;
|
||||
|
||||
const auto& lightFrame = inputs;
|
||||
const auto& shadowFrame = inputs;
|
||||
|
||||
// Return view frustum
|
||||
auto& viewFrustum = output[VIEW_FRUSTUM].edit<ViewFrustumPointer>();
|
||||
|
@ -214,18 +214,15 @@ void ExtractFrustums::run(const render::RenderContextPointer& renderContext, con
|
|||
}
|
||||
|
||||
// Return shadow frustum
|
||||
auto lightStage = args->_scene->getStage<LightStage>(LightStage::getName());
|
||||
LightStage::ShadowPointer globalShadow;
|
||||
if (shadowFrame && !shadowFrame->_objects.empty() && shadowFrame->_objects[0]) {
|
||||
globalShadow = shadowFrame->_objects[0];
|
||||
}
|
||||
for (auto i = 0; i < SHADOW_CASCADE_FRUSTUM_COUNT; i++) {
|
||||
auto& shadowFrustum = output[SHADOW_CASCADE0_FRUSTUM+i].edit<ViewFrustumPointer>();
|
||||
if (lightStage) {
|
||||
/* auto globalShadow = lightStage->getCurrentKeyShadow(*lightFrame);
|
||||
|
||||
if (globalShadow && i<(int)globalShadow->getCascadeCount()) {
|
||||
auto& cascade = globalShadow->getCascade(i);
|
||||
shadowFrustum = cascade.getFrustum();
|
||||
} else*/ {
|
||||
shadowFrustum.reset();
|
||||
}
|
||||
if (globalShadow && i<(int)globalShadow->getCascadeCount()) {
|
||||
auto& cascade = globalShadow->getCascade(i);
|
||||
shadowFrustum = cascade.getFrustum();
|
||||
} else {
|
||||
shadowFrustum.reset();
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ public:
|
|||
FRUSTUM_COUNT
|
||||
};
|
||||
|
||||
using Inputs = LightStage::FramePointer;
|
||||
using Inputs = LightStage::ShadowFramePointer;
|
||||
using Outputs = render::VaryingArray<ViewFrustumPointer, FRUSTUM_COUNT>;
|
||||
using JobModel = render::Job::ModelIO<ExtractFrustums, Inputs, Outputs>;
|
||||
|
||||
|
|
|
@ -354,7 +354,7 @@ void RenderDeferredTaskDebug::build(JobModel& task, const render::Varying& input
|
|||
|
||||
task.addJob<DrawBounds>("DrawLightBounds", lights);
|
||||
task.addJob<DrawBounds>("DrawZones", zones);
|
||||
const auto frustums = task.addJob<ExtractFrustums>("ExtractFrustums", lightFrame);
|
||||
const auto frustums = task.addJob<ExtractFrustums>("ExtractFrustums", shadowFrame);
|
||||
const auto viewFrustum = frustums.getN<ExtractFrustums::Outputs>(ExtractFrustums::VIEW_FRUSTUM);
|
||||
task.addJob<DrawFrustum>("DrawViewFrustum", viewFrustum, glm::vec3(0.0f, 1.0f, 0.0f));
|
||||
for (auto i = 0; i < ExtractFrustums::SHADOW_CASCADE_FRUSTUM_COUNT; i++) {
|
||||
|
@ -447,7 +447,7 @@ void DrawDeferred::run(const RenderContextPointer& renderContext, const Inputs&
|
|||
const auto& lightFrame = inputs.get2();
|
||||
const auto& lightingModel = inputs.get3();
|
||||
const auto& lightClusters = inputs.get4();
|
||||
const auto& shadowFrame = inputs.get5();
|
||||
// Not needed yet: const auto& shadowFrame = inputs.get5();
|
||||
const auto jitter = inputs.get6();
|
||||
auto deferredLightingEffect = DependencyManager::get<DeferredLightingEffect>();
|
||||
|
||||
|
|
Loading…
Reference in a new issue