Nick Heiner
Nick Heiner

Reputation: 122450

OpenGL: Turn off all lighting except what I specify?

I'm new to OpenGL/JOGL. I'm experimenting with lighting:

    gl.glEnable(GL2.GL_LIGHT1);
    gl.glEnable(GL2.GL_LIGHTING);

When I disable the first line, all the objects in my scene get somewhat dark, but they still have some light. Where else could that light be coming from? (This is the only light source I have.) Is there some default ambient light that I can turn off?

Upvotes: 3

Views: 2149

Answers (1)

Yakov Galka
Yakov Galka

Reputation: 72479

Yep, there are glMaterial(GL_AMBIENT, ...) and glLightModel(GL_LIGHT_MODEL_AMBIENT, ...) which are both set by default to (0.2, 0.2, 0.2, 1.0);

Upvotes: 6

Related Questions