Page MenuHome

One more fix for Voxel Remesher preserve volume artifacts
ClosedPublic

Authored by Leha (leha) on Nov 7 2019, 10:21 AM.
Tags
None
Tokens
"100" token, awarded by franMarz."Love" token, awarded by weasel."Like" token, awarded by MetinSeven."Love" token, awarded by ogierm."Love" token, awarded by lopoIsaac."Love" token, awarded by CobraA."Like" token, awarded by Frozen_Death_Knight.

Details

Summary

I noticed that https://developer.blender.org/rB265295e6a6ca9935159f75fe2956ee908c06bf4f provided better results, but there is still some artifacts appear after voxel remesh. Especially in sharp corners. Then I tested Shrinkwrap modifier on copied mesh and it provided better results. After looking at code and removing that one line from preserve volume code artifacts seems to disappear.

Diff Detail

Event Timeline

Leha (leha) created this revision.Nov 7 2019, 10:21 AM
Leha (leha) edited the summary of this revision. (Show Details)Nov 7 2019, 10:50 AM
This revision is now accepted and ready to land.Nov 14 2019, 9:37 PM

Hi. I tested Shrinkwrap modifier one more time, and on very rare occasion found this bug with holes in mesh again. And it can be prevented by setting Limit parameter!
So I think this line

ssmd.projLimit = target_me->remesh_voxel_size;

is important. Sorry, my fault.
But we can increase this Limit a little to prevent artifacts described in the first post.
After some tests I found 7 of voxel sizes is a good value to preserve sharp corners. At the same time it is small enough to not allow holes of shrinkwrap modifier

ssmd.projLimit = target_me->remesh_voxel_size * 7.0f;

Did this get in the latest master or is it forgotten? the issue is still there and it's a bit annoying when using draw sharp or crease then remeshing.
I had to disable preserve volume but at the same time need it, this patch looks like it will fix it.

I think this patch is accepted but not commited yet. Maybe @Pablo Dobarro (pablodp606) can commit this, or we need more reviewers to look at this?
I tested sculpting with this patch for a while and it worked great and preserve mesh better.

Can someone review and commit this please? This is small tweak but sculptors can benefit from it.
Notice popping of mesh in eyes, ears, nose of monkey because shrinkwrap is limited in those areas currently.

@Pablo Dobarro (pablodp606) Any reason why this hasn't been committed yet despite being accepted? Seems like a pretty useful fix for the most severe projection artifacts happening to Voxel Remesher.

Hey. Noticed this issue in the video D7306


Just a reminder that this fix can improve a result of remesh in corners

ogierm added a subscriber: ogierm.
Leha (leha) edited the summary of this revision. (Show Details)

But we can increase this Limit a little to prevent artifacts described in the first post.
After some tests I found 7 of voxel sizes is a good value to preserve sharp corners. At the same time it is small enough to not allow holes of shrinkwrap modifier

ssmd.projLimit = target_me->remesh_voxel_size * 7.0f;

I did similar tests few month ago but I didn't find value that will work properly in all cases. We are dealing with wrong projection or no projection at all. This could be solved by multiple steps of projection and smoothing vertices that wasn't projected but performance would suffer a lot. Shrinkwap code don't tell which vertices were snapped so we would have to calculate whole mesh multiple times.

I think this distance multiplier should be a setting in Voxel Remesher panel so w people can tweak it (until we have solution what will work in all cases).
Minimum projection distance must be bigger than diagonal distance of a voxel (1.732), anything below won't project sharp edges.

@Bartosz Moniewski (monio) Yes, a setting in voxel remesher would be awesome! But I think a default value must be bigger than 1.732. Just made a comparison with different values on image below. Original mesh is a harsh example, and higher values got some artifacts (that can be cured by remeshing again). Shape preserved way better with higher values.
Maybe default value 3.0 can be considered as a safe alternative.

Sure. 1.732 is absolute minimum multiplier, mathematically speaking. 1.732 also don't take into account VDB mesh smoothing (your last example) so value needs to be bigger than that.

I think, for now, this parameter should be set to 3 or 4 by default and slider should have hard minimum of 2 (or we can hardcode multiplier).

Maybe try adding another reviewer or ask someone directly to commit this