History

Merge remote-tracking branch 'upstream/master' into smarter_textures

Brad Davis committed 9 years ago

Commit e482eac2 parents 5a6478c 92e3f87123 files · +3184 −1521Browse files

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

Unified · Split

libraries/render-utils/src/RenderDeferredTask.cpp+22−3
@@ -259,8 +259,18 @@ void DrawDeferred::run(const SceneContextPointer& sceneContext, const RenderCont · 258 unmodified lines
259259 // Setup lighting model for all items;
260260 batch.setUniformBuffer(render::ShapePipeline::Slot::LIGHTING_MODEL, lightingModel->getParametersBuffer());
261261
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+
263272 args->_batch = nullptr;
273+ args->_globalShapeKey = 0;
264274 });
265275
266276 config->setNumDrawn((int)inItems.size());
@@ -295,12 +305,21 @@ void DrawStateSortDeferred::run(const SceneContextPointer& sceneContext, const R · 28 unmodified lines
295305 // Setup lighting model for all items;
296306 batch.setUniformBuffer(render::ShapePipeline::Slot::LIGHTING_MODEL, lightingModel->getParametersBuffer());
297307
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+
298316 if (_stateSort) {
299− renderStateSortShapes(sceneContext, renderContext, _shapePlumber, inItems, _maxDrawn);
317+ renderStateSortShapes(sceneContext, renderContext, _shapePlumber, inItems, _maxDrawn, globalKey);
300318 } else {
301− renderShapes(sceneContext, renderContext, _shapePlumber, inItems, _maxDrawn);
319+ renderShapes(sceneContext, renderContext, _shapePlumber, inItems, _maxDrawn, globalKey);
302320 }
303321 args->_batch = nullptr;
322+ args->_globalShapeKey = 0;
304323 });
305324
306325 config->setNumDrawn((int)inItems.size());