Showing the changes to libraries/render-utils/src/RenderDeferredTask.cpp (1 of 123 files). Show all
Unified · Split
| @@ -259,8 +259,18 @@ void DrawDeferred::run(const SceneContextPointer& sceneContext, const RenderCont · 258 unmodified lines | |||
| 259 | // Setup lighting model for all items; | 259 | // Setup lighting model for all items; |
| 260 | batch.setUniformBuffer(render::ShapePipeline::Slot::LIGHTING_MODEL, lightingModel->getParametersBuffer()); | 260 | batch.setUniformBuffer(render::ShapePipeline::Slot::LIGHTING_MODEL, lightingModel->getParametersBuffer()); |
| 261 | 261 | ||
| 262 | renderShapes(sceneContext, renderContext, _shapePlumber, inItems, _maxDrawn); | 262 | // From the lighting model define a global shapKey ORED with individiual keys |
| 263 | ShapeKey::Builder keyBuilder; | ||
| 264 | if (lightingModel->isWireframeEnabled()) { | ||
| 265 | keyBuilder.withWireframe(); | ||
| 266 | } | ||
| 267 | ShapeKey globalKey = keyBuilder.build(); | ||
| 268 | args->_globalShapeKey = globalKey._flags.to_ulong(); | ||
| 269 | |||
| 270 | renderShapes(sceneContext, renderContext, _shapePlumber, inItems, _maxDrawn, globalKey); | ||
| 271 | |||
| 263 | args->_batch = nullptr; | 272 | args->_batch = nullptr; |
| 273 | args->_globalShapeKey = 0; | ||
| 264 | }); | 274 | }); |
| 265 | 275 | ||
| 266 | config->setNumDrawn((int)inItems.size()); | 276 | config->setNumDrawn((int)inItems.size()); |
| @@ -295,12 +305,21 @@ void DrawStateSortDeferred::run(const SceneContextPointer& sceneContext, const R · 28 unmodified lines | |||
| 295 | // Setup lighting model for all items; | 305 | // Setup lighting model for all items; |
| 296 | batch.setUniformBuffer(render::ShapePipeline::Slot::LIGHTING_MODEL, lightingModel->getParametersBuffer()); | 306 | batch.setUniformBuffer(render::ShapePipeline::Slot::LIGHTING_MODEL, lightingModel->getParametersBuffer()); |
| 297 | 307 | ||
| 308 | // From the lighting model define a global shapKey ORED with individiual keys | ||
| 309 | ShapeKey::Builder keyBuilder; | ||
| 310 | if (lightingModel->isWireframeEnabled()) { | ||
| 311 | keyBuilder.withWireframe(); | ||
| 312 | } | ||
| 313 | ShapeKey globalKey = keyBuilder.build(); | ||
| 314 | args->_globalShapeKey = globalKey._flags.to_ulong(); | ||
| 315 | |||
| 298 | if (_stateSort) { | 316 | if (_stateSort) { |
| 299 | renderStateSortShapes(sceneContext, renderContext, _shapePlumber, inItems, _maxDrawn); | 317 | renderStateSortShapes(sceneContext, renderContext, _shapePlumber, inItems, _maxDrawn, globalKey); |
| 300 | } else { | 318 | } else { |
| 301 | renderShapes(sceneContext, renderContext, _shapePlumber, inItems, _maxDrawn); | 319 | renderShapes(sceneContext, renderContext, _shapePlumber, inItems, _maxDrawn, globalKey); |
| 302 | } | 320 | } |
| 303 | args->_batch = nullptr; | 321 | args->_batch = nullptr; |
| 322 | args->_globalShapeKey = 0; | ||
| 304 | }); | 323 | }); |
| 305 | 324 | ||
| 306 | config->setNumDrawn((int)inItems.size()); | 325 | config->setNumDrawn((int)inItems.size()); |