@@ -14,7 +14,9 @@ void ofApp::setup(){
1414 glm::vec3 (-maxWizardPos,-maxWizardPos,-maxWizardPos),
1515 glm::vec3 (maxWizardPos,maxWizardPos,maxWizardPos) ) );
1616 gui.add (wizardHandOffset.set (" WizardHandOffset" , glm::vec3 (10.0 , 12 , 38 ), glm::vec3 (-200 ), glm::vec3 (200 )));
17+ gui.add (mBEnableCubeMap .set (" EnableCubeMap" , true ));
1718 gui.add (cubeMapExposure.set (" CubeMapExposure" , 0.25 , 0.0 , 1.0 ));
19+ gui.add (mBDrawCubeMap .set (" DrawCubeMap" , false ));
1820
1921 ofx::assimp::ImportSettings tsettings;
2022 tsettings.filePath = " ofLogoHollow.fbx" ;
@@ -109,9 +111,9 @@ void ofApp::setup(){
109111 cam.setPosition ( 0 , 400 , 1000 );
110112 cam.lookAt ( glm::vec3 (0 ,150 ,0 ) );
111113
112- // try commenting this out to see the effect that cube maps have on lighting
114+ // cube maps still have an effect on the final output even if an image is not loaded.
113115 // https://polyhaven.com/a/kloppenheim_06_puresky
114- cubeMap.load ( " kloppenheim_06_puresky_1k.exr " , 512 );
116+ cubeMap.load ( " kloppenheim_06_puresky_1k.hdr " , 512 );
115117}
116118
117119// --------------------------------------------------------------
@@ -150,7 +152,10 @@ void ofApp::update(){
150152 }
151153
152154 light.getShadow ().setStrength (mShadowStrength );
153- cubeMap.setExposure (cubeMapExposure);
155+ cubeMap.setEnabled (mBEnableCubeMap );
156+ if ( mBEnableCubeMap ) {
157+ cubeMap.setExposure (cubeMapExposure);
158+ }
154159
155160 float spacing = 50 .0f ;
156161 float hw = (((float )foxes.size ()-1 .f ) * spacing) / 2 .f ;
@@ -192,6 +197,9 @@ void ofApp::draw(){
192197
193198
194199 cam.begin ();
200+ if (mBDrawCubeMap ) {
201+ cubeMap.draw ();
202+ }
195203 renderScene ();
196204 if (mBDebug ) {
197205 light.draw ();
0 commit comments