- adds 'view normals' and 'flip faces' function.
What kind of features did you have in mind for the optimisation?
Whatever's there now
With anything else that needs fixing that might come to light. Mostly the redundant animation frames you first brought to our attention, duplicate vertices which seem rather common, and the ability to turn off the two-sided flag.
The last one is fairly big, because it effects every blender exported model. It doubles the number of triangles send down the pipe, in a best case scenario the front faces will have been rendered first and the fragment processing for the back faces on the other side of the model will be averted by a depth test failure, in the worst case all the back facing ones come first and the fragments are all processed, only to be overwritten when the front faces are rendered.
On average, for a(n opaque) blender exported model, there is 50% more fragment processing than is needed.
Does merging near vertices cope with the impact on normals that might result?
An auto-normal tool would be most useful if incorporated.
If you use a non-zero tolerance for normals when welding, the 'merged' normal will be the average of the unique
normals merged. I went with this policy because if you are using non-zero tolerances it is because you were sloppy with your modelling, and this seemed the most sensible (ie, if 4 vertices were merged but two were really just the same vertex, then the normal wouldn't be skewed because of the double).
Also, by using colour picking and a lot of rendering and picking passes, you could perhaps determine which faces are never visible (as models are never drawn from the bottom) and that would prehaps remove the most faces from a mesh.
Interesting idea, I would hope the artist removes such faces in the first place though, while the brute force solution you propose would work nicely, it would take some work to get running.
Just checking the face normal could eliminate blatantly downward facing ones, but your idea would get any hidden geometry too...
Also a very minor bug: the animation menu does not work, though the stop and play buttons in the main window do.
Also, if you set a specific mesh to look like something else, eg: wireframe, they aren't rendered until you move the model.
The animation menu was actually a relic, from before when the Animation control in the main window was built. Removed it.
The refresh bug should be fixed now.
An option to flip the normals on a mesh would be useful. There are a few in Woodsmen that have to be double-sided because otherwise they'd be inside-out.
Done, you can't actually see any effect from normals atm though
No lights yet. Front facing Vs Back facing is determined by the 'winding order' of the triangles, I've added a 'show normals' like the g3d has to the RenderMode menu, and 'Flip faces' to the Mesh menu.
If the faces are pointing the wrong way after turning off the two sided flag, they need their winding reversed. If they need this, then the normals are almost certainly pointing the wrong way too, so both reversing the winding and flipping normals is the default and probably correct thing to do, but I made the seperate options just in case.
Oh, and PS: The program works for me now.