Fixed issue when creating EffectLayer and RenderPass

This commit is contained in:
Felipe Alfonso 2017-06-02 12:27:51 -04:00
parent ea44513fda
commit 9244b271cc
3 changed files with 6 additions and 5 deletions

View file

@ -1,4 +1,4 @@
var CHECKSUM = {
build: '50d8bd90-478a-11e7-9f64-3f061ec2a0e8'
build: '43bc4e80-47b0-11e7-88ab-6b6b368a5071'
};
module.exports = CHECKSUM;

View file

@ -34,7 +34,7 @@ var EffectLayer = new Class({
var pot = ((width & (width - 1)) == 0 && (height & (height - 1)) == 0);
var resourceManager = state.game.renderer.resourceManager;
var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE;
var wrap;
var gl;
this.dstRenderTarget = null;
@ -45,7 +45,7 @@ var EffectLayer = new Class({
if (resourceManager !== undefined)
{
gl = state.game.renderer.gl;
wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE;
this.dstShader = resourceManager.createShader(effectName, {
vert: TexturedAndNormalizedTintedShader.vert,
frag: fragmentShader

View file

@ -37,9 +37,9 @@ var RenderPass = new Class({
var resourceManager = state.game.renderer.resourceManager;
var pot = ((width & (width - 1)) == 0 && (height & (height - 1)) == 0);
var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE;
var gl;
var wrap;
this.renderer = state.game.renderer;
this.passRenderTarget = null;
this.renderTexture = null;
@ -49,6 +49,7 @@ var RenderPass = new Class({
if (resourceManager !== undefined)
{
gl = state.game.renderer.gl;
wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE;
this.passShader = resourceManager.createShader(shaderName, {vert: TexturedAndNormalizedTintedShader.vert, frag: fragmentShader});
this.renderTexture = resourceManager.createTexture(0, gl.LINEAR, gl.LINEAR, wrap, wrap, gl.RGBA, null, width, height);
this.passRenderTarget = resourceManager.createRenderTarget(width, height, this.renderTexture, null);