f13rce Posted May 10, 2011 Share Posted May 10, 2011 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: 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: 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'. 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: Collapsed: 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 Quote 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 More sharing options...
Canardia Posted May 10, 2011 Share Posted May 10, 2011 Try SetStats(2) to see information about rendered triangles, shadows, etc.... Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
f13rce Posted May 10, 2011 Author Share Posted May 10, 2011 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: 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 Quote 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 More sharing options...
Josh Posted May 10, 2011 Share Posted May 10, 2011 That seems quite low for 332 entities, but i can't tell anything else without examining the actual file in question, Quote 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 More sharing options...
f13rce Posted May 10, 2011 Author Share Posted May 10, 2011 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 Quote 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 More sharing options...
Richard Simpson Posted May 10, 2011 Share Posted May 10, 2011 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. Quote 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 More sharing options...
f13rce Posted May 10, 2011 Author Share Posted May 10, 2011 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. Quote 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 More sharing options...
Richard Simpson Posted May 10, 2011 Share Posted May 10, 2011 I'm free to help out if you need it. Quote 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 More sharing options...
f13rce Posted May 13, 2011 Author Share Posted May 13, 2011 Update: I've put Mall in the Editor and removed some unseen polies, but I get the same result. :\ (VSync is off, just a small gain of 8 FPS.) 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 Quote 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 More sharing options...
Richard Simpson Posted May 14, 2011 Share Posted May 14, 2011 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. Quote 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 More sharing options...
f13rce Posted July 31, 2011 Author Share Posted July 31, 2011 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! whatisit.txt Quote 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 More sharing options...
Canardia Posted July 31, 2011 Share Posted July 31, 2011 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. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Josh Posted July 31, 2011 Share Posted July 31, 2011 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. Quote 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 More sharing options...
f13rce Posted July 31, 2011 Author Share Posted July 31, 2011 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? 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 Quote 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 More sharing options...
Paul Thomas Posted July 31, 2011 Share Posted July 31, 2011 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. Quote Link to comment Share on other sites More sharing options...
f13rce Posted August 1, 2011 Author Share Posted August 1, 2011 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. Quote 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 More sharing options...
Paul Thomas Posted August 1, 2011 Share Posted August 1, 2011 77 is your real FPS. Quote Link to comment Share on other sites More sharing options...
macklebee Posted August 1, 2011 Share Posted August 1, 2011 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. Quote 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 More sharing options...
f13rce Posted August 1, 2011 Author Share Posted August 1, 2011 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. Quote 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 More sharing options...
f13rce Posted August 1, 2011 Author Share Posted August 1, 2011 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) Quote 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 More sharing options...
Paul Thomas Posted August 1, 2011 Share Posted August 1, 2011 Compared it's slower, since the framework creates/manages worlds, cameras, buffers, and manages post-process. Just creating a camera and world is nothing compared. Not sure anymore what post processes are on by default in framework. Quote Link to comment Share on other sites More sharing options...
Cole Chapman Posted August 1, 2011 Share Posted August 1, 2011 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. 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) Quote Link to comment Share on other sites More sharing options...
Paul Thomas Posted August 1, 2011 Share Posted August 1, 2011 That's basically what I said here: 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. Hopefully it will resolve most of your FPS issues. Quote Link to comment Share on other sites More sharing options...
f13rce Posted August 9, 2011 Author Share Posted August 9, 2011 Done digging for a while. Time for results: 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 Quote 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 More sharing options...
Road Kill Kenny Posted August 10, 2011 Share Posted August 10, 2011 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. Quote 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 More sharing options...
Recommended Posts
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.