Skip to content

Commit

Permalink
feat(webgl): add initial coll of blend mode presets
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jul 15, 2019
1 parent c8898a0 commit 58e0b04
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/webgl/src/api/blend.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tuple } from "@thi.ng/api";
import { IObjectOf, Tuple } from "@thi.ng/api";

export const enum Blend {
ZERO = 0,
Expand Down Expand Up @@ -28,7 +28,10 @@ export const enum BlendEquation {

export type BlendFunc = Tuple<Blend, 2>;

export const DEFAULT_BLEND: BlendFunc = [
Blend.SRC_ALPHA,
Blend.ONE_MINUS_SRC_ALPHA
];
// 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]
};

0 comments on commit 58e0b04

Please sign in to comment.