I export geometry data from a CAD application, and convert complex polygons to indexed triangles (or indexed fans, strips) with GeometryInfo from the Java 3D project. This gives me four arrays, two of which contains the verticies and normals, and the other two contains the indices for normals and the vertices.
Currently I try to use jME for the visualization of this data. (After OGRE, and J3D). JOGL worked fine, but after a few months I realized that if I implement every feature I need I'll eventually end up writing something like jME, so I decided to give it a try instead of trying to reinvent the wheel
Now I don't seem to find anything in jME that handles different index buffers for vertices and normals. I tried TriMesh, but for a big polygon with only one normal I have to copy the same normal for every vertex in the buffer, instead of indexing the same one.
So is there a way to make a geometry object without copying redundant information for normals (using indexed vertices and normals with different index buffers?
My model is increadibly big and every few bytes saved on normals per polygon worth a try
The geometry class in jME doesn't provide for indexing like that. You could change your local copy to allow it though.
AFAIK OpenGL/Hardware doesn't support it so the problem is not in jME.
Based on your application:
for a big polygon with only one normal I have to copy the same normal for every vertex in the buffer, instead of indexing the same one.
Is this polygon a grid? Or you using some form of lighting? If you're not using lighting you don't need normals.
Please provide more details about your meshes and how you are going to use them so that we can help you better :)
I use lighting, so I have to use normals.
After browsing through the code and also the opengl docs, I realized that it can not be done, because there is only one index buffer in opengl for every list (normals, texturecoords, etc…), so my question was dumb (or uninformed ;))
So I could save data by creating the arrays on the fly with redundant normal data, but in memory it will still be the same amount, and would mean additional CPU overhead.
Now I have a more general question.
I have a really big amount of data from an architectural CAD software (the raw data in indexed triangles in float-s and normals is somewhere between 500M and 1G). Currently I use big arrays for meshes with the same texture data to keep object creation at the minimum. However indexed triangles are not the most efficient form, triangle strips would be more space efficient, but there would be more of them per mesh, which in turn means more objects.
So does anyone has hands on experience with displaying big amount of data at once with jME ? Or any suggestion on how to keep the balance between main memory usage and video performance ?