From f83516cf428479adea5e8f2b1093c2dae686fe32 Mon Sep 17 00:00:00 2001 From: Vsevolod Kremianskii Date: Sat, 30 Jan 2021 17:09:24 +0700 Subject: [PATCH] fix(scene): Self-illuminated model nodes must not receive shadows --- src/scene/node/modelnodescenenode.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/scene/node/modelnodescenenode.cpp b/src/scene/node/modelnodescenenode.cpp index 7b462cbb..40b9754e 100644 --- a/src/scene/node/modelnodescenenode.cpp +++ b/src/scene/node/modelnodescenenode.cpp @@ -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 skin(_modelNode->skin()); if (skin) { locals.general.skeletalEnabled = true;