fix: Room models must never produce shadows (because artifacts)

This commit is contained in:
Vsevolod Kremianskii 2021-02-17 23:00:25 +07:00
parent 230e5efc16
commit 3858d8fc78

View file

@ -89,13 +89,7 @@ bool ModelNodeSceneNode::shouldRender() const {
bool ModelNodeSceneNode::shouldCastShadows() const {
shared_ptr<ModelMesh> mesh(_modelNode->mesh());
if (!mesh) return false;
if (isFeatureEnabled(Feature::DynamicRoomLighting) && _modelSceneNode->classification() == ModelSceneNode::Classification::Room) {
return mesh->shouldRender() && !_modelNode->isSelfIllumEnabled();
}
return mesh->shouldCastShadows() && !static_cast<bool>(_modelNode->skin());
return mesh && mesh->shouldCastShadows() && !static_cast<bool>(_modelNode->skin());
}
bool ModelNodeSceneNode::isTransparent() const {