From 615649534573520d643095ac1007ce46d068410d Mon Sep 17 00:00:00 2001 From: HifiExperiments Date: Tue, 26 Nov 2019 22:28:06 -0800 Subject: [PATCH] stupid, shadows still broken --- .../entities-renderer/src/RenderableModelEntityItem.cpp | 2 +- libraries/render-utils/src/Model.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index 1ea0d9d4c7..5fbbdfa0b8 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -1060,7 +1060,7 @@ void ModelEntityRenderer::setKey(bool didVisualGeometryRequestSucceed) { if (!_cullWithParent && _model && _model->isGroupCulled()) { builder.withMetaCullGroup(); } else if (_cullWithParent) { - builder.withoutSubMetaCulled(); + builder.withSubMetaCulled(); } if (didVisualGeometryRequestSucceed) { diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index 32e44c5cbf..d8172112ff 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -965,9 +965,11 @@ void Model::setCullWithParent(bool cullWithParent) { _cullWithParent = cullWithParent; render::Transaction transaction; - foreach(auto item, _modelMeshRenderItemsMap.keys()) { - transaction.updateItem(item, [cullWithParent](ModelMeshPartPayload& data) { + auto renderItemsKey = _renderItemKeyGlobalFlags; + for(auto item : _modelMeshRenderItemIDs) { + transaction.updateItem(item, [cullWithParent, renderItemsKey](ModelMeshPartPayload& data) { data.setCullWithParent(cullWithParent); + data.updateKey(renderItemsKey); }); } AbstractViewStateInterface::instance()->getMain3DScene()->enqueueTransaction(transaction);