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?

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?

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).

http://content.screencast.com/users/Andargor/folders/Jing/media/622470c8-a6af-45a4-9bf3-d51e3ca324d7/2014-06-06_1755.png

Any ideas from you rendering gurus?

EDIT: Deleting and reimporting the SkeletalMesh got rid of the flickering. The performance issue remains however.

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.

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.

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.

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.

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!

Cool, I’ll look into it. Like I said I’m a noob at rendering and shaders, but I’m willing to learn. :slight_smile:

The point would be that a StaticMesh would provide better performance?

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.

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.

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:

02.jpg

6d8a9aeeef556534407241f7642cc741a80c836e.jpeg

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.

You guys are great!

Cool, I’ll learn how to do that. More on how I intend to use it below.

Okay, I added a boolean modifier with a cylinder to take out the internal stuff in the middle. Here’s the result:

http://content.screencast.com/users/Andargor/folders/Jing/media/4d7e3b4d-e145-4d10-8a48-b77719b0dd45/2014-06-08_0022.png

http://content.screencast.com/users/Andargor/folders/Jing/media/08c24492-4cd7-4954-8906-e3949aeaf9b4/2014-06-08_0022.png

Wow that’s a great example, thanks. I don’t know if I can make mine look pro like that. :slight_smile:

FYI, the model is a spherical torus deuterium-helium-3 fusion reactor with a magnetic nozzle. It comes from a NASA study on realistic spacecraft design. In any case, it is one of many engine types that can be fitted on a spacecraft by the player in a hangar environment. The player can add up to 32 of these engines on a spacecraft in various configurations (there are smaller models than this one).

So yes, there will be far shots, but the player will also be able to look more closely at these engines while designing his spacecraft, whose dimensions may vary (these are approx 7x7x15 m). I think the LOD idea is great, since as I understand it will provide the necessary close-up detail when needed.

Here’s the editor screenie:

http://content.screencast.com/users/Andargor/folders/Jing/media/dff1cf47-2ee1-45ee-9be0-86c11b055c1f/2014-06-08_0024.png