Announcement

Collapse
No announcement yet.

Distance Fields taking up way too much rendering time

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

    Distance Fields taking up way too much rendering time

    I posted in the answerhub about this already - but it's getting to the point where I can't even play test anymore because the frame rate is dropping just too low . I suspect I may have just ticked a checkbox somewhere I shouldn't have. I've attached screen-shots of the GPU profile and of the only light using distance field shadows in the scene.

    Is there anything I can do to reduce the rendering time for distance fields? This wasn't an issue until about a week ago - and in terms of scene lights, nothing new has been added since then. In other words, the change happened randomly without modifying the scene much. Thank you!

    Update: When I delete all the NPC's from the room, the performance goes back to 14ms per frame. However, if I leave the NPC's there and disable 'Affect Distance Field Lighting' and disable 'Cast Shadows', it still has the performance impact.
    Attached Files
    Last edited by TheKing530; 04-19-2016, 06:55 PM. Reason: Update

    #2
    Anyone? :'(

    Comment


      #3
      I haven't had this problem, but I know that distance fields can take ages to render, especially if you change to a new UE version and everything needs to be re-rendered. Do you need to have the distance fields working when you build your scenes? If you don't need them you can uncheck the "generate mesh distance fields" under the Rendering tab in the project settings.

      Also, check the resolution of your mesh distance fields. Most objects don't need more than 1-4 resolution, and making them larger is a waste of time and resources.
      http://www.pixelpirates.se/
      Architectural and product visualisations

      Comment


        #4
        Thank you for the response! All my scenes are lit by dynamic light only (for a multitude of reason) - but I use Raytraced shadows for most of my large interior lights just because I find them to look better - especially in dim lighting where you can't really notice the resolution artifacts. And the performance gain is great as well. But I checked every mesh in the scene (I wish I could check the Distance Field resolution in the asset matrix ), and they all had a resolution of 1. The curious thing for me is that once I remove my NPC's from the scene, the distance field rendering time drops down to sub millisecond times. But if I disable 'Cast Shadows' on their mesh, the lag is still there. However, if I remove their helmets (a 9K tri mesh), then the UpdateGlobalDistanceFieldVolume rendering time drops down to 4ms. I'm just not sure what's going here because all of what I've described worked fine a week ago and then all of a sudden, it started lagging heavily. I thought that it might have had something to do with the 4.11.1 update, but I don't see anything in the changelog that would imply anything having to do with distance fields.

        I ran some tests in a clean map and clean third person example project just to see what the issue might be. I think there is something wrong with either my setup of distance fields, or distance field shadows as a whole in 4.11. Here is a comparison between my 4.10 and my 4.11 using raytraced shadows. The cubes are the standard cubes UE4 comes with and the artifacts are there even if I remove all the NPC's from the 4.11.2 version.

        4.10.4:
        Click image for larger version

Name:	lKGO03d.png
Views:	1
Size:	823.2 KB
ID:	1104967

        4.11.2:
        Click image for larger version

Name:	87cB8Ev.png
Views:	1
Size:	608.7 KB
ID:	1104968

        Are those artifacts to be expected? Or is there something I've done wrong here?
        Attached Files

        Comment


          #5
          I tried disabling Distance Fields all together in the project settings and changing all the lights I had set to raytraced shadows to use shadow maps instead. It is my understanding that using shadow maps instead of raytraced shadows should lead to a decrease in performance. However, my framerate went up from 20ish up to almost 80. Does this have something to do with the density or number of meshes that the raytraced shadows would have to be calculated for? Because even then, that doesn't explain why going from NPC's with helmets and NPC's without helmets would make such a profound difference (almost 20 fps increase for a reduction in about 12 static meshes).

          Comment

          Working...
          X