Jump to content

Outdoor scene with a few NPCs cannot get above 20-35 FPS


blueapples
 Share

Recommended Posts

I have an 1024x1024 outdoor scene with terrain that I can't seem to get above 35 or so FPS:

 

post-17500-0-80638100-1469494252_thumb.png

 

When looking at the NPCs it drops significantly, down to 19-20 FPS or less:

 

post-17500-0-17583500-1469494193_thumb.png

 

I've had a really hard time even getting this to perform this well and retain some of the look I'm going for. Originally I wanted a much denser forest (though I'm unsure if reducing density even helped, there are so many variables it's hard to keep track).

 

So what can I do to speed this up?

 

Josh you should have access to our SVN in a PM from me. This is the start.map file.

 

Here is a shot with debug stats:

 

post-17500-0-35094600-1469494212_thumb.png

Link to comment
Share on other sites

4 million polygons per frame is way too much. It doesn't look that dense, but you should play around with the distance and billboard settings to get those polycounts down. I'd also be interested in knowing the polycounts on those characters.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

So the models have about ~54,000 and ~39,9000 polys.

 

The Merc from one of the workshop assets has ~13,000 so I don't think these are really *that* far off. Unfortunately I haven't been able to find a way to reduce polys on the models. Adobe's Decimator really messes up parts of them like their feet (they get 180 degree inverted upside down, very strange)... though it otherwise does a pretty good job, it's not usable. Not sure how else to approach that.

 

This entire game is about NPCs so these are custom iClone Character Creator exports. Definitely want to have more than 2 of them and want to be able to render 12+ characters if at all possible.

 

Adjusting billboard distances seems to have helped a little but it's still pretty tough to keep it above 30.

 

Is there a way to FPS lock at 30 so it won't render higher FPS? I'd prefer it to be consistent.

Link to comment
Share on other sites

The Merc is actually pretty far on the high end. Those models aren't even real-time.

 

With the vegetation stuff, just keep lowering the view distance and billboard distance until it's fast enough. I probably wouldn't even use billboards on grass and some small objects.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

try lowering the view distance of your vegetation, not just the billboarding, i don't know what yours is at but you don't need to be able to see grass at 300 away in my opinion, also do you have collision on any bush type objects, i played around with having collide-able bushes for a bit but i realized that adding a simple box collision to my bushes brought my frames down by half, bring down both the view distance and billboard distance on those rocks especially if they have collisions should help.

 

also another thing for your scene i don't know how many objects you have in it but if you go into their properties and make sure their view distances aren't set to max but something like medium so they aren't being drawn all the time.

 

you probably already knew and done all of that but just thought i would throw it out there.

  • Upvote 1
Link to comment
Share on other sites

13K is not much by today's standards; you can definitely push more. I've personally used higher res meshes than that with decent performance. One of the biggest things for me was the shadows for animated objects (much more than the mesh itself).

 

This came out two years ago on the PS4 (not exactly top of the line PC) and it's characters were 120k. This shouldn't be an anomaly in today's games with today's GPUs:

http://suckerpunch.playstation.com/images/stories/GDC14_infamous_second_son_engine_postmortem.pdf

 

You definitely should use LODs though. The problem is that the fill rate gets way too high for dense objects (in terms of screen space occupation and number of triangles). Small triangles can cause rasterization performance problems because of the algorithms used to fill triangles (has to do with bounds checking and overdraw). The rasterizer on your graphics card is fixed unlike the processing cores. The other issue is that it can be parallelized, but if one part of the screen is much denser than another, you get issues with fragment discarding. IDK if that's a bottleneck, but it could be. You may want to try tessellation approaches since they work fairly well with characters (although it's kind of difficult to learn). With 4K resolution becoming the norm, 10k characters are going to stick out even more. TLDR; use tessellation and/or LODs for characters farther away.

 

Another thing you should try to do is make the line of sight broken up more. You'll see that a lot of open-world designers do this to avoid problems with draw distances (and to help with streaming). This allows you to hide objects that are closer from the camera though.

Link to comment
Share on other sites

Thanks for all the ideas everyone! Very helpful.

 

Recalculating the normal maps definitely seem like something I need to do, but so far ShaderMap doesn't seem to be compatible with an iClone character (with separate materials for each part) that's been put through UU3D's PolyReduce command. PolyReduce seems to move everything to a single mesh which causes ShaderMap to produce a giant normal map for the whole model rather than one for each separate subset.

 

Any other tools that might work better to do either the poly reduction or normal recalculation?

 

Is there a feature in Leadworks I'm missing that might help with LOD management or do I just need to do it myself in script?

 

As far as the level design aspects go, I've definitely been thinking about breaking things up more. I wish that the terrain counted for occlusion.

 

Overall I'm hoping that as I fill in the map with more zones and buildings that things will sort of be a wash and I can at least stick to 30 FPS when a lot of stuff is occluded and not being rendered. Ideally I would get this up to 60 FPS with these characters looking good as a baseline.

Link to comment
Share on other sites

The terrain sort of counts for occlusion. Whenever you have the terrain (or anything really) covering something else, some of those surfaces get removed earlier from the graphics card, so there's less to process. Hardware occlusion culling in my experience has limited effectiveness. Sometimes it works well, but somethings it doesn't. It just depends on the scene. Outdoor areas are probably the worst places for it though.

 

For normal map generation, there are some tools that use retopology such as 3D-Coat, but they can be expensive. It's harder with animated meshes because you have to preserve edge-flow (basically how a triangle stretches during animation).

 

Unfortunately, LOD isn't built in, so you'll need to write a script. The vegetation system has a billboard system, so you could possibly use that for some repeating objects or something.

Link to comment
Share on other sites

If you look at the slides, they say they draw over 11 million triangles regularly. This isn't the only game to do this either (I'm sure you can find more data by searching):

 

http://kotaku.com/just-how-more-detailed-are-ps4-characters-over-ps3-char-507749539

 

BTW, the PS4 graphics is roughly between the GTX 750 Ti and the GTX 760 in terms of floating point operations per second and cores, and there's no integrated GPU better than that (two newer GPUs by Intel that are their best GPUs compete with it though). Since the GTX 750 Ti is at the lower end (look at some of the Steam system requirements for some of the newer AAA non-VR games), I don't think 30k is unreasonable for characters, but LODs would certainly help.

Link to comment
Share on other sites

If you look at the slides, they say they draw over 11 million triangles regularly. This isn't the only game to do this either (I'm sure you can find more data by searching):

 

http://kotaku.com/just-how-more-detailed-are-ps4-characters-over-ps3-char-507749539

 

BTW, the PS4 graphics is roughly between the GTX 750 Ti and the GTX 760 in terms of floating point operations per second and cores, and there's no integrated GPU better than that (two newer GPUs by Intel that are their best GPUs compete with it though). Since the GTX 750 Ti is at the lower end (look at some of the Steam system requirements for some of the newer AAA non-VR games), I don't think 30k is unreasonable for characters, but LODs would certainly help.

40,000 polygons on characters that are right up close to the camera does not mean they are always rendering with that detail.

 

What is a good polygon count in a scene?

For simple games, a few hundred thousand. For more complex games meant to run on fast hardware, I would try to limit it to 2 million.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

@Josh

 

I have at most 500k polygons in my scene at 80% 1080p resolution and I pull 20-30 FPS with an AMD Radeon 280x while running in release mode.

 

All my building models are static shadows. Textures sizes are around 1024x1024.

 

Shadow Mode = Light::Dynamic

TerrainQuality = 2

Tesselation Quality = 2

MSAA = 4

Light Quality = 2

 

Obviously if I drop the terrain quality, MSAA value, tessellation quality, and light quality it should render better.

 

But is my frame rate appropriate with my settings?

 

I can run BF4 on Ultra pulling more FPS than I can my own game.

Link to comment
Share on other sites

And 10k is too much for characters 100m away, and 1k is way too much for character 1000m away. That game is one of the first on the PS4, came out three years ago, and uses forward rendering, and even then, the 3rd LOD level is 10k.

 

Check out this paper:

http://graphics.stanford.edu/papers/fragmerging/shade_sig10.pdf

 

And this discussion (to help prove that I'm not making these numbers up):

https://www.reddit.com/r/gamedev/comments/26fpq1/polycount_and_system_requirements/

 

The paper refers to overdraw and a way to change GPUs to better render smaller triangles. This is relevant because the OPs problem isn't related just to vertices for the characters. In the same way 40k characters are inappropriate for certain distances, 10k characters are as well. You put stress on the rasterizer by rendering small triangles, and you also add more fragments to be computed.

 

The point is that 13k is not high-end in today's games, and that 40-60k should be reasonable as long as you use LODs (which you should be using for 10k as well because of the overdraw problem).

Link to comment
Share on other sites

@Josh

 

I have at most 500k polygons in my scene at 80% 1080p resolution and I pull 20-30 FPS with an AMD Radeon 280x while running in release mode.

 

All my building models are static shadows. Textures sizes are around 1024x1024.

 

Shadow Mode = Light::Dynamic

TerrainQuality = 2

Tesselation Quality = 2

MSAA = 4

Light Quality = 2

 

Obviously if I drop the terrain quality, MSAA value, tessellation quality, and light quality it should render better.

 

But is my frame rate appropriate with my settings?

 

I can run BF4 on Ultra pulling more FPS than I can my own game.

I would guess that your entity count is the bottleneck, but you need to test to find out.

 

The good news is that if you limit the draw distance on different entities, they will be a total non-issue once they get out of range. The renderer doesn't even iterate through entities that are far enough away. This works out well because small "debris" types of objects tend to be very dense, while larger objects that can be seen from far away occur much less frequently.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

You guys should really focus more on finishing your stuff then optimizing though or you'll drive yourself mad. Leadwerks is more than capable of producing performant games. Even on a complex scene where I can only get ~100 FPS (I have a pretty powerful PC) it doesn't matter what else I throw at it it'll stay around 100 fps and that's what I love about Leadwerks and it's deferred rendering. But yeah entity-count does seem to be one of the biggest bottlenecks in LE.

 

Also I noticed my NVIDIA card tends to fight sometimes w/ v-sync enabled... nothing crazy but when I limit FPS in other ways I generally get significantly better performance. And my PCs with AMD cards are just **** in general on most modern games.. (never buying an AMD card again -.-).

 

I think it's worth trying to run your application with v-sync off and then see what kind of FPS you get... I bet you it'll be higher, even though I think in theory it shouldn't be.

 

EDIT:

Disable shadows on your grass! big no no.

 

So incase anyone has performance issues last I heard from Blueapples:

-He disable grass shadows for a huge shadow poly drop.

-He removed his post processing shaders.

-He disabled v-sync.

-He re-enabled occlusion culling on his entities.

 

Now he says he's getting 80fps +

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...