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
34void RenderShadowMap::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext,34void RenderShadowMap::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext,
35 const render::ShapeBounds& inShapes) {35 const render::ShapeBounds& inShapes) {
36 assert(renderContext->args);36 assert(renderContext->args);
37 assert(renderContext->args->_viewFrustum);37 assert(renderContext->args->hasViewFrustum());
38 38
39 const auto& lightStage = DependencyManager::get<DeferredLightingEffect>()->getLightStage();39 const auto& lightStage = DependencyManager::get<DeferredLightingEffect>()->getLightStage();
40 const auto globalLight = lightStage.lights[0];40 const auto globalLight = lightStage.lights[0];
@@ -146,16 +146,15 @@ void RenderShadowTask::run(const SceneContextPointer& sceneContext, const render · 105 unmodified lines
146 }146 }
147 147
148 // Cache old render args148 // Cache old render args
149 const ViewFrustum* viewFrustum = args->_viewFrustum;
150 RenderArgs::RenderMode mode = args->_renderMode;149 RenderArgs::RenderMode mode = args->_renderMode;
151 150
152 auto nearClip = viewFrustum->getNearClip();151 auto nearClip = args->getViewFrustum().getNearClip();
153 float nearDepth = -args->_boomOffset.z;152 float nearDepth = -args->_boomOffset.z;
154 const int SHADOW_FAR_DEPTH = 20;153 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);
156 155
157 // Set the keylight render args156 // Set the keylight render args
158 args->_viewFrustum = globalLight->shadow.getFrustum().get();157 args->pushViewFrustum(*(globalLight->shadow.getFrustum()));
159 args->_renderMode = RenderArgs::SHADOW_RENDER_MODE;158 args->_renderMode = RenderArgs::SHADOW_RENDER_MODE;
160 159
161 // TODO: Allow runtime manipulation of culling ShouldRenderFunctor160 // TODO: Allow runtime manipulation of culling ShouldRenderFunctor
@@ -165,6 +164,6 @@ void RenderShadowTask::run(const SceneContextPointer& sceneContext, const render · 3 unmodified lines
165 }164 }
166 165
167 // Reset the render args166 // Reset the render args
168 args->_viewFrustum = viewFrustum;167 args->popViewFrustum();
169 args->_renderMode = mode;168 args->_renderMode = mode;
170};169};

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