Black shadow spots under props


I’m currently working on a map intended as a scene for an SFM movie, but I have some issues with shadows. Here are some screenshots of some of the problematic areas: (screenshots are taken from within SFM).

I initially believed that the props I have placed were going too deep into the geometry, however I have tried placing them as high as possible while still having contact with the geometry but the issue is still there. Disabling shadows on the props seem to fix it, but I want them to be able to cast shadows, since I intend to setup manual lighting in SFM for the scene as well.

Some information regarding the map:

  • It has sky_cam 3d skybox
  • It has light_env, shadow_control and env_sun entities (one of each)
  • All props are ‘prop_static’, set to No Collision and set to cast shadows
  • The map is compiled with HDR enabled

I have tried turning off shadows via the shadow_control entity; this had no effect, the dark spots were still there. I have also tried using the info_no_dynamic_shadow entity and selected the faces of those areas in the screenshots but the shadows were still there after compilation. I’m not really sure what else I can try, so I hope someone here might have a suggestion. :slight_smile:

An extra question: Does disabling prop shadows in Hammer also mean that the props won’t cast shadows from lights created within SFM?

You should try expert compile settings, with -staticproppolys and -staticproplighting parameters in Vrad command line.

If you want more detailed shadows, you’ll have to lower the resolution of the lightmaps on the faces that shadows are cast on.

I had the exact same problem with trees and foliage my last map. I spent more time trying to FIX those shadows than I think I spend actually making the map. I tried everything I could think of, multiple times. Changing sun angle, (the black shadows always cast directly down), different sun spread angles, lightmap scale down to 2, disabling self shadowing. Every combination of settings, nothing worked.

I compiled with -textureshadows -StaticPropLighting -StaticPropPolys -final and added all the offending models to the .rad file. The compile log SHOWED it was using them but I still ended up with pitch black shadows. Strange thing is that using those tricks did help on most the props. My final solution was to individually disable shadows on some and use a different prop that worked where I could.

I’d be interested to know what causes this and if there’s a way to fix it.

I noticed with bigger pieces of displacements, the lightmap scale can’t go under a certain number. If I cut the pieces into smaller sections, I was able to lower it more. It happened with a beach I was making on one level, and It wouldn’t go below 40, so I cut it into multiple sizes(keep in mind, I wanted to keep the power at 3), and I was able to lower it to 16. Probably not the problem here, though.

I tried that too, haha. I kept clipping my displacements down till I could get a lightmap scale of 4 to “stick”. Other than making my compile time CRAZY, it didn’t help with those specific troublemakers. All the other shadows looked AMAZING, though. ha
My shadow issues were on displacements, though. I have a feeling that might have something to do with it.

If you have a large area of terrain, instead of making one big displacement, it’s always better to make several 1024x1024 displacements. This allows you to set the lightmap resolution to something reasonable and keeps the terrain from becoming too jagged.

I did both of these things and it solved the majority of the issues, thanks a lot! :smiley: A few models still have black shadows below them, but I’ll try messing around with some settings or just disable their shadows entirely.

The entire map is made with 324 individual 512x512 tiles which are sewn together and grouped. This way I was able to make each tile displacement a power of 4 and give a lightmap of 5 which is enough.

Oh dear, you shouldn’t do that.

Power 4 displacements inflate the BSP size because power 4 displacements can’t be compressed. And they also significantly increase CPU usage on the client and server when the map is running from additional physics calculations.

You also should only decrease the lightmap scale on displacements that actually have shadows on them because faces with smaller lightmaps also can significantly inflate the BSP size. Like if you change the lightmap scale on a face from 16 to 8, it uses double the amount of lightmap data. Decrease it again to 4 and you use 8x more lightmap data vs a 16 lightmap scale.

There is a limited amount of space allocated to lightmaps so if you use tons of it on terrain, you’ll quickly run out of resources for lighting other parts of the map and the compile tools will error out.

Very nice info, fortunately this is also how I have done it. I have only set the lightmap to 5 where the actual props are placed and where the recording will happen. This map is purely meant as a scene for SFM, so there will never be players on it. Thats why I don’t mind big files, I need the quality to be as high as possible.

The rest of the map that will be largely unseen have a lightmap of 16.