OpenGL Ambient Light grays out my models
Posted: Fri Feb 03, 2012 8:51 pm
Hello again.
I've tried to move forward to 3D programming, and I kinda understand the basic of OpenGL. But I seem to have problem with the lightning...
In my project, there is a 'object loader' function, which loads up a .obj file that I can render to my scene. It looks nice and all, but the parts where there is no light, there is completely black.
I have set the ambient light to 0.3, 0.3, 0.3 (and I've tried different numbers), but when I do this, the black just turn gray.
(When I load in the object, I don't read in the ambient light from the .obj/.mtl file)
What I want, is that the colors is still visible - just darker - when there is no light.
Is this the default way OpenGL handles ambient light, or do I do something wrong?
And is there a way I can make it 'not gray out' with ambient light?
Let me know if you need some code to read.
1: No light reaches this side of the face
2: Light on the object, but with amibent light as well, so it still somewhat grayed out.
3: With ambient light turned Off.
I've tried to move forward to 3D programming, and I kinda understand the basic of OpenGL. But I seem to have problem with the lightning...
In my project, there is a 'object loader' function, which loads up a .obj file that I can render to my scene. It looks nice and all, but the parts where there is no light, there is completely black.
I have set the ambient light to 0.3, 0.3, 0.3 (and I've tried different numbers), but when I do this, the black just turn gray.
(When I load in the object, I don't read in the ambient light from the .obj/.mtl file)
What I want, is that the colors is still visible - just darker - when there is no light.
Is this the default way OpenGL handles ambient light, or do I do something wrong?
And is there a way I can make it 'not gray out' with ambient light?
Let me know if you need some code to read.
1: No light reaches this side of the face
2: Light on the object, but with amibent light as well, so it still somewhat grayed out.
3: With ambient light turned Off.