Announcement

Collapse
No announcement yet.

Dynamic shadows artifacts

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

    Originally posted by Maximum-Dev View Post
    The bug with grass tool is already killing our performance so much we can't even afford to have 4 shadow cascades and with 3 cascades it's all blurred out. Problem solved. You can't really have any tools working properly in this engine lol.

    Use A to hide the problem with B. Use C to hide the problem with A. Use D to hide the problem with C, and it goes on.
    It really seems like the only way something ever gets done here is if epic needs it for one of their own games, or an enterprise customer requests it.
    Then they implement the most useless things, like clear coat with dual normal map.

    Meanwhile we can't have non-blocky shadows.

    Comment


      Originally posted by Zeblote View Post
      It really seems like the only way something ever gets done here is if epic needs it for one of their own games, or an enterprise customer requests it.
      Then they implement the most useless things, like clear coat with dual normal map.

      Meanwhile we can't have non-blocky shadows.
      Have you got your hands on 4.17 prev?
      Artstation
      Join the support channel
      Gumroad Store

      Comment


        Originally posted by Maximum-Dev View Post
        Have you got your hands on 4.17 prev?
        Yes, I posted an image on the last page, it looks exactly the same as in 4.16 if you don't enable expensive soft shadows.



        With soft shadows on:

        Last edited by Zeblote; 07-16-2017, 08:15 PM.

        Comment


          Originally posted by Zeblote View Post
          Yes, I posted an image on the last page, it looks exactly the same as in 4.16 if you don't enable expensive soft shadows.
          Oh didn't see that. Well, not sure what joinmake meant there by saying it's looking good in 4.17.
          Artstation
          Join the support channel
          Gumroad Store

          Comment


            On flat surfaces there has been improvement at least, previously I got acne on surfaces that were close to perpendicular to the directional light, now it's pretty much fixed. Or maybe I'm just imaging stuff :\

            Gotta double check.
            Last edited by jonimake; 07-17-2017, 03:03 AM.

            Comment


              Originally posted by jonimake View Post
              On flat surfaces there has been improvement at least, previously I got acne on surfaces that were close to perpendicular to the directional light, now it's pretty much fixed. Or maybe I'm just imaging stuff :\

              Gotta double check.
              Not seeing any improvements at all. Still lots of weird artifacts on walls even with a bias of 0.5

              Comment


                Yeah, no improvement. I must have been dreaming or something

                Comment


                  Here is another approach to dampen the artifacts. Flat bias based on screen-space derivatives
                  Default shadow filtering, 3x3 PCF, 0.5 constant bias:
                   
                  Spoiler


                  2x2 PCF with additional depth-based bias and 0.5 constant bias.
                   
                  Spoiler


                  Pros: Keeps shadow silhouettes more or less intact, easily implementable.

                  Cons: Breaks at larger kernels, generates small artifacts on edges/object intersections occasionally, adds cost to shadow filtering.

                  Potentially, can be used as alternative to slope-scaled depth bias, but still does not replace receiver plane depth bias and should be only used in conjunction with the latter one.

                  Speaking of which, I've ran into issues applying proper receiver plane bias to default shadows though. I've described it in this thread. If anyone has an idea about the reason, I'd be glad for any help.

                  Comment


                    How long do we have to deal with this.

                    Artstation
                    Join the support channel
                    Gumroad Store

                    Comment


                      Originally posted by Maximum-Dev View Post
                      How long do we have to deal with this.

                      Until someone like [MENTION=146056]Deathrey[/MENTION] figures out a solution, because epic doesn't care

                      Comment


                        Someone should hire him full time to just fix what community needs fixed.
                        Artstation
                        Join the support channel
                        Gumroad Store

                        Comment


                          Instead of Deathray pretending like he's reinventing the wheel, by "paraphrasing" known code and acting like it's his own creation, the majority of the base code is already in the link that I linked earlier. There is a whole section about screen space PCF ddx/ddy filtering. It also states that it's a pretty complex operation, meaning it has a non-trivial performance cost. Keep in mind that you can quickly google to find more versions and variations of these types of filtering

                          https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx

                          The problem lies in properly fitting it into the UE rendering path and doing it in a way that minimizes impact on frame time. There is a lot asynchronicity in the rendering engine and I'm pretty sure that plays a lot into the mix as to why they haven't implemented it already. In that article, it even states "Because this technique is computationally complex, it should be used only when a GPU has compute cycles to spare." The problem is that the UE rendering engine is already pretty optimized in filling up empty cycles.

                          You'd have a few options to pick from:
                          1)Let it lock up GPU to calculate completely and immediately
                          2)Mess around with priorities and "spare cycles," so that this filtering would have a higher priority and finish sooner
                          3)Let it constantly update over several frames like DFAO

                          #3 would be the best trade off between performance vs quality. It would be made to have an iterative approach where it's filter quality starts out course and progresses into finer and finer accuracy. So it might start out looking a tiny bit like the faceting problem and over a couple frames, it would smooth out to look closer to what the soft shadow filtering looks like.
                          Last edited by IronicParadox; 07-22-2017, 12:36 PM.

                          Comment


                            How long do we have to deal with this.
                            Well, terrain issue is a bit complicated. It is 3 issues combined, not a single one.

                            More or less default appearance:
                             
                            Spoiler


                            Firstly, it is cascaded shadows with large filter size. This is the issue discussed in this thread. Dealing with it is hard and always comes at drawbacks. 4.17 PCSS does a good job at minimizing it. I will post the code of adding additional bias for simple PCF shadows shortly, but one way or another, biasing involves certain loss of details.
                            Once you dampen this issue's contribution, you end up with something like this, hopefully with slightly better shadow filtering:

                             
                            Spoiler


                            Secondly, it is screen-space ambient occlusion. You will notice its contribution only in indirectly lit areas. Dealing with it involves tweaking ambient occlusion bias, until you get acceptable balance of faceting and details.
                            After dealing with it, terrain should look like this:

                             
                            Spoiler


                            Lastly, there is inconsistency between shading and shadowing. Shortly, it is described as unshadowed triangle, facing away from the light, being brighter than shadowed part. I believe this issue is landscape-specific.
                            Potentially, scaling terrain's normals to make them more aggressive helps to minimize it. It is somewhat fake, but helps to hide problematic shadowing areas with shading.
                            With slightly scaled normals terrain appears this way:

                             
                            Spoiler


                            Hope that helps with terrain issues.

                            Comment


                              Sandly PCSS can't be used everywhere as it adds an additional performance cost. And tweaking SSAO to make the blocky shadows less apparent on the ground, makes the SSAO look bad/go off on other regular meshes.



                              This is the Vehicle Game project from Learn Tab. I've done zero changes to it. Directional Light comes with 3 cascades.
                              This is simply unacceptable even as a demo.



                              Artstation
                              Join the support channel
                              Gumroad Store

                              Comment


                                This is simply unacceptable even as a demo.
                                This does look pretty bad yeah.

                                The same scene with RPDB at defaults. It has sufficient artifacts of its own, but generally seems a tad better.






                                Should anyone want to give it a try, here is Receiver plane depth bias for 4.16. (You need to have linked github account to view.)

                                The change is partially based on 4.17 PCSS code and is a shader edit only. You do not need to build engine from source to try it.
                                It is incomplete, but generally should work without major issues.
                                Spot lights are not working correctly, but you might never notice that. Point lights are unaffected. Lower quality presets need to be replaced with no-bias version though.

                                It is probably good to enable shader development mode and make backups of two USF files in question before overwriting originals.

                                I am most likely unable to offer any kind of support on this one. Use at your own risk. Make backups!



                                There are scenes, that seem to benefit from this kind of bias greatly, but also there are ones, that look worse. As everything here, it is situational




                                And tweaking SSAO to make the blocky shadows less apparent on the ground, makes the SSAO look bad/go off on other regular meshes.
                                Yeah, that it is a tradeoff. Pretty sure something can be done to improve it though.
                                Last edited by Deathrey; 07-25-2017, 04:53 PM.

                                Comment

                                Working...
                                X