Announcement

Collapse
No announcement yet.

Distance Field Shadows - can't get them to work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    In a real scene this kind of artifact is typically unnoticeable as it primarily happens when the light is parallel to the surface. But you can get rid of it (at the cost of accuracy) by adjusting the shadow bias. Setting the bias too high can cause light bleeding at corners though so you have to balance it. Contact shadows can be used to mask this issue, but comes at additional cost and has its own quirks.

    Keep in mind, shadow settings are per-light. So if you are already generating distance fields for other features (particle collision, indirect shadows, DFAO, etc.) then you can always switch to distance field shadows on lights where this is a noticeable problem.

    Edit: Just a word of warning also, area light (what you're using in your video) shadows are only intended to work with static and raytraced shadows. DFS and shadow maps will behave as though it is casting light from a single point, not a rectangular area.
    Last edited by Arkiras; 10-08-2020, 03:51 PM.

    Leave a comment:


  • replied
    How do you guys actually handle the bending in the shadows when using DX11 and not using distance field shadows?


    thank you so much for all your input!

    Leave a comment:


  • replied
    thank ya'll for your thoughts and findings. hmmm.. sooo I guess.. for a fallback.. without dx12.. distance field shadows seem to be great with some exceptions.. like animated foliage.. when trees are animated with some wind ... leaves, and moving objects just don't work.. sooo. I guess.. it's very scene dependent.. hmmm...

    I was wondering ... when you use distance field shadows.. do you also usually use the indirect ones?
    or mainly just for interior shots and not exterior?

    what's your expertise on that?

    thanks for all your contribution.. I really do appreciate that.. keep rocking,
    cheers

    Leave a comment:


  • replied
    We're working on DX11 without raytracing. The tech isn't there yet tbh. DF shadows works really well and gives great results the majority of time.

    Leave a comment:


  • replied
    Originally posted by BernhardRieder View Post
    okay.. while I was posting.. it seems everyone else was posting.. just saw all your comments right after.. uuahhh

    anyways.. but I guess the debate is great.
    For best perfomance.. not being able to use an RTX card.. it seems like the best option to use distance field shadows..

    or am I missing something here again?
    Like everything else they have tradeoffs, distance fields are completely static which makes them incredibly crappy for foliage (except for distant shadows) or anything else that uses any sort of vertex animation.

    They also have very limited resolution which makes them bad at capturing fine detail, you can increase the resolution (up to a point) but in a large scene with lots of objects this can quickly explode your VRAM usage. Which you can bring back down at the cost of quality by reducing them to 8bit...

    I use indirect distance field shadows, I think they're amazing. But for direct lighting I just use shadow maps as I find they are just much easier to work with and good enough most of the time.
    Last edited by Arkiras; 10-05-2020, 08:11 PM.

    Leave a comment:


  • replied
    okay.. while I was posting.. it seems everyone else was posting.. just saw all your comments right after.. uuahhh

    anyways.. but I guess the debate is great.
    For best perfomance.. not being able to use an RTX card.. it seems like the best option to use distance field shadows..

    or am I missing something here again?

    Leave a comment:


  • replied
    Originally posted by Arkiras View Post
    Turn ray traced shadows off on the light if you want to use distance field shadows instead. Sounds like an awful idea to me though...

    If you are just trying to use indirect distance field shadowing then make the mesh movable and check the "distance field indirect shadow" checkbox
    cool.. I guess that was the problem.. you need to make sure that the ray traced shadows are off... then the distance field shadows will "kick-in".. lol;

    Leave a comment:


  • replied
    as I mentioned in my video, and as you can see in the project file I've been uploading.
    1. Light has distance field shadows checked
    2. Project Settings --> Ray Tracing is on
    3. RHI: Direct X 12
    4. Project Settings--> Generate Mesh Distance Fields is True
    5. Point Light is Moveable
    What am I missing?



    Click image for larger version

Name:	001.jpg
Views:	68
Size:	170.3 KB
ID:	1818947



    Click image for larger version

Name:	002.jpg
Views:	65
Size:	55.9 KB
ID:	1818948

    Click image for larger version

Name:	003.jpg
Views:	66
Size:	40.8 KB
ID:	1818949




    Click image for larger version

Name:	004.jpg
Views:	65
Size:	67.7 KB
ID:	1818950



    Click image for larger version

Name:	005.jpg
Views:	65
Size:	129.8 KB
ID:	1818951



    Attached Files

    Leave a comment:


  • replied
    Originally posted by MostHost LA View Post
    Sure, if your environment isn't dynamic. Otherwise you get kind of forced into that, or not having shadows at all. That looks pretty unnatural on a large map.
    cascaded shadow maps look god awful on a landscape.
    / if they would just eliminate the banding effect it would be MUCH better.
    Inset shadows, light functions, blob shadow decals... all will work fine on dynamic objects. They have plenty of limitations sure but it definitely isn't "If it moves you must use a distance field shadow"

    Leave a comment:


  • replied
    Originally posted by Arkiras View Post
    Then I would just fall back on shadow maps.
    Sure, if your environment isn't dynamic. Otherwise you get kind of forced into that, or not having shadows at all. That looks pretty unnatural on a large map.
    cascaded shadow maps look god awful on a landscape.
    / if they would just eliminate the banding effect it would be MUCH better.

    Leave a comment:


  • replied
    Originally posted by MostHost LA View Post
    I agree that it looks poor / you get all sorts of issues with landscape / why can't epic make it better?
    but at the same time its probably a requirement to have a fallback. Not everyone is on an RTX.
    Then I would just fall back on shadow maps unless it was absolutely necessary to have a soft falloff that can't be achieved any other way.. There are not many situations where that's the case though.

    Leave a comment:


  • replied
    Originally posted by Arkiras View Post
    Sounds like an awful idea to me though...
    I agree that it looks poor / you get all sorts of issues with landscape / why can't epic make it better?
    but at the same time its probably a requirement to have a fallback. Not everyone is on an RTX.
    performance on a 1080ti is sub 20fps by just enabling ray tracing on a default scene. SURE, you can somewhat optimize that, but its still too expensive for one of the most used GFX out there.
    The unavailability of the 3080/3090 is seeing to that not changing anytime soon ;P

    Leave a comment:


  • replied
    Turn ray traced shadows off on the light if you want to use distance field shadows instead. Sounds like an awful idea to me though...

    If you are just trying to use indirect distance field shadowing then make the mesh movable and check the "distance field indirect shadow" checkbox
    Last edited by Arkiras; 10-05-2020, 06:14 PM.

    Leave a comment:


  • replied
    Oh, in addition, to get softer shadows, make sure to play with Source Radius / Angle.

    Leave a comment:


  • replied
    Make sure your light has DF shadows enabled. The thick is disabled by default even after enabling Generate mesh distance field. I also disabled ''Dynamic Shadow Distance Movable'' with a 0 value.
    Attached Files

    Leave a comment:

Working...
X