How to use SMesh to draw non-indexed primitives effectively

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
lab_zj
Posts: 26
Joined: Wed May 21, 2008 3:25 am

How to use SMesh to draw non-indexed primitives effectively

Post by lab_zj »

I have a big terrain that represented by a TIN (triangulate irregular network) and many contour lines. I currently using a SMesh to contain TIN as indexed triangles, and using another SMesh to contain contour lines as indexed line-strips. when rendering, the contour lines always shows above TIN surfaces.

In fact, all points in my contour lines has order, so not need index buffer,
but currently if I does not set index buffer, I will can't draw my contour lines.

So, I think, should have some flags inside SMesh that can tell driver what kind of primitives is it, or have another alternative method that can draw non-indexed primitives directly?

thanks.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

If you use VBOs (setHardwareMappingHint(EHM_STATIC)) there's merely no overhead when using an indexed mesh over a non-indexed. Moreover, once you're not having just one strip, but many crossing elements, you will gain much performance by using indexed objects. And finally, the gfx card just loves indexed elements, so it's always good to use it.
Post Reply