I don't know if I'm doing something wrong or missing anything but I want to simulate sun light, like in a sunny day.
When the object is facing the directional light, it's well lit and there's no problems there. If I go around the object and look at it's back, it's dark. It's not too much dark because I'm using GL_AMBIENT
but it's still too dark for a sunny day. If I increase the value, it will never look better because the side of the object facing the light will be too bright.
And there's another annoying issue with the ambient light, when looking at the back of the object, I can't see any shape, only a plain color. Hard to explain, here's some pictures:
Object Front: https://i.stack.imgur.com/YW53X.png
Object Back: https://i.stack.imgur.com/Qufha.png
As you can easily see, the front side looks nice, you can see the shape of that red thing. On the back side, it's plain, you can't see the same shape.
Now, I know that I'm looking at the back of an object and I'm looking in the direction of the light and it should be darker than the front side. But it shouldn't look so plain like this. That's not what we see when going against the sun light looking at some object, we see that the objects form some shape.
How can I have the same (or similar) effect on OpenGL?
My light is currently defined like this:
float posLight0[4] = {-1.0f, 1.0f, 1.0f, 0.0f};
float ambLight0[4] = {0.5f, 0.5f, 0.5f, 0.5f};
glLightfv(GL_LIGHT0, GL_POSITION, posLight0);
glLightfv(GL_LIGHT0, GL_AMBIENT, ambLight0);