Jump to content

Remesh using only VEX


marcmesafervfx

Recommended Posts

Hello to everyone! 

I'm creating this topic just to see if someone is able to break down the remesh node in VEX. The point is to achieve a faster result using a wrangler or more as a substitution for the remesh or polyreduce. So here you have some questions:

1. Is it better to use the original mesh (deleting and modifying the mesh) or creating a new one (generating points)?

2. Is the source code used in the remesh node faster than any script that could be written in VEX?

If you find a way or you have an idea about how to do it, don't hesitate to share it with the community!

Link to comment
Share on other sites

the remesh node is done in C++, doing it yourself in VEX is unlikely to make it faster :P

That said, there are some things that you can optimize on top of the node.
One very easy optimization is to split your mesh by connectivity (create a "class" attribute with the connectivity SOP)
then loop over this attribute with a foreach block, and in turn, use compile block around that.

My suspicion is that because in each iteration of the loop, the remesh node does not have to consider irrelevant (far away)
data, doing a bunch of smaller pieces separately (in a compiled fashion) is faster than processing it as one large chunk.
This can speed it up a loot, depending on the target mesh density etc.

Link to comment
Share on other sites

You can do almost anything in VEX. I have written some SOPs in VEX that beat their C++ versions in performance (in some cases for some). It mostly depends on the algorithm and carefully designed implementation. But it's also highly dependent on the operation.

For something like remesh, it's mostly a serial operation and pure geometry creation won't be very fast in VEX unless you pre-generate points and primitives, etc. So your best bet is to find a better algorithm first.

I would first get comfortable with topology manipulation in VEX, handling/stitching adjacent polygons properly, interpolating attributes, preserving groups, dealing with edges, etc then you will start to see patterns.

  • Like 1
Link to comment
Share on other sites

OK yeah, maybe I should have been more clear :P
there are nodes that can done faster in VEX than native, the partition and measure SOPs come to mind.

Its just that Remesh is a much complex beast. If you are a researcher in the field or just want to learn how to do it, then by all means go ahead!
But I think that those things: remesh, poly reduce and also uv layout and uv relax(hopefully at some point xD) are among the most difficult graphical problems you run into on a regular basis

Link to comment
Share on other sites

50 minutes ago, acey195 said:

OK yeah, maybe I should have been more clear :P
there are nodes that can done faster in VEX than native, the partition and measure SOPs come to mind.

Its just that Remesh is a much complex beast. If you are a researcher in the field or just want to learn how to do it, then by all means go ahead!
But I think that those things: remesh, poly reduce and also uv layout and uv relax(hopefully at some point xD) are among the most difficult graphical problems you run into on a regular basis

Yes definitely, my comment wasn't directed towards you so I agree with you :)

Those nodes, Boolean SOP, etc are quite tricky to get right regardless of language. Back in the day I wrote a UV packer, and it was a difficult problem.

  • Haha 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...