Giter Site home page Giter Site logo

Comments (6)

kobalicek avatar kobalicek commented on September 22, 2024 1

I think it's difficult to even compare Blend2D with a single purpose project that has no source code available. I mean Blend2D can render arbitrary paths, transformed text, it has a composition pipeline, you can have 10k font faces loaded and render them simultaneously, etc... (and I'm not suggesting everybody would need to have 10k font faces loaded, but it's just possible with Blend2D as it doesn't need to do anything fancy to render text, it would just quickly extract the data from the TTF/OTF font and rasterize it).

Just an interesting figure - on my Zen4 machine I can render the Qt-SVG tiger demo at 115fps @ 4K resolution by only using a single thread for rendering (for comparison, Qt can render it at 35fps). And the architecture of these demos is to use QImage which is then blitted by using QPainter, so Blend2D renders to a QImage, then its content is blitted to QPainter's backing store, and then it's finally handled by Qt, most likely by using XShm or something to upload it to GPU backed memory (I'm using a dedicated GPU and X11).

I think on modern machines rendering on CPU is not really a problem - what is interesting is what the 2D library allows you to do, which is something that I would like to focus on - adding more features > making the existing faster.

In other words - performance was never something that Blend2D users complained about - users want features like layers, path-based clipping, path manipulation, and filters/effects. Yeah maybe the only thing where performance should be improved is text rendering by using a glyph cache, and I have already experimented with glyph compression that would be ideal for this task, so this feature is coming as well.

To put more context into this:

I think that if you only have 1 or 2 fonts that you need to render with a very specific text sizes, then you can do a lot of optimizations / precalculations - like creating the mentioned atlas, etc... But if you have a universal library like Blend2D - you cannot count on that. So Blend2D cannot spend 50ms by creating a 2MB font atlas per font, which would only be used once for few glyphs, for example, before the font-face is destroyed. Creating a universal library that can be used for many use cases is much more difficult than creating a library for a very narrow use case.

from blend2d.

dumblob avatar dumblob commented on September 22, 2024

Oh, yeah I fully agree.

I read the article with focus on a bit different aspects it seems. Namely what I saw there was the train of thought how to go about the current .

1.The (AFAIK still unsolved) issue of high quality text rendering in 3D can be approached by "leaving it up to the existing proven 2D libraries".
- conclusion for Blend2D: having good text in 3D necessitates the existing 2D font rendering infrastructure
2. For vector graphics, use SDFs in shaders where possible (SDFs which can not be computed that way will stay CPU-computed).
- conclusion for Blend2D: having an API allowing "seamless hybrid CPU/GPU computation" is a great advantage

from blend2d.

kobalicek avatar kobalicek commented on September 22, 2024

Closing as GPU backend is a future plan.

from blend2d.

dumblob avatar dumblob commented on September 22, 2024

Sounds encouraging! Thanks.

from blend2d.

dumblob avatar dumblob commented on September 22, 2024

Btw. do you already have any ideas or plans about the hybrid CPU/GPU approach? I could not find it in the roadmap https://blend2d.com/roadmap.html .

Thanks!

from blend2d.

kobalicek avatar kobalicek commented on September 22, 2024

Not really at the moment. That would need a lot of experimentation and time, which I don't have, so I want to focus on improving the existing backend.

from blend2d.

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.