History

Generating the SH from the cube map!

Sam Cake committed 11 years ago

Commit 65e83df1 parent 04d3f696 files · +17 −7Browse files

Showing the changes to libraries/render-utils/src/DeferredLightingEffect.cpp (1 of 6 files). Show all

Unified · Split

libraries/render-utils/src/DeferredLightingEffect.cpp+6−1
@@ -291,7 +291,12 @@ void DeferredLightingEffect::render() { · 290 unmodified lines
291291 auto globalLight = _allocatedLights[_globalLights.front()];
292292
293293 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+ }
295300 for (int i =0; i <model::SphericalHarmonics::NUM_COEFFICIENTS; i++) {
296301 program->setUniformValue(locations->ambientSphere + i, *(((QVector4D*) &sh) + i));
297302 }