max 65536 indices

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
sodandk
Competition winner
Posts: 340
Joined: Wed Aug 10, 2011 11:58 am

max 65536 indices

Post by sodandk »

core::array<u16> Indices;

is there a way to use a u32 for indices ?
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Re: max 65536 indices

Post by polylux »

Given you quite short question I can only guess that you talk about the indices of a MeshBuffer being limited to 16bit range.
If this is the case, have a look at IDynamicMeshBuffer's implementation (being CDynamicMeshBuffer.h).
Its constructor has the following signature:

Code: Select all

CDynamicMeshBuffer(video::E_VERTEX_TYPE vertexType, video::E_INDEX_TYPE indexType)
                {
                        (...)
                }
...allowing you to specify to use the 32bit index type.

Cheers,
p.
beer->setMotivationCallback(this);
sodandk
Competition winner
Posts: 340
Joined: Wed Aug 10, 2011 11:58 am

Re: max 65536 indices

Post by sodandk »

arh. Thanx!
Is there a limit on the hardware, to have max 65536 indices? So if I make an object with 200.000 indices, it will fail or be slower (ie. cant be cached on the graphics card) or other problems ?
I there a way to specify QUADs, without making my own node renderer? Are Quads supported on all platforms ?
thanx in advance for these newbee questions.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: max 65536 indices

Post by hendu »

Both AMD and Nvidia recommend to use less than 65536 indices. Whether more is only slower or entirely unsupported depends on the card. All current gens should support them though.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: max 65536 indices

Post by hybrid »

Quads are only supported for OpenGL driver.
dejai
Posts: 522
Joined: Sat Apr 21, 2007 9:00 am

Re: max 65536 indices

Post by dejai »

0 - 65535 is the range of a GL_UNSIGNED_SHORT which can be used to retain the indices of exactly 65536 vertices. So you have 2 bytes to work with which is plenty for a lot of things. It is totally valid to have more if you need them as hybrid mentioned.
Programming Blog: http://www.uberwolf.com
Mel
Competition winner
Posts: 2293
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: max 65536 indices

Post by Mel »

Don't concern with the 65536 vertices per meshbuffer limit too much. It is fairly hard to reach such amount of vertices in a single meshbuffer, and you can add another meshbuffer to a mesh to have more vertices, the only drawback is that it forces another drawcall.

Also, think that storing 16 bit indices uses less memory than storing the same indices but in 32 bit, it is better to have 16 bit indices, imo.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply