Vertex/triangle limit per surface?

Blitz3D Forums/Blitz3D Programming/Vertex/triangle limit per surface?

OrcSlayer(Posted 2007) [#1]
I noticed that when merging large levels made with the tileset system I use, eventually I get an error on levels with very high polycounts. This can be fixed of course by splitting the map into sections, but it would be very helpful if I knew the hard limit of what causes this error.

So, is there a limit of vertex/triangle count per surface, and what exactly is it? I'm pretty sure that's what's wrong...otherwise would appreciate it if someone could clue me in.


Naughty Alien(Posted 2007) [#2]
I'm not sure but its about 54K polys or like that...as for me, I'm always holding limit about 40K per loaded chunk max.


John J.(Posted 2007) [#3]
Most video cards can handle either 16 or 32 bit vertex indexes. If your vertex count exceeds the storage capacity of a 16 or 32 bit unsigned integer, then it won't be able to count how many vertices you have.

16 bits = 65535 size
32 bits = 4294967295 size

I'm pretty sure Blitz3D uses only 16-bit vertex indexes, so that means you can have up to 65 thousand vertices per mesh, as far as I know.


OrcSlayer(Posted 2007) [#4]
Ah, now I understand the problem. I"ll keep it at 40k just to be safe, like Naughty suggested. Thanks!


jfk EO-11110(Posted 2007) [#5]
As far as I know, the limit for the number of vertices and/ or triangles is at least on some cards a SIGNED 16 bit, that's a max of about 32000. But you can't use it all, the real max is somewhere around 31000. I'd suggest to use 30000. BTW You don't have to split the meshes, you can also split the surfaces instead.


(tu) sinu(Posted 2007) [#6]
Yep, stick to round 30 as the limit of 32k is somewhat hit and miss. I've hit errors near it and some times way below ie 500ish below.


DareDevil(Posted 2007) [#7]
the limits are 32k!! for surface


(tu) sinu(Posted 2007) [#8]
for vertices it is.


big10p(Posted 2007) [#9]
I've always taken 32k as the vertex/tri limit per surface.


OrcSlayer(Posted 2007) [#10]
Ok, 30k per surface it is! Should be simple enough, I'll just add a feature in my editor to show how many triangles per "group" so I don't go over it...


puki(Posted 2007) [#11]
My 8800 GTX seems to handle a cube of 64K meshes at the same time with no problems.

Plus, with that number of polys, the smoothness of the lighting is like "Britney Spears" smothered in peanut butter and slapped onto a large slice of toast.


John J.(Posted 2007) [#12]
My 8800 GTX seems to handle a cube of 64K meshes at the same time with no problems.

Assuming you mean "a cube of 64K vertices", and assuming this is being done with Blitz3D, then that must mean 64K is the limit after all.

Edit:

I just tested it, and 65535 vertices in Blitz3D runs fine, while 65536 does NOT. Like I said earlier, Blitz3D uses unsigned 16-bit vertex buffers.

The reason some of you are getting errors with lower counts is probably due to the index buffer, which also has limits I think.

I really don't know how Blitz3D works internally, so this is just all guessing really, but if Blitz3D uses 16-bit buffers, you should be able to use up to 21845 polygons.

21K polys max., and 64K vertices max.


puki(Posted 2007) [#13]
I'm pretty sure I can take it up to 128K though.


John J.(Posted 2007) [#14]
I'm pretty sure I can take it up to 128K though.

Sure, a 8800 (as well as many other cards) can handle that easily, but I doubt Blitz3D can. Though it can't hurt to try.


puki(Posted 2007) [#15]
We need a universal piece of stress-test code that everyone can run.

I delegate that to one of you to knock up.


puki(Posted 2007) [#16]
I can do 181K. However, when I jump to 182K Blitz3D freaks out - literally - it loses the ability to scale the meshes correctly and probably other weird side-effects too.


Tom(Posted 2007) [#17]
Natively, DX7 has a limit of $ffff (65535) vertices in arrays to be drawn. There are various draw methods, but each has a similar limit like so according to the SDK docs:

dwVertexCount
The number of vertices in the array. The maximum number of vertices allowed is D3DMAXNUMVERTICES (0xFFFF).


I assume anything bigger would be split up by Blitz3D.


_33(Posted 2007) [#18]
I've managed to build 100K models, but they had 6 surfaces. Still, it runs without a problem. Yet, you might have issues with things like Physics engines or stencil shadow engines...


John J.(Posted 2007) [#19]
Tom: Ok, thanks for clearing that up :)

I've managed to build 100K models, but they had 6 surfaces. Still, it runs without a problem. Yet, you might have issues with things like Physics engines or stencil shadow engines...

Well, you can have an unlimited amount of polygons per model, since you can have as many surfaces as you want. It's the amount of polygons in a surface that's limited.


big10p(Posted 2007) [#20]
Actually, we tried to nail down the tri/vert limit of B3D meshes some years ago, but gave up and settled on 32k as a safe limit, because we were getting some frankly bizarre results. I seem to remember having x number of tris/verts in a mesh which worked fine, but by simply changing the position of the verts borked it. :/