Self illum primitives

Well, i was trying to do self illuminated primitives rendering in my scenes but it seems that enabling/disabling GL_LIGHTING in the frame is disturbing rendering!!
I’ve tried to change the ambientColor per primitive but it doesn’t work too…

Any idea?

You set the material properties for GL_EMISSION to be the self illuminating colour. If you don’t want any shading you must set all other material elements to black

Ok, but i am not using materials or such things… only glColor stuff with openGl lighting… More precisely if i want to make some polys lighted or unlighted can i use glEnable(GL_LIGHTING) to encapsulate vertice to be lighted and then in the same frame use glDisable(GL_LIGHTING) to encapsulate other vertice to be unlighted…

With my app, i’ve got visual artifacts… some polys which must be lighted appears unlighted randomly … Thus is this an OpenGL problem due to the GL_LIGHTING state change or what?

You can enable and disable lighting as required. To the best of my knowledge in order to light primitives you must use materials. You can tell materials to track current colours if you desire.

With lighting enabled, to use glColor instead of glMaterial you must enable GL_COLOR_MATERIAL and call glColorMaterial.
Without lighting, disable GL_COLOR_MATERIAL.