You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chatted with @Kangz, and we're not 100% sure a dual-source blend is the best way for you to spend your time. But hey, I'm still game for one if you are!
Example Use Cases
There are several potential uses for this functionality. A first example
is in the implementation of sub-pixel accurate font rendering algorithms.
Given a known layout of pixel elements (red, green and blue components),
coverage may be calculated independently for each element and passed
to the blender in the second source color as a per-channel opacity. To use
this mode, use the following blend functions:
glBlendFunc(GL_SRC1_COLOR, GL_ONE_MINUS_SRC1_COLOR);
As a second example, consider a partially reflective colored glass window.
It will attenuate light passing through it, and reflect some of the light
that strikes it. Using an appropriate combination of functions, this effect
may be simulated in a single pass using only fixed-function blending
hardware. In this case, the following blend functions may be used:
glBlendFunc(GL_SRC_ALPHA, GL_SRC1_COLOR);
I think a WebGPU sample illustrating the dual source blending feature would be nice.
@Jiawei-Shao Did you have something in mind already?
The text was updated successfully, but these errors were encountered: