Comments (15)
Maybe my recent commit broke it, I'll check
from thorvg.
@RuiwenTang @SergeyLebedkin Hello, do you mind any anti-aliasing (AA) techniques for GL backend? We plan to implement this with WebGPU and it would be beneficial if the same methodology could be applied. Our primary is MSAA.
I also prefer MSAA which is more efficient in modern GPU APIs like vulkan, metal or WebGPU
from thorvg.
@lostminds Thanks for suggestion. Still, it needs more attention and development. Perhaps AA (Anti-Aliasing) should be applied before basic practical usage. I'd like to suggest that you can test for specific drawing contents and then decide which backend engine would be more efficient for your project (rather than fallback mechanism). btw, I'm really wondering the software renderer is not suitable for your project due to performance concerns.
from thorvg.
However, in many cases the content will likely be just a lot of simple filled or stroked shapes. And for these cases it would be nice to get something more performant like GPU-based rendering since in this case the more complex features are not required.
I completely understand your point. However, after considering the conditions you mentioned, you can always use the ThorVG GL engine once anti-aliasing (AA) is implemented. Nevertheless, Godot also needs to consider the ThorVG GL version, a topic that has not yet been discussed on the Godot side. Let me look into this further.
from thorvg.
@RuiwenTang, wrt https://github.com/orgs/thorvg/discussions/2048, I think we need to think about the GL integration now. Currently,
glCanvas
has parameters:GlCanvas::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h)
The
buffer
is not actually used; however, I assume we can replace it withfbo(id)
:GlCanvas::target(int32_t targetID, uint32_t stride, uint32_t w, uint32_t h, Colorspace cs)
Basically, we expect the
targetID
to be a valid FBO, which we can bind inside the GL renderer. If the FBO is invalid or 0, we can probably assume the rendering target is main surface, and we can perform the drawing directly (with no threading).What do you think?
It looks good to me. 👍
from thorvg.
from thorvg.
from thorvg.
@RuiwenTang Radial Gradient fill is a bit different. I remember it worked properly before?
from thorvg.
Retaining doesn't updated.
from thorvg.
Masking samples appear to be mostly working well, although some background colors are not appropriate.
from thorvg.
@RuiwenTang @SergeyLebedkin Hello, do you mind any anti-aliasing (AA) techniques for GL backend? We plan to implement this with WebGPU and it would be beneficial if the same methodology could be applied. Our primary is MSAA.
from thorvg.
Condition check:
These are basically working but some minor differences are observed.
from thorvg.
Would it be possible use this faster (I assume) rendering backend in parallell with the regular SW-engine, and have ThorVG automatically pick renderer to use based on what features the content drawn requires?
This way we could benefit from the performance improvements of this renderer for rendering more basic content, while it would fall back to the regular SW renderer in case features are required that the GL renderer doesn't yet support.
from thorvg.
btw, I'm really wondering the software renderer is not suitable for your project due to performance concerns.
My use-case is probably a bit unusual, I'm using ThorVG via Godot in a parametric graphic design app I'm building. It both imports and exports SVG and uses an SVG-like internal format. So I use ThorVG to render a preview of each layer, re-rendering the layers separately on a separate thread when they change and composit them together as textures in Godot. The performance is ok, but could of course be better.
The reason I proposed the automatic renderer selection/fallback-model is that since the content in my case is controlled by the user, I can't know what it will be. It could for example include imported SVG files, so I would like to have as close to full SVG support as possible since fidelity is more important than performance. However, in many cases the content will likely be just a lot of simple filled or stroked shapes. And for these cases it would be nice to get something more performant like GPU-based rendering since in this case the more complex features are not required. But I understand very well that it's a big task, and like you say, getting a good AA solution in place first will likely be needed for any practical use.
from thorvg.
@RuiwenTang, wrt https://github.com/orgs/thorvg/discussions/2048, I think we need to think about the GL integration now. Currently, glCanvas
has parameters:
GlCanvas::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h)
The buffer
is not actually used; however, I assume we can replace it with fbo(id)
:
GlCanvas::target(int32_t targetID, uint32_t stride, uint32_t w, uint32_t h, Colorspace cs)
Basically, we expect the targetID
to be a valid FBO, which we can bind inside the GL renderer. If the FBO is invalid or 0, we can probably assume the rendering target is main surface, and we can perform the drawing directly (with no threading).
What do you think?
from thorvg.
Related Issues (20)
- Corrupt radial gradient on Apple Silicon HOT 5
- Incorrect outline for specific curve HOT 1
- Hash collisions in SVG loader HOT 4
- Lottie regression bug HOT 1
- Add c/c++ test suites for lottie slot
- Apply clang-format HOT 1
- Lottie loader is not updating the canvas HOT 8
- Metal backend support?
- Adding a web build test CI HOT 2
- Lottie: Animation Segment(Marker) Support
- Lottie/slot: multiple properties in single slot not working
- broken lottie trimpath (individual)
- Feature Request: Clear canvas without deleting paints HOT 2
- Storing the address of local variable HOT 2
- CAPI: update colorspace interfaces
- Lottie: Support feasibility of accessing a specific Lottie node by identifier
- Lost compose effect when call canvas::draw second time
- lottie compatibility issue HOT 2
- Embedded compilers doesn't like `_A`, `_B`, and `_C` function names.
- ThorVG 0.13 Release HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thorvg.