-
Notifications
You must be signed in to change notification settings - Fork 130
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
When I use Clipper to cut polygons, sometimes I get some separated polygons and some holes. How can I use earcut to process these separated polygons? #91
Comments
You have to invoke earcut for each individual separated polygon. If you require more specific help you can provide some polygons you get from clipper as output and I'm happy to show you how to prepare them to run earcut on them. |
Thank you for your reply, I seem to have found a way. I'm making an SVG library, using Clipper to do clipping, and Earcut to triangulate. But because I have to run on OpenGL ES 3.0 hardware, I need to render to textures. OpenGL ES 3.0 does not yet support multi-sampling of textures. Is there any good solution for this? |
An alternative to multisampling is supersampling, basically you increase the size of the texture by a factor of 2x, 4x or 8x, scale the polygons by the same amount, render them to the texture and finally downscale the output texture back to your desired size. |
This will lead to too much pixel filling, and the performance will be affected |
I'm considering whether I can use clipper to make an edge offset, then triangulate the offset part, and then make an alpha transition in GPU shader. I don't know if this is the right direction |
I think your solution would be quite blurry, but you can try. Before you do, try to check if the 'EXT_multisampled_render_to_texture' extension is available and use it instead. |
I tried to use msaa and found that the effect is not good. It should be provided by hardware, there may be many differences. |
When I use Clipper to cut polygons, sometimes I get some separated polygons and some holes. How can I use earcut to process these separated polygons?
The text was updated successfully, but these errors were encountered: