Skip to content

Commit 98a843f

Browse files
committed
fix for hdr image and toggle for enabling cube map.
1 parent cc177eb commit 98a843f

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed
Binary file not shown.
Binary file not shown.

examples/3d/ofxAssimpAdvancedExample/src/ofApp.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ 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));
1819

1920
ofx::assimp::ImportSettings tsettings;
@@ -109,9 +110,8 @@ void ofApp::setup(){
109110
cam.setPosition( 0, 400, 1000 );
110111
cam.lookAt( glm::vec3(0,150,0) );
111112

112-
// try commenting this out to see the effect that cube maps have on lighting
113113
// https://polyhaven.com/a/kloppenheim_06_puresky
114-
cubeMap.load( "kloppenheim_06_puresky_1k.exr", 512 );
114+
cubeMap.load( "kloppenheim_06_puresky_1k.hdr", 512 );
115115
}
116116

117117
//--------------------------------------------------------------
@@ -150,7 +150,10 @@ void ofApp::update(){
150150
}
151151

152152
light.getShadow().setStrength(mShadowStrength);
153-
cubeMap.setExposure(cubeMapExposure);
153+
cubeMap.setEnabled(mBEnableCubeMap);
154+
if( mBEnableCubeMap ) {
155+
cubeMap.setExposure(cubeMapExposure);
156+
}
154157

155158
float spacing = 50.0f;
156159
float hw = (((float)foxes.size()-1.f) * spacing) / 2.f;
@@ -192,6 +195,9 @@ void ofApp::draw(){
192195

193196

194197
cam.begin();
198+
if(mBEnableCubeMap) {
199+
cubeMap.draw();
200+
}
195201
renderScene();
196202
if(mBDebug) {
197203
light.draw();

examples/3d/ofxAssimpAdvancedExample/src/ofApp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class ofApp : public ofBaseApp{
4444
ofCubeMap cubeMap;
4545
ofParameter<float> cubeMapExposure;
4646
ofParameter<bool> mBDebug;
47+
ofParameter<bool> mBEnableCubeMap;
4748

4849
ofParameterGroup mShadowParams;
4950
ofParameter<float> mShadowStrength;

0 commit comments

Comments
 (0)