History

use references not pointers for ViewFrustums

also unravelling some spaghetti: (1) split Octree stuff out of ViewFrustum (2) moved ViewFrustum from octree to shared lib (3) removed some cruft

Andrew Meadows committed 10 years ago

Commit bcf2cc81 parent 21fa29446 files · +412 −390Browse files

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

Unified · Split

libraries/render-utils/src/RenderShadowTask.cpp+5−6
@@ -34,7 +34,7 @@ using namespace render; · 33 unmodified lines
3434 void RenderShadowMap::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext,
3535 const render::ShapeBounds& inShapes) {
3636 assert(renderContext->args);
37− assert(renderContext->args->_viewFrustum);
37+ assert(renderContext->args->hasViewFrustum());
3838
3939 const auto& lightStage = DependencyManager::get<DeferredLightingEffect>()->getLightStage();
4040 const auto globalLight = lightStage.lights[0];
@@ -146,16 +146,15 @@ void RenderShadowTask::run(const SceneContextPointer& sceneContext, const render · 105 unmodified lines
146146 }
147147
148148 // Cache old render args
149− const ViewFrustum* viewFrustum = args->_viewFrustum;
150149 RenderArgs::RenderMode mode = args->_renderMode;
151150
152− auto nearClip = viewFrustum->getNearClip();
151+ auto nearClip = args->getViewFrustum().getNearClip();
153152 float nearDepth = -args->_boomOffset.z;
154153 const int SHADOW_FAR_DEPTH = 20;
155− globalLight->shadow.setKeylightFrustum(viewFrustum, nearDepth, nearClip + SHADOW_FAR_DEPTH);
154+ globalLight->shadow.setKeylightFrustum(args->getViewFrustum(), nearDepth, nearClip + SHADOW_FAR_DEPTH);
156155
157156 // Set the keylight render args
158− args->_viewFrustum = globalLight->shadow.getFrustum().get();
157+ args->pushViewFrustum(*(globalLight->shadow.getFrustum()));
159158 args->_renderMode = RenderArgs::SHADOW_RENDER_MODE;
160159
161160 // TODO: Allow runtime manipulation of culling ShouldRenderFunctor
@@ -165,6 +164,6 @@ void RenderShadowTask::run(const SceneContextPointer& sceneContext, const render · 3 unmodified lines
165164 }
166165
167166 // Reset the render args
168− args->_viewFrustum = viewFrustum;
167+ args->popViewFrustum();
169168 args->_renderMode = mode;
170169 };

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t