Announcement

Collapse
No announcement yet.

Increasing FPS for procedurally added meshes

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

    Increasing FPS for procedurally added meshes

    I'm a bit of a noob on the rendering side, so maybe someone can help or point me to good guides.

    I have a SkeletalMesh with these stats:



    I add this mesh up to 32 times on an Actor, and my FPS drops from 90 to 17. I was wondering what can I do to keep high FPS? Can they be batched? Other tricks I don't know about?
    It is by will alone I set my code in motion.
    It is by coding that thoughts acquire speed, the hands acquire shaking, the shaking becomes a warning.
    It is by will alone I set my code in motion.

    #2
    I would say the poly count there is just much too high.
    Ninja Arcade - UE4 - Forum Thread -- Ninja Arcade - UE4 - Demo v0.02a

    Comment


      #3
      Originally posted by Obihb View Post
      I would say the poly count there is just much too high.
      Ok thanks, so that is all I can do to improve performance? What poly count should I be aiming for?
      It is by will alone I set my code in motion.
      It is by coding that thoughts acquire speed, the hands acquire shaking, the shaking becomes a warning.
      It is by will alone I set my code in motion.

      Comment


        #4
        I've reduced the poly count to 20K, but I'm still getting quite poor FPS, like 30-40. I need to add more stuff as well. Also, the meshes I add "flicker". Here's a screenshot, there is supposed to be 32 in a square grid, but this shows only half of them (the others flicker in and out).



        Any ideas from you rendering gurus?

        EDIT: Deleting and reimporting the SkeletalMesh got rid of the flickering. The performance issue remains however.
        Last edited by Andargor; 06-06-2014, 06:08 PM.
        It is by will alone I set my code in motion.
        It is by coding that thoughts acquire speed, the hands acquire shaking, the shaking becomes a warning.
        It is by will alone I set my code in motion.

        Comment


          #5
          20k is still alot of polys for a mesh you are going to be using alot of. Try looking into normal mapping high poly detail onto low poly meshes. I'm not able to see your mesh super clearly, but you might be able to get it down to 5k if you rely on normal maps.

          Comment


            #6
            Originally posted by Knobbynobbes View Post
            20k is still alot of polys for a mesh you are going to be using alot of. Try looking into normal mapping high poly detail onto low poly meshes. I'm not able to see your mesh super clearly, but you might be able to get it down to 5k if you rely on normal maps.
            Ok thanks, I'll read up and look into that. At 20k, they are of poor quality, but I hear shaders can help as well.

            EDIT: This is what it looks like in Blender with the decimation. The round part is really gnarly.

            It is by will alone I set my code in motion.
            It is by coding that thoughts acquire speed, the hands acquire shaking, the shaking becomes a warning.
            It is by will alone I set my code in motion.

            Comment


              #7
              Does it need to be a skeletal mesh? I am assuming it has some kind of animation, but depending on how complex that animation is, you might be able to accomplish it via a vertex shader on a static mesh.
              Ryan Brucks
              Principal Technical Artist, Epic Games

              Comment


                #8
                Originally posted by RyanB View Post
                Does it need to be a skeletal mesh? I am assuming it has some kind of animation, but depending on how complex that animation is, you might be able to accomplish it via a vertex shader on a static mesh.
                That's a very good question and suggestion. I used a SkeletalMesh to allow swiveling and vibrations. I tried the baking of high-res normals onto a 10k model but it doesn't look any better, although I might have done it wrong.

                The greatest boost in FPS was removing shadows, which takes the FPS to about 80 with 32 of these models.
                It is by will alone I set my code in motion.
                It is by coding that thoughts acquire speed, the hands acquire shaking, the shaking becomes a warning.
                It is by will alone I set my code in motion.

                Comment


                  #9
                  Originally posted by dmacesic View Post
                  Ok thanks, I'll read up and look into that. At 20k, they are of poor quality, but I hear shaders can help as well.

                  EDIT: This is what it looks like in Blender with the decimation. The round part is really gnarly.
                  Part of the reason it looks so gnarly is that you need to set the faces to interpolate smoothly. Select the sphere and in the left-hand panel of your 3D viewport you should see that option. That will help a lot. you should be able to reduce the poly count on that sphere drastically.

                  If you can post a wireframe that might help see where else we can reduce the polycount.
                  Trevor Lee

                  Comment


                    #10
                    Sounds like a great candidate for vertex shader animation to me. In gears of war3 we often used vertex shaders for things like vibrating engine components or things bobbing on the surface of the water etc. rotation of meshes is also possible but you will have to rotate the normals as well if you want the lighting to stay correct.
                    Ryan Brucks
                    Principal Technical Artist, Epic Games

                    Comment


                      #11
                      Originally posted by Hyperloop View Post
                      Part of the reason it looks so gnarly is that you need to set the faces to interpolate smoothly. Select the sphere and in the left-hand panel of your 3D viewport you should see that option. That will help a lot. you should be able to reduce the poly count on that sphere drastically.

                      If you can post a wireframe that might help see where else we can reduce the polycount.
                      Doh! It indeed makes it look better:



                      Here's the wireframe. I can ignore the internal stuff, right? It gets culled?



                      Thanks for the help so far!
                      It is by will alone I set my code in motion.
                      It is by coding that thoughts acquire speed, the hands acquire shaking, the shaking becomes a warning.
                      It is by will alone I set my code in motion.

                      Comment


                        #12
                        Originally posted by RyanB View Post
                        Sounds like a great candidate for vertex shader animation to me. In gears of war3 we often used vertex shaders for things like vibrating engine components or things bobbing on the surface of the water etc. rotation of meshes is also possible but you will have to rotate the normals as well if you want the lighting to stay correct.
                        Cool, I'll look into it. Like I said I'm a noob at rendering and shaders, but I'm willing to learn.

                        The point would be that a StaticMesh would provide better performance?
                        It is by will alone I set my code in motion.
                        It is by coding that thoughts acquire speed, the hands acquire shaking, the shaking becomes a warning.
                        It is by will alone I set my code in motion.

                        Comment


                          #13
                          In my opinion, that thing is still way over modeled. I don't know the size of it in context to the scene but if it's gonna be that small on screen then you can easily get rid of thousands of polys on that. You can get rid of thousands of polys regardless. I wouldn't recommend using an auto poly cruncher to get rid of any polygons. The model can get real ugly with that, especially a model like this where the border edges are pretty important for shape. I suggest you just model it lower poly.

                          You can also consider doing pretty aggressive LOD to scale poly count down real quick based on distance.

                          As for the culling thing, well, no, models will only cull when they are separate models. A single model with polygons you never see, those polygons still gets processed. So if you have polygons you never see in your model, get rid of them.

                          Whether to use skeletal mesh or not will become much less of an issue when you have a good poly count to work with. Though skeletal mesh will be the more expensive choice anyway, you might get away with it depending on your end goal. Start off with a good model and worry about the rest of it later. No workaround on a bad base, is gonna be as good as a good base to start with.
                          Ninja Arcade - UE4 - Forum Thread -- Ninja Arcade - UE4 - Demo v0.02a

                          Comment


                            #14
                            Originally posted by dmacesic View Post
                            Doh! It indeed makes it look better:



                            Here's the wireframe. I can ignore the internal stuff, right? It gets culled?



                            Thanks for the help so far!
                            Nope, go ahead and get rid of all the polygons that you won't see. They won't get culled out because if part of the model is visible, it will all be drawn.
                            Trevor Lee

                            Comment


                              #15
                              Originally posted by Obihb View Post
                              In my opinion, that thing is still way over modeled. I don't know the size of it in context to the scene but if it's gonna be that small on screen then you can easily get rid of thousands of polys on that. You can get rid of thousands of polys regardless. I wouldn't recommend using an auto poly cruncher to get rid of any polygons. The model can get real ugly with that, especially a model like this where the border edges are pretty important for shape. I suggest you just model it lower poly.
                              I sort of agree. I normally wouldn't focus my reply on this area unless I thought I could provide a good example of some kind.

                              This asset reminded me of another asset that I hand re-modelled based on previously separate static meshes to optimize a gears of war 3 level. They originally had custom normal maps and materials made by a dedicated hi poly modeller but due to optimization reasons (huge hangar bay on ravens nest ship with tons of things going on) had to re-UV them to use the wall materials to save texture memory. Turned out to just be easier to remodel from primitive shapes than adjust the UVs of complex meshes.
                              The original poly count of the combined meshes was probably somewhere in the 10-20k ballpark too not unlike your mesh. At first the missiles actually had separately popped off plates and everything, and you might even think "wow, it's too bad they had to remove that" if you saw the original asset, but I don't have that asset to post a screenshot of anymore... Still I think it looks pretty decent considering it is using a wall texture.

                              Total polycount here is around 5100 for 4 missiles and 2 'bracket things' that each has a nicely curved handlebar bit. I think the complexity is fairly close to your mesh:

                              Click image for larger version

Name:	02.jpg
Views:	1
Size:	49.4 KB
ID:	1051134

                              Click image for larger version

Name:	01.jpg
Views:	1
Size:	145.7 KB
ID:	1051135

                              Of course I have no idea how big or up close your object is going to be, but I would guess that with minimal clean line loops you could have your mesh looking pretty good anywhere in the 2-6k poly range. A screenshot from the editor wireframe would be more helpful, we can't really see how many triangulated edges are on your mesh.
                              Last edited by RyanB; 06-07-2014, 11:29 PM.
                              Ryan Brucks
                              Principal Technical Artist, Epic Games

                              Comment

                              Working...
                              X