pipeline

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
drarem
Posts: 81
Joined: Mon Mar 06, 2006 4:40 am
Contact:

pipeline

Post by drarem »

if I create a bunch of nodes, does it automatically use vertex buffers and whatever optimization is possible like the pipeline I hear so much about? I'm developing on a machine with opengl 2.1.
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Re: pipeline

Post by Radikalizm »

drarem wrote:if I create a bunch of nodes, does it automatically use vertex buffers and whatever optimization is possible like the pipeline I hear so much about? I'm developing on a machine with opengl 2.1.
I'm sorry, but I have absolutely no idea what you're trying to ask.
A 'pipeline' could be any kind of pipeline, a rendering system has a rendering pipeline, you have content creation pipelines, etc. but I can't place it in any kind of optimization context

And with vertex buffers, are you talking about VBO's?
drarem
Posts: 81
Joined: Mon Mar 06, 2006 4:40 am
Contact:

Re: pipeline

Post by drarem »

I thought my question was phrased in english. Will this be in immediate mode by default, or optimized using yes VBO's or other.

in pseudocode:

for (i=0; i<255; i++)
node.mesh=load("model.obj");

Render loop()
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: pipeline

Post by hendu »

IIRC irrlicht uses vertex arrays, which are nearly as good as VBOs. But it's been a while, I'd appreciate someone to fill in the details.
blAaarg
Posts: 94
Joined: Tue Mar 02, 2010 9:11 pm
Location: SoCal

Re: pipeline

Post by blAaarg »

IIRC, drawMeshBuffer()--or anything that uses it--will (re)use index and vertex arrays that are loaded onto the video card unless they haven't been loaded yet, in which case, it will load them the first time you call that function and re-use them thereafter. Anything that's loaded to the scene manager with addMeshSceneNode()--directly or indirectly-- should be pre-loading the mesh in such a way and then calling drawMeshBuffer() at render time so those should be optimized for you, too. Also, the various scene manager methods add[some-kind-of-mesh-node]() should, in turn, be calling addMeshSceneNode(), so those should also be optimized for you by default. And, sceneManager->drawAll() will also eventually call drawMeshBuffer() for nodes that are loaded/added to the scene manager in the standard way. Customized mesh scene nodes won't necessarily be optimized. It depends on how their render() calls are implemented. That should be the defaulf behavior, I believe.

However, calling drawVertexPrimitiveList() or most of the other draw3D[whatever]() methods reloads the mesh to the video card each call (frame), so that's much less efficient, though that is typically only used by custom scene nodes or when you call it explicitly.

I don't recall about draw2D*() methods. Probably some of them are optimized for you too, but I guess that's not what you're asking about.

Hopefully, that's helpful and accurate. :)
"Computers don't make mistakes! What they do they do on purpose!!"

-Dale Gribble
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: pipeline

Post by mongoose7 »

I think the vertices are sent on every frame. Otherwise you wouldn't be able to move them.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: pipeline

Post by CuteAlien »

Depends ... by default meshes are transmitted every frame. But if you know you have a static mesh - meaning vertices/indices do not change for example by an animation - then you can use setHardwareMappingHint to ensure a mesh is only send once by setting it to static.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
drarem
Posts: 81
Joined: Mon Mar 06, 2006 4:40 am
Contact:

Re: pipeline

Post by drarem »

Thanks for the answers, it helps.
Post Reply