Mesh/surface limit (JFK, one 4 u i think)

Blitz3D Forums/Blitz3D Programming/Mesh/surface limit (JFK, one 4 u i think)

Ok, we established the safe tri limit for a surf was 33000 (does that mean 99000 verts unwelded????)

Whats the single mesh limit? i tried adding more than 2 surfaces with 20000 tris each and it renders blank after the third(the whole mesh that is!), but no mav.


Graphics3D 640,480,0,2


cam=CreateCamera ()
MoveEntity cam,5,0,-10

m=CreateMesh()

sn=10

SeedRnd MilliSecs ()
Dim surf(110)
For a=1 To 20
	surf(a)=CreateSurface (m)
	tris=0
	Repeat
	
	
		v1=AddVertex (surf(a),Rnd(1)*a,Rnd(1),0)
		v2=AddVertex (surf(a),Rnd(1)*a,Rnd(1),0)
	
		v3=AddVertex (surf(a),Rnd(1)*a,Rnd(1),0)
		tri=AddTriangle(surf(a),v1,v2,v3)
		
	
		tris=tris+1
	
		verts=verts+3
	Until tris>10000
	DebugLog CountVertices(surf(a))
 	RenderWorld
Next



	DebugLog (a-1)+"   "+verts
WaitKey


Basicly, the limit for vertices, as well as for triangles may be a 16 bit number. since some cards used signed 16 bit values, this was limited to -32767 to 32768 (or so). I don't know why your max is 33000, I wouldn't rely on it.
Even 32768 isn't save, I'd use something like 30000.

A fas as I know the number of surfaces on a mesh isn't limited in theory, but IRL it may use the same 16 bits, or even less. It should however be possible to use multiple surfaces with a lot of tris all in all.

Once I had exported meshes of a tool that used to ignore these numbers and exported unlimited polycounts. I wrote a surface splitter utility that was capable of reorganizeing the surfaces using a max of 30000 tris as well as vertices for each surface. It worked.

The 32k is the mesh limit, not the surface. There is no surface limit actually.

Correct, you can add as many surfaces it seems as you like.

so its the MESH limit not the surface limit(although in a way this amounts to my problem either way)

Righty Ho, ill create my 'overflow' meshes every 30K. At the moment i was using surfs :(

thanks

Dan

It's been a long time, but I thought it was vertices rather than triangles. However, since you're ( I guess? ) doing this with terrains the ratio between triangles and vertices should remain pretty consistent so it shouldn't cause you any unexpected problems. Just thought I'd mention it in case though.

Yeah right, I guess it was 64k Vertices and 32k Tris, tho, no guaranty given.

I suggest not to use the term "Mesh limit" vs "surface limit", because a surface is a sub-object of a mesh, and a triangle, as well as a vertex is s sub-object of a surface. So you may say a mesh may have as many surfaces as you want, but the polycount of each surface is limited.

Although, I wouldn't be surprised if some cards refuse to add more than a few thousand surfaces to one mesh.

its not for terrains, its for welding static scenery meshes from prefabs

did you check out the b3d cpp geometry code?
- its the stickiest code in the b3d forum.
maybee, you'll find a field with a definition of surfaces...