mirror of https://github.com/axmolengine/axmol.git
Merge pull request #14194 from super626/v3
check light enable or not when switching shader
This commit is contained in:
commit
7466c4c71e
|
@ -730,7 +730,7 @@ void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
|
||||||
const auto lights = scene->getLights();
|
const auto lights = scene->getLights();
|
||||||
bool usingLight = false;
|
bool usingLight = false;
|
||||||
for (const auto light : lights) {
|
for (const auto light : lights) {
|
||||||
usingLight = ((unsigned int)light->getLightFlag() & _lightMask) > 0;
|
usingLight = (light->isEnabled() && (unsigned int)light->getLightFlag() & _lightMask) > 0;
|
||||||
if (usingLight)
|
if (usingLight)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue