I had an issue recently where I could not rotate or zoom the cameras without the bounds of the camera changing relative to the values when using setRenderToTexture(). The solution is by changing the file:
src/renderer/webgl/WebGLRenderer.js
In this section:
pipeline.batchTexture(
camera,
camera.glTexture,
camera.width, camera.height,
camera.x, camera.y,
camera.width, camera.height,
1, 1, //previously zoom, zoom
0, //previously rotation
camera.flipX, !camera.flipY,
1, 1,
0, 0,
0, 0, camera.width, camera.height,
getTint(camera._tintTL, camera._alphaTL),
getTint(camera._tintTR, camera._alphaTR),
getTint(camera._tintBL, camera._alphaBL),
getTint(camera._tintBR, camera._alphaBR),
(camera._isTinted && camera.tintFill),
0, 0,
this.defaultCamera,
null
);
I had a similar issue with setRenderToTexture and camera zoom. I think (but maybe I'm really wrong because I have little experience with Phaser) that it is applying the camera view matrix twice. One for "objects -> render texture" and another for "render texture -> screen".
The solution you mention worked for me, thanks. But it would be nice maybe to correct this on the master so we don't have to apply the fix manually?
Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.
Can this be released please?
My team needs this fix, and is currently blocked
Patch the fix above into your own build then.
What is holding up the release may I ask?
Most helpful comment
Can this be released please?
My team needs this fix, and is currently blocked