pipeline
pipeline
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.
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: pipeline
I'm sorry, but I have absolutely no idea what you're trying to ask.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.
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?
Re: pipeline
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()
in pseudocode:
for (i=0; i<255; i++)
node.mesh=load("model.obj");
Render loop()
Re: pipeline
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.
Re: pipeline
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.
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
-Dale Gribble
Re: pipeline
I think the vertices are sent on every frame. Otherwise you wouldn't be able to move them.
Re: pipeline
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: pipeline
Thanks for the answers, it helps.