diff options
Diffstat (limited to 'src/datavisualization/engine')
-rw-r--r-- | src/datavisualization/engine/abstract3drenderer.cpp | 7 | ||||
-rw-r--r-- | src/datavisualization/engine/qabstract3dgraph.cpp | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/datavisualization/engine/abstract3drenderer.cpp b/src/datavisualization/engine/abstract3drenderer.cpp index a2181271..82952a26 100644 --- a/src/datavisualization/engine/abstract3drenderer.cpp +++ b/src/datavisualization/engine/abstract3drenderer.cpp @@ -582,6 +582,7 @@ CustomRenderItem *Abstract3DRenderer::addCustomItem(QCustom3DItem *item) QVector3D translation = convertPositionToTranslation(item->position()); newItem->setTranslation(translation); newItem->setVisible(item->isVisible()); + newItem->setShadowCasting(item->isShadowCasting()); m_customRenderCache.insert(item, newItem); return newItem; } @@ -620,6 +621,10 @@ void Abstract3DRenderer::updateCustomItem(CustomRenderItem *renderItem) renderItem->setVisible(item->isVisible()); item->d_ptr->m_dirtyBits.visibleDirty = false; } + if (item->d_ptr->m_dirtyBits.shadowCastingDirty) { + renderItem->setShadowCasting(item->isShadowCasting()); + item->d_ptr->m_dirtyBits.shadowCastingDirty = false; + } } void Abstract3DRenderer::drawCustomItems(RenderingState state, @@ -700,7 +705,7 @@ void Abstract3DRenderer::drawCustomItems(RenderingState state, itemColor /= 255.0f; shader->setUniformValue(shader->color(), itemColor); m_drawer->drawObject(shader, item->mesh()); - } else { + } else if (item->isShadowCasting()) { // Depth render shader->setUniformValue(shader->MVP(), depthProjectionViewMatrix * modelMatrix); m_drawer->drawObject(shader, item->mesh()); diff --git a/src/datavisualization/engine/qabstract3dgraph.cpp b/src/datavisualization/engine/qabstract3dgraph.cpp index 9818d176..196460da 100644 --- a/src/datavisualization/engine/qabstract3dgraph.cpp +++ b/src/datavisualization/engine/qabstract3dgraph.cpp @@ -430,6 +430,11 @@ void QAbstract3DGraph::removeCustomItemAt(const QVector3D &position) * Gets ownership of given \a item back and removes the \a item from the graph. * * \since Qt Data Visualization 1.1 + * + * \note If the same item is added back to the graph, the texture or the texture file needs to be + * re-set. + * + * \sa QCustom3DItem::setTextureImage(), QCustom3DItem::setTextureFile() */ void QAbstract3DGraph::releaseCustomItem(QCustom3DItem *item) { |