No announcement yet.

grass killing my fps. gtx 970, 3700x - empty map fps 120

  • Filter
  • Time
  • Show
Clear All
new posts

    grass killing my fps. gtx 970, 3700x - empty map fps 120

    I enabled distance culling, Forward Rendering. And it's not very dense. Zpass enabled.
    1000 draw calls. 53k units of grass. 500 Vertices per asset. I am using ProjectNature Grass. Very good optimization.
    Someone else gets gets 90 fps with another good optimized grass asset. Why don't I get that? ProjectNature has very good optimization for games.

    Click image for larger version  Name:	UE4Editor_aea7qQvOhx.jpg Views:	0 Size:	485.1 KB ID:	1740150

    It's probably not a good asset.
    modern GFX perform better with less transparency and more triangles.
    Look into Vertex grass.

    Also make sure the LODs exist and are in use.
    There is absolutely no need to keep the initial LOD at a distance since the grass quickly becomes less then 1 pixel and therefore hard to render.

    Another thing is, disable shadows on it and fake the shadow with a texture. This prevents the dynamic light from wasting resources calculating the imperceptible shadow that the grass will cast - which is also more expensive if the grass uses transparency.

    Forward rendering will get you more frames in general, but not in this case. You can revert to the regular system unless you need forward rendering specifically.

    Last but not least your landscape is eating up FPS too. Which is normal. Drop the LOD of it down to 0 as a last touch and see if that gets you back above 60fps.


      I've made lots of tests with foliage.
      For that kind of grass, you should disable dynamic shadows for that mesh on the foliage tool, and enable contact shadows in the directional light. (That usually boosts performance).
      You can also try to change the depth prepass from "opaque meshes only" to "opaque and masked". I've seen some performance increase on forest like scenes changing that setting,
      Of course all that "MostHost LA" said, are good advices also,

      I know this is an old post but maybe this info can be usefull for someone else.


        MostHost LA
        Grass is: focused "hp" meshes to reduce overdraw.
        Drop down landscape lod to 0? That is the highest vertices count tho.
        There is very little overdraw on this grass. I am sure you're confusing this with ****** grass.

        Directional light and its contact shadows doesnt work for me. iscaru1988
        ​​​​​​​This Post is not old.


          I haven't tested the asset in question, but nonetheless I told you all the things you need to check on to get things to run smoother.
          and you misunderstood on the landscape LOD. Check the details tab on the landscape, you'll find the setting.

          Btw, 500 vertex per mesh is not low impact on transparency.


            Hi, an image from the result of "stat gpu" might be useful here, since you're gpu bound.

            Btw. he is using exactly this grass here which I think you know about
            Last edited by chrudimer; 04-02-2020, 12:16 PM.


              LODS are in use.
              I dont understand: There is absolutely no need to keep the initial LOD at a distance since the grass quickly becomes less then 1 pixel and therefore hard to render.
              How do I fake shadows with texture?
              Ive changed LOd of landscape and nothing happend regarding fps. MostHost LA


                Check how aggressive the lods on the grass are. The more aggressive, the more likely they use transparency. The more transparency in use (there is a view for this btw) the more Overdraw. The more Overdraw, the more GPU cost.

                To fake the shadow with a texture you simply darken the root of the grass by coloring the albedo texture (more performant) or overlay a texture to darken it (less performant but can be done with a UV mapping trick to save a texture).
                Doing so will make the grass feel alive even during motion while you'll be able to disable shadow on it and gain in performance.

                I'll dig out the exact setting to tweak on the landscape when I can.


                  I don't understand how a AO similar shadow should replicate a sharp shadow incoming from moon/sun.
                  Attached Files


                    Because you will never be able to tell the difference between one and the other past 2 meters from camera.
                    So essentially you could even force a different material for LOD1 and up to gain performance. However, as far as I know, you can't selectively disable shadowing only on a specific LOD level.
                    That means you usually have to disable the showing on it and just fake it - or else you will have performance issues.

                    Aside from that. Green isn't bad, but it can be better:
                    Click image for larger version

Name:	optimizedgrass.jpg
Views:	172
Size:	527.9 KB
ID:	1740839

                    Check the LOD coloration detail view. Depending on what you see color wise at the same distance, you can figure out what LOD it is that needs adjusting.

                    Last but not least, that landscape setting.
                    Try playing with SubSection Min Component ScreenSize. Also make sure your landscape material is good - without tessellation to gain FPS. Or alternatively benchmark without a landscape material entirely to see if you should be concerned about the landscape material you are using or not.

                    Attached Files


                      Unless you're using a translucent material, it won't display anything beyond green, so for this masked material green is the worst you can get. The problem for this overdraw is the high vertex count (if more than one triangle covers the same pixel that will result in overdraw). To reduce this overdraw you can either reduce the cull distance to before it turns all green, or add more lods with lower vertex count for the distance.

                      If your goal is only to reduce overdraw due to the opacity mask, you don't need such an high amount of vertices. But if you also want realistic wind effects, then you do. And that's another problem for your performance. The grass from project nature has a high vertex shader complexity (above 400) due to simulating player interaction and realistic wind effects and combining this with a very high vertex count is bad for performance.

                      And could you add an image from "stat_gpu"?


                        Not the original scene. This is really difficult to understand what you write.


                          hello MostHost LA
                          u can disable the shadow on lods
                          i think we can turn on dynamic shadow on lod0 and lod1 then disabling it and faking the shadows on the other lods by tinting the root off the grass to make it darker (and get red off some off the maps like normal map or AO +roughness ) to give more performance
                          is that a good solution?


                            Ok thanks, couple of things:

                            (1) "stat gpu" inside the shader complexity view will give you wrong results since this is rendering a different image, could you make another image from "stat gpu" while in normal view?

                            (2) Seems you're capping at 60 fps, could you uncap the fps? (the console command is "t.maxFPS" and if you would set it to <= 0 it will uncap the fps)

                            (3) Always test performance (and therefore the image from "stat gpu") in standalone (not sure if you're already doing that but since this is rather important for performance I mention it). Because else you will also see the performance used up by the editor (and every window you have open there) and therefore you will get much lower framerates.

                            This is really difficult to understand what you write.
                            Hmmm, what specifically?


                              Standalone game runs with less fps than in editor viewport. EDIT: Standalone runs with 7 fps more
                              My cap is at 120 or higher.
                              Last edited by poky; 04-03-2020, 01:57 PM.