New to shading


I am getting pretty familiar with OpenGL basics. I have created a huge terrain with caves underneath. The problem is that objects above do not cast shadows on objects below. Consequently, my caves look a little funny. Not dark at all.

I am brand new to shading. I have read a bunch of tutorials and watched quite a few videos. But I am still confused. Can someone point me to the basic of the basics on shading? I mean like, what libraries I need to download and install.


It am not aware of any library to do shadows - you will have to build it yourself from tutorials on the web (be warned it is not as simple as it sounds)

Now I am no expert, but I believe the standard way of shadowing larger terrains is cascaded shadow maps. I implemented these myself, and boy, is it a pain! So if you are making a Minecraft clone (I am just guessing, since it is popular to do that now), you can easily do shadows by just baking lighting into the vertices of the mesh instead of using full shadow maps. You can ray cast through the voxel grid to see if a vertex is visible from the light’s point of view.
If you want to go the cascaded shadow maps route, first research basic shadow mapping, and then cascaded shadow mapping (since this is an extension of basic shadow mapping).