-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
beginShape(TESS) does not respect UV coordinates when tessellating. #5631
Comments
I looked into this a little bit to see what it would involve. Our tesselation uses libtess, and I've found another I'm not 100% sure this is correct but I've found another library using libtess and it seems to indicate that it supports arbitrary vertex dimensions. The idea being, instead of passing in If we were to do something like that, it would mean adding texture coordinates (and more) here, which is where we construct the data we pass to libtess: p5.js/src/webgl/p5.RendererGL.js Line 1484 in 05c9385
We would then need to update our combine and vertex callbacks to handle the extra data, and put it back into p5's buffers when libtess is done. For the combine and vertex callbacks, the aforementioned library has an implementation of this already that we could borrow from. I think the key is this line, which uses the vertex weights (Barycentric weights?) to interpolate all the data, not just the position, which is what is all that the library does for us and is what we are currently using: |
Most appropriate sub-area of p5.js?
p5.js version
1.4.1
Web browser and version
No response
Operating System
No response
Steps to reproduce this
Steps:
beginShape(TESS)
and specify UV coordinatesExpected
Tessellation should respect/preserve the specified UV coordinates.
Actual
The resulting set of vertices do not match the specified UV coordinates at all and the texture is displayed but very distorted.
Snippet:
The text was updated successfully, but these errors were encountered: