News for hackers. Stuff that matters.
Re:Instanced Line Rendering Part II: Alpha Blending by rebuilder on Friday October 08, 2021 @02:55AM (#28796453)
Is it not possible to use a different operator for alpha blending? So instead of a1 + a2, do max(a1,a2)?
Re:Instanced Line Rendering Part II: Alpha Blending by catdawg on Friday October 08, 2021 @05:59AM (#28797459)
Yeah, I had exactly this problem before. I tried to wrap my head around how to actually do it geometrically, but thankfully had the much easier idea of just using the blend op.

This is super useful though! You don't always have the ability to change the blending op, or you could be rendering on top of something that might give you artifacts. Thankfully I was rendering something like this on a blank canvas.

Re:Instanced Line Rendering Part II: Alpha Blending by ghusbands on Friday October 08, 2021 @06:13AM (#28797545)
That depends on whether you're drawing to a (temporary) buffer with alpha or drawing directly onto a background. Even if you can, it imposes limits on your overall compositing/drawing order.
Re:Instanced Line Rendering Part II: Alpha Blending by GuB-42 on Friday October 08, 2021 @09:03AM (#28798776)
I guess it can be done using stencil buffer trickery too. Using "max" instead of "+" will work, but is will be a different effect.
Re:Instanced Line Rendering Part II: Alpha Blending by pcwalton on Friday October 08, 2021 @04:10AM (#28796844)
It requires EXT_blend_minmax or WebGL 2, but yes.