I've found a simple approach using gradient for marching cubes algorithm (I'm working on a voxel engine too), but since you're still operating on a 3D grid and not directly on the triangles you could give it a try.
Dual Contouring - Normal Vectors of a Noise Function
Question
I'm currently working on a voxel engine that utilizes dual contouring to give the terrain a more organic/real-life look.
If you're not familiar with dual contouring, basically I need to supply a density function to denote whether a specific point is air or solid (in my case, I'm utilizing 3D Simplex Noise) and I need to be able to provide the normal vector at any point on the 3D noise function.
Normally, when calculating normals for a triangle, I take the cross product of two of the vectors that constitute the triangle; in this case, should I just apply a small delta to the noise function to achieve the same effect?
Thanks for any help!
Solution
OTHER TIPS
You may compute the gradient function of the noise function as normal vector at a point on the iso-surface.
In 3D Perlin noise case, you may use 3D Perlin noise analytical derivative.