Maximum vertecies

Blitz3D Forums/Blitz3D Programming/Maximum vertecies

AbbaRue(Posted 2004) [#1]
I have discovered that the maximum number of verteces Blitz3D allows us to MAKE is 32,768.
Is there any way around that limit.
I tried making a mesh 188x188 which=35344 verteces in size and it gets chopped off.
A mesh with 180x180 which=32400 verteces works fine.


napole0n(Posted 2004) [#2]
Can't you split it up in two objects and realign them in Blitz? Or is it a limit for the whole world/scene you're trying to render?


Mustang(Posted 2004) [#3]
Blitz does not have such limit... .3DS and other crappy fileformat have, but you should use .B3D. And you can always make the models from smaller bits.


AbbaRue(Posted 2004) [#4]
Here is the function I wrote:

Global sz#=180 ;size of tiled
Global nodes#=800

Dim T(nodes*nodes)
Dim V(nodes,nodes); set up array to store vertices


Tiled=CreateTile3()

Function CreateTile3() ;Create one tile

Local m=CreateMesh() ;temp mesh
Local ss=CreateSurface(m) ;,b ) ;temp surface
For nx=0 To sz
For nz=0 To sz
V#(nx,nz)=AddVertex(ss,nx,0,nz,(nx*0.004),(nz*0.004),0 );create all vertices
Next
Next

tt#=0
For x=0 To sz-1 Step 2 ;
For z=0 To sz-1 Step 2 ;

t(tt)=AddTriangle( ss,V(x,z),V(x,z+1),V(x+1,z) ) ;
tt=tt+1
t(tt)=AddTriangle( ss,V(x+1,z),V(x,z+1),V(x+1,z+1) )
tt=tt+1
t(tt)=AddTriangle( ss,V(x,z+1),V(x,z+2),V(x+1,z+2) )
tt=tt+1
t(tt)=AddTriangle( ss,V(x+1,z+2),V(x+1,z+1),V(x,z+1) )
tt=tt+1
t(tt)=AddTriangle( ss,V(x+1,z),V(x+1,z+1),V(x+2,z+1) )
tt=tt+1
t(tt)=AddTriangle( ss,V(x+2,z+1),V(x+2,z),V(x+1,z) )
tt=tt+1
t(tt)=AddTriangle( ss,V(x+1,z+1),V(x+1,z+2),V(x+2,z+1) )
tt=tt+1
t(tt)=AddTriangle( ss,V(x+2,z+1),V(x+1,z+2),V(x+2,z+2) )
tt=tt+1

Next
Next

Return m

End Function

If I set sz to anything higher then 180 the mesh gets cut off, along one of it's axes.
The cut off value always leaves just enough so the mesh uses less then 32,768 verteces.
Test it for yourself.

@ Mustang: As you can see I am creating a mesh, not loading one.

@ napole0n : There are other ways of doing things, I just didn't know that Blitz3D had this limitation.

I was just checking if someone knew something I did wrong here.


Shambler(Posted 2004) [#5]
The surface limit is 65535 verts.

What is V# ? this array will be the problem, where are you dimensioning it?


jhocking(Posted 2004) [#6]
I think DirectX has a maximum vertex limit. As I recall this is per mesh, and the entire scene is limitless (well, assuming you have enough memory of course.)


AbbaRue(Posted 2004) [#7]
I added the # symble to everything to see if it made a difference, originally I just used V(nx,nz).
And sz instead of sz#.
And as you can see by the line at the bottom of this post I am using a Radeon 9800 with 128 megs of video memory.
So video memory is the least of my problems.
Also 188x188=35344, Which is much less then 65536.
It could be DirectX is to blame. But then how do you load meshes with more verteces.


jhocking(Posted 2004) [#8]
I can't test this right now but I had a thought. I apologize if this is too obvious but, well, the obvious stuff often never occurs to people. After creating the mesh, are you counting the number of vertices to make sure? Because if not, maybe the cutoff isn't a cap on the vertices but simply the mesh extending beyond the camera range.


AbbaRue(Posted 2004) [#9]
I was using 65 mesh tiles placed in rings around a centre point. So I have a viewing distance of 135,000 in each direction.
But I had problems with gaps between the mesh tiles.
So I tried using one large mesh instead and That's when I discovered the limitation.
So camera range is definitly not a matter here.
I have camera range set at 65,800.
I experamented with different values for sz and the mesh always gets cut off at a point so that there are never more then 32,768 verteces.
And the cutoff is always along one axes so I get a rectangle instead of a square.
sz=180 works perfectly, with nice square mesh.
but as soon as I use sz=182 the mesh becomes a long skinny rectange.
sz=254 gets a real bizare effect. And anything above 254 and I get memory access violation error.

The reason for the function is so the triangles don't all face the same way.


Floyd(Posted 2004) [#10]
There is also a 64K limit on triangles in a surface.

This is why the example is failing. With sz=180 it creates 90*90*8 triangles.
When sz is any larger this exceeds 64K.