I am adding procedurally generated caves to my game. But I found it tricky to render them properly. By default, they are only as dark as the ambient color and shadow color when the sun light is on outside the caves.
I read from the documentation that negative lights could be used to make caves dark. But in arbitrarily generated caves, I don’t know if it is possible to place negative lights properly to achieve a reasonable effect. Does anyone know how to do this properly with negative lights?
Alternatively, I am considering to use zones inside caves, such that zones near the cave entrances will have lighter ambient color, and zones away from the entrances will have darker ambient color. Then I will also modify the shaders such that shadow colors are properly darkened according to the zone ambient colors. This way I am more or less sure it can produce acceptable results.
But I am curious if there is a better way. Does anyone know how other games (such as Minecraft) handle such problem? Thanks!