Exemplo n.º 1
0
void DeferredLightingEffect::setGlobalLight(const glm::vec3& direction, const glm::vec3& diffuse, float intensity, float ambientIntensity) {
    auto light = _allocatedLights.front();
    light->setDirection(direction);
    light->setColor(diffuse);
    light->setIntensity(intensity);
    light->setAmbientIntensity(ambientIntensity);
}
Exemplo n.º 2
0
void RenderableZoneEntityItem::updateKeyAmbientFromEntity(RenderableZoneEntityItemMeta& keyZonePayload) {
    auto ambientLight = keyZonePayload.editAmbientLight();
    ambientLight->setType(model::Light::AMBIENT);

    ambientLight->setPosition(this->getPosition());
    ambientLight->setOrientation(this->getRotation());


    // Set the keylight
    ambientLight->setAmbientIntensity(this->getKeyLightProperties().getAmbientIntensity());
 
    if (this->getKeyLightProperties().getAmbientURL().isEmpty()) {
        keyZonePayload.setAmbientURL(this->getSkyboxProperties().getURL());
    } else {
        keyZonePayload.setAmbientURL(this->getKeyLightProperties().getAmbientURL());
    }

}