Skip to content

Commit

Permalink
refactor(webgl): update blend mode presets as sep consts
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jul 28, 2019
1 parent 6951459 commit cc0ffcd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/webgl/src/api/blend.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IObjectOf, Tuple } from "@thi.ng/api";
import { Tuple } from "@thi.ng/api";

export const enum Blend {
ZERO = 0,
Expand Down Expand Up @@ -31,7 +31,9 @@ export type BlendFunc = Tuple<Blend, 2>;
// TODO blend func presets
// https://www.andersriggelsen.dk/glblendfunc.php

export const BLEND_MODES: IObjectOf<BlendFunc> = {
normal: [Blend.SRC_ALPHA, Blend.ONE_MINUS_SRC_ALPHA],
add: [Blend.SRC_ALPHA, Blend.DST_ALPHA]
};
export const BLEND_NORMAL: BlendFunc = [
Blend.SRC_ALPHA,
Blend.ONE_MINUS_SRC_ALPHA
];

export const BLEND_ADD: BlendFunc = [Blend.SRC_ALPHA, Blend.DST_ALPHA];

0 comments on commit cc0ffcd

Please sign in to comment.