开发者

OpenGL: Turn off all lighting except what I specify?

开发者 https://www.devze.com 2023-01-17 10:51 出处:网络
I\'m new to OpenGL/JOGL. I\'m experimenting with lighting: gl.glEnable(GL2.GL_LIGHT1); gl.glEnable(GL2.GL_LIGHTING);

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 co开发者_如何学Culd that light be coming from? (This is the only light source I have.) Is there some default ambient light that I can turn off?


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);

0

精彩评论

暂无评论...
验证码 换一张
取 消