2
votes

Lets say my display function draws polygons pixel by pixel not using opengl functions, but a drawpixel function.
I call

   glLightModelfv(GL_LIGHT_MODEL_AMBIENT, global_ambient);
    glShadeModel(GL_SMOOTH);
    glEnable(GL_LIGHTING);

where global_ambient is 0.0, 0.0, 0.0, 1.0 and I have material parameters defined, that is glmaterial is never called. Would the global ambient lighting still work as in I will not be able to see the polygon? Or would I need to define material parameters.

1
With a black light you will not see anything, thus it does not matter what material you choose. - SinisterMJ
@Anton: It will at least identify the points of your program at which germs are multiplying. - Lightness Races in Orbit

1 Answers

1
votes

Lets say my display function draws polygons pixel by pixel not using opengl functions, but a drawpixel function.

If that's true, then the lighting state is completely irrelevant. Fixed-function OpenGL lighting is per-vertex. You're not sending vertices; you're sending pixel data.