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.
How to use SMesh to draw non-indexed primitives effectively
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
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.