Let there be more lights!

Lately I’ve been messing around with OpenGL 3.3 core / GLSL lighting a bit more.

First I created a scene with a floor and the now used to boredom box of mine. Then I added a global light  source ( that is it doesn’t change with the camera like the one I posted about earlier ) with red color and started to experiment a little with light color and texture color mixing:

Obviously this one wasn’t a very successful experiment 😛

The next one was a little bit better already:

This time in addition to the color mixing changes, I also changed how ambient light is handled: The parts where the diffuse red light source cannot light the scene are only lit with the ambient light source, which basically only modifies the luminosity of the texels. The result is as it can be seen on the picture, the side of the box is not colored red.

After all this I worked on it a bit more and added another diffuse light source, with blue color and a direction that can hit the box where the red light can’t, therefore one side of the box becomes reddish the other side becomes blueish. The floor of course becomes a mix of the two.

Here’s video that shows it, enjoy!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: