Canvas Nasal API: Difference between revisions

Jump to navigation Jump to search
→‎set: Explained how blending works.
(→‎set: z-index minimum integer is 0)
(→‎set: Explained how blending works.)
Line 117: Line 117:


''Key = "blend-destination-alpha":''
''Key = "blend-destination-alpha":''
These are blending operations, they determine how a texel is drawn based on what your current element want to draw (source) and what is already drawn at this texel (destination).
For example for the 2 first listed keys, the formula is ''output_color = (blend_source * src_color) + (blend_destination * dst_color).''
The value for the keys can be one of: (string)
''zero, one, dst-color, src-color, one-minus-dst-color, one-minus-src-color, src-alpha, dst-alpha, one-minus-dst-alpha, one-minus-src-alpha, src-alpha-saturate''
You can see the formulas [[https://web.cs.ship.edu/~djmoon/cg/cg-notes/cg-ogl-blending.pdf here]]
With a little creativity these can be used for many things, like creating custom clipping geometry and other stuff.
NOTICE: Blending does NOT work for paths. They are confirmed to work with text and images though.


=== update ===
=== update ===
574

edits

Navigation menu