Recommended Posts

First off, hey everyone! I'm not new to programming, but new to 3D programming. My preferred language is C++, so if you give an example please use that language or one similar in syntax. It'll help a lot. ^_^

Anyway, i've been reading nehe's tutorial on opengl, which is very impressive. I noticed there wasn't a lot about ambient lighting though. Now i know you can set an ambient light source and it will give a general amount of light to every surface, but that's not exactly what i want.

As an example, let's say i have a small island and it has a cave. I want the island to be lit up like day, but the cave to be completely dark once you get so deep into it. How can this be done?