Skip to content

Commit

Permalink
adjust blend GL modes to match ES
Browse files Browse the repository at this point in the history
  • Loading branch information
bcamper committed Dec 2, 2016
1 parent 47fc96c commit 330fc9c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,7 @@ export default class Scene {
// Opaque: all source, no destination
if (blend === 'opaque') {
render_states.blending.set({
blend: true,
src: gl.SRC_ALPHA, dst: gl.ZERO
blend: false
});
}
// Traditional alpha blending
Expand All @@ -677,16 +676,14 @@ export default class Scene {
else if (blend === 'add') {
render_states.blending.set({
blend: true,
src: gl.ONE, dst: gl.ONE,
src_alpha: gl.ONE, dst_alpha: gl.ONE_MINUS_SRC_ALPHA
src: gl.ONE, dst: gl.ONE
});
}
// Multiplicative blending
else if (blend === 'multiply') {
render_states.blending.set({
blend: true,
src: gl.ZERO, dst: gl.SRC_COLOR,
src_alpha: gl.ONE, dst_alpha: gl.ONE_MINUS_SRC_ALPHA
src: gl.ZERO, dst: gl.SRC_COLOR
});
}
}
Expand Down

0 comments on commit 330fc9c

Please sign in to comment.