diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 91a44ea..bf39de6 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -102,6 +102,7 @@ this.boundsPadding = 0; this._localBounds = new PIXI.Rectangle(0,0,1,1); + this.boundsDirty = true; /** * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. @@ -162,7 +163,7 @@ else { this.destroyCachedSprite(); - this.dirty = true; + this.dirty = this.boundsDirty = true; } } @@ -229,7 +230,7 @@ PIXI.Graphics.prototype.lineTo = function(x, y) { this.currentPath.shape.points.push(x, y); - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -279,7 +280,7 @@ } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -335,7 +336,7 @@ dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -381,7 +382,6 @@ { if( points[points.length-2] !== x1 || points[points.length-1] !== y1) { - //console.log(">>") points.push(x1, y1); } } @@ -406,7 +406,7 @@ this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -488,7 +488,7 @@ ( (cTheta * -s) + (sTheta * c) ) * radius + cy); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -625,7 +625,7 @@ this.lineWidth = 0; this.filling = false; - this.dirty = true; + this.dirty = this.boundsDirty = true; this.clearDirty = true; this.graphicsData = []; @@ -821,14 +821,15 @@ // return an empty object if the item is a mask! if(this.isMask)return PIXI.EmptyRectangle; - if(this.dirty) + + if(this.boundsDirty) { this.updateLocalBounds(); - this.webGLDirty = true; - this.cachedSpriteDirty = true; - this.dirty = false; + this.boundsDirty = false; } + + var bounds = this._localBounds; var w0 = bounds.x; @@ -902,6 +903,8 @@ var minY = Infinity; var maxY = -Infinity; + + if(this.graphicsData.length) { var shape, points, x, y, w, h; @@ -1026,6 +1029,7 @@ // now render the graphic.. PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); this._cachedSprite.alpha = this.alpha; + }; /** @@ -1093,7 +1097,7 @@ this.currentPath = data; } - this.dirty = true; + this.dirty = this.boundsDirty = true; return data; }; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 91a44ea..bf39de6 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -102,6 +102,7 @@ this.boundsPadding = 0; this._localBounds = new PIXI.Rectangle(0,0,1,1); + this.boundsDirty = true; /** * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. @@ -162,7 +163,7 @@ else { this.destroyCachedSprite(); - this.dirty = true; + this.dirty = this.boundsDirty = true; } } @@ -229,7 +230,7 @@ PIXI.Graphics.prototype.lineTo = function(x, y) { this.currentPath.shape.points.push(x, y); - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -279,7 +280,7 @@ } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -335,7 +336,7 @@ dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -381,7 +382,6 @@ { if( points[points.length-2] !== x1 || points[points.length-1] !== y1) { - //console.log(">>") points.push(x1, y1); } } @@ -406,7 +406,7 @@ this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -488,7 +488,7 @@ ( (cTheta * -s) + (sTheta * c) ) * radius + cy); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -625,7 +625,7 @@ this.lineWidth = 0; this.filling = false; - this.dirty = true; + this.dirty = this.boundsDirty = true; this.clearDirty = true; this.graphicsData = []; @@ -821,14 +821,15 @@ // return an empty object if the item is a mask! if(this.isMask)return PIXI.EmptyRectangle; - if(this.dirty) + + if(this.boundsDirty) { this.updateLocalBounds(); - this.webGLDirty = true; - this.cachedSpriteDirty = true; - this.dirty = false; + this.boundsDirty = false; } + + var bounds = this._localBounds; var w0 = bounds.x; @@ -902,6 +903,8 @@ var minY = Infinity; var maxY = -Infinity; + + if(this.graphicsData.length) { var shape, points, x, y, w, h; @@ -1026,6 +1029,7 @@ // now render the graphic.. PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); this._cachedSprite.alpha = this.alpha; + }; /** @@ -1093,7 +1097,7 @@ this.currentPath = data; } - this.dirty = true; + this.dirty = this.boundsDirty = true; return data; }; diff --git a/src/pixi/renderers/webgl/WebGLRenderer.js b/src/pixi/renderers/webgl/WebGLRenderer.js index 02b30e4..82dbc05 100644 --- a/src/pixi/renderers/webgl/WebGLRenderer.js +++ b/src/pixi/renderers/webgl/WebGLRenderer.js @@ -224,6 +224,7 @@ this.renderSession.stencilManager = this.stencilManager; this.renderSession.renderer = this; this.renderSession.resolution = this.resolution; + this.renderSession.buffer = null; // time init the context.. this.initContext(); @@ -356,6 +357,9 @@ // reset the render session data.. this.renderSession.drawCount = 0; + // set the buffer ref.. + this.renderSession.buffer = buffer; + // make sure to flip the Y if using a render texture.. this.renderSession.flipY = buffer ? -1 : 1; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 91a44ea..bf39de6 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -102,6 +102,7 @@ this.boundsPadding = 0; this._localBounds = new PIXI.Rectangle(0,0,1,1); + this.boundsDirty = true; /** * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. @@ -162,7 +163,7 @@ else { this.destroyCachedSprite(); - this.dirty = true; + this.dirty = this.boundsDirty = true; } } @@ -229,7 +230,7 @@ PIXI.Graphics.prototype.lineTo = function(x, y) { this.currentPath.shape.points.push(x, y); - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -279,7 +280,7 @@ } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -335,7 +336,7 @@ dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -381,7 +382,6 @@ { if( points[points.length-2] !== x1 || points[points.length-1] !== y1) { - //console.log(">>") points.push(x1, y1); } } @@ -406,7 +406,7 @@ this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -488,7 +488,7 @@ ( (cTheta * -s) + (sTheta * c) ) * radius + cy); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -625,7 +625,7 @@ this.lineWidth = 0; this.filling = false; - this.dirty = true; + this.dirty = this.boundsDirty = true; this.clearDirty = true; this.graphicsData = []; @@ -821,14 +821,15 @@ // return an empty object if the item is a mask! if(this.isMask)return PIXI.EmptyRectangle; - if(this.dirty) + + if(this.boundsDirty) { this.updateLocalBounds(); - this.webGLDirty = true; - this.cachedSpriteDirty = true; - this.dirty = false; + this.boundsDirty = false; } + + var bounds = this._localBounds; var w0 = bounds.x; @@ -902,6 +903,8 @@ var minY = Infinity; var maxY = -Infinity; + + if(this.graphicsData.length) { var shape, points, x, y, w, h; @@ -1026,6 +1029,7 @@ // now render the graphic.. PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); this._cachedSprite.alpha = this.alpha; + }; /** @@ -1093,7 +1097,7 @@ this.currentPath = data; } - this.dirty = true; + this.dirty = this.boundsDirty = true; return data; }; diff --git a/src/pixi/renderers/webgl/WebGLRenderer.js b/src/pixi/renderers/webgl/WebGLRenderer.js index 02b30e4..82dbc05 100644 --- a/src/pixi/renderers/webgl/WebGLRenderer.js +++ b/src/pixi/renderers/webgl/WebGLRenderer.js @@ -224,6 +224,7 @@ this.renderSession.stencilManager = this.stencilManager; this.renderSession.renderer = this; this.renderSession.resolution = this.resolution; + this.renderSession.buffer = null; // time init the context.. this.initContext(); @@ -356,6 +357,9 @@ // reset the render session data.. this.renderSession.drawCount = 0; + // set the buffer ref.. + this.renderSession.buffer = buffer; + // make sure to flip the Y if using a render texture.. this.renderSession.flipY = buffer ? -1 : 1; diff --git a/src/pixi/renderers/webgl/shaders/PixiShader.js b/src/pixi/renderers/webgl/shaders/PixiShader.js index e70be7f..d9aab0e 100644 --- a/src/pixi/renderers/webgl/shaders/PixiShader.js +++ b/src/pixi/renderers/webgl/shaders/PixiShader.js @@ -98,12 +98,14 @@ this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); this.dimensions = gl.getUniformLocation(program, 'dimensions'); + this.flipY = gl.getUniformLocation(program, 'flipY'); // get and store the attributes this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); this.colorAttribute = gl.getAttribLocation(program, 'aColor'); + // Begin worst hack eva // // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? @@ -373,16 +375,17 @@ 'attribute vec2 aTextureCoord;', 'attribute vec4 aColor;', + 'uniform float flipY;', + 'uniform vec2 projectionVector;', 'uniform vec2 offsetVector;', 'varying vec2 vTextureCoord;', 'varying vec4 vColor;', - 'const vec2 center = vec2(-1.0, 1.0);', - 'void main(void) {', - ' gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);', + ' vec2 finalV = aVertexPosition + offsetVector;', + ' gl_Position = vec4( finalV.x / projectionVector.x -1.0, (finalV.y / projectionVector.y * +flipY ) + flipY , 0.0, 1.0);', ' vTextureCoord = aTextureCoord;', ' vColor = vec4(aColor.rgb * aColor.a, aColor.a);', '}' diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 91a44ea..bf39de6 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -102,6 +102,7 @@ this.boundsPadding = 0; this._localBounds = new PIXI.Rectangle(0,0,1,1); + this.boundsDirty = true; /** * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. @@ -162,7 +163,7 @@ else { this.destroyCachedSprite(); - this.dirty = true; + this.dirty = this.boundsDirty = true; } } @@ -229,7 +230,7 @@ PIXI.Graphics.prototype.lineTo = function(x, y) { this.currentPath.shape.points.push(x, y); - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -279,7 +280,7 @@ } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -335,7 +336,7 @@ dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -381,7 +382,6 @@ { if( points[points.length-2] !== x1 || points[points.length-1] !== y1) { - //console.log(">>") points.push(x1, y1); } } @@ -406,7 +406,7 @@ this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -488,7 +488,7 @@ ( (cTheta * -s) + (sTheta * c) ) * radius + cy); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -625,7 +625,7 @@ this.lineWidth = 0; this.filling = false; - this.dirty = true; + this.dirty = this.boundsDirty = true; this.clearDirty = true; this.graphicsData = []; @@ -821,14 +821,15 @@ // return an empty object if the item is a mask! if(this.isMask)return PIXI.EmptyRectangle; - if(this.dirty) + + if(this.boundsDirty) { this.updateLocalBounds(); - this.webGLDirty = true; - this.cachedSpriteDirty = true; - this.dirty = false; + this.boundsDirty = false; } + + var bounds = this._localBounds; var w0 = bounds.x; @@ -902,6 +903,8 @@ var minY = Infinity; var maxY = -Infinity; + + if(this.graphicsData.length) { var shape, points, x, y, w, h; @@ -1026,6 +1029,7 @@ // now render the graphic.. PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); this._cachedSprite.alpha = this.alpha; + }; /** @@ -1093,7 +1097,7 @@ this.currentPath = data; } - this.dirty = true; + this.dirty = this.boundsDirty = true; return data; }; diff --git a/src/pixi/renderers/webgl/WebGLRenderer.js b/src/pixi/renderers/webgl/WebGLRenderer.js index 02b30e4..82dbc05 100644 --- a/src/pixi/renderers/webgl/WebGLRenderer.js +++ b/src/pixi/renderers/webgl/WebGLRenderer.js @@ -224,6 +224,7 @@ this.renderSession.stencilManager = this.stencilManager; this.renderSession.renderer = this; this.renderSession.resolution = this.resolution; + this.renderSession.buffer = null; // time init the context.. this.initContext(); @@ -356,6 +357,9 @@ // reset the render session data.. this.renderSession.drawCount = 0; + // set the buffer ref.. + this.renderSession.buffer = buffer; + // make sure to flip the Y if using a render texture.. this.renderSession.flipY = buffer ? -1 : 1; diff --git a/src/pixi/renderers/webgl/shaders/PixiShader.js b/src/pixi/renderers/webgl/shaders/PixiShader.js index e70be7f..d9aab0e 100644 --- a/src/pixi/renderers/webgl/shaders/PixiShader.js +++ b/src/pixi/renderers/webgl/shaders/PixiShader.js @@ -98,12 +98,14 @@ this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); this.dimensions = gl.getUniformLocation(program, 'dimensions'); + this.flipY = gl.getUniformLocation(program, 'flipY'); // get and store the attributes this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); this.colorAttribute = gl.getAttribLocation(program, 'aColor'); + // Begin worst hack eva // // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? @@ -373,16 +375,17 @@ 'attribute vec2 aTextureCoord;', 'attribute vec4 aColor;', + 'uniform float flipY;', + 'uniform vec2 projectionVector;', 'uniform vec2 offsetVector;', 'varying vec2 vTextureCoord;', 'varying vec4 vColor;', - 'const vec2 center = vec2(-1.0, 1.0);', - 'void main(void) {', - ' gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);', + ' vec2 finalV = aVertexPosition + offsetVector;', + ' gl_Position = vec4( finalV.x / projectionVector.x -1.0, (finalV.y / projectionVector.y * +flipY ) + flipY , 0.0, 1.0);', ' vTextureCoord = aTextureCoord;', ' vColor = vec4(aColor.rgb * aColor.a, aColor.a);', '}' diff --git a/src/pixi/renderers/webgl/utils/WebGLFilterManager.js b/src/pixi/renderers/webgl/utils/WebGLFilterManager.js index ddc4691..ba642c3 100644 --- a/src/pixi/renderers/webgl/utils/WebGLFilterManager.js +++ b/src/pixi/renderers/webgl/utils/WebGLFilterManager.js @@ -346,6 +346,8 @@ gl.uniform2f(shader.projectionVector, width/2, -height/2); gl.uniform2f(shader.offsetVector, 0,0); + gl.uniform1f(shader.flipY, this.renderSession.flipY); + if(filter.uniforms.dimensions) { filter.uniforms.dimensions.value[0] = this.width;//width; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 91a44ea..bf39de6 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -102,6 +102,7 @@ this.boundsPadding = 0; this._localBounds = new PIXI.Rectangle(0,0,1,1); + this.boundsDirty = true; /** * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. @@ -162,7 +163,7 @@ else { this.destroyCachedSprite(); - this.dirty = true; + this.dirty = this.boundsDirty = true; } } @@ -229,7 +230,7 @@ PIXI.Graphics.prototype.lineTo = function(x, y) { this.currentPath.shape.points.push(x, y); - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -279,7 +280,7 @@ } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -335,7 +336,7 @@ dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -381,7 +382,6 @@ { if( points[points.length-2] !== x1 || points[points.length-1] !== y1) { - //console.log(">>") points.push(x1, y1); } } @@ -406,7 +406,7 @@ this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -488,7 +488,7 @@ ( (cTheta * -s) + (sTheta * c) ) * radius + cy); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -625,7 +625,7 @@ this.lineWidth = 0; this.filling = false; - this.dirty = true; + this.dirty = this.boundsDirty = true; this.clearDirty = true; this.graphicsData = []; @@ -821,14 +821,15 @@ // return an empty object if the item is a mask! if(this.isMask)return PIXI.EmptyRectangle; - if(this.dirty) + + if(this.boundsDirty) { this.updateLocalBounds(); - this.webGLDirty = true; - this.cachedSpriteDirty = true; - this.dirty = false; + this.boundsDirty = false; } + + var bounds = this._localBounds; var w0 = bounds.x; @@ -902,6 +903,8 @@ var minY = Infinity; var maxY = -Infinity; + + if(this.graphicsData.length) { var shape, points, x, y, w, h; @@ -1026,6 +1029,7 @@ // now render the graphic.. PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); this._cachedSprite.alpha = this.alpha; + }; /** @@ -1093,7 +1097,7 @@ this.currentPath = data; } - this.dirty = true; + this.dirty = this.boundsDirty = true; return data; }; diff --git a/src/pixi/renderers/webgl/WebGLRenderer.js b/src/pixi/renderers/webgl/WebGLRenderer.js index 02b30e4..82dbc05 100644 --- a/src/pixi/renderers/webgl/WebGLRenderer.js +++ b/src/pixi/renderers/webgl/WebGLRenderer.js @@ -224,6 +224,7 @@ this.renderSession.stencilManager = this.stencilManager; this.renderSession.renderer = this; this.renderSession.resolution = this.resolution; + this.renderSession.buffer = null; // time init the context.. this.initContext(); @@ -356,6 +357,9 @@ // reset the render session data.. this.renderSession.drawCount = 0; + // set the buffer ref.. + this.renderSession.buffer = buffer; + // make sure to flip the Y if using a render texture.. this.renderSession.flipY = buffer ? -1 : 1; diff --git a/src/pixi/renderers/webgl/shaders/PixiShader.js b/src/pixi/renderers/webgl/shaders/PixiShader.js index e70be7f..d9aab0e 100644 --- a/src/pixi/renderers/webgl/shaders/PixiShader.js +++ b/src/pixi/renderers/webgl/shaders/PixiShader.js @@ -98,12 +98,14 @@ this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); this.dimensions = gl.getUniformLocation(program, 'dimensions'); + this.flipY = gl.getUniformLocation(program, 'flipY'); // get and store the attributes this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); this.colorAttribute = gl.getAttribLocation(program, 'aColor'); + // Begin worst hack eva // // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? @@ -373,16 +375,17 @@ 'attribute vec2 aTextureCoord;', 'attribute vec4 aColor;', + 'uniform float flipY;', + 'uniform vec2 projectionVector;', 'uniform vec2 offsetVector;', 'varying vec2 vTextureCoord;', 'varying vec4 vColor;', - 'const vec2 center = vec2(-1.0, 1.0);', - 'void main(void) {', - ' gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);', + ' vec2 finalV = aVertexPosition + offsetVector;', + ' gl_Position = vec4( finalV.x / projectionVector.x -1.0, (finalV.y / projectionVector.y * +flipY ) + flipY , 0.0, 1.0);', ' vTextureCoord = aTextureCoord;', ' vColor = vec4(aColor.rgb * aColor.a, aColor.a);', '}' diff --git a/src/pixi/renderers/webgl/utils/WebGLFilterManager.js b/src/pixi/renderers/webgl/utils/WebGLFilterManager.js index ddc4691..ba642c3 100644 --- a/src/pixi/renderers/webgl/utils/WebGLFilterManager.js +++ b/src/pixi/renderers/webgl/utils/WebGLFilterManager.js @@ -346,6 +346,8 @@ gl.uniform2f(shader.projectionVector, width/2, -height/2); gl.uniform2f(shader.offsetVector, 0,0); + gl.uniform1f(shader.flipY, this.renderSession.flipY); + if(filter.uniforms.dimensions) { filter.uniforms.dimensions.value[0] = this.width;//width; diff --git a/src/pixi/renderers/webgl/utils/WebGLGraphics.js b/src/pixi/renderers/webgl/utils/WebGLGraphics.js index 710383c..6ec74a8 100644 --- a/src/pixi/renderers/webgl/utils/WebGLGraphics.js +++ b/src/pixi/renderers/webgl/utils/WebGLGraphics.js @@ -61,8 +61,8 @@ shader = renderSession.shaderManager.primitiveShader; gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - gl.uniform1f(shader.flipY, 1); - + gl.uniform1f(shader.flipY, renderSession.flipY); + gl.uniform2f(shader.projectionVector, projection.x, -projection.y); gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 91a44ea..bf39de6 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -102,6 +102,7 @@ this.boundsPadding = 0; this._localBounds = new PIXI.Rectangle(0,0,1,1); + this.boundsDirty = true; /** * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. @@ -162,7 +163,7 @@ else { this.destroyCachedSprite(); - this.dirty = true; + this.dirty = this.boundsDirty = true; } } @@ -229,7 +230,7 @@ PIXI.Graphics.prototype.lineTo = function(x, y) { this.currentPath.shape.points.push(x, y); - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -279,7 +280,7 @@ } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -335,7 +336,7 @@ dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -381,7 +382,6 @@ { if( points[points.length-2] !== x1 || points[points.length-1] !== y1) { - //console.log(">>") points.push(x1, y1); } } @@ -406,7 +406,7 @@ this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -488,7 +488,7 @@ ( (cTheta * -s) + (sTheta * c) ) * radius + cy); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -625,7 +625,7 @@ this.lineWidth = 0; this.filling = false; - this.dirty = true; + this.dirty = this.boundsDirty = true; this.clearDirty = true; this.graphicsData = []; @@ -821,14 +821,15 @@ // return an empty object if the item is a mask! if(this.isMask)return PIXI.EmptyRectangle; - if(this.dirty) + + if(this.boundsDirty) { this.updateLocalBounds(); - this.webGLDirty = true; - this.cachedSpriteDirty = true; - this.dirty = false; + this.boundsDirty = false; } + + var bounds = this._localBounds; var w0 = bounds.x; @@ -902,6 +903,8 @@ var minY = Infinity; var maxY = -Infinity; + + if(this.graphicsData.length) { var shape, points, x, y, w, h; @@ -1026,6 +1029,7 @@ // now render the graphic.. PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); this._cachedSprite.alpha = this.alpha; + }; /** @@ -1093,7 +1097,7 @@ this.currentPath = data; } - this.dirty = true; + this.dirty = this.boundsDirty = true; return data; }; diff --git a/src/pixi/renderers/webgl/WebGLRenderer.js b/src/pixi/renderers/webgl/WebGLRenderer.js index 02b30e4..82dbc05 100644 --- a/src/pixi/renderers/webgl/WebGLRenderer.js +++ b/src/pixi/renderers/webgl/WebGLRenderer.js @@ -224,6 +224,7 @@ this.renderSession.stencilManager = this.stencilManager; this.renderSession.renderer = this; this.renderSession.resolution = this.resolution; + this.renderSession.buffer = null; // time init the context.. this.initContext(); @@ -356,6 +357,9 @@ // reset the render session data.. this.renderSession.drawCount = 0; + // set the buffer ref.. + this.renderSession.buffer = buffer; + // make sure to flip the Y if using a render texture.. this.renderSession.flipY = buffer ? -1 : 1; diff --git a/src/pixi/renderers/webgl/shaders/PixiShader.js b/src/pixi/renderers/webgl/shaders/PixiShader.js index e70be7f..d9aab0e 100644 --- a/src/pixi/renderers/webgl/shaders/PixiShader.js +++ b/src/pixi/renderers/webgl/shaders/PixiShader.js @@ -98,12 +98,14 @@ this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); this.dimensions = gl.getUniformLocation(program, 'dimensions'); + this.flipY = gl.getUniformLocation(program, 'flipY'); // get and store the attributes this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); this.colorAttribute = gl.getAttribLocation(program, 'aColor'); + // Begin worst hack eva // // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? @@ -373,16 +375,17 @@ 'attribute vec2 aTextureCoord;', 'attribute vec4 aColor;', + 'uniform float flipY;', + 'uniform vec2 projectionVector;', 'uniform vec2 offsetVector;', 'varying vec2 vTextureCoord;', 'varying vec4 vColor;', - 'const vec2 center = vec2(-1.0, 1.0);', - 'void main(void) {', - ' gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);', + ' vec2 finalV = aVertexPosition + offsetVector;', + ' gl_Position = vec4( finalV.x / projectionVector.x -1.0, (finalV.y / projectionVector.y * +flipY ) + flipY , 0.0, 1.0);', ' vTextureCoord = aTextureCoord;', ' vColor = vec4(aColor.rgb * aColor.a, aColor.a);', '}' diff --git a/src/pixi/renderers/webgl/utils/WebGLFilterManager.js b/src/pixi/renderers/webgl/utils/WebGLFilterManager.js index ddc4691..ba642c3 100644 --- a/src/pixi/renderers/webgl/utils/WebGLFilterManager.js +++ b/src/pixi/renderers/webgl/utils/WebGLFilterManager.js @@ -346,6 +346,8 @@ gl.uniform2f(shader.projectionVector, width/2, -height/2); gl.uniform2f(shader.offsetVector, 0,0); + gl.uniform1f(shader.flipY, this.renderSession.flipY); + if(filter.uniforms.dimensions) { filter.uniforms.dimensions.value[0] = this.width;//width; diff --git a/src/pixi/renderers/webgl/utils/WebGLGraphics.js b/src/pixi/renderers/webgl/utils/WebGLGraphics.js index 710383c..6ec74a8 100644 --- a/src/pixi/renderers/webgl/utils/WebGLGraphics.js +++ b/src/pixi/renderers/webgl/utils/WebGLGraphics.js @@ -61,8 +61,8 @@ shader = renderSession.shaderManager.primitiveShader; gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - gl.uniform1f(shader.flipY, 1); - + gl.uniform1f(shader.flipY, renderSession.flipY); + gl.uniform2f(shader.projectionVector, projection.x, -projection.y); gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); diff --git a/src/pixi/renderers/webgl/utils/WebGLShaderManager.js b/src/pixi/renderers/webgl/utils/WebGLShaderManager.js index a15974e..168e4ac 100644 --- a/src/pixi/renderers/webgl/utils/WebGLShaderManager.js +++ b/src/pixi/renderers/webgl/utils/WebGLShaderManager.js @@ -127,6 +127,7 @@ this.currentShader = shader; this.gl.useProgram(shader.program); + this.setAttribs(shader.attributes); return true; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 91a44ea..bf39de6 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -102,6 +102,7 @@ this.boundsPadding = 0; this._localBounds = new PIXI.Rectangle(0,0,1,1); + this.boundsDirty = true; /** * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. @@ -162,7 +163,7 @@ else { this.destroyCachedSprite(); - this.dirty = true; + this.dirty = this.boundsDirty = true; } } @@ -229,7 +230,7 @@ PIXI.Graphics.prototype.lineTo = function(x, y) { this.currentPath.shape.points.push(x, y); - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -279,7 +280,7 @@ } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -335,7 +336,7 @@ dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -381,7 +382,6 @@ { if( points[points.length-2] !== x1 || points[points.length-1] !== y1) { - //console.log(">>") points.push(x1, y1); } } @@ -406,7 +406,7 @@ this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -488,7 +488,7 @@ ( (cTheta * -s) + (sTheta * c) ) * radius + cy); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -625,7 +625,7 @@ this.lineWidth = 0; this.filling = false; - this.dirty = true; + this.dirty = this.boundsDirty = true; this.clearDirty = true; this.graphicsData = []; @@ -821,14 +821,15 @@ // return an empty object if the item is a mask! if(this.isMask)return PIXI.EmptyRectangle; - if(this.dirty) + + if(this.boundsDirty) { this.updateLocalBounds(); - this.webGLDirty = true; - this.cachedSpriteDirty = true; - this.dirty = false; + this.boundsDirty = false; } + + var bounds = this._localBounds; var w0 = bounds.x; @@ -902,6 +903,8 @@ var minY = Infinity; var maxY = -Infinity; + + if(this.graphicsData.length) { var shape, points, x, y, w, h; @@ -1026,6 +1029,7 @@ // now render the graphic.. PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); this._cachedSprite.alpha = this.alpha; + }; /** @@ -1093,7 +1097,7 @@ this.currentPath = data; } - this.dirty = true; + this.dirty = this.boundsDirty = true; return data; }; diff --git a/src/pixi/renderers/webgl/WebGLRenderer.js b/src/pixi/renderers/webgl/WebGLRenderer.js index 02b30e4..82dbc05 100644 --- a/src/pixi/renderers/webgl/WebGLRenderer.js +++ b/src/pixi/renderers/webgl/WebGLRenderer.js @@ -224,6 +224,7 @@ this.renderSession.stencilManager = this.stencilManager; this.renderSession.renderer = this; this.renderSession.resolution = this.resolution; + this.renderSession.buffer = null; // time init the context.. this.initContext(); @@ -356,6 +357,9 @@ // reset the render session data.. this.renderSession.drawCount = 0; + // set the buffer ref.. + this.renderSession.buffer = buffer; + // make sure to flip the Y if using a render texture.. this.renderSession.flipY = buffer ? -1 : 1; diff --git a/src/pixi/renderers/webgl/shaders/PixiShader.js b/src/pixi/renderers/webgl/shaders/PixiShader.js index e70be7f..d9aab0e 100644 --- a/src/pixi/renderers/webgl/shaders/PixiShader.js +++ b/src/pixi/renderers/webgl/shaders/PixiShader.js @@ -98,12 +98,14 @@ this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); this.dimensions = gl.getUniformLocation(program, 'dimensions'); + this.flipY = gl.getUniformLocation(program, 'flipY'); // get and store the attributes this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); this.colorAttribute = gl.getAttribLocation(program, 'aColor'); + // Begin worst hack eva // // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? @@ -373,16 +375,17 @@ 'attribute vec2 aTextureCoord;', 'attribute vec4 aColor;', + 'uniform float flipY;', + 'uniform vec2 projectionVector;', 'uniform vec2 offsetVector;', 'varying vec2 vTextureCoord;', 'varying vec4 vColor;', - 'const vec2 center = vec2(-1.0, 1.0);', - 'void main(void) {', - ' gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);', + ' vec2 finalV = aVertexPosition + offsetVector;', + ' gl_Position = vec4( finalV.x / projectionVector.x -1.0, (finalV.y / projectionVector.y * +flipY ) + flipY , 0.0, 1.0);', ' vTextureCoord = aTextureCoord;', ' vColor = vec4(aColor.rgb * aColor.a, aColor.a);', '}' diff --git a/src/pixi/renderers/webgl/utils/WebGLFilterManager.js b/src/pixi/renderers/webgl/utils/WebGLFilterManager.js index ddc4691..ba642c3 100644 --- a/src/pixi/renderers/webgl/utils/WebGLFilterManager.js +++ b/src/pixi/renderers/webgl/utils/WebGLFilterManager.js @@ -346,6 +346,8 @@ gl.uniform2f(shader.projectionVector, width/2, -height/2); gl.uniform2f(shader.offsetVector, 0,0); + gl.uniform1f(shader.flipY, this.renderSession.flipY); + if(filter.uniforms.dimensions) { filter.uniforms.dimensions.value[0] = this.width;//width; diff --git a/src/pixi/renderers/webgl/utils/WebGLGraphics.js b/src/pixi/renderers/webgl/utils/WebGLGraphics.js index 710383c..6ec74a8 100644 --- a/src/pixi/renderers/webgl/utils/WebGLGraphics.js +++ b/src/pixi/renderers/webgl/utils/WebGLGraphics.js @@ -61,8 +61,8 @@ shader = renderSession.shaderManager.primitiveShader; gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - gl.uniform1f(shader.flipY, 1); - + gl.uniform1f(shader.flipY, renderSession.flipY); + gl.uniform2f(shader.projectionVector, projection.x, -projection.y); gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); diff --git a/src/pixi/renderers/webgl/utils/WebGLShaderManager.js b/src/pixi/renderers/webgl/utils/WebGLShaderManager.js index a15974e..168e4ac 100644 --- a/src/pixi/renderers/webgl/utils/WebGLShaderManager.js +++ b/src/pixi/renderers/webgl/utils/WebGLShaderManager.js @@ -127,6 +127,7 @@ this.currentShader = shader; this.gl.useProgram(shader.program); + this.setAttribs(shader.attributes); return true; diff --git a/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js b/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js index 711b4da..b4d873b 100755 --- a/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js +++ b/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js @@ -556,6 +556,10 @@ var offsetVector = this.renderSession.offset; gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y); + // set the correct flip.. + gl.uniform1f(shader.flipY, this.renderSession.flipY); + + // set the pointers } } diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 91a44ea..bf39de6 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -102,6 +102,7 @@ this.boundsPadding = 0; this._localBounds = new PIXI.Rectangle(0,0,1,1); + this.boundsDirty = true; /** * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. @@ -162,7 +163,7 @@ else { this.destroyCachedSprite(); - this.dirty = true; + this.dirty = this.boundsDirty = true; } } @@ -229,7 +230,7 @@ PIXI.Graphics.prototype.lineTo = function(x, y) { this.currentPath.shape.points.push(x, y); - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -279,7 +280,7 @@ } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -335,7 +336,7 @@ dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -381,7 +382,6 @@ { if( points[points.length-2] !== x1 || points[points.length-1] !== y1) { - //console.log(">>") points.push(x1, y1); } } @@ -406,7 +406,7 @@ this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -488,7 +488,7 @@ ( (cTheta * -s) + (sTheta * c) ) * radius + cy); } - this.dirty = true; + this.dirty = this.boundsDirty = true; return this; }; @@ -625,7 +625,7 @@ this.lineWidth = 0; this.filling = false; - this.dirty = true; + this.dirty = this.boundsDirty = true; this.clearDirty = true; this.graphicsData = []; @@ -821,14 +821,15 @@ // return an empty object if the item is a mask! if(this.isMask)return PIXI.EmptyRectangle; - if(this.dirty) + + if(this.boundsDirty) { this.updateLocalBounds(); - this.webGLDirty = true; - this.cachedSpriteDirty = true; - this.dirty = false; + this.boundsDirty = false; } + + var bounds = this._localBounds; var w0 = bounds.x; @@ -902,6 +903,8 @@ var minY = Infinity; var maxY = -Infinity; + + if(this.graphicsData.length) { var shape, points, x, y, w, h; @@ -1026,6 +1029,7 @@ // now render the graphic.. PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); this._cachedSprite.alpha = this.alpha; + }; /** @@ -1093,7 +1097,7 @@ this.currentPath = data; } - this.dirty = true; + this.dirty = this.boundsDirty = true; return data; }; diff --git a/src/pixi/renderers/webgl/WebGLRenderer.js b/src/pixi/renderers/webgl/WebGLRenderer.js index 02b30e4..82dbc05 100644 --- a/src/pixi/renderers/webgl/WebGLRenderer.js +++ b/src/pixi/renderers/webgl/WebGLRenderer.js @@ -224,6 +224,7 @@ this.renderSession.stencilManager = this.stencilManager; this.renderSession.renderer = this; this.renderSession.resolution = this.resolution; + this.renderSession.buffer = null; // time init the context.. this.initContext(); @@ -356,6 +357,9 @@ // reset the render session data.. this.renderSession.drawCount = 0; + // set the buffer ref.. + this.renderSession.buffer = buffer; + // make sure to flip the Y if using a render texture.. this.renderSession.flipY = buffer ? -1 : 1; diff --git a/src/pixi/renderers/webgl/shaders/PixiShader.js b/src/pixi/renderers/webgl/shaders/PixiShader.js index e70be7f..d9aab0e 100644 --- a/src/pixi/renderers/webgl/shaders/PixiShader.js +++ b/src/pixi/renderers/webgl/shaders/PixiShader.js @@ -98,12 +98,14 @@ this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); this.dimensions = gl.getUniformLocation(program, 'dimensions'); + this.flipY = gl.getUniformLocation(program, 'flipY'); // get and store the attributes this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); this.colorAttribute = gl.getAttribLocation(program, 'aColor'); + // Begin worst hack eva // // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? @@ -373,16 +375,17 @@ 'attribute vec2 aTextureCoord;', 'attribute vec4 aColor;', + 'uniform float flipY;', + 'uniform vec2 projectionVector;', 'uniform vec2 offsetVector;', 'varying vec2 vTextureCoord;', 'varying vec4 vColor;', - 'const vec2 center = vec2(-1.0, 1.0);', - 'void main(void) {', - ' gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);', + ' vec2 finalV = aVertexPosition + offsetVector;', + ' gl_Position = vec4( finalV.x / projectionVector.x -1.0, (finalV.y / projectionVector.y * +flipY ) + flipY , 0.0, 1.0);', ' vTextureCoord = aTextureCoord;', ' vColor = vec4(aColor.rgb * aColor.a, aColor.a);', '}' diff --git a/src/pixi/renderers/webgl/utils/WebGLFilterManager.js b/src/pixi/renderers/webgl/utils/WebGLFilterManager.js index ddc4691..ba642c3 100644 --- a/src/pixi/renderers/webgl/utils/WebGLFilterManager.js +++ b/src/pixi/renderers/webgl/utils/WebGLFilterManager.js @@ -346,6 +346,8 @@ gl.uniform2f(shader.projectionVector, width/2, -height/2); gl.uniform2f(shader.offsetVector, 0,0); + gl.uniform1f(shader.flipY, this.renderSession.flipY); + if(filter.uniforms.dimensions) { filter.uniforms.dimensions.value[0] = this.width;//width; diff --git a/src/pixi/renderers/webgl/utils/WebGLGraphics.js b/src/pixi/renderers/webgl/utils/WebGLGraphics.js index 710383c..6ec74a8 100644 --- a/src/pixi/renderers/webgl/utils/WebGLGraphics.js +++ b/src/pixi/renderers/webgl/utils/WebGLGraphics.js @@ -61,8 +61,8 @@ shader = renderSession.shaderManager.primitiveShader; gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - gl.uniform1f(shader.flipY, 1); - + gl.uniform1f(shader.flipY, renderSession.flipY); + gl.uniform2f(shader.projectionVector, projection.x, -projection.y); gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); diff --git a/src/pixi/renderers/webgl/utils/WebGLShaderManager.js b/src/pixi/renderers/webgl/utils/WebGLShaderManager.js index a15974e..168e4ac 100644 --- a/src/pixi/renderers/webgl/utils/WebGLShaderManager.js +++ b/src/pixi/renderers/webgl/utils/WebGLShaderManager.js @@ -127,6 +127,7 @@ this.currentShader = shader; this.gl.useProgram(shader.program); + this.setAttribs(shader.attributes); return true; diff --git a/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js b/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js index 711b4da..b4d873b 100755 --- a/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js +++ b/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js @@ -556,6 +556,10 @@ var offsetVector = this.renderSession.offset; gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y); + // set the correct flip.. + gl.uniform1f(shader.flipY, this.renderSession.flipY); + + // set the pointers } } diff --git a/src/pixi/textures/RenderTexture.js b/src/pixi/textures/RenderTexture.js index 37dd7c8..aad895d 100644 --- a/src/pixi/textures/RenderTexture.js +++ b/src/pixi/textures/RenderTexture.js @@ -202,9 +202,7 @@ //Lets create a nice matrix to apply to our display object. Frame buffers come in upside down so we need to flip the matrix var wt = displayObject.worldTransform; wt.identity(); - wt.translate(0, this.projection.y * 2); if(matrix)wt.append(matrix); - wt.scale(1,-1); // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1;