Loading Mesh Advice

Blitz3D Forums/Blitz3D Programming/Loading Mesh Advice

-Rick-(Posted 2004) [#1]
I've managed to get my hands on some nice meshes for my Solar System Model program. These are models of some of the smaller non round moons. Thier counts are ungodly high (26,000 surfaces / 13,000 vertices PER moon) but I've managed to shrink them down to what I thought was a more manageable size (948 surfaces / 476 vertices) and still maintain their distinctive shapes.

The size of the mesh files are between 20 and 30k in size. The jpg's I'm using to texture them are on the large size and I plan on trimming those up later, but for now are around 100k to 300k on the average (there are some below 100 and 1 or 2 above 500k).

Milkshape wouldnt even handle the original file sizes so I used another program (AC3D) to decrease the triangle counts and saved them as .3ds files. Then I used Milkshape to "weld Vertices" (which smoothed the model very nicely) and add its texture to and save as a .b3d file.

Now once in my Model program I only load the mesh, I dont load the texture since it was already set in Milkshape. The moons look great. The problem I'm having is the time to load.

If I do a full load of all 60 meshes at the beginning then it takes about 2-3 minutes on my 2.66 ghz system to simply do that. Way to long to sit thru. I decided to load the meshes on the fly whenever the camera gets a set distance from them. The problem here is I'm getting about a 2-3 second delay - horrible while in the middle of a flight sequence.

I'm unsure where I need to trim. I really cant cut much more vertices out of the meshes or the overall shape is lost. It would make having them meshes pointless and I'd be better off just going with resized spheres.

Is there a faster way to load meshes? Is there a better file type I should use rather than b3d or jpg's? I just wish I could hide that load delay better. Any suggestions would be appreciated.


-Rick-(Posted 2004) [#2]
Think I may have solved this - seems to be my texture sizes? I went in and removed the material settings for each moon (what a pain) and found that the meshes now load instantly. Even when entering an area like Jupiter where there are some 28 moons I dont see any noticeable loss of time when they come in range. Now I'll have to code in the texture part and see if .b3d format just sucks at loading textures or of the files themselves are just way too large.


-Rick-(Posted 2004) [#3]
Once again I was a tad quick to post. The sollution the to problem was indeed the texture sizes. Most were in the range of 2048x1024. I decreased them down to 512x256 and nearlyl all the files are under 30k now. When alot load at once there is a slight hitch, but I can fix that by tightening my distance check. I wanted a full moonlette system load for testing purposes.

I'm going with jpg's ... if anyone thinks I'd be better off in another format please holler.


Sweenie(Posted 2004) [#4]
When I was fiddling with streamed meshloading, I rearranged the vertices, indices and uvs from a mesh and saved them in a new "Raw-file" in this way...

1.Total number of surfaces
2.Texturename for first surface(if used)
3.Number of vertices in first surface
4.VertexList of first surface(pos, uv's, normals & colors)
5.Number of triangles in first surface
6.TriangleList of first surface
... and repeat from step 2 for the rest of the surfaces.

Then I wrote a loaderfunction that simply reads the file and creates the mesh.

In some cases I actually improved the loadtime with 400%.


EvilMeowChi(Posted 2004) [#5]
you really just need to reduce the poly count and texture resolution. If you want i can do it for you, just email the models and textures to me.


-Rick-(Posted 2004) [#6]
I've gone thru and reduced both my meshes and my textures. After noticing the load time all but vanished when I took the texture settings out of b3d I figured out it was mostly my texture sizes being too big.

Thanks for the offer to reduce for me tho, that was very generous.