2
\$\begingroup\$

I have a cave that is inside a mountain (one mesh) that I created in Blender. I would like to make the cave quite dark inside so that either the player can light it up, or it is lit up with things such as crystals. Because I have ambient light through the scene, it's proven to be quite awkward to make it dark, and removing the ambient light kinda destroys the look.

I then played around with having a separate material for inside the cave so that I can make it darker, which kinda worked, but then I noticed a big issue with shadows.

The following images is from inside the cave far from the entrance.

The first image is with the default settings for shadow distance (in this case it was 70 in the quality settings). As you can see in the image, the shadow doesn't fill the cave because of the distance.

Default

Second image is with the shadow distance turned up to make sure the cave is in darkness (not pitch black though, due to ambient lighting), this took the setting from 70 to around 500.

Increased

The problem with setting the distance so high, is that it causes artifacts on geometry outside the cave, which look nasty.

What's the best way to make a cave dark (doesn't need to be pitch black) without removing ambient lighting for the whole scene?

I was looking at similar art styles to what I am working on, and Grow Home (Unity) is basically where I am heading. They have caves which would be acceptable for what I need, but am not sure how they done it. As far as I know, they have dynamic lighting, as I believe there is a day / night cycle, so I don't think anything is baked.

\$\endgroup\$
  • \$\begingroup\$ You need to set the ambient light low (but not off), otherwise you're not going to have any chance of getting a baseline dark in the cave. You're saying it destroys the look (and I kind of see what you mean) but you haven't put any lights in there to give it more feel. You could also look into writing a custom shader that has some special contrast or something so that darker faces are darker and lighter faces are lighter (from the grow home picture). Also notice how that grow home pictures uses decently bright lights of a darker color \$\endgroup\$ – Coburn Sep 19 '16 at 16:01
  • \$\begingroup\$ I done some testing with ambient lighting completely off so the only thing lighting the scene was the directional light (turning that off makes the scene black, so that is the only source of light now), and the issue remains in the cave, that being the shadow distance. So what I thought might be a lighting issue, is leaning more towards a shadow problem. Setting the distance high fixes it, but as in the screen shot above, it doesn't work well. Not sure what else to do. \$\endgroup\$ – JacketPotatoeFan Sep 19 '16 at 16:21
  • \$\begingroup\$ Look into Unity solutions for shadow acne (like by changing the bias value) docs.unity3d.com/Manual/ShadowOverview.html. Also, if this is the WebGL export engine, I think this is a known problem because I was running into it and there really isn't a good fix due to WebGL itself not supporting enough yet. \$\endgroup\$ – Coburn Sep 19 '16 at 16:25
  • \$\begingroup\$ Think I found a solution. Seems to all come to scale. I decided to scale down my objects from 1 to .1, and the default shadow value of 70 works fine now. Kinda annoying considering that I was wanting to match Blender units to Unity units. So now, an Island that is 1,000 meters in Blender units, becomes 100 meters in Unity units. Oh well. \$\endgroup\$ – JacketPotatoeFan Sep 19 '16 at 16:40
  • 1
    \$\begingroup\$ You could also use layers to exclude interior spaces from being lit by your directional sun light. \$\endgroup\$ – DMGregory Sep 20 '16 at 17:14
4
\$\begingroup\$

Some information on the Grow Home/Grow Up art direction here if you're still interested :)

We relied very heavily on our custom Fresnel shader for... well... the entire look of the game. But it was especially important for the lighting of cave interiors. We pretty much only had one directional light in the whole game from the sun, but you're not seeing any of that here. The 'lighting' that you see in the screenshot above all comes from the Fresnel effect, which reflects the colour of the sky dome on all acute angled polys, giving you that rim-lighting effect everywhere you look.

\$\endgroup\$
  • \$\begingroup\$ Oh, were you one of the developers of Grow up? \$\endgroup\$ – Bálint Oct 18 '17 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.