FIxing the problem of shadows not repecting the cull group

This commit is contained in:
samcake 2018-05-21 18:07:04 -07:00
parent f536f7b6c9
commit 072d0f262c

View file

@ -395,9 +395,13 @@ void CullShapeBounds::run(const RenderContextPointer& renderContext, const Input
if (antiFrustum == nullptr) {
for (auto& item : inItems.second) {
if (test.solidAngleTest(item.bound) && test.frustumTest(item.bound)) {
const auto shapeKey = scene->getItem(item.id).getKey();
const auto& theItem = scene->getItem(item.id);
const auto shapeKey = theItem.getKey();
if (cullFilter.test(shapeKey)) {
outItems->second.emplace_back(item);
if (theItem.getKey().isMetaCullGroup()) {
theItem.fetchMetaSubItemBounds(outItems->second, (*scene));
}
}
if (boundsFilter.test(shapeKey)) {
outBounds += item.bound;
@ -407,9 +411,13 @@ void CullShapeBounds::run(const RenderContextPointer& renderContext, const Input
} else {
for (auto& item : inItems.second) {
if (test.solidAngleTest(item.bound) && test.frustumTest(item.bound) && test.antiFrustumTest(item.bound)) {
const auto shapeKey = scene->getItem(item.id).getKey();
const auto& theItem = scene->getItem(item.id);
const auto shapeKey = theItem.getKey();
if (cullFilter.test(shapeKey)) {
outItems->second.emplace_back(item);
if (theItem.getKey().isMetaCullGroup()) {
theItem.fetchMetaSubItemBounds(outItems->second, (*scene));
}
}
if (boundsFilter.test(shapeKey)) {
outBounds += item.bound;