Christian Clavet Posted March 11, 2014 Share Posted March 11, 2014 Hi, Been reading this for days, and been questioning myself if I should write in that thread. From what I see, the changes from 3.0 to 3.1 affected a lot the framerate, But using performance tools, I am sure we could get speed back to 3.0 had, we just need some patience. I'm sure the developer are well aware of this. I find it nice that some users would like to help and create comparison between version. Could be a good idea to have a framerate meter on the demos and use them as a benchmark. Perhaps do some demo to improve the benchmark in lots of situations so the developers (engine) could have something to use with their tools to improve the rendering time. The things that I don't find that nice, is that some are pushing too hard. The LE developers know that the rendering is affected and is slow. They have more than a hint about it now. Then why compare it with much matured engines, and make it look even worse?! Theses engine, with time and popularity have much more budget and staff that is on LE right now. At the beginning they were worse that LE could have been. I pre-ordered my version, because I think the tool has the potential to get as great as other products. If you are on a real GAME project, and starting from scratch using 3.1 would not be advised at the moment. If you have a previous version that have the performance you need then stick to it until the "newer" one is finalized and reach the performance. 3.1 on Steam was released less than 2 month ago, what's the big rush about it?! I'm still using Irrlicht (only rendering) and its stuck in GL2.0 since the day I first used it (5 years now). They plan to get it to GL3.2 but it could take the whole year before they reach it. Quote Link to comment Share on other sites More sharing options...
cassius Posted March 11, 2014 Share Posted March 11, 2014 Christian is right. Josh made le2 come good, and he will do it again.Just thnk its a priority Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Einlander Posted March 11, 2014 Share Posted March 11, 2014 Does it change if you run it full screen? I know my PC kicks into its sli/crossfire mode and gives me some extra fps. But I'm not making any major use of shaders. Quote Link to comment Share on other sites More sharing options...
Roland Posted March 11, 2014 Author Share Posted March 11, 2014 As I'm the one who started this thread I thought I would give a "final" comment. The intention was to simply ask a question about the frame rate and if I was doing anything wrong to get such a low FPS. As it seems I didn't and the FPS is low at this moment. This was then my comment on that : Thanks for the info Josh. I'm OK with that and I trust that you will get up the speed in the optimization phase. Just wanted be sure that this issue is on the to-do list. Now looking forward to the Leadwerks 3.1 C++ release. I though this was clear enough and don't want this to be any starter of a FPS-war. Josh has surely got the message and has this on his production line by now. Have a nice day Roland 2 Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 11, 2014 Share Posted March 11, 2014 I though this was clear enough and don't want this to be any starter of a FPS-war. Josh has surely got the message and has this on his production line by now. Have a nice day Roland Well said Roland. Perhaps it is possible you can lock the thread? 2 Quote Link to comment Share on other sites More sharing options...
Roland Posted March 11, 2014 Author Share Posted March 11, 2014 Well said Roland. Perhaps it is possible you can lock the thread? I would have long time ago if I could have . However I cant find any such lock thing. So here is my lock Stop fighting over this now. Be nice to each other 2 Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Josh Posted March 11, 2014 Share Posted March 11, 2014 Some simple testing revealed the following: Presently, Leadwerks is calling the Lua garbage collector every frame. There are two ways you can manage this. One is to constantly call the collector, the other is to let it automatically run on its own when it feels like. I like the constant collection for testing memory allocations, but the automatic is more performant; it just lets memory collect until a certain quota is reached, and then it performs a collection. (This can make it appear that the application has a memory leak when it does not.) Before: 170 FPS After: 220 FPS Another thing I checked is the speed of a 1x Multisample texture verses a conventional 2D texture. Theoretically they should be exactly the same, but the Nvidia driver performs faster with a conventional 2D texture. I would classify this as a driver bug and am contacting Nvidia about it. The current edition does not have lighting shaders for conventional 2D textures, but I easily modified them and will provide that in the next update. So instead of using 1x multisampling, and using a multisample texture by default, the next update will use 0 for the default multisample value, and use a conventional 2D image. Before: 220 FPS After: 306 FPS So those two quick tests that took less than an hour nearly doubled the framerate. That's why I wouldn't be too concerned with performance right now; it's a process of building, using, and evaluating. It doesn't take a lot of time to optimize, but it needs to be spread over a period of time so we have that usage->evaluation->update cycle going. 6 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...
Marcus Posted March 11, 2014 Share Posted March 11, 2014 Good news. Keep this coming. Quote Link to comment Share on other sites More sharing options...
Josh Posted March 11, 2014 Share Posted March 11, 2014 I did find something significant. It didn't make sense to me that a 1x MSAA texture would perform any differently than a regular 2D texture, so I looked more carefully at where they were being created. There are some textures being allocated and deleted in real-time, which is bad. Once I fixed that, performance was comparable to what you would see in Leadwerks 2. Thanks for bringing this to my attention. 13 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...
Roland Posted March 11, 2014 Author Share Posted March 11, 2014 This is VERY Good news Josh. Congrats Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Marcus Posted March 11, 2014 Share Posted March 11, 2014 I did find something significant. It didn't make sense to me that a 1x MSAA texture would perform any differently than a regular 2D texture, so I looked more carefully at where they were being created. There are some textures being allocated and deleted in real-time, which is bad. Once I fixed that, performance was comparable to what you would see in Leadwerks 2. Thanks for bringing this to my attention. Somebody buy this man a beer! Quote Link to comment Share on other sites More sharing options...
Christian Clavet Posted April 6, 2014 Share Posted April 6, 2014 Hi, Sorry to revive that thread. I would kindly ask if the Leadwerks developpers would have to check on another optimization pass on the engine. Get very low framerate with the "crawlers" level (all of them, but this map is the most apparent, since it the biggest) I have a NVidia GTX 780 and Intel I7 running on Windows 7. And I get excellent performance from all the games I have here. I also understand that the product is being released, and there still more tweaks to do. Here is a screenshot I have taken when I start the level using DEBUG mode. Using RELEASE seem a bit faster but... On this screen, I got around 20+ with my current hardware with rendering only done in the windows (meaning that it's not even using my full screen resolution) With scenes with less than 4K poly to render, got around 200+ Fps (other maps), and these maps are really small. I've just got Leadwerks 3.1 standalone with LUA/C++ support for windows. EDIT: Done a quick map using the editor. This editor is really cool! Happy to work with it. temp.zip The prefabs are really a JOY to use!I've been placing the player and the crawler in a few clicks and used a menu item to create the navmesh and the Crawler was running after me! I've only been using the editor since 1-2 hours and I can already create a working map! Got almost 200+ FPS when I was building and testing this map, did not see go much higher or lower until I put the crawler in. I don't think it's the crawler geometry, as I've put more of them and the frame dropped but never as much as the first. Here are some things that perhaps could be checked to see how much they take MS per frame update. Perhaps there something to optimize in there. All reference frame numbers are taken from the DEBUG (slower). It was easier for me to have real numbers using this mode. 1 - Without the crawler on this map, regular refresh is about 200+fps 2 - When I added the crawler the FPS dropped from 200 to around 76+ fps How much the LUA scripts are taking from one frame to the next? Is the lua subsystem is refreshed per frame? Seen that the animated objects were creating a dynamic shadow. How much this shadow projection cost per frame? (seing a "shadow polygon" increase a lot when the crawler is near) How much MS the navigation system takes per frame? Quote Link to comment Share on other sites More sharing options...
YouGroove Posted April 6, 2014 Share Posted April 6, 2014 I made a test with one crawler AI only, i don't think it's Lua problem at all . I have 20 FPS in run mode : BUT ... in another level part with crawler running i got 60 FPS What is it ? Lightening and lights problem ? Navigation more at ease on some level part ? ---------------------------- EDIT : Test 1 : Ok i just kept one directionnal light only : 60 FPS contant in all level with one crawler AI. Test 2 : Lightening test : 5 Crawler one directionnal light only : 60 FPS mainly all time Going another room where it is a spotlight with 5 crawlers following frae rate stays at 30 FPS max. This is shader and lightening performance problem. -------------------- Main ideas for optimisation : Number Lights max per shader or model : LE3 shaders can receive any number of lights to compute shaders, as we suggested we should have the possibility to indicate on shaders or model entity how many lights maximum they should receive. Global illumination system like Deffered radiance transfert volumes Well like Josh said optimisation will come later, no need to hurry now. (Build your level and gameplay first). start.zip Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Christian Clavet Posted April 6, 2014 Share Posted April 6, 2014 Thanks YouGrove. Done another test. I removed all lights (used only Ambient) The framerate still max at 200, and dropped from 200 to around 170 when the "crawler" was attacking. I killed it using the pistol, and then the framerate got back at 196 when it was in view. For the fun of it, I added about 8-10 crawlers and the framerate dropped to 40-50 frames/sec. For me this is directly related to NPC, could be a lot of things. On a sidenote, I was really surprised at how easy it was to add a functional weapon the the player. Will have to dig this lua code and see how it was done. Congrat. This editor is really simple to use! Global illumination system like Deffered radiance transfert volumes Checked on this technique. I did not know about. This is really incredible! Don't know if the dev will be able to implement something like this, but if they do, we'll all be in heaven! Quote Link to comment Share on other sites More sharing options...
YouGroove Posted April 6, 2014 Share Posted April 6, 2014 Thanks YouGrove. Done another test. I removed all lights (used only Ambient) The framerate still max at 200, and dropped from 200 to around 170 when the "crawler" was attacking. I killed it using the pistol, and then the framerate got back at 196 when it was in view. Crawlers shader will impact frame rate a lot , not their code. You can make another test and just replace the crawler normal/spec shader with a simple diffuse shader and you'll see you'll have better frame rate. You see with one light you have lot better than your 76 FPS . In my test above pictures you can see with one crawler , i got 60 FPS on some area where spotlights where not visible and 30 FPS when near sportlights . It's lightening and shader problem mainly it seems. Perhaps some code optimisation in second position , but what drops the most frame rate is having more than one directionnal light. For the fun of it, I added about 8-10 crawlers and the framerate dropped to 40-50 frames/sec. For me this is directly related to NPC, could be a lot of things. Indeed at some point more crawlers = more shader processing Not sure about code as in my side i had constant 60 FPS with 9 crawlers in a simple level room. ( 60 FPS is the LE3 max on my level on my laptop PC test , even without crawlers it's 60 FPS) Checked on this technique. I did not know about. This is really incredible! Don't know if the dev will be able to implement something like this, but if they do, we'll all be in heaven! Not easy, and it's done by big companies with lightening coders teams behind. Even don't know if it could work in LE3 and it's workflow and shaders., it wold ask a major rework again. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Josh Posted April 6, 2014 Share Posted April 6, 2014 Animated models will always result in a lower framerate because they cause shadow maps to be re-rendered. Shadows are not rendered unless they need to be updated. An animated model invalidates the shadows of any lights it interacts, causing the shadow to be re-rendered. 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...
SarperSoher Posted April 6, 2014 Share Posted April 6, 2014 Josh, is there any form of draw call batching in the engine's current version? Also is there a way to get the number of draw calls for the current frame? Quote Link to comment Share on other sites More sharing options...
Josh Posted April 6, 2014 Share Posted April 6, 2014 The engine always uses GPU instancing / batched rendering. I can get some additional low-end hardware and play around with the framerate on that, but I have other things to do first. Your debug framerate will always be low. It's constantly syncing with the GPU with glCheckError() calls and doing other things that slow it down. 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...
tournamentdan Posted April 6, 2014 Share Posted April 6, 2014 Are the shadows updated every frame or can we drop the shadow update to about twice or maybe three times per second. Quote Link to comment Share on other sites More sharing options...
MexSource Posted April 6, 2014 Share Posted April 6, 2014 shadow updates 3 times a second? :/ imagine a game running with 3 fps, then you now how the shadows would look like. I think it would lag massive (but maybe increases performance yeah) Quote C++ :3 Link to comment Share on other sites More sharing options...
Josh Posted April 6, 2014 Share Posted April 6, 2014 Directional shadows always render each frame, because it is assumed something moved in the scene. Other shadows render when needed. If the shadows were not redrawn, you would have a mismatch between the visible geometry and the shadows it casts, and objects would sort of move into their own shadows. I tried it before, and the results were pretty ugly. 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...
tournamentdan Posted April 6, 2014 Share Posted April 6, 2014 shadow updates 3 times a second? :/ imagine a game running with 3 fps, then you now how the shadows would look like. I think it would lag massive (but maybe increases performance yeah) I seriously doubt you can see something change at three times per second. Two might be pushing it. Its no different than physics updates. You do not need a update every frame. How many frames you would do an update depends on what your game is getting for fps. And your fps will change as your game evolves. Your game may star out at 200 fps. So you would update every 66 frames. When your game is done. You might get 60fps. So every 20fps should be fine. Quote Link to comment Share on other sites More sharing options...
MexSource Posted April 6, 2014 Share Posted April 6, 2014 i think you would see a little mismatch doing it this way (how josh said). (would love to test how big this mismatch is, but waiting for 3.1 steam ) //wait a sec... isn't it completely indifferent if you run the game with 200 fps and shadow updates 3 times per sec or with 10 fps and shadow updates 3 times per sec, i mean you have 3 shadow updates per second? (the only change is that the game is running smoother) or am i wrong? Quote C++ :3 Link to comment Share on other sites More sharing options...
tournamentdan Posted April 6, 2014 Share Posted April 6, 2014 i think you would see a little mismatch doing it this way (how josh said). (would.. love to test how big this mismatch is, but waiting for 3.1 steam ) //wait a sec... isn't it completely indifferent if you run the game with 200 fps and shadow updates 3 times per sec or with 10 fps and shadow updates 3 times per sec, i mean you have 3 shadow updates per second? (the only change is that the game is running smoother) or am i wrong? Right, as long as the amount per second stays the same. It will be the same. However the amount of frames per update will have to evolve as your game evolves. I just read some things I did not know. I thought the human eye to brain process was around 30fps. I just read that it is actually 10 to 12 fps. Most films are played at 24 to 25 fps. The hobit movie was at 48 fps to make it more realistic. I now doubt that you need to update more than 10fps. Which is a big jump from every frame. Quote Link to comment Share on other sites More sharing options...
MexSource Posted April 6, 2014 Share Posted April 6, 2014 Right, as long as the amount per second stays the same. It will be the same. However the amount of frames per update will have to evolve as your game evolves. I just read some things I did not know. I thought the human eye to brain process was around 30fps. I just read that it is actually 10 to 12 fps. Most films are played at 24 to 25 fps. The hobit movie was at 48 fps to make it more realistic. I now doubt that you need to update more than 10fps. Which is a big jump from every frame. yeah //Offtopic: i ever asked me why seems 30 fps for the human eye laggy when it can only see up to 10-12 fps?.... Quote C++ :3 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.