OfLight Class -- Max light number and how to increase it


I’m new to the forum. I was playing with the class ofLight and I was
trying to activate multiple light sources.

Reached the number of 8 I’ve received and error that says that 8 is the maximum number of lights that can be enabled.

Which is the origin of this constrain?
Is there way to increase this maximum number?


This is a hard limit in openGL 2, if you change to using openGL 3 or more then there’s no limit on the number of lights (except the performance)

you can change to for example opengl 3.3 in main.cpp using:

int main(){
    ofGLWindowSettings settings;
    return ofRunApp(new ofApp);
1 Like

Thankyou very much for the help, now it works!