diff --git a/VERSIONS.txt b/VERSIONS.txt index 260ca56d4..731812d77 100644 --- a/VERSIONS.txt +++ b/VERSIONS.txt @@ -1,3 +1,18 @@ +Version 1.1.0 (April 05, 2018) +**************************************************************************************************** +CRITICAL (may break existing content): +- filters now always stretch loaded images in both GL and Context2D + +NEW +- Chromatic Abberation Filter (shift independant color channels +- Displacement Map Filter (reposition portions of the rendered image) +- StageGL composite operations, avaiable through `StageGL.directDraw = false` + +***** +OTHER: +- minor bug fixes in StageGL + + Version 1.0.0 (September 14, 2017) **************************************************************************************************** CRITICAL (may break existing content): diff --git a/examples/WebGL/Benchmark.html b/examples/WebGL/Benchmark.html index 7efdc078b..d201efac7 100644 --- a/examples/WebGL/Benchmark.html +++ b/examples/WebGL/Benchmark.html @@ -63,8 +63,8 @@ this.objects = MaxPerTick; this.triangles = ""; - this.texture = "Individual"; - this.particleRender = false; + this.texture = "Sprite Sheet"; + this.directDraw = true; this.allowWebGL = true; this.more = handleRelease; // add event listener for down @@ -113,7 +113,7 @@ propsFolder.open(); propsFolder.add(guiProps, "texture", ["Individual", "Sprite Sheet"]).onChange(toggleEffect); propsFolder.add(guiProps, "allowWebGL").onChange(toggleEffect); - //propParticle = propsFolder.add(guiProps, "particleRender").onChange(toggleEffect); + propsFolder.add(guiProps, "directDraw").onChange(toggleEffect); gui.add(guiProps, "reset"); @@ -187,8 +187,9 @@ canvas.width = CANVAS_WIDTH; canvas.height = CANVAS_HEIGHT; if(guiProps.allowWebGL) { + //debugger; // we know we wont be unloading textures, so turn off the cleanup routine to get maximum speed - stage = new createjs.StageGL(canvas, {autoPurge: -1}); + stage = new createjs.StageGL(canvas, {autoPurge: -1, directDraw: guiProps.directDraw}); stage.setClearColor(0x000000); } else { stage = new createjs.Stage(canvas); diff --git a/src/easeljs/display/StageGL.js b/src/easeljs/display/StageGL.js index 5522ee793..e4550d602 100644 --- a/src/easeljs/display/StageGL.js +++ b/src/easeljs/display/StageGL.js @@ -211,7 +211,7 @@ this.createjs = this.createjs||{}; * @type {Boolean} * @default false */ - this._directDraw = directDraw === undefined ? true : false; + this._directDraw = directDraw === undefined ? true : (!!directDraw); /** * The width in px of the drawing surface saved in memory. @@ -1276,6 +1276,8 @@ this.createjs = this.createjs||{}; gl.enable(gl.BLEND); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); gl.clearColor(0.0, 0.0, 0.0, 0); + gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD); + gl.blendFuncSeparate(gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); this._createBuffers(); this._initMaterials(); @@ -2427,7 +2429,7 @@ this.createjs = this.createjs||{}; this._activeShader = this._mainShader; gl.bindFramebuffer(gl.FRAMEBUFFER, this._batchTextureOutput._frameBuffer); - gl.clear(gl.COLOR_BUFFER_BIT); + if(this._batchTextureOutput._frameBuffer !== null) { gl.clear(gl.COLOR_BUFFER_BIT); } this._appendToBatch(content, new createjs.Matrix2D(), this.alpha, ignoreCache); @@ -2543,7 +2545,7 @@ this.createjs = this.createjs||{}; item._updateState(); } - if(!ignoreCache && item.cacheCanvas === null && item.filters !== null && item.filters.length) { + if(!this._directDraw && (!ignoreCache && item.cacheCanvas === null && item.filters !== null && item.filters.length)) { var bounds; if (item.bitmapCache === null) { bounds = item.getBounds();