Few thousand Tris in world gets slow.

Blitz3D Forums/Blitz3D Beginners Area/Few thousand Tris in world gets slow.

Pakz(Posted 2014) [#1]
I was trying to make a big map with 2 code archives function. I combined. Box making code and fps view code.

I get a really bad framerate if I add more then a few thousand tris. How would you be able to make bigger maps?




RemiD(Posted 2014) [#2]
You want to combine the different surfaces of different meshes which are static and near enough and use the same material into one mesh with one surface or a few surfaces, when possible.
One surface can contain up to around 32000 vertices and 32000 triangles without causing problems on old graphics cards or low end graphics cards.
See the code example here :
http://www.blitzbasic.com/Community/posts.php?topic=102895
to see how you can combine different surfaces of different meshes into one mesh with one surface or a few surfaces.


Pakz(Posted 2014) [#3]
So I should use addmesh to combine then into 1 mesh?

I tried that and it did not work.

B = createmesh()
A = makecube()
Addmesh a,b

I want to make a minecraft like level so I Need the Cuba appearance. I want to generate mountains and caves.

Edit..

I just saw the link. I am not behind my machine right now so I Will look at it later. I could not get the addmesh working just a time ago.


RemiD(Posted 2014) [#4]
See :
http://www.blitzbasic.com/Community/posts.php?topic=93982


Pakz(Posted 2014) [#5]
I tried the code in the first link but on my computer it can only handle 6000 triangles in around under 15 ms. The original value took more then a second to create. That 6000 is as much as I got fast with my original code.

I will see if I can copy and modify my code to use the code in the second post. Maybe it will be faster. But 6000 is what I got fast enough in my code:)

I thought games got so much more tris in the ten years since I last programmed 3d. I hate to have to create a big to small rectangle loop and check every tile position to see if I can create a surface with that. Whole lot more work :(


RemiD(Posted 2014) [#6]
The first code example was only to demonstrate how to merge different surfaces of different meshes into one surface of one mesh.

Except if some of your static meshes will often not be in the camera fov and will be hidden, i don't think that the render will be faster if you put only 6000tris per surface. 32000tris (or 32000vertices) per surface is ok with most graphics cards. (less than 32768)


Pakz(Posted 2014) [#7]
I now tried generating a random map with the build in cubes and now I can get a few hundred thousand tris. I still have a lot to learn.
I tried placing bigger cubes in the cube spaces where this is possible but this takes a long time to generate the map. I still Need to improve this further. Also creating a map with cave systems is probably difficult to but I Will spend Some time figuring out how to do that.