Git Product home page Git Product logo

Comments (8)

mrgreywater avatar mrgreywater commented on June 20, 2024 1

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.

from earcut.hpp.

mrgreywater avatar mrgreywater commented on June 20, 2024 1

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.

from earcut.hpp.

jellychen avatar jellychen commented on June 20, 2024

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?

from earcut.hpp.

jellychen avatar jellychen commented on June 20, 2024

@mrgreywater

from earcut.hpp.

jellychen avatar jellychen commented on June 20, 2024

This will lead to too much pixel filling, and the performance will be affected

from earcut.hpp.

jellychen avatar jellychen commented on June 20, 2024

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

from earcut.hpp.

mrgreywater avatar mrgreywater commented on June 20, 2024

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.

from earcut.hpp.

jellychen avatar jellychen commented on June 20, 2024

I tried to use msaa and found that the effect is not good. It should be provided by hardware, there may be many differences.
I now use clipper to cut and triangulate through earcut, but I need anti-aliasing, so I wonder if I can add some redundant data through the vertices to interpolate, and then use the shader to determine whether the current pixel is Near the edge? Is there such a technique?
@mrgreywater

from earcut.hpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.