Showing the changes to libraries/render-utils/src/DeferredLightingEffect.cpp (1 of 6 files). Show all
Unified · Split
| @@ -291,7 +291,12 @@ void DeferredLightingEffect::render() { · 290 unmodified lines | |||
| 291 | auto globalLight = _allocatedLights[_globalLights.front()]; | 291 | auto globalLight = _allocatedLights[_globalLights.front()]; |
| 292 | 292 | ||
| 293 | if (locations->ambientSphere >= 0) { | 293 | if (locations->ambientSphere >= 0) { |
| 294 | auto sh = globalLight->getAmbientSphere(); | 294 | model::SphericalHarmonics sh; |
| 295 | if (useSkyboxCubemap) { | ||
| 296 | sh = _skybox->getAmbientSH(); | ||
| 297 | } else { | ||
| 298 | sh = globalLight->getAmbientSphere(); | ||
| 299 | } | ||
| 295 | for (int i =0; i <model::SphericalHarmonics::NUM_COEFFICIENTS; i++) { | 300 | for (int i =0; i <model::SphericalHarmonics::NUM_COEFFICIENTS; i++) { |
| 296 | program->setUniformValue(locations->ambientSphere + i, *(((QVector4D*) &sh) + i)); | 301 | program->setUniformValue(locations->ambientSphere + i, *(((QVector4D*) &sh) + i)); |
| 297 | } | 302 | } |