History

fixing warnings from the build

sam gateau committed 7 years ago

Commit b8d96d91 parent 5b50b035 files · +11 −35Browse files

Showing the changes to libraries/render-utils/src/RenderShadowTask.cpp (1 of 5 files). Show all

Unified · Split

libraries/render-utils/src/RenderShadowTask.cpp+5−11
@@ -33,6 +33,8 @@ · 32 unmodified lines
3333 // but are readjusted afterwards
3434 #define SHADOW_FRUSTUM_NEAR 1.0f
3535 #define SHADOW_FRUSTUM_FAR 500.0f
36+static const unsigned int SHADOW_CASCADE_COUNT{ 4 };
37+static const float SHADOW_MAX_DISTANCE{ 40.0f };
3638
3739 using namespace render;
3840
@@ -62,8 +64,6 @@ void RenderShadowTask::build(JobModel& task, const render::Varying& input, rende · 23 unmodified lines
6264
6365 const auto& lightFrame = input.getN<Input>(0);
6466
65− const auto& lightingModel = input.getN<Input>(1);
66−
6767 const auto setupOutput = task.addJob<RenderShadowSetup>("ShadowSetup", input);
6868 const auto queryResolution = setupOutput.getN<RenderShadowSetup::Output>(1);
6969 const auto shadowFrame = setupOutput.getN<RenderShadowSetup::Output>(3);
@@ -371,7 +371,7 @@ void RenderShadowSetup::run(const render::RenderContextPointer& renderContext, c · 301 unmodified lines
371371 output.edit2() = _cameraFrustum;
372372
373373 if (!_globalShadowObject) {
374− _globalShadowObject = std::make_shared<LightStage::Shadow>(graphics::LightPointer(), 100.f, 4);
374+ _globalShadowObject = std::make_shared<LightStage::Shadow>(graphics::LightPointer(), SHADOW_MAX_DISTANCE, SHADOW_CASCADE_COUNT);
375375 }
376376
377377 const auto theGlobalLight = lightStage->getCurrentKeyLight(lightFrame);
@@ -446,19 +446,13 @@ void RenderShadowSetup::run(const render::RenderContextPointer& renderContext, c · 68 unmodified lines
446446
447447 void RenderShadowCascadeSetup::run(const render::RenderContextPointer& renderContext, const Inputs& input, Outputs& output) {
448448 const auto shadowFrame = input;
449− /*
450− auto lightStage = renderContext->_scene->getStage<LightStage>();
451− const auto& lightFrame = *input;
452− assert(lightStage);
453−*/
449+
454450 // Cache old render args
455451 RenderArgs* args = renderContext->args;
456452
457453 RenderShadowTask::CullFunctor cullFunctor;
458−
459−
460454 if (shadowFrame && !shadowFrame->_objects.empty() && shadowFrame->_objects[0]) {
461− const auto globalShadow = shadowFrame->_objects[0]; //lightStage->getCurrentKeyShadow(lightFrame);
455+ const auto globalShadow = shadowFrame->_objects[0];
462456
463457 if (globalShadow && _cascadeIndex < globalShadow->getCascadeCount()) {
464458 // Second item filter is to filter items to keep in shadow frustum computation (here we need to keep shadow receivers)