Skip to content

Commit 27426dd

Browse files
committed
Testing RenderTextures (currently broken, will fix next week)
1 parent 0ff08a2 commit 27426dd

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/gameobjects/rendertexture/RenderTextureWebGLRenderer.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ var RenderTextureWebGLRenderer = function (renderer, src, interpolationPercentag
2727
var width = frame.width;
2828
var height = frame.height;
2929
var getTint = Utils.getTintAppendFloatAlpha;
30+
var pipeline = src.pipeline;
3031

31-
this.pipeline.batchTexture(
32+
// var textureUnit = pipeline.setTexture2D(frame.glTexture);
33+
34+
pipeline.batchTexture(
3235
src,
3336
frame.glTexture,
3437
width, height,
@@ -51,7 +54,7 @@ var RenderTextureWebGLRenderer = function (renderer, src, interpolationPercentag
5154
);
5255

5356
// Force clear the current texture so that items next in the batch (like Graphics) don't try and use it
54-
renderer.setBlankTexture(true);
57+
// renderer.setBlankTexture(true);
5558
};
5659

5760
module.exports = RenderTextureWebGLRenderer;

src/renderer/webgl/pipelines/TextureTintPipeline.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,16 @@ var TextureTintPipeline = new Class({
360360
* @since 3.1.0
361361
*
362362
* @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch. If not given uses blankTexture.
363+
*
364+
* @return {number} The assigned texture unit.
363365
*/
364366
setTexture2D: function (texture)
365367
{
366368
if (texture === undefined) { texture = this.renderer.blankTexture.glTexture; }
367369

368370
this.currentUnit = this.renderer.setTexture2D(texture);
371+
372+
return this.currentUnit;
369373
},
370374

371375
/**

0 commit comments

Comments
 (0)