Jump to content

Fentinor build


VeTaL
 Share

Recommended Posts

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

Working on LeaFAQ :)

Link to comment
Share on other sites

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

Working on LeaFAQ :)

Link to comment
Share on other sites

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);

Working on LeaFAQ :)

Link to comment
Share on other sites

I'm writing a small and fast GUI right now for LEFlow. So far hovering and clicking of buttons work, also z-order of GUI elements, and it takes 0 FPS.

What GUI features do you need for your game?

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

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)

Working on LeaFAQ :)

Link to comment
Share on other sites

  • 2 weeks later...

Turn full statistics on in the editor and post screenshots.

 

I can't look at your models because they're all in a password-protected pak file.

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

Do you use LOD on your level ? perhaps it could save some frames also :(

And for lights, why not deactivating some non important/significant lights and their shadows when you are far away from them ?

If you disable all shadows , is the result better or not in terms of Fps caus it depends , but eat a lot also !

 

I'm interested in all optimisations you'll do it could serve me and perhaps others for our projects.

So don't hesitate to post you results and solutions :(

Stop toying and make games

Link to comment
Share on other sites

//Do you use LOD on your level ?

Of course

 

//And for lights, why not deactivating some non important/significant lights and their shadows when you are far away from them

the scene is too small for that, i think ;)

 

//So don't hesitate to post you results and solutions

Of course, thats why i ask for tutorials and solutions section here

 

What about current models, here they are: http://www.speedyshare.com/files/29762947/Fentinor.7z

password: nOde46repLY30zOA47yak!

 

Head of this topic is updated.

Working on LeaFAQ :)

Link to comment
Share on other sites

From what I see the thing that drops the fps the greatest is the flickering light script. If I replace those objects with just a simple pointlight, the fps is basically a flat 60 fps (vsynch on obviously) in a standalone lua script. With the flickering lights, the fps will drop down to 15 whenever those lights are viewed. You could try what Josh did in the firepit script and fake the range of the light by changing the color of the light instead of actually changing the light range every update.

 

btw, I love the artwork... fantastic stuff! reminds me of torchlight.

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

Okay, first of all the scene looks great. I love how you blended the cliffs with the terrain, and the coloring and use of coronas is great.

 

Your flickering light script was the main culprit. Replace the Update() function with this:

	function object:Draw()
	local r = self.random and self.random or 0
	--if math.random(1,1.5) == 1 then r = object.light:GetRange()-r else r = object.light:GetRange()+r end

	--object.light:SetColor(r)

	--if self.maxrange~=nil then
	--	if object.light:GetRange() > self.maxrange then object.light:SetRange(self.maxrange) end
	--end

	--if self.minrange~=nil then
	--	if object.light:GetRange() < self.minrange then object.light:SetRange(self.minrange) end
	--end
end

 

The second thing that jumps out at me is the high entity draw count. It's drawing almost 4000 entities each frame, which is more than our Zone stress test.

 

Some of your models have a lot of redundant surfaces. This model, for example, has six surfaces and it only needs one. That means if you would otherwise be drawing 200 instances for this object (just an arbitrary number) with the extra surfaces, you are now drawing 1200 instances, and six times as many reference surfaces! Fortunately, we have a little tool to make this easier, but be careful because this will collapse all models:

http://www.leadwerks.com/werkspace/files/file/140-gmf-processor

post-1-0-83146800-1315177678_thumb.jpg

 

Finally, building scenes out of lots of individual parts is less efficient than loading bigger chunks of scenery. I understand that it is easier to work with, and you might be able to get away with it if you collapse your models like in the previous point I made, but just keep in mind more entities overall = slower:

post-1-0-05538400-1315177908_thumb.jpg

 

BTW, that time of day script is looking fantastic. It's come a long ways since the videos I first saw.

  • Upvote 1

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

I just noticed you are using occlusion on a lot of objects. The occlusion test itself has a cost, so you only want to use it when the savings will be significant...by default, only animated meshes and lights use occlusion testing. You should disable this on little things like this, because each tested object requires a single-pass draw call.

 

post-1-0-89710000-1315179974_thumb.jpg

 

During development of the Zone scene, we already dealt with all the bottlenecks you are experiencing. If you follow my tips, you will be able to get optimum performance for this fantastic scene.

  • Upvote 1

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

Great tips !

I htink it's a general purpose that drawing lot of entities has a big cost instead of drawing "glued" entities or a lot as a single mesh.

For a level made in UT3, there was a trick for the stones on the floor :There was some 6*6 stones , and you thaught they weere individual entities, but it was one entitie only , yyou could rotate it 90° or 180° to creatre some variation. And the scene had some individual stones entities to bring bigger variations but theywas not a lot !

 

For occlusion, we can do a rectangle distance occlusion or LOD in some sort , it could be fast and work in lot of situations no ?

Stop toying and make games

Link to comment
Share on other sites

Wow, thats it

 

Thanks a lot, Josh. Of course, i'll try with your advices

 

//For occlusion, we can do a rectangle distance occlusion or LOD in some sort , it could be fast and work in lot of situations no ?

For now i'm paying with distance culling - the only culling thing avaivable :)

Working on LeaFAQ :)

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