Optimisation Project

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Steel Style
Posts: 168
Joined: Sun Feb 04, 2007 3:30 pm
Location: France

Optimisation Project

Post by Steel Style »

Hi there I'm here to talk about a project about renders optimisations. I didn't find a proper scene like I asked to, but I think that I'll start small and get higher. Please link anything you know about optimisation and ask features, I'll try to find the best method this way.

I'll update soon with a todo list under.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I didn't get a word of what you intend to do, but it seems that this belongs to Open Discussion for now.
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

Essentially, I think he wants to work on optimizing Irrlicht. And it appears as though he didn't find any modeler to produce a scene that he could use to test certain optimizations (occlusion culling, etc.) Now he's looking to start small, and he wants people to suggest little things that he can start on.

That's what I gathered from his post.
TheQuestion = 2B || !2B
grumpymonkey
Posts: 222
Joined: Mon Jan 19, 2009 10:03 pm
Location: Miami, Florida
Contact:

Post by grumpymonkey »

Actually I think he was saying something different:
I didn't find a proper scene like I asked to, but I think that I'll start small and get higher.
He was high and tried to look for a scene but couldn't find it, so he decided to get higher.

The rest of the post proves he was high
Image
MasterM
Posts: 128
Joined: Sat Oct 20, 2007 2:38 am
Location: netherlands antilles, Curacao

Post by MasterM »

Ok, i want to ask which is the better way to load scenes into irrlicht...

Oh and which is the best optimized way to let a class share variable and pointers without using a singleton :)
Hope you can answer these questions, i have a whole book of optimized questions ready for you so ill just post them 2 by 2 :)
C++ is not the Magdalena...it takes patience...shes like the well aged prostitute, it takes years to learn her tricks! she is cruel...laughs at you when you are naked...
Life of a programmer == Const abuse
Steel Style
Posts: 168
Joined: Sun Feb 04, 2007 3:30 pm
Location: France

Post by Steel Style »

Sorry guys I was away but Halifax you are right.
grumpymonkey
Posts: 222
Joined: Mon Jan 19, 2009 10:03 pm
Location: Miami, Florida
Contact:

Post by grumpymonkey »

hows he going to optimize irrlicht if he cant even make a readable post? (no offence)
Image
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

grumpymonkey wrote:hows he going to optimize irrlicht if he cant even make a readable post? (no offence)
That's an exteremly ignorant question. Not everyone speaks english well, but that doesn't define their C++ engineering skills. For some people on this forum, English is their second language, not their first. C++ is a universal programming language, and programs using C++ generally don't make extensive use of English; furthermore, he clearly already has an intermediate grasp on English, which is all that is needed.

Secondly, have you every met Nadro? His English may be on the brink of incoherent, but he has certainly made a number of major contributions to Irrlicht.

Think a little bit before holding a person's mastery of the English language against them, when it comes to software engineering.
TheQuestion = 2B || !2B
koscianski
Posts: 5
Joined: Thu Aug 13, 2009 12:35 am
Location: Brazil
Contact:

Possible optimization?

Post by koscianski »

Er.. maybe I spot a point in

void CSceneManager::drawAll ()

Instead of:

Code: Select all

	if (!Driver)
		return;
        ...
	// reset all transforms
	video::IVideoDriver* driver = getVideoDriver();
	if ( driver )
	{
		driver->setTransform ( video::ETS_PROJECTION, core::IdentityMatrix );
		driver->setTransform ( video::ETS_VIEW, core::IdentityMatrix );
		driver->setTransform ( video::ETS_WORLD, core::IdentityMatrix );
		driver->setTransform ( video::ETS_TEXTURE_0, core::IdentityMatrix );
		driver->setTransform ( video::ETS_TEXTURE_1, core::IdentityMatrix );
		driver->setTransform ( video::ETS_TEXTURE_2, core::IdentityMatrix );
		driver->setTransform ( video::ETS_TEXTURE_3, core::IdentityMatrix );
	}
it would be better:

Code: Select all

	if (!Driver)
		return;
        ...
	// reset all transforms
	video::IVideoDriver* driver = getVideoDriver();  // necessary?

	driver->setAllTransformsToIdentity ();   // <- here is the trick
	}
(en passant: what's the difference between variables "Driver" and "driver"? Seems a bad choice for identificators.)

Anyway, by creating "setAllTransformsToIdentity", we can drop 6 parameterized function calls per frame.

Next, looking into COpenGLDriver, CD3D8Driver and CD3D9Driver, we perceive that all the switches and ifs can be thrown away in this possible "setAllTransformsToIdentity".
In the case of COpenGLDriver, ETS_VIEW and ETS_WORLD are the same, so another function call could be avoided. For ETS_PROJECTION, the calculations are not needed in this particular case, since we want a constant matrix.

Probably not a dramatic speed improvement, but certainly not a reason not to implement it.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Function calls are fast and this is only done once per frame. This isn't a good reason to add extra methods to the public API, which should be avoided where possible.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply