Recommended Posts

For example to render my bitmap fonts correctly I have to disable lighting and textures and then re-enable them when I'm finished, is this a normal thing to have to do or should I be worried about making a lot of calls like this? Is this a ridiculous thing to be worried about?

Share this post

Link to post

Share on other sites

You are switching opengl state when you do that so it could be expensive. How much is hard to say without benchmarking it. Like ggp83 says though, don't worry about it too much.

If you do worry anyway, a good idea would be to makes sure you do all text rendering at the same time. Then you only have to switch state before and after all text rendering, instead of for each rendered text.

Share this post

Link to post

Share on other sites

It's only a problem if you do it MANY times and you CPU and drivers are slow.In general, the less calls to GL the better. And it depends very much on the actual call. glBindTexture is expensive, glUseProgram, etc...glEnable and glDisable are less expensive