-
Posts
1,272 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by VeTaL
-
-
Imgui and wishes are sent to you
-
Hm... Yep, there are some guis, but i dont want to invent new own gui right now
Maybe, later i'll convert Imgui to pure OpenGl (instead of SDL, like now), but it is needed to make Layout Editor and so on... maybe later
But yes, Cegui eats too much (comparing with 0)
-
What also bothered me a LOT is that the lighting and shadows take a LOT of FPS.
This is trouble forme too.
Working on the same thing: trying to optimize level to make fps higher.
http://www.leadwerks.com/werkspace/topic/3728-fentinor-build/
It would be nice if Josh and other experienced guys would write a collection of tips for modelling, ligtning and leveldesign.
-
Made simple tests for Cegui. Hope, they would be usefull for someone.
1) New application, created with LEBuilder (rotating cube, C++): 280-282 FPS
TurnEntity( mesh, Vec3( AppSpeed()*0.5f ) ); UpdateFramework(); RenderFramework(); Flip( 0 );
2) Rotating cube + simple Cegui render (taken here): 262-265 FPS
TurnEntity( mesh, Vec3( AppSpeed()*0.5f ) ); UpdateFramework(); RenderFramework(); glPixelStoref(0x806E, 0); glPixelStoref(GL_PACK_ROW_LENGTH, 0); glPixelStoref(GL_UNPACK_ROW_LENGTH, 0); CEGUI::System::getSingleton().renderGUI(); Flip(0);
3) Rotating cube + simple Cegui render + cegui cursor: 265 FPS
if( xMouse != MouseX() || yMouse != MouseY() ){ CEGUI::System::getSingleton().injectMousePosition( (float)MouseX(), (float)MouseY() ); yMouse = MouseY(); xMouse = MouseX(); } TurnEntity( mesh, Vec3( AppSpeed()*0.5f ) ); UpdateFramework(); RenderFramework(); glPixelStoref(0x806E, 0); glPixelStoref(GL_PACK_ROW_LENGTH, 0); glPixelStoref(GL_UNPACK_ROW_LENGTH, 0); CEGUI::System::getSingleton().renderGUI(); Flip(0);
-
my code:
1) _stateReturns = _activeState->UpdateState(_deltaTime);
this is
int StateGame::UpdateState( float _deltaTime ) { SingletonOisManager.Update(); // ois input SingletonLevelManager.Update(_deltaTime); // this contains UpdateFramework();, now it is empty return GameState; }
2) __raise updateEvent->UpdateEvent( _deltaTime );
camera and player updates are subscribed there
3) _activeState->RenderState(_deltaTime);
is doing nothing. Previously, RenderFramework(); was there, but now its also empty
4) __raise renderEvent->RenderEvent( _deltaTime );
this called imgui debug panels (player and camera had their own debug panels), also disabled for now
Also, i'm planning to change "__raise" to http://www.codeproject.com/KB/cpp/FastDelegate.aspx
-
<> - Updating Framework: 6
UpdateFramework();
<> - Updating World: 0
_stateReturns = _activeState->UpdateState(_deltaTime);
__raise updateEvent->UpdateEvent( _deltaTime );
<> - Rendering Framework: 17
RenderFramework();
<> - Rendering World: 0
_activeState->RenderState(_deltaTime);
__raise renderEvent->RenderEvent( _deltaTime );
<> - Rendering Cegui: 4
_activeState->RenderGuiState(_deltaTime);
__raise guiRenderEvent->RenderGuiEvent( _deltaTime ); // cegui
Do Cegui render takes 0 in your test?
-
118951 [2408] INFO Main logger <> - UPS:16.949152
118954 [2408] INFO Main logger <> - FPS:17.000000
118957 [2408] INFO Main logger <> - Updating Framework: 8
118960 [2408] INFO Main logger <> - Updating World: 0
118963 [2408] INFO Main logger <> - Rendering Framework: 25
118967 [2408] INFO Main logger <> - Rendering World: 0
118970 [2408] INFO Main logger <> - Rendering Cegui: 4
119002 [2408] INFO Main logger <> - UPS:16.949152
119005 [2408] INFO Main logger <> - FPS:17.000000
119007 [2408] INFO Main logger <> - Updating Framework: 6
119011 [2408] INFO Main logger <> - Updating World: 0
119015 [2408] INFO Main logger <> - Rendering Framework: 17
119018 [2408] INFO Main logger <> - Rendering World: 0
119022 [2408] INFO Main logger <> - Rendering Cegui: 4
119059 [2408] INFO Main logger <> - UPS:16.949152
119062 [2408] INFO Main logger <> - FPS:17.000000
119064 [2408] INFO Main logger <> - Updating Framework: 6
119068 [2408] INFO Main logger <> - Updating World: 1
119071 [2408] INFO Main logger <> - Rendering Framework: 23
119075 [2408] INFO Main logger <> - Rendering World: 0
119077 [2408] INFO Main logger <> - Rendering Cegui: 3
119110 [2408] INFO Main logger <> - UPS:16.949152
119113 [2408] INFO Main logger <> - FPS:17.000000
119116 [2408] INFO Main logger <> - Updating Framework: 6
119120 [2408] INFO Main logger <> - Updating World: 0
119123 [2408] INFO Main logger <> - Rendering Framework: 20
119127 [2408] INFO Main logger <> - Rendering World: 0
119129 [2408] INFO Main logger <> - Rendering Cegui: 3
Looking like that code is almost not affecting fps. The mostly fps are eaten by UpdateFramework(); and RenderFramework();
Also, i found my mistake (if be honest till the end ), i rendered Cegui two times.. well, tha's fixed fast enough... and i'm thinking about another gui instead of Cegui.
Idk, how Metatron get so large difference in running with and without content.
Edit: just tested game without logger: got the same fps with and without Cegui: about 25-30
-
// Update framework SingletonProfilerManager.SetTime(timeGetTime()); UpdateFramework(); SingletonProfilerManager.PrintTime("Updating Framework", timeGetTime() ); // Update state SingletonProfilerManager.SetTime(timeGetTime()); _stateReturns = _activeState->UpdateState(_deltaTime); __raise updateEvent->UpdateEvent( _deltaTime ); SingletonProfilerManager.PrintTime("Updating World", timeGetTime() ); // Render framework SingletonProfilerManager.SetTime(timeGetTime()); RenderFramework(); SingletonProfilerManager.PrintTime("Render Framework", timeGetTime() ); // Render state SingletonProfilerManager.SetTime(timeGetTime()); _activeState->RenderState(_deltaTime); __raise renderEvent->RenderEvent( _deltaTime ); SingletonProfilerManager.PrintTime("Rendering World", timeGetTime() ); // Render GUI state SingletonProfilerManager.SetTime(timeGetTime()); _activeState->RenderGuiState(_deltaTime); __raise guiRenderEvent->RenderGuiEvent( _deltaTime ); // _activeState->RenderGuiPostState(_deltaTime); SingletonProfilerManager.PrintTime("Rendering Gui States", timeGetTime() ); // Render cegui SingletonProfilerManager.SetTime(timeGetTime()); SingletonCeGuiManager.RenderWithImgui(_deltaTime); SingletonProfilerManager.PrintTime("Rendering Cegui", timeGetTime() ); SingletonProfilerManager.Submit();
*VeTaL is ready for searching bottlenecks*
Something like this
-
You're right, Pixel: i just forgot about Tools folder with openal installer and redistr 2010.
-
Now i have 35-40 fps in Editor (all included), 35-40 fps in client (without shadows), 25-30 fps in client (all included).
Thanks a lot, Loom.
Next step is profiler and code optimization
-
Lights, that are in the second floor of tavern are dynamic+static, as static only doesnt cast a shadow
Lights, that are near player, are dynamic+static+buffered
Also, minimal resolution is 256, so i left it.
Got some additional fps, trying to remove torches
looking like i really need to decrease light radius there: as differed shading is used, 16 additional small lights cant drop fps from 25 to 15, i think
-
Make sure the light ranges are very low, because higher range eats a lot of FPS. You can have over 300 point lights with only few FPS cost, if you keep the ranges low (like range=5 or so).
You was right:
I changed it to
and have some fps boost
Now level is looking like this, is that ok, or i should decrease torches light radius?
-
0_0
Quite strange: i loaded level with this template code (get 6 fps)
// ==================================================================== // This file was generated by LEBuilder // http://leadwerks.com/werkspace // ==================================================================== #include "engine.h" #include <iostream> #include <string> const int ScreenWidth = 1024; const int ScreenHeight = 768; const char* MediaDir = "Z:/Leadwerks Engine SDK"; const char* AppTitle = "Test"; void ErrOut( const std::string& message ) { std::cerr << message << std::endl; } // ------------------------------- int main( int argn, char* argv[] ) { // Initialize if( !Initialize() ) return 1; SetAppTitle( AppTitle ) ; RegisterAbstractPath( MediaDir ); // Set graphics mode if( !Graphics(ScreenWidth,ScreenHeight) ) { ErrOut( "Failed to set graphics mode." ); return 1; } // Create framework object and set it to a global object so other scripts can access it TFramework fw = CreateFramework(); if( fw == NULL ) { ErrOut( "Failed to initialize engine." ); return 1; } // Set Lua framework object SetGlobalObject( "fw", fw ); // Set Lua framework variable BP lua = GetLuaState(); lua_pushobject( lua, fw ); lua_setglobal( lua, "fw" ); lua_pop( lua, 1 ); // Get framework main camera TCamera camera = GetLayerCamera( GetFrameworkLayer(0) ); PositionEntity( camera, Vec3(0,0,-2) ); // Create cube TMaterial material = LoadMaterial( "abstract::cobblestones.mat" ); // TMesh mesh = CreateCube(); // PaintEntity( mesh, material ); LoadScene("abstract::SoulHill.sbx"); TEntity cam=CreateCamera(); PositionEntity(cam,Vec3(0,2,-10)); // Create ground TMesh ground = CreateCube(); ScaleEntity( ground, Vec3(10,1,10) ); PositionEntity( ground, Vec3(0,-2,0) ); PaintEntity( ground, material ); // Add some light TLight light = CreateDirectionalLight(); RotateEntity( light, Vec3(45,45,45) ); TVec3 camrotation=Vec3(0); float mx=0; float my=0; float move=0; float strafe=0; // Spin cube until user hits Escape while( !KeyHit() && !AppTerminate() ) { if( !AppSuspended() ) { //Camera look mx=Curve(MouseX()-GraphicsWidth()/2,mx,6); my=Curve(MouseY()-GraphicsHeight()/2,my,6); MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2); camrotation.X=camrotation.X+my/10.0; camrotation.Y=camrotation.Y-mx/10.0; RotateEntity(cam,camrotation); //Camera movement move=Curve(KeyDown(KEY_W)-KeyDown(KEY_S),move,20); strafe=Curve(KeyDown(KEY_D)-KeyDown(KEY_A),strafe,20); MoveEntity(cam,Vec3(strafe/10.0 *(1 + 20*KeyDown(KEY_LSHIFT)),0,move/10.0 * (1 + 20*KeyDown(KEY_LSHIFT)))); // TurnEntity( mesh, Vec3( AppSpeed()*0.5f ) ); UpdateFramework(); RenderFramework(); Flip( 0 ); } } return Terminate(); }
-
Here they are
Maybe they are a little mess ) Its my "Templates" folder
Just dreamed to have that templates in LEBuilder and make them in one click
-
No, i mean some gameplay examples.
- Viewer (just camera control around mesh, so user can load and see any model)
- Spectator (camera, that fly free through the level... like a Viewer, idk id they are needed to be separated)
- FPS (physic player + camera control)
- SkyCube
- ***
maybe some framework/pure templates
-
It would be nice to have pack of templates for updater
-
-
I also think so: taking into account that the only gui is in the red rectangle... anyway, its not a problem to turn it off
Moreover, fps are nice if player is standing nearg green zone on the picture
So, i think that its because of models.. or lights
-
This is without LoadScene
// Update state SingletonProfilerManager.SetTime(timeGetTime()); _stateReturns = _activeState->UpdateState(_deltaTime); __raise updateEvent->UpdateEvent( _deltaTime ); SingletonProfilerManager.PrintTime("Updating World", timeGetTime() ); // Render state SingletonProfilerManager.SetTime(timeGetTime()); _activeState->RenderState(_deltaTime); __raise renderEvent->RenderEvent( _deltaTime ); SingletonProfilerManager.PrintTime("Rendering World", timeGetTime() ); // Render GUI state SingletonProfilerManager.SetTime(timeGetTime()); _activeState->RenderGuiState(_deltaTime); __raise guiRenderEvent->RenderGuiEvent( _deltaTime ); // _activeState->RenderGuiPostState(_deltaTime); SingletonCeGuiManager.Render(_deltaTime); SingletonProfilerManager.PrintTime("Rendering Gui", timeGetTime() ); SingletonProfilerManager.Submit();
Here is my main loop. the results are next:
137581 [2980] INFO Main logger <> - Updating World: 7
137589 [2980] INFO Main logger <> - Rendering World: 20
137600 [2980] INFO Main logger <> - Rendering Gui: 7
137648 [2980] INFO Main logger <> - UPS:7.611798
137656 [2980] INFO Main logger <> - FPS:9.000000
137666 [2980] INFO Main logger <> - Updating World: 7
137673 [2980] INFO Main logger <> - Rendering World: 20
137784 [2980] INFO Main logger <> - Rendering Gui: 5
137822 [2980] INFO Main logger <> - UPS:7.611798
137831 [2980] INFO Main logger <> - FPS:9.000000
137837 [2980] INFO Main logger <> - Updating World: 7
137851 [2980] INFO Main logger <> - Rendering World: 18
137865 [2980] INFO Main logger <> - Rendering Gui: 5
137948 [2980] INFO Main logger <> - UPS:7.611798
137961 [2980] INFO Main logger <> - FPS:9.000000
137971 [2980] INFO Main logger <> - Updating World: 9
137996 [2980] INFO Main logger <> - Rendering World: 40
138003 [2980] INFO Main logger <> - Rendering Gui: 5
138065 [2980] INFO Main logger <> - UPS:7.611798
138082 [2980] INFO Main logger <> - FPS:9.000000
138095 [2980] INFO Main logger <> - Updating World: 15
138110 [2980] INFO Main logger <> - Rendering World: 25
138166 [2980] INFO Main logger <> - Rendering Gui: 6
138223 [2980] INFO Main logger <> - UPS:7.568590
138230 [2980] INFO Main logger <> - FPS:9.000000
138236 [2980] INFO Main logger <> - Updating World: 11
138246 [2980] INFO Main logger <> - Rendering World: 21
138256 [2980] INFO Main logger <> - Rendering Gui: 9
138301 [2980] INFO Main logger <> - UPS:7.568590
138311 [2980] INFO Main logger <> - FPS:9.000000
138318 [2980] INFO Main logger <> - Updating World: 8
138324 [2980] INFO Main logger <> - Rendering World: 24
138337 [2980] INFO Main logger <> - Rendering Gui: 4
138391 [2980] INFO Main logger <> - UPS:7.568590
138535 [2980] INFO Main logger <> - FPS:9.000000
138544 [2980] INFO Main logger <> - Updating World: 9
138551 [2980] INFO Main logger <> - Rendering World: 21
138558 [2980] INFO Main logger <> - Rendering Gui: 10
138600 [2980] INFO Main logger <> - UPS:7.568590
138609 [2980] INFO Main logger <> - FPS:9.000000
138619 [2980] INFO Main logger <> - Updating World: 6
138625 [2980] INFO Main logger <> - Rendering World: 21
138632 [2980] INFO Main logger <> - Rendering Gui: 7
138673 [2980] INFO Main logger <> - UPS:7.568590
138681 [2980] INFO Main logger <> - FPS:9.000000
138687 [2980] INFO Main logger <> - Updating World: 10
138695 [2980] INFO Main logger <> - Rendering World: 17
138702 [2980] INFO Main logger <> - Rendering Gui: 6
138747 [2980] INFO Main logger <> - UPS:7.568590
138753 [2980] INFO Main logger <> - FPS:9.000000
138780 [2980] INFO Main logger <> - Updating World: 8
138790 [2980] INFO Main logger <> - Rendering World: 23
138933 [2980] INFO Main logger <> - Rendering Gui: 4
138994 [2980] INFO Main logger <> - UPS:7.568590
139001 [2980] INFO Main logger <> - FPS:9.000000
139010 [2980] INFO Main logger <> - Updating World: 11
139021 [2980] INFO Main logger <> - Rendering World: 32
139032 [2980] INFO Main logger <> - Rendering Gui: 6
139080 [2980] INFO Main logger <> - UPS:7.568590
139086 [2980] INFO Main logger <> - FPS:9.000000
139095 [2980] INFO Main logger <> - Updating World: 12
139102 [2980] INFO Main logger <> - Rendering World: 19
139115 [2980] INFO Main logger <> - Rendering Gui: 10
139170 [2980] INFO Main logger <> - UPS:7.568590
139180 [2980] INFO Main logger <> - FPS:9.000000
139186 [2980] INFO Main logger <> - Updating World: 8
139283 [2980] INFO Main logger <> - Rendering World: 23
139289 [2980] INFO Main logger <> - Rendering Gui: 17
139333 [2980] INFO Main logger <> - UPS:8.042895
139350 [2980] INFO Main logger <> - FPS:9.000000
139361 [2980] INFO Main logger <> - Updating World: 6
139368 [2980] INFO Main logger <> - Rendering World: 20
139382 [2980] INFO Main logger <> - Rendering Gui: 6
Next step is to separate GameLogic from UpdateWorld
-
Yep, now i'm making second try without LoadScene
Also, i had imgui profiler, but now i'm outputting results to the file.
-
-
*get ready to defend the Earth agains the army of marching robots* xD
-
It looks mostly like bad code. When I delete models.pak and materials.pak, the game runs with 150 FPS, but with 500 FPS in Editor. So the game code is eating 350 FPS.
Hm, i'll check that once more time. But on my home PC ( GeForce 9600 ), i have: about 30 in editor and about 20 in the game
Measure the whole main loop time, and the UpdateFramework time, and the RenderFramework time, and the rest of code time in the main loop.Previous buid used SDL+imgui for debug purposes, i thought if i'd drop down SDL, i'll have a little perfomance boost.
I'll post here profiler's results
i do not know what are you doing to get such low FPS on such machinesThat's what i'm interested in too. I hope, there is a trouble with models, or, at least, in code.
If i can cut down code and check its perfomance, i can do nothing with models- thats why i posted this post here: maybe someone have some recommendations about that.
The solution of "The program cannot start because MSVCP100.DLL is missing" is to install Microsoft Visual C++ 2010 Redistributable Package
I think Vetal meant for you to see those and add them yourself since he was having issues with the upload feature.yep
Added this to web-silte report
-
About a week ago we (me, leveldesigner, who is working on one PC with me, and some modellers) had finished first build of the level.
Then i showed build to a number of people and was really shocked by extremely low fps.
Modern AAA games uses textures 1024*1024 and 2048*2048, and this demo used only 512*512
FPS:
GeForce 8600M gives 6 FPS, which is epic fail, i think: that laprop runs more complete levels using other engines
GeForce 9600 gives 20-30 FPS without shadows and 7-8 FPS with shadows (<ShadowQuality>0</ShadowQuality> in Configuration.xml)
ATI Radeon M 56xx 1Gb, IntelCore i7 1.6GHz (boost up to 2,5+), gives 23-26 fps, while Crysis 2 gives 20 fps on maximum settings
Top-quality PC: i5 760 2.80, GeForce GTX 460 SE, 4 Gb shows only 45-50 fps, while Crysis 2 gives 70 fps on maximum settings
ati mobility radeon hd 5700 - 10 fps
gtx 560 ti - about 100 fps
The most fail is trying to run build on my laptop: i5 480M 2.66, GeForce GT540M 1 Gb, 4 Gb - that gives me 30 fps without shadows and about 10 FPS with shadows (like on my PC, 9600)
Can you look at the models and give us some advices?
I believe that modellers made their models in not-optimized-for-this-engine way.
Maybe they used too much materials or something like that.
Demo is here: http://www.speedyshare.com/files/29762947/Fentinor.7z
Also take a look into Configuration.xml
Updated:
What about current models, here they are: http://www.speedyshare.com/files/29762947/Fentinor.7z
password: nOde46repLY30zOA47yak!
PS: got some errors with banner uploading in Chrome, so i had attched them here
Breve: a 3d Simulation Environment for Multi-Agent Simulations and Artificial Life
in Tech Talk
Posted
http://www.spiderland.org/
Wanted to try it as a simple AI behaviour: grass is spawning on the land, animals are looking for grass, hunters are looking for animals