@@ -14,7 +14,9 @@ void ofApp::setup(){
14
14
glm::vec3 (-maxWizardPos,-maxWizardPos,-maxWizardPos),
15
15
glm::vec3 (maxWizardPos,maxWizardPos,maxWizardPos) ) );
16
16
gui.add (wizardHandOffset.set (" WizardHandOffset" , glm::vec3 (10.0 , 12 , 38 ), glm::vec3 (-200 ), glm::vec3 (200 )));
17
+ gui.add (mBEnableCubeMap .set (" EnableCubeMap" , true ));
17
18
gui.add (cubeMapExposure.set (" CubeMapExposure" , 0.25 , 0.0 , 1.0 ));
19
+ gui.add (mBDrawCubeMap .set (" DrawCubeMap" , false ));
18
20
19
21
ofx::assimp::ImportSettings tsettings;
20
22
tsettings.filePath = " ofLogoHollow.fbx" ;
@@ -109,9 +111,9 @@ void ofApp::setup(){
109
111
cam.setPosition ( 0 , 400 , 1000 );
110
112
cam.lookAt ( glm::vec3 (0 ,150 ,0 ) );
111
113
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.
113
115
// 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 );
115
117
}
116
118
117
119
// --------------------------------------------------------------
@@ -150,7 +152,10 @@ void ofApp::update(){
150
152
}
151
153
152
154
light.getShadow ().setStrength (mShadowStrength );
153
- cubeMap.setExposure (cubeMapExposure);
155
+ cubeMap.setEnabled (mBEnableCubeMap );
156
+ if ( mBEnableCubeMap ) {
157
+ cubeMap.setExposure (cubeMapExposure);
158
+ }
154
159
155
160
float spacing = 50 .0f ;
156
161
float hw = (((float )foxes.size ()-1 .f ) * spacing) / 2 .f ;
@@ -192,6 +197,9 @@ void ofApp::draw(){
192
197
193
198
194
199
cam.begin ();
200
+ if (mBDrawCubeMap ) {
201
+ cubeMap.draw ();
202
+ }
195
203
renderScene ();
196
204
if (mBDebug ) {
197
205
light.draw ();
0 commit comments