Commit graph

22 commits

Author SHA1 Message Date
Mira Grudzinska
0a76a4f0a3 gl_engine: fix color burn/dodge edge cases
Aligned with sw_engine implementation.
2025-03-12 02:10:32 +01:00
Hermet Park
c460591b39 gl_engine: corrected ColorDodge, ColorBurn equation
issue: https://github.com/thorvg/thorvg/issues/3072
2025-01-16 18:44:41 +01:00
RuiwenTang
e82830147c gl_engine: Support new radial gradient data struct and calculation
Change the shader and uniform struct to support new radial gradient.
The mathematical calculation comes from https://skia.org/docs/dev/design/conical/
2024-11-18 23:22:56 +09:00
Hermet Park
3490f9b9ce png, gl_engine: fixed an wrong png colorspace.
issue: https://github.com/thorvg/thorvg/pull/2880
2024-10-22 00:41:42 +09:00
RuiwenTang
6427b81358 gl_engine: ignore masking alpha when calculate inv luma masking 2024-10-22 00:41:24 +09:00
RuiwenTang
c8a04a5337 gl_engine: implement darken and lighten mask method
Add new shader to support darken and lighten mask method.
2024-09-30 23:24:28 +09:00
RuiwenTang
4bc1e60dfd gl_engine: implement advance blending
Implement some advance blending equation in GLEngine by using two
RenderPass.

* The first pass render the content into an off-screen framebuffer, also
blit the screen content to an off-screen Texture.

* The second pass renders the final blended color to the screen.
Also use a stencil test to prevent non-drawn areas from participating in the color blending calculation.

issue: https://github.com/thorvg/thorvg/issues/2435
2024-09-30 16:44:22 +09:00
RuiwenTang
3eb2e66fe0 gl_engine: fix aliasing in gradient rendering 2024-09-30 15:11:40 +09:00
RuiwenTang
063474ba05 gl_engine: fix clip path and bounds not correct
* Optimize clip logical, change to use GL_GRATER and keep incrace depth
  value, so no need to do depth clear after every clip draw.
* Correct geometry bounding box calculation, and make sure the bounds is
  larger than all vertices
* Limit drawing area for off-screen RenderPass with correct scissor box
2024-06-24 14:47:33 +09:00
RuiwenTang
059c452249 gl_engine: fix gradient color interpretation error
Fix when gradient position is same as some starting or ending point
of a gradient stop, the output color is blank
2024-06-24 14:37:22 +09:00
RuiwenTang
56de3bb3ca gl_engine: fix gradient rendering error
* Fix error when handle GradientTransform calculation. And move the inv
calculation into gradient vertex shader.
* Fix cubic tessellation not close the last point
2024-06-24 12:23:38 +09:00
RuiwenTang
574783be16 gl_engine: using normal texture rendering in final color blit
Since blit msaa framebuffer to another msaa framebuffer may generate
GLError in some platforms. Use normal texture rendering to blit the final
color buffer onto target framebuffer.
2024-06-24 12:10:18 +09:00
RuiwenTang
cde17a4fc6 gl_engine: change all shader output premultiplied alpha color 2024-04-07 15:15:59 +09:00
RuiwenTang
5bf82bf142 gl_engine: remove unused alpha attribute
Since we choose MSAA, no need to calculate edge alpha during fragment
stage. So this commit removed the alpha attribute and related code:

* Remove the alpha attribute in vertex data.
* Change position type from `vec3` to `vec2` in all shader code.
* Remove alhpa multiplication in all fragment shaders
2024-04-06 12:08:21 +09:00
RuiwenTang
2855b9b339 gl_engine: add stencil and cover render task
* add new render task to do stencil and cover rendering which is a
  fallback rendering method to handle cases that trianglation tessellation
  failed

* add a new tessellator to generate stencil and cover vertex mesh
2024-04-06 12:08:21 +09:00
RuiwenTang
78b2435596 gl_engine: fix radial gradient not render correctly
root cause: the gradient shader not taking into account FillSpread property
2024-04-05 17:28:08 +09:00
Jinny You
92288c8291 updated copyright date (#1866) 2024-01-02 20:34:12 +09:00
RuiwenTang
2db45c7ba0 gl_engine: fix svg gradient position not correct
* change the color and stop size to 16 in shader and buffer block
* calculate transform when upload gradient info to gpu pipeline
2024-01-02 20:34:11 +09:00
RuiwenTang
269537a411 gl_engine: support advance compose method 2024-01-02 20:34:10 +09:00
RuiwenTang
d257835507 gl_engine: support render image 2023-12-26 17:45:18 +09:00
RuiwenTang
453cba7ddd gl_engine: make GlRenderTask generic with uniform block
* Use uniform block to pack all color informations
* Move the actual gl draw call into GlRenderer::sync function, so all
  data is been uploaded into GPU
* Make GlRenderTask simple and generic for direct gl draw
2023-09-21 22:24:07 +09:00
Hermet Park
24711e485c infra: renames the source folders
lib -> renderer
bin -> tools
utils -> common
2023-08-28 13:11:24 +09:00
Renamed from src/lib/gl_engine/tvgGlShaderSrc.cpp (Browse further)