Announcement

Collapse
No announcement yet.

Dynamic shadows artifacts

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

    Originally posted by DamirH View Post
    I've been trying to write up a reply for a bit now to suggest what could or should be done but there really isn't much to say. At its core, it's disheartening and saddening to see this go without a reply. I'm angry, worried and annoyed not by the bug but by the lack of a response in over a solid year. I could go rant about how Epic has abandoned the forum, plainly visible in the still broken software and lack of responses, or how the community has taken a sharp decline or all those things, but on the other hand I realize that they're all just humans doing their dayjobs and I'm sure they aren't avoiding this topic out of malice. I suppose it's my own fault for getting invested in the community and setting myself up for disappointment, but at this point I consider the fact that our projects are tied to UE4 and will be tied to UE4 for a good while in the future a fault rather than a strength. I can no longer know if this engine, its community or anything resembling an infrastructure will exist a year or two down the line, and that's very frightening.

    Edit: Some people may think me melodramatic, but right now pretty much 100% of my income, my family's existence hinges on UE4, so it very much interests me if there is something unwell with any part of it. Even disregarding that, the forum community here is one I thoroughly enjoyed being a part of and one I grew much invested in.

    I feel with you. I have spend the past two years intensively learning UE4 to be able to publish my own games and (digital) art projects, not to mention spend a lot of money on the marketplace. And now it feels all of this was wasted because suddenly it seems Epic doesn't give a **** anymore and I can't be certain that I can rely on UE4 later on.

    Honestly I will finish my current project, hope it will give me some return and then switch to Lumberyard, since Amazon is pouring a **** ton of resources into it, and they don't do such a thing without a longterm goal.

    Comment


      Originally posted by spacegojira View Post


      I feel with you. I have spend the past two years intensively learning UE4 to be able to finally publish my own games, not to mention spend a lot of money on the marketplace. And now it feels all of this was wasted because suddenly it seems Epic doesn't give a **** anymore and I can't be certain that I can rely on UE4 later on.

      Honestly I will finish my current project, hope it will give me some return and then switch to Lumberyard, since Amazon is pouring a **** ton of resources into it, and they don't do such a thing without a longterm goal.
      Not commenting on single thread is hardly not giving a ****. Grass is not greener on other side.

      Comment


        Originally posted by spacegojira View Post


        I feel with you. I have spend the past two years intensively learning UE4 to be able to publish my own games and (digital) art projects, not to mention spend a lot of money on the marketplace. And now it feels all of this was wasted because suddenly it seems Epic doesn't give a **** anymore and I can't be certain that I can rely on UE4 later on.

        Honestly I will finish my current project, hope it will give me some return and then switch to Lumberyard, since Amazon is pouring a **** ton of resources into it, and they don't do such a thing without a longterm goal.
        Before choosing UE4 I have given Lumberyard a shot and I didn't like it. More than two years later I am not seeing much progress there and maybe because Im not there at all, but I know what progress we are having here and the space it still has to grow here, so shifting is a no no for me. The feeling for the known are much better of the feeling for the unknown...
        Nilson Lima
        Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
        Join us at Discord: https://discord.gg/FUwTvzr

        UE4 Marketplace: Cloudscape Seasons
        supporting: Community FREE Ocean plugin

        Comment


          Originally posted by Kalle-H View Post

          Yeah sample Gather is used SM5 platforms but not on mobile. IOS supports: sample_compare(), gather() and gather_compare() fetches.
          Yep. No doubt, one way or another SampleCmp is better than Gather plus two vector instructions. Might be even more significant on mobile, but I'm not familiar with mobile shading.

          Slope scaled bias would have eliminated the need for that soft comparison thingy, which does not seem to do the job it was intended to do, apart from transitions.
          Speaking of soft comparison, the way it works now, it has a linear dependency curve on shadow distance. In reality, one would almost always desire to have exponential curve, that relates shadow cascade number and bias. That is another thing, why having Slope Bias and Bias controls adjustable for each cascade individually would be a one size fits all solution.

          Additional thing it might be worth implementing, is ability to adjust filter size depending on the cascade, again with full manual control. This would situationally boost performance as well as eliminate another issue, that some users were complaining, namely over-blurred shadows in the distance. It would be cool, but it tags along some complications with cascade snapping and i'm unaware of reliable methods for handling cascades borders in this case. At least not with a box filter. But IMO, this topic is worth looking into.


          Comment


            Originally posted by Deathrey View Post
            Yep. No doubt, one way or another SampleCmp is better than Gather plus two vector instructions. Might be even more significant on mobile, but I'm not familiar with mobile shading.

            Slope scaled bias would have eliminated the need for that soft comparison thingy, which does not seem to do the job it was intended to do, apart from transitions.
            Speaking of soft comparison, the way it works now, it has a linear dependency curve on shadow distance. In reality, one would almost always desire to have exponential curve, that relates shadow cascade number and bias. That is another thing, why having Slope Bias and Bias controls adjustable for each cascade individually would be a one size fits all solution.

            Additional thing it might be worth implementing, is ability to adjust filter size depending on the cascade, again with full manual control. This would situationally boost performance as well as eliminate another issue, that some users were complaining, namely over-blurred shadows in the distance. It would be cool, but it tags along some complications with cascade snapping and i'm unaware of reliable methods for handling cascades borders in this case. At least not with a box filter. But IMO, this topic is worth looking into.

            Just found another problem that contributes this problem. When Gather4 isn't used code is calling function. FetchRowOfThree() this always offset towards positive x coords. Calling code always use positive offsets. This Shifts shadows 1-2 texels(on both axis) depending if pcf2 or 3 is used.

            Comment


              Originally posted by Kalle-H View Post

              Just found another problem that contributes this problem. When Gather4 isn't used code is calling function. FetchRowOfThree() this always offset towards positive x coords. Calling code always use positive offsets. This Shifts shadows 1-2 texels(on both axis) depending if pcf2 or 3 is used.
              This is is true for mobile platforms. The kernel is missing 1 texel of offset, when MOBILE_CSM_QUALITY == 2.

              FetchRowOfThree() is not used anywhere else.

              Comment


                Originally posted by Deathrey View Post

                This is is true for mobile platforms. The kernel is missing 1 texel of offset, when MOBILE_CSM_QUALITY == 2.

                FetchRowOfThree() is not used anywhere else.
                But FetchRowOfFour is used with similar flaw when Gather4 isn't used.

                Comment


                  Originally posted by Kalle-H View Post
                  Not commenting on single thread is hardly not giving a ****. Grass is not greener on other side.
                  Forum still broken. Two-Factor authentification still not implemented (I have to delete my credit card data each time after making a purchase). Sharp decline in responses from Epic. Marketplace-quality control non-existant. Oh and how about a good dynamic lighting solution? yeah no..

                  And yes, if you keep ignoring a thread where a ton of different users describe how negatively such a problem is impacting their projects, and there is ZERO response from Epic, then I think it is safe to say that they don't give a **** about this.

                  I'm not saying they don't care about the engine or community in general, but it's clear there is a decline and it makes me sad to see this.

                  Last edited by spacegojira; 02-08-2018, 06:01 AM.

                  Comment


                    Originally posted by Kalle-H View Post

                    But FetchRowOfFour is used with similar flaw when Gather4 isn't used.
                    The calling code adds offsets to FetchRowOfFour call, so it does not use only positive offsets.
                    For 4x4 filter, the sample center is offset is offset by (-1,-1). It matches gather code.
                    for 7x7 filter, the sample center is offset by (-3,-3), It is half a texel off the gather code.


                    I don't see more than half a texel shift anywhere.






                    Comment


                      Originally posted by Deathrey View Post
                      The calling code adds offsets to FetchRowOfFour call, so it does not use only positive offsets.
                      For 4x4 filter, the sample center is offset is offset by (-1,-1). It matches gather code.
                      for 7x7 filter, the sample center is offset by (-3,-3), It is half a texel off the gather code.

                      I don't see more than half a texel shift anywhere.
                      Yeah you are right. I tested code a bit and noticed that original and my offset version(-1, 0, 1) was both half texel offsetted. Proper fix was to remove - 0.5f bias and use my offsets.
                      Code:
                      float2 TexelPos = ShadowPosition * Settings.ShadowBufferSize.xy - 0.5f; // bias to be consistent with texture filtering hardware
                      Click image for larger version

Name:	Original.jpg
Views:	85
Size:	133.3 KB
ID:	1425291Click image for larger version

Name:	Fixed.jpg
Views:	79
Size:	132.8 KB
ID:	1425292

                      Comment


                        Created pull request for this fix. https://github.com/EpicGames/UnrealEngine/pull/4485

                        Edit:
                        So this bug is only happening when kernel is symmetric. This affect PCF2x2 and non gather 7x7 kernel.
                        Last edited by Kalle-H; 02-08-2018, 08:16 AM.

                        Comment


                          Originally posted by spacegojira View Post

                          Forum still broken. Two-Factor authentification still not implemented (I have to delete my credit card data each time after making a purchase). Sharp decline in responses from Epic. Marketplace-quality control non-existant. Oh and how about a good dynamic lighting solution? yeah no..

                          And yes, if you keep ignoring a thread where a ton of different users describe how negatively such a problem is impacting their projects, and there is ZERO response from Epic, then I think it is safe to say that they don't give a **** about this.

                          I'm not saying they don't care about the engine or community in general, but it's clear there is a decline and it makes me sad to see this.
                          No they do not, Its so sad really, We can send a self-driving car into space to mars but we can't get good dynamic lighting in UE4

                          Comment


                            Originally posted by Kalle-H View Post
                            Created pull request for this fix. https://github.com/EpicGames/UnrealEngine/pull/4485

                            Edit:
                            So this bug is only happening when kernel is symmetric. This affect PCF2x2 and non gather 7x7 kernel.
                            Pretty noticeable difference for just 1 texel of a shift.

                            Comment


                              Just made PR to optimize mobile and non gather PCF. https://github.com/EpicGames/UnrealEngine/pull/4494

                              Comment


                                Originally posted by Kalle-H View Post
                                Just made PR to optimize mobile and non gather PCF. https://github.com/EpicGames/UnrealEngine/pull/4494
                                I get a 404 error when I open that link?

                                Comment

                                Working...
                                X