Home Technical Talk

UDK Landscape Shadows

polycounter lvl 19
Offline / Send Message
TorQue[MoD] polycounter lvl 19
Hey all,

I'm working on a landscape for my game project and I'm noticing some issues with shadows.
landscape_shadows.jpg

Basically put, shadows look fine when you're up close, but off in the distance they all look completely hard edged and this looks horrid on the landscape. Is there a way to soften the shadows in the distance on a landscape? I've spent all night reading the UDN documentation on lighting and shadows and I couldn't find any mention of how to adjust the shadow quality on landscapes. I tried adjusting the Whole Scene Dynamic Shadow Radius, WSDS Cascades and Cascade Distribution Exponent to 1024, 4 and 4 respectively but that didn't seem to do anything other than make my build time increase and simply limit the range at which shadows are drawn in which just looks awful seeing them slowly fade in/out.

If anyone knows how to approach this it would be greatly appreciated.

Replies

  • James Ordner
    Options
    Offline / Send Message
    You can increase the landscape's lightmap resolution by changing a setting in its properties. I forgot what the property's called offhand, but when you see it you'll know what it is. Of course, this only makes the problem smaller, but it helps a lot.
  • System
    Options
    Offline / Send Message
    System admin
    you using a dom directional?
  • Ark
    Options
    Offline / Send Message
    Ark polycounter lvl 11
    That's basically what CSM do, you get a lower resolution shadowmap for the areas farther away from the camera frustum. Increasing the cascades/shadowmap size should help somewhat, but with an increase in performance for little improvement.
  • Computron
    Options
    Offline / Send Message
    Computron polycounter lvl 7
    ^ But If you bake the lighting with Lightmass, the default settings will swap the realtime shadows for the baked-in lighting at farther distances, or higher levels of the CSM, no?
  • System
  • System
    Options
    Offline / Send Message
    System admin
    I cant remember the name of the value I think its distance field shadows, make it like 50,000 - its the third one down on the dominant directional properties i think
  • TorQue[MoD]
    Options
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Thanks for all the help guys. I was playing around with a few things and found that matching my environment color to the color of my dom directional light really helped to pull the shadows away from being pitch black which has improved the look a lot but still not perfectly. I spent all night playing Far Cry 3 so I'll have to check the distance field shadows setting tomorrow though off hand I believe it was one of the settings I already tried.

    @ James Ordner - you sure about a lightmap res in the landscape properties? I didn't notice one when I was looking but again, I'll look tomorrow. Sleep awaits.
  • James Ordner
    Options
    Offline / Send Message
    @ James Ordner - you sure about a lightmap res in the landscape properties? I didn't notice one when I was looking but again, I'll look tomorrow. Sleep awaits.

    It's more of a multiplier than an actual resolution, but it achieves the same thing. It's called 'Static Lighting Resolution' under the Lighting tab.
  • TorQue[MoD]
    Options
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Ok so I've tried adjusting all of the settings suggested (Chris I can't find a distance field shadows property. Did you mean Cascade Distribution Exponent?) and I can't for the life of me get anything better than my previous results. I'm starting to think that the problem isn't with the resolution or brightness of the shadows, but the way they're rendered across the scene. Take this new scene for example (wanted to try with a different landscape)
    landscape_shadows2.jpg

    The shadows are breaking apart in seemingly random places when they shouldn't be. I just don't understand what's causing this.
  • James Ordner
    Options
    Offline / Send Message
    Notice that the shadows look fine on flat ground, but they get ugly on the steeper slopes. This is because the lightmap (it's not an actual lightmap, but imagine it is for a second) is projected straight from the top down. Obviously, you'll have issues on the steeper areas. There's not really a good solution to this problem, but some things you can try is to use fully dynamic lighting, increase the density of the landscape, increase the static lighting exponent by a lot, or modeling the landscape externally and importing it as a static mesh with proper, non-stretched UVs.
  • TorQue[MoD]
    Options
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Ok. If the only light source in the environment is a dominant directional, isn't it already using only dynamic lighting? I thought a Dominant was dynamic. I will be covering the entire area with plants and trees and other rock meshes etc. so I should be able to mask it. I'll also look into increasing the density of the landscape mesh.

    Thanks for the help.
  • James Ordner
    Options
    Offline / Send Message
    The dominant label mostly means that the light is the primary light source, not that it is dynamic. You can make the entire scene shadowed dynamically by setting the 'Whole Scene Dynamic Shadow Radius' in your dominant directional light's properties to a huge number.

    By default it is 0, which means the engine will use lightmap shadowing, no matter how far you are from a mesh/surface. If you set this setting higher, it will use dynamic shadows from the camera up to the distance you set from the camera. So for example, if you set the 'Whole Scene Dynamic Shadow Radius' to 500, you will have dynamic lighting up to 500 units away from the camera, and then from 500 units on it will use lightmap shadows.

    Edit: Make sure you set your trace distance to the default. Otherwise your shadows can get really blurry with a higher Whole Scene Dynamic Shadow Radius.
  • TorQue[MoD]
    Options
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Cool I'll try playing around with this the next time I'm working on the map. Thanks James.
  • TorQue[MoD]
    Options
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    I was wondering; is it possible to disable the shadows all together if I wanted to bake a shadow map into the texture? I wouldn't want to turn off the shadows in the DOM light because I would still want it to cast shadows for the static meshes and characters, but is there a way to turn off the terrain's occlusion shadows? IE casting shadows on itself?
  • TorQue[MoD]
    Options
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    No one knows if its possible to disable self shadows on the landscape only? IE I want character and object shadows to show but I don't want the Landscape to shadow itself (IE other peaks casting a shadow on the landscape).
Sign In or Register to comment.