fix(scene): Self-illuminated model nodes must not receive shadows

This commit is contained in:
Vsevolod Kremianskii 2021-01-30 17:09:24 +07:00
parent fb2929fb89
commit f83516cf42

View file

@ -130,10 +130,15 @@ void ModelNodeSceneNode::renderSingle(bool shadowPass) const {
locals.bumpmap.gridSize = glm::vec2(bumpmapTexture->features().numX, bumpmapTexture->features().numY);
locals.bumpmap.frame = _bumpmapFrame;
}
bool receivesShadows = _modelSceneNode->model()->classification() == Model::Classification::Other;
bool receivesShadows =
_modelSceneNode->model()->classification() == Model::Classification::Other &&
!_modelNode->isSelfIllumEnabled();
if (receivesShadows) {
locals.general.shadowsEnabled = true;
}
shared_ptr<ModelNode::Skin> skin(_modelNode->skin());
if (skin) {
locals.general.skeletalEnabled = true;