Hey folks, I’ve got a query regarding ofLight and it’s interactions on other objects. It seems that calling ofLight::enable() has some sort of global effect which is leading to undesired results.
This is my current setup for testing, I have a cuboid and an icosphere drawn, the former is being lit the latter is outside and appears flat grey. I also have a GUI being drawn outside of the camera and depth test. Why are these elements not being drawn as they would be if ofLight::enable() hadn’t been called, perhaps there’s an easy fix I’m missing.
void ofApp::draw(){
ofClear(0);
ofEnableDepthTest();
light.enable();
camera.begin();
ofDrawSphere(lightPosition->x, lightPosition->y, lightPosition->z, 16);
ofDrawBox(0.0f, 0.0f, 0.0f, 256.0f, 128.0f, 128.0f);
light.disable();
ofDrawIcoSphere(300, 0.0f, 0.0f, 64.0f);
camera.end();
ofDisableDepthTest();
gui.draw();
}
Many thanks!