ofLight for OpenGL ES2

Hi, I’ve got a question regarding the programmable renderer on mobile platforms. It seems like on OpenGL ES 2 (iOS, Android and WebGL with Emscriptem) the generated shaders don’t implement lighting like the ES 1 fixed function pipeline? Is that correct, or did I miss some flag to enable that? Does that mean, that to have simple vertex lighting I’d need to implement my own shaders? I’d be ok with that, but for fast prototyping of ideas, I would like to make sure I didn’t miss anything.

For testing I rendered a few cubes with a directional light. On ES1 lighting was correct, on ES2 the cubes (using ofDrawBox()) using the color from ofSetColor(), so they are simply white in my case.

I am on version 0.9.3.


you can still have lights since 0.9 but you need to use ofMaterial which has the corresponding shaders to do the lighting. in this case the calculations are per fragment instead of per vertex

Thanks, good to know.