Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Working with more then 8 ofLights-objects

$
0
0

@Jipolie01 wrote:

Hi everybody,

I'm trying to use a bunch of lights (over 20), I found out that the limit is 8. With help from an other post on this forum I was able to change my GL-version to 3,3. The code for this is below:

ofGLWindowSettings settings;
settings.setGLVersion(3, 3);
ofCreateWindow(settings);
return ofRunApp(new ofApp());

The problem now is that my light doesn't seem to work anymore. The box is white instead of the color I gave as diffuseColor. The code for the light and box is below:

    void ofApp::setup(){

        ofSetVerticalSync(true);
        cam.setAutoDistance(true);
        light.setup();
        light.setSpotlight();
        light.tilt(-180);
        light.setPosition(0, 0, -60);
        light.setDiffuseColor(ofFloatColor::coral);
    }

    void ofApp::draw(){
        cam.begin();
        light.enable();

        ofDrawBox(0, 0, 100, 60,60,1);
        light.draw();
        light.disable();
        cam.end();
    }

Do ofLight-objects work differently in GL 3.3 then they do in the original version? Is there a solution for this?

Thanks!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles