-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Algorithms Preserve/Calculate Texture Coordinates #159
Comments
I'd definitely like to see that as well! Remeshing would be another algorithm to consider... |
Do you think this should partially work/be implemented at the level of |
I think this should not be implemented on the core data structure level, but on an algorithm level. We had a similar discussion for the seam-aware decimation. The bottom line is that this is not a responsibility of the mesh data structure. One other idea would be to provide hooks into the data structure that could check for user-specified conditions, but I would have some concerns about performance implications. |
Yeah, from a theoretical, architectural standpoint, I tend to agree with that assessment. That said, let's look at |
While this might be too extreme, I think another approach could be to treat vertex/half edge properties as first class citizens that automatically get interpolated. That actually makes a lot of sense for many different use cases. We could make this either opt in on a per property basis and possibly allow custom interpolation methods that way, too. Just thinking out loud here :) |
I'm not sure what the purpose of those wrapper functions would be. Maybe you could make this more concrete with some code or pseudo-code? I'd think that deciding what exactly happens with the texture coordinates is specific to the concrete algorithm. |
After a good night of sleep, I think you are right. I oversimplified/-generalized things a bit too much in my mind yesterday. |
I added a version of I think I still need to add some code to properly handle isolated vertices? |
One thing that I don't like about this approach right now is that it is hard coded to support only one set of uvs. I think it could be super useful to at least allow to somehow support multiple sets of uv coordinates or possibly a more generic way to tell the algorithm what to do with specific properties. That could take a lot of different forms so I just wanted to put that thought out there for the time being! |
I added uv support for Screencast.from.07-12-2023.12.29.25.PM.webm |
I have been digging into the remeshing source to figure out what is required to keep uv's in tact and at this point I am not quite sure if there is a meaningful way to achieve this as the output mesh topology is so drastically different from the input. Here are the current "naive" steps that I think will be necessary: Preprocessing
Remeshing
Please let me know if these steps sounds reasonable and if you have any thoughts! |
Awesome progress! I did not yet look at the changes in detail, but I hope to find some time now that 3.0 is out the door. As for remeshing: I agree this gets ugly and I'm not really sure this is feasible or reasonable. We might think about something simpler along the lines of not trying to preserve the texture coordinates during all those changes but instead to reconstruct them from the original mesh afterwards. Again, thanks for looking into this! I think this work could be well suited for a 3.1 feature release. |
Is your feature request related to a problem? Please describe.
Right now
pmp
has limited support for texture coordinates. I.e. seams are preserved during decimation. I'd love to see all of the existing algorithms to become texture coordinate aware. Based on my initial scoping this should only affect algorithms that emit new vertices which in the pmp case might only be the subdivision functions?At the same time it could be super awesome to add optional tex coord generation to all the shape functions!
Describe the solution you'd like
Make
v:tex
/h:tex
a "core" vertex property that is properly calculated/respected by algorithms if present. Affected functions:quad_tri_subdivision
loop_subdivision
catmull_clark_subdivision
Please let me know what other functions might be affected, I might start working on a feature branch in the nearish future.
The text was updated successfully, but these errors were encountered: