Skip to content

Instantly share code, notes, and snippets.

View phamtanlong's full-sized avatar

Pham Tan Long phamtanlong

View GitHub Profile
@phamtanlong
phamtanlong / BlendModes.c
Created August 19, 2019 03:49 — forked from elringus/BlendModes.c
Popular blend modes algorithms implemented in Cg.
fixed G (fixed4 c) { return .299 * c.r + .587 * c.g + .114 * c.b; }
fixed4 Darken (fixed4 a, fixed4 b)
{
fixed4 r = min(a, b);
r.a = b.a;
return r;
}
fixed4 Multiply (fixed4 a, fixed4 b)