Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

To make a lighting system for a voxel game, I need to specify a darkness value per vertex. I'm using GL_COLOR_MATERIAL and specifying a color per vertex, like this:



glColor3f(0.6f, 0.6f, 0.6f);

glColor3f(0.3f, 0.3f, 0.3f);    

glColor3f(0.7f, 0.7f, 0.7f);        

glColor3f(0.9f, 0.9f, 0.9f);


This is working, but with many quads it is very slow.. I'm using display lists too. Any good ideas in how to make vertices darker?

share|improve this question
You need to switch to vertex buffers. – bobobobo Nov 3 '12 at 22:51
up vote 3 down vote accepted

The problem here, almost certainly, is not that you're "darkening" your vertices by specifying the vertex colors. The problem is more likely to do with how you're rendering everything in general -- you appear to be using immediate mode in your code sample, and although you claim to be using display lists which are somewhat better, you're likely going to want to switch to VBOs as suggested by bobobobo.

However, your performance issue could be somewhere else entirely, for example, you may not be culling your voxels as aggressively as you could. You're not providing enough information to answer the question about your poor render performance, though.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.