From 9269e63a5e9cc7dbdd96f087e3c66b004efaf000 Mon Sep 17 00:00:00 2001 From: Brian Chirls Date: Tue, 8 Apr 2014 12:40:00 -0400 Subject: [PATCH 1/2] Converted monochromebars.png to indexed color because Safari doesn't like grayscale images http://stackoverflow.com/questions/21540074/webgl-2d-texture-display-error --- examples/images/monochromebars.png | Bin 7880 -> 10525 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/examples/images/monochromebars.png b/examples/images/monochromebars.png index 1600347301faa859ee11200b4fd9cc4e188de59c..d0d8c83757c91695e3a1e14b572bffc74ee2a1cd 100644 GIT binary patch literal 10525 zcmeHNO=uHA6n@+MG_5UGky?5&l~7Pba_|t6Ce)H*LVqZ=f>p6Ss;7z-R7ktADC*5y zy?9gcqD3%G+Nf1TC>}gW6+C!REK;o?_(vgeCX>u=;z~O^PZ+R=kY&S8-uvcz-}hc7 zm-~A6)z>!H0ziE{7VQV9)&X4LagaM#_djxxx30eKfll(SX`0jN3U3S$8}v#CX*8r6RA{cdU`sYPG>TinVFf{+1YG1yRx#9%jNR)he4!LR*$(%JX@%S-PT z4&8lleB}P?SJ%J1NF{!pj(MGaU8@_04Rg?_YrDX45ZqHxH>@?yRrz(7zz5)Hl3s&+ zE4W!e_5)#|)1+ubZhr&06i>(eL@6X;Ow5ZAczH;A(j$Ou#VTx*iYUorUPMW5^I3?6 z1Z@+Dr&-uGNTn)U9LZJ!DI0`|4lU#&_7BHHm z7m?(0+GMza+{STn!l{$07G_kEh?AVSj<1!<)?_h61q*K#-M20((R(p~ImzucaD11r z+<rpWQ7AM)K};(4$dFz+RZ-Fnu(gR)PP?@K zBFi|m5*?T1`2XR)w2ZMxE+QWm1zJ)%*^MK`To5N54{!7om99b~#8>A!t{UD-y05oN zcKpR^F|pjBG}O!f)_D*{To0kSp` zeM2~jBznuhLTY#73Z6qM>AqApSx6C3V}FbXR&m*u`Yh9<8qKL2!KiTno<;+?(GI~~L4e*;~TQd0l` literal 7880 zcmeHLi9eM4_kY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VG)&kUIn8G zGxrK!XTCmv$GKTr72$18Ix}R`{Uoj_vngQgT~q&f#Q29Y9`az@(Td2i(z23f8)7MG zrr_ns4hu_*?mXlvkIB>HxWyNPcM?z4^|hOd}y%~M1^2`c&YjxE*h4pq$S zyYBOFwf&oQ5%Uh_aQrO(@RKXvW3|0cOA%kq`|J83LFu2;XKp^P?xyGk;YEnTNcoS5 zo>_?xt!2DZ^$%@{!G4ENEF>=#6VU-VgO?_+TzMDtt|Lv>7rBI*me{K2h)EB|A z!M0y2hf#HP1F>J7A38g)0^5>jzwvUl+EI^{te)CdUI4KFJ?)}1+&{Je01R30v<#g7h_NGCaHqKG)I5^*5^sW zIsNSk@3j#YH9!arfxu*;kYCZTzPNv&(U5h{HplsG{wYU7+jT&4Iy2042-O4Z^ z;;_{0(sh`704EwEo?o4BhJb17i>8w5~{Gy-ej|d zz2=)hG$jz+)zoPV8?=^MFBgI*2xX!GlF-9A;P51Zmy6`4iEI!y#!`XMmfEJJx4y2| zwA6*I#ztlS*d)~0Je7K>FS6VnI-2UHzTK05=5sy+aU4~T3OOI2wh~UC!EspuKQ+u+ zE?p)ud~x9TD81gySUzt^Ze*`e#O$7(NRl~S_mK2j5qc~=|&=$L52AV?D)JDMB` zp`*$M@H=DcN%?hNeh+NDAhy=TdhEXowgU(OwowJ3=b#A-lqR5OG+76JXKW)Wzs$>T zf~^LYXATM From 5a7d1a6b1ed29572b8d5f604f014b30ce39007c0 Mon Sep 17 00:00:00 2001 From: Brian Chirls Date: Tue, 8 Apr 2014 13:34:38 -0400 Subject: [PATCH 2/2] Regression fix: changes to GL blend function broke anything with alpha < 1.0 - need to reset blend function to correct default values - `dstAlpha` and `dstRGB` were misspelled in blend effect - layers effect needs to specify blend function components --- effects/seriously.blend.js | 4 ++-- effects/seriously.layers.js | 10 ++++++++++ seriously.js | 6 +++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/effects/seriously.blend.js b/effects/seriously.blend.js index a8cd16b..384a4d1 100644 --- a/effects/seriously.blend.js +++ b/effects/seriously.blend.js @@ -97,9 +97,9 @@ if (nativeMode && gl) { topOpts.blendEquation = gl[nativeMode[0]]; topOpts.srcRGB = gl[nativeMode[1]]; - topOpts.destRGB = gl[nativeMode[2]]; + topOpts.dstRGB = gl[nativeMode[2]]; topOpts.srcAlpha = gl[nativeMode[3]]; - topOpts.destAlpha = gl[nativeMode[4]]; + topOpts.dstAlpha = gl[nativeMode[4]]; } } diff --git a/effects/seriously.layers.js b/effects/seriously.layers.js index 6ea50e6..111ee4c 100644 --- a/effects/seriously.layers.js +++ b/effects/seriously.layers.js @@ -150,6 +150,16 @@ }; return { + initialize: function (initialize) { + var gl = this.gl; + initialize(); + + topOpts.blendEquation = gl.FUNC_ADD; + topOpts.srcRGB = gl.SRC_ALPHA; + topOpts.dstRGB = gl.ONE_MINUS_SRC_ALPHA; + topOpts.srcAlpha = gl.SRC_ALPHA; + topOpts.dstAlpha = gl.DST_ALPHA; + }, commonShader: true, shader: function (inputs, shaderSource) { shaderSource.vertex = [ diff --git a/seriously.js b/seriously.js index ff7ad70..028a953 100644 --- a/seriously.js +++ b/seriously.js @@ -1159,9 +1159,9 @@ gl.blendFuncSeparate( options && options.srcRGB || gl.ONE, - options && options.dstRGB || gl.ONE_MINUS_SRC_ALPHA, - options && (options.srcAlpha || options.srcRGB) || gl.SRC_ALPHA, - options && (options.dstAlpha || options.dstRGB) || gl.ONE + options && options.dstRGB || gl.ZERO, + options && (options.srcAlpha || options.srcRGB) || gl.ONE, + options && (options.dstAlpha || options.dstRGB) || gl.ZERO ); gl.blendEquation(options && options.blendEquation || gl.FUNC_ADD); } else {