Optimisation Project
-
- Posts: 168
- Joined: Sun Feb 04, 2007 3:30 pm
- Location: France
Optimisation Project
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.
I'll update soon with a todo list under.
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.
That's what I gathered from his post.
TheQuestion = 2B || !2B
-
- Posts: 222
- Joined: Mon Jan 19, 2009 10:03 pm
- Location: Miami, Florida
- Contact:
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
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
Life of a programmer == Const abuse
-
- Posts: 168
- Joined: Sun Feb 04, 2007 3:30 pm
- Location: France
-
- Posts: 222
- Joined: Mon Jan 19, 2009 10:03 pm
- Location: Miami, Florida
- Contact:
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.grumpymonkey wrote:hows he going to optimize irrlicht if he cant even make a readable post? (no offence)
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
-
- Posts: 5
- Joined: Thu Aug 13, 2009 12:35 am
- Location: Brazil
- Contact:
Possible optimization?
Er.. maybe I spot a point in
void CSceneManager::drawAll ()
Instead of:
it would be better:
(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.
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 );
}
Code: Select all
if (!Driver)
return;
...
// reset all transforms
video::IVideoDriver* driver = getVideoDriver(); // necessary?
driver->setAllTransformsToIdentity (); // <- here is the trick
}
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.