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
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 }