Avoid light prop copies when setting globalLight

This commit is contained in:
Zach Pomerantz 2016-02-24 16:20:59 -08:00
parent 1817b8ef2f
commit 20bfdba14b

View file

@ -560,13 +560,7 @@ static void loadLightProgram(const char* vertSource, const char* fragSource, boo
}
void DeferredLightingEffect::setGlobalLight(const model::LightPointer& light, const gpu::TexturePointer& skyboxTexture) {
auto globalLight = _allocatedLights.front();
globalLight->setDirection(light->getDirection());
globalLight->setColor(light->getColor());
globalLight->setIntensity(light->getIntensity());
globalLight->setAmbientIntensity(light->getAmbientIntensity());
globalLight->setAmbientSphere(light->getAmbientSphere());
_allocatedLights.front() = light;
_skyboxTexture = skyboxTexture;
}