Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
14 changes: 11 additions & 3 deletions examples/3d/ofxAssimpAdvancedExample/src/ofApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ void ofApp::setup(){
glm::vec3(-maxWizardPos,-maxWizardPos,-maxWizardPos),
glm::vec3(maxWizardPos,maxWizardPos,maxWizardPos) ) );
gui.add(wizardHandOffset.set("WizardHandOffset", glm::vec3(10.0, 12, 38), glm::vec3(-200), glm::vec3(200)));
gui.add(mBEnableCubeMap.set("EnableCubeMap", true));
gui.add(cubeMapExposure.set("CubeMapExposure", 0.25, 0.0, 1.0));
gui.add(mBDrawCubeMap.set("DrawCubeMap", false ));

ofx::assimp::ImportSettings tsettings;
tsettings.filePath = "ofLogoHollow.fbx";
Expand Down Expand Up @@ -109,9 +111,9 @@ void ofApp::setup(){
cam.setPosition( 0, 400, 1000 );
cam.lookAt( glm::vec3(0,150,0) );

// try commenting this out to see the effect that cube maps have on lighting
// cube maps still have an effect on the final output even if an image is not loaded.
// https://polyhaven.com/a/kloppenheim_06_puresky
cubeMap.load( "kloppenheim_06_puresky_1k.exr", 512 );
cubeMap.load( "kloppenheim_06_puresky_1k.hdr", 512 );
}

//--------------------------------------------------------------
Expand Down Expand Up @@ -150,7 +152,10 @@ void ofApp::update(){
}

light.getShadow().setStrength(mShadowStrength);
cubeMap.setExposure(cubeMapExposure);
cubeMap.setEnabled(mBEnableCubeMap);
if( mBEnableCubeMap ) {
cubeMap.setExposure(cubeMapExposure);
}

float spacing = 50.0f;
float hw = (((float)foxes.size()-1.f) * spacing) / 2.f;
Expand Down Expand Up @@ -192,6 +197,9 @@ void ofApp::draw(){


cam.begin();
if(mBDrawCubeMap) {
cubeMap.draw();
}
renderScene();
if(mBDebug) {
light.draw();
Expand Down
1 change: 1 addition & 0 deletions examples/3d/ofxAssimpAdvancedExample/src/ofApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class ofApp : public ofBaseApp{
ofCubeMap cubeMap;
ofParameter<float> cubeMapExposure;
ofParameter<bool> mBDebug;
ofParameter<bool> mBEnableCubeMap, mBDrawCubeMap;

ofParameterGroup mShadowParams;
ofParameter<float> mShadowStrength;
Expand Down