You can compute normals in the fragment shader using the trick here:
http://www.volumesoffun.com/polyvox/doc ... bic-meshesThere's a similar trick you can use for computing some UV coordinates once you have the normal:
Code:
vec2 texCoord = vec2(dot(position, normal.yzx), dot(position, normal.zxy));
I haven't tested that exact code but used something similar in Voxeliens for the normal mapping.
If you don't want to use shaders then you will have to write code to take the extracted mesh and build a new mesh from it by copying across the triangles and computing normals as you do so. Actually I do intend to add such a utility function at some point (but not soon).
Illidan wrote:
Would it be hard for me to add the semplification while leaving duplicate vertices on the edges or are there some kind of technical limitations I'm not aware of?
It's mostly that I don't want to maintain two CubicSurfacExtractors. The version with normals will probably be removed once I add the utility function mentioned above.
Illidan wrote:
I've seen the performance improvement commits on bitbucket, have you benchmarked them? If there's a nice speedup, I will update to the latest version
I think the CubicSurfaceExtractor is quite a bit faster (maybe 50%) and the whole unit test suite runs about 20% faster. The develop branch currently builds but has a few warnings on Linux. In general we try to keep it stable but don't promise this