Sign in to follow this  

How not apply lightning on texts?

This topic is 3848 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Im trying to make a scene containing a 3d shape, a light and some texts. Everything were fine, but how can I exclude the lightning for texts, or others specified shapes?

Share this post


Link to post
Share on other sites
You can disable all lighting with glDisable(GL_LIGHTING) before drawing the text objects, then switch it on with glEnable(GL_LIGHTING) afterwords.

Or you could use a light specific light sourse for the text by first switching of the stantard one whith glDisable(GL_LIGHT#a), then switch on the light for the text with glEnable(GL_LIGHT#b), then draw the text. Afterwards: glDisable(GL_LIGHT#b), glEnable(GL_LIGHT#a). (where #a is the number of the standard light and #b the number of the text light.)

/Lidestro

Share this post


Link to post
Share on other sites
Quote:
Original post by GreyHound
switching GL_MODULATE to GL_REPLACE should also work, shouldn´t it?

Say that was the answer he got and he said "Thank you, problem is now solved". After all, he got the result he wanted.

Then he starts working further on his application and adds another object that doesn't need lighting, but don't involve textures. Lighting is still enabled, he have a problem, and comes here and as "How do I disable lighting so it doesn't affect my object"?

Was the problem solved the first time? No, it wasn't. You exclude lighting by disabling lighting, not by switching texture combiner settings.

Share this post


Link to post
Share on other sites

This topic is 3848 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this