Jump to content

Low FPS


f13rce
 Share

Recommended Posts

Hey guys,

 

I've been with this problem for a pretty long time, thought it was time to show what I had after a testing round.

The problem is that I have a low FPS, while the map (Mall) is only 14k tris. My graphics card is an NVidia GeForce 9800GTX with 512mb. My processor is an AMD Phenom II X4 965, so even quad core.

 

Got a few screenshots here:

 

Tris_In3DSMax.JPG

As you can see here, the triangle count is only 14k. The average FPS in 3DS Max is about 33.

 

After I exported it to .gmf with the 3DS Max tool, the triangle count is slightly different, saving about 50 tris:

Tris_InModelViewer.JPG

 

So I went to test the FPS in the Editor, with the lowest settings except for the texture quality, which has been set to 'Very High'.

Tris_InEditor.jpg

 

So I tried to collapse all the models, which was a possible solution after seeing this topic.

Even after trying that, the geometry only got worse, materials got erased but the FPS raised with about 250%. You can see the FPS bottom-left of the window.

 

Normal:

FPS_Normal.jpg

 

Collapsed:

FPS_Collapsed.jpg

 

If you have any idea what it could be, then please, make a post. I'm really curious to know what this could be.

 

Thanks for reading and helping me,

 

Ivar / Evayr

Using Leadwerks Professional Edition (Beta), mainly using C++.

Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz

Previously known as Evayr.

Link to comment
Share on other sites

Thanks for the fast reply Lumooja.

 

I've tried SetStats(2); in the editor with the Mall.gmf and the terrain_arctic.sbx. This was the result:

 

ResultSetStats2.jpg

 

Now I see that the ammount of Polies and Mem. Usage is way lower than the arctic scene, but that the ammount of entities and batches is ridiculously higher. I suppose that is the problem? If so, what can I do about it to get that fixed?

 

Thanks,

Ivar / Evayr

Using Leadwerks Professional Edition (Beta), mainly using C++.

Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz

Previously known as Evayr.

Link to comment
Share on other sites

That seems quite low for 332 entities, but i can't tell anything else without examining the actual file in question,

Thanks for helping Josh. Here you go: http://Evayr.com/other/Mall.rar

Using Leadwerks Professional Edition (Beta), mainly using C++.

Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz

Previously known as Evayr.

Link to comment
Share on other sites

I gave this a try with my GTX460, and that section outside with all the boxes in it is where i get the worst FPS. I get 23FPS there. But most other places of the map I get about 50-250 fps.

 

You should break this map into sections, and use instances of the boxes, bins etc. Have the mall walls,floor and ceiling as one mesh, then all the stuff inside as seperate props. also make those taller distance buildings a seperate mesh and instance those.

 

All the faces that aren't visible by the player should be deleted too. like the ceiling of the mall on the outside. the distant buildings roofs and bases should be removed also. The same goes for the stalls and vending machines too. This should increase performance for you. :)

Intel core 2 quad 6600 | Nvidia Geforce GTX460 1GB | 2GB DDR2 Ram | Windows 7.

 

Google Sketchup | Photoshop | Blender | UU3D | Leadwerks Engine 2.4

Link to comment
Share on other sites

Thanks for the help Richard :)

 

I'll wait for Josh's response before I'll do that hell of a job in case anything seems to be a mistake or so.

Using Leadwerks Professional Edition (Beta), mainly using C++.

Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz

Previously known as Evayr.

Link to comment
Share on other sites

Update:

 

I've put Mall in the Editor and removed some unseen polies, but I get the same result. :\

 

FPS_Sandbox.jpg

(VSync is off, just a small gain of 8 FPS.)

 

Mall_editor.jpg

 

Editor files: Download

(Extract these files in the Leadwerks SDK root folder. I forgot to add mall_ in the beginning of each .gmf file, so please spare me for that)

 

Anyone got an idea what it could be?

 

Thanks :)

Using Leadwerks Professional Edition (Beta), mainly using C++.

Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz

Previously known as Evayr.

Link to comment
Share on other sites

Hmm strange. Good job though on breaking it up a bit. Although, there is still a lot of faces here that could be deleted. And some meshes that could be instanced. You should only have 1 container model for example, and instance that around. Do the same for anything you have more than one of. You have a lot of box meshes in one file here. You could easily cut that down to 3 seperate box meshes and instance those. I would also instance the shop shelves too, that are in the middle of the map.

 

 

If you own GTA IV you should download spark IV and take a look at their meshes, and how they export them. I have learnt a lot from doing this. :)

Intel core 2 quad 6600 | Nvidia Geforce GTX460 1GB | 2GB DDR2 Ram | Windows 7.

 

Google Sketchup | Photoshop | Blender | UU3D | Leadwerks Engine 2.4

Link to comment
Share on other sites

  • 2 months later...

Pretty big update on this topic:

 

I've looked into the source code and changed the drawing of frames. It's working with Framewerks now. This also increased the FPS by 30.

Because of that I solved a few problems, like a box shadow following the camera all the time (

(don't know if this is a bug, guess it's my fault?)). So I fixed up some code and changed some lights.

 

I was doing tests and logged the fps manually with every little change I did.

After a while I changed the camera scale from 1.4 back to 1, which saved me 17.7 fps. This used to remove the square on the ground.

Second I used a gigantic directional light instead of a spotlight, which saved me another 22.5 fps.

 

So in the end I ended up with ~100FPS instead of 61.3. But still, I don't think that's a lot for only 15k tris (7k poly). So I made a cube in 3DS Max and exported it - Zing, 109 FPS. Guess it's something in my code.

 

I've cut out a lot of things that didn't matter with the FPS. Since I use multiple .h and .cpp files you won't be able to compile it and run it - sorry for that, but I don't feel like giving the entire source away.

You can download the source in the attachments. I will personally give you a big hug if you can see the problem (or something else - except for kisses *lol*). Main loop starts at line 816. As I said, I removed a lot of (mail loop) code to make it easier to understand what's happening.

 

Thanks for helping in advance! :unsure:

whatisit.txt

Using Leadwerks Professional Edition (Beta), mainly using C++.

Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz

Previously known as Evayr.

Link to comment
Share on other sites

Your main loop has mostly commands which should be called only once before the main loop.

Move all those Set... commands before the main loop.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

I'm not sure if calling those commands will impact performance or not, but that is kind of odd.

 

So in the end I ended up with ~100FPS instead of 61.3. But still, I don't think that's a lot for only 15k tris (7k poly). So I made a cube in 3DS Max and exported it - Zing, 109 FPS. Guess it's something in my code.

The performance of Leadwerks Engine is not usually impacted by the amount of geometry onscreen. The performance tends to be limited by the screen resolution, effects settings, and the number of shader pipelines the GPU has.

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

Thanks for the fast replies!

 

You main loop has mostly commands which should be called only once before the main loop.

Move all those Set... commands before the main loop.

 

This saved another 13 FPS. Any other ideas? :unsure:

 

Edit:

The performance of Leadwerks Engine is not usually impacted by the amount of geometry onscreen. The performance tends to be limited by the screen resolution, effects settings, and the number of shader pipelines the GPU has.

 

Apparently is does over here. The effects are just some contrast, brightness and saturation changes.

 

I have been thinking about some memory leaks or something, too many initializes or perhaps some bad build settings? Can't really figure it out, hopefully you can. I will supply you as much as I can. ;)

 

Another edit:

I changed the cube.gmf with the CreateCube(); command. FPS is 152 now. Something might be wrong with the exporting of the GMF? Or perhaps importing? My export settings in Max aren't that weird: http://Evayr.com/images/MaxExport.jpg

Using Leadwerks Professional Edition (Beta), mainly using C++.

Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz

Previously known as Evayr.

Link to comment
Share on other sites

You're also calling UpdateAppTime() which I believe Framework already does in it's update function. Careful of draw calls too, the amount of meshes in the map, and keep digging.

 

Unfortunately not the problem. From ~150 FPS I now get 77 FPS. Guess that line is pretty essential.

 

I'll edit this post if I find something new.

Using Leadwerks Professional Edition (Beta), mainly using C++.

Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz

Previously known as Evayr.

Link to comment
Share on other sites

Unfortunately not the problem. From ~150 FPS I now get 77 FPS. Guess that line is pretty essential.

 

I'll edit this post if I find something new.

 

What paul is saying is that by using UpdateAppTime() and framework (which has UpdateAppTime in it), you are creating a false reading of the actual FPS. By using two of them, you are doubling the value being reported but not actually increasing the number of frames per second. So remove it.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

What paul is saying is that by using UpdateAppTime() and framework (which has UpdateAppTime in it), you are creating a false reading of the actual FPS. By using two of them, you are doubling the value being reported but not actually increasing the number of frames per second. So remove it.

Ah, I see. I also checked it with Fraps and you're both right. I removed it. Back to ~77 FPS.

Using Leadwerks Professional Edition (Beta), mainly using C++.

Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz

Previously known as Evayr.

Link to comment
Share on other sites

Some more testing with interesting results. Worth double-posting.

 

I've made the frameworks work from scratch, totally clean and got 88FPS. I guess my laptop's video card isn't perfect (Ati Mobility Radeon 5470). I'll edit my laptop's hardware in my signature. The reason I'm using a laptop is because I'm at a place full of nurses and such (I'll be fine, don't worry). So I can't test it on my good PC. Instead, I gave the .exe to a friend.

 

After installing OpenAL he got 580 FPS.

The hardware of his PC:

- nVidia GeForce 460 GTX

- 6 GB RAM

- Intel i7 920 @2.67GHz

- Windows 7 64 Bit

 

In the test, nothing has been drawn on the screen (no models, no CreateCube etc). Is 580 FPS normal for such a good PC?

 

At last I also made a new project with just a camera and world. My friend was able to get a FPS of 2500 (422 on my laptop). Does this mean Framewerks is a lot slower? Could that be the problem? (Using LE2.43 btw, will try 2.50 tomorrow)

Using Leadwerks Professional Edition (Beta), mainly using C++.

Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz

Previously known as Evayr.

Link to comment
Share on other sites

I do believe they are your models bud. (I am no expert) When I put them in the editor, the largest number that jumped out was the 3000 batches (I'm not sure what exactly they are though) so I started messing with them. In the image below, I deleted those two small models (Both of the Crates models) from the scene and the batch size went down by roughly 820. The FPS difference after this was about 17 Before to 25 after. I could be very wrong, but thats just what I picked up on.

 

unledgxj.png

 

Since the Arctic scene has WAY more polys than your mall scene and WAY less batches, I think we can say that that is the first issue you should try and tackle.

 

(Like I said though, could be wrong)

Link to comment
Share on other sites

Done digging for a while. Time for results:

 

Result.jpg

 

Left side: Mall

Notes:

- No lighting

 

Noticeable things:

- FPS is just 14 higher than the middle SetStats(2) result (Desert highway)

- 319 entities drawn. After playing around with the camera rotation and position in the map, this had some serious influences in the map (300 was low, gave me ~120 fps, 1000 entities gave me ~70 FPS).

- 439 Batches drawn. Again, after playing with the cam this had no influence on the FPS.

 

Middle side: Desert Highway

Notes:

- No lighting

- Imported it in Ravage, not the Editor

 

Noticeable things:

- A LOT of polies, no influence on the FPS (so that isn't the problem at all, unlike my first post).

- A LOT more memory usage, guess that lowers the FPS so much.

- Only 12 batches drawn. But as I said above, it has no influence on the FPS. Yet the draw time is higher than the 439 batches... found that slightly weird to see.

 

Right side: CreateCube()

Notes:

- No lighting

- Scene is a cube from Leadwerks. No LoadScene nor LoadModel has been used (except for the viewmodel).

 

Noticeable things:

- Low everything and 161 FPS. It's only ~5k poly's away from the Mall scene but 315 entities. Guess we have a winner: the amount of entities. However, the amount of batches is also insanely low compared to the Mall scene. But I wrote that didn't matter when I was playing around with the camera.

--------------------------

 

To fix the entities problem, I think I will have to export the models in Mall piece by piece... am I right? I rather ask it first to make sure before I start that big job, heheh..

 

What also bothered me a LOT is that the lighting and shadows take a LOT of FPS. I've set the ShadowMapsize to 2048 because then it looks good, even though it's high. ShadowQuality is 1 (best). Any tips and tricks to keep the FPS high with some good lighting? I'm used to have one big sun, but that makes the FPS go so low I don't dare to put some small detail lights in the map.

 

Thanks for reading and helping in advance. Big time. :)

 

- Ivar / Evayr

Using Leadwerks Professional Edition (Beta), mainly using C++.

Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz

Previously known as Evayr.

Link to comment
Share on other sites

You could probably give players a choice of quality as all games seem to do. That way you can have a large shadow map size, and for those systems that can't handle it, they can tone it down for better fps :). It seems in most commercial games that I play, puting shadows on and shadow quality up is one of the biggest fps hits in the options menu. Giving the player the option is probably the best way to go in that case.

STS - Scarlet Thread Studios

AKA: Engineer Ken

 

Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now!

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