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

When to use ofEnableLighting()/ofDisableLighting()?

$
0
0

@cuinjune wrote:

Hi, I always thought I have to call ofEnableLighting()/ofDisableLighting() and ofLight::enable()/ofLight::disable() together to make the lighting properly work like the following way. I think I read somewhere that this is the proper way to use lighting in OF.

ofEnableLighting();
light.enable();
 ofDrawSphere(ofGetWidth()/2, ofGetHeight()/2, 100);
 light.disable();
ofDisableLighting();

But I just found out that it seems like it's works fine even without calling ofEnableLighting(); and ofDisableLighting();.

And even if I disable lighting using ofDisableLighting();, I could make it enabled again by calling light.enable();

So I wonder why we have ofEnableLighting()/ofDisableLighting() separately and when to use these instead of ofLight::enable()/ofLight::disable().

Thanks in advance.

EDIT: I think the lighting is not completely disabled just by calling ofLight::disable(). When I draw other objects outside lighting area, they also got affected by the lighting. So I guess I have my answer.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles