Announcement

Collapse
No announcement yet.

Dynamic shadows artifacts

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

  • replied
    4.20 seems to be different. 4.20.0 has a different type dynamic shadows artifact

    Leave a comment:


  • replied
    I can confirm that this problem still exists in version 4.19, nothing has changed yet.

    Leave a comment:


  • replied
    Bumping this to increase the chance for Epic to enter this thread.

    Leave a comment:


  • replied
    Originally posted by Kalle_H View Post
    Deathrey: Have you this PR integrated when you do testing? https://github.com/EpicGames/UnrealEngine/pull/4507
    Yep, I have.

    Leave a comment:


  • replied
    Deathrey: Have you this PR integrated when you do testing? https://github.com/EpicGames/UnrealEngine/pull/4507

    Leave a comment:


  • replied
    Originally posted by Deathrey View Post

    What I was asking, aren't you supposed to shift whole shadow projection behind, so that source is at spotlight's near clip plane? That is.. at distance zero, your source raidus will be radius, not zero.

    I haven't implemented PCSS for spot and omni lights myself, so bear with me.


    In case, that above is a brainfart, what is happening with PCSSParameters.y ?
    I don't know about that shifting. There is only division by projected distance. Near plane distance isn't factored at all. Not sure about should it.

    PCSSParameters.y = MaxKernelSize / float(ShadowInfo->ResolutionX). So this should be correctly adjusted.

    Leave a comment:


  • replied
    Red Color: Expected Umbra
    Green Color: Expected Penumbra
    Blue Color: Received umbra at defaults

    default:
    Click image for larger version  Name:	UnadjustedPCSS.png Views:	1 Size:	501.2 KB ID:	1438307



    0.5 replaced with 1.0,
    and max kernel size inflated:




    Click image for larger version  Name:	PCSS.png Views:	1 Size:	459.8 KB ID:	1438302
    Last edited by Deathrey; 03-05-2018, 11:14 AM.

    Leave a comment:


  • replied
    Originally posted by Kalle_H View Post
    CotanOuterCone variable is the adjustment.
    What I was asking, aren't you supposed to shift whole shadow projection behind, so that source is at spotlight's near clip plane? That is.. at distance zero, your source raidus will be radius, not zero.

    I haven't implemented PCSS for spot and omni lights myself, so bear with me.


    In case, that above is a brainfart, what is happening with PCSSParameters.y ?

    Leave a comment:


  • replied
    Originally posted by Deathrey View Post
    Returning to my previous post, is spotlight projection adjusted for source radius? I believe it is not and it is root of all problems.
    CotanOuterCone variable is the adjustment.

    Leave a comment:


  • replied
    Returning to my previous post, is spotlight projection adjusted for source radius? I believe it is not and it is root of all problems.

    Leave a comment:


  • replied
    Original shader:
    Click image for larger version  Name:	WithMultiplier.jpg Views:	1 Size:	84.4 KB ID:	1438121

    Without Multiplier:
    Click image for larger version  Name:	WithoutMultiplier.jpg Views:	1 Size:	89.6 KB ID:	1438122Reference:Click image for larger version  Name:	Lightmass.jpg Views:	1 Size:	81.9 KB ID:	1438120

    Leave a comment:


  • replied
    I will make more lightmass testing. If the multiplier is indeed correct I will remove my PR.

    Leave a comment:


  • replied
    0.5 there seems to be correct visually. Lightmass difference can be attributed to exposure, biasing, sharpening and filter radius clamping.

    Lightmass:

    Click image for larger version  Name:	LightMass.png Views:	1 Size:	531.1 KB ID:	1437746


    PCSS:

    Click image for larger version  Name:	PCSS.png Views:	1 Size:	431.9 KB ID:	1437747

    PCSS low exposure:

    Click image for larger version  Name:	PCSS_LowExposure.png Views:	1 Size:	261.1 KB ID:	1437748

    PCSS high exposure:

    Click image for larger version  Name:	PCSS_HighExposure.png Views:	1 Size:	448.9 KB ID:	1437749

    As to why is it there, needs in depth look. I don't have source accessible at the moment, will check in a few days.

    Leave a comment:


  • replied
    Originally posted by Deathrey View Post

    Search radius is intended to be used as in shadow space, but shader gets source radius as is, from the light, correct me if i'm wrong.


    Also, what happens when source radius is 0 ? Projecteded source radius is also 0, and all the softenss comes just from PCF.

    Me thinks that Light Source Radius needs to be adjusted to be in shadow space before being used.


    When radius is 0 the projected value is clamped to one texel.

    Source radius is projected from world space to shadow clip space:
    Code:
    radius * (1 / tan(fov/2)) / ShadowSpaceDepth

    Leave a comment:


  • replied
    Originally posted by Kalle_H View Post

    Could the 0.5 be multplier because after perspective projection coordinates are in clip space (-1 to 1) but we need radius to be at texture space(0 to 1). I am not sure about this at all.

    Ps. Ligthmass reference says that even after removing 0.5 scale, dynamic shadows were bit too sharp.
    Search radius is intended to be used as in shadow space, but shader gets source radius as is, from the light, correct me if i'm wrong.


    Also, what happens when source radius is 0 ? Projecteded source radius is also 0, and all the softenss comes just from PCF.

    Me thinks that Light Source Radius needs to be adjusted to be in shadow space before being used.



    Leave a comment:

Working...
X