Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions VERSIONS.txt
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
9 changes: 5 additions & 4 deletions examples/WebGL/Benchmark.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -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);
Expand Down
8 changes: 5 additions & 3 deletions src/easeljs/display/StageGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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();
Expand Down