[solved]How to create a mesh with more than 65536 vertices

Problems building or running the engine, queries about how to use features etc.
Rockeye
Gnoblar
Posts: 22
Joined: Thu Feb 01, 2007 5:04 pm
Location: Grenoble, France

[solved]How to create a mesh with more than 65536 vertices

Post by Rockeye »

I think the question is clear :

I would like to build a mesh during runtime, with more than 2^16 vertices using ManualObject.
Unfortunatelly, vertices index is limited to 16bits...

Is there an other way for doing that ?
Last edited by Rockeye on Thu Jul 12, 2007 8:03 pm, edited 1 time in total.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67

Post by sinbad »

Indexes can be 32-bit too, see the HardwareIndexBuffer API reference.
Rockeye
Gnoblar
Posts: 22
Joined: Thu Feb 01, 2007 5:04 pm
Location: Grenoble, France

Post by Rockeye »

thanks !

but I am not sure how to specify to a manualObject a HardwarePixelBuffer...

can I just call "estimateVertexCount()" or "resizeTempVertexBufferIfNeeded" and Ogre adapts itself to use a 32bit index ?
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67

Post by sinbad »

ManualObject only supports 16-bit indexes for now, true - it could be extended to support 32-bit fairly easily but if you're dealing with objects this size it would pay you to go directly to Mesh and avoid the overhead ManualObject incurs from being 'friendlier'. And remember, it may be more efficient to use multiple 16-bit sections (of a ManulObject or SubMesh in a Mesh) since 32-bit indexes use 2x the bandwidth and some older cards hate them.
Rockeye
Gnoblar
Posts: 22
Joined: Thu Feb 01, 2007 5:04 pm
Location: Grenoble, France

Post by Rockeye »

thank you for this complete answer !