Closed sts1skj closed 2 years ago
Some questions:
One thing I noticed while experimenting with the new bpcf position-smoother is that it sometimes produces slightly poor results near points with connections like this: The reason is that the bpcf code relies on normals calculated by Mesh::SmoothNormals, and that function doesn't produce great results when a point's triangles are unbalanced on one side, like the point in the image above. It produces a normal for the central point that is more dominated by the upper triangles' normals than the lower triangles' normals, because there are four upper triangles and only two lower triangles. So the normals at points like this aren't quite right. I'm not sure, but I think I've noticed this a few times while playing Skyrim.
So maybe Mesh::SmoothNormals could be improved. One idea is to do a plane fit through balanced pairs of neighboring vertices. Another idea is calculating triangle normals for a set of temporarily generated triangles that only use balanced pairs of neighboring vertices (instead of using the mesh's own neighboring triangles). Should I look into this?
@sts1skj There's been some changes in dev (adjacent points) that require a rebase/merge.
For the position-smoothing brush, the new algorithm is a "balanced pair circle fit" smoother. It finds balanced pairs of adjacent points and fits a circle through each pair.
For the mask-smoothing and weight-smoothing brushes, the new algorithms are "balanced pair parabola fit" smoothers. They find balanced pairs of adjacent points and fit a parabola through each pair.
I think the circle fitter works well. The parabola fitter doesn't work great, it seems to me, but is still probably better than the existing hclap code.