phaser icon indicating copy to clipboard operation
phaser copied to clipboard

RenderTexture draw

Open TadejZupancic opened this issue 8 years ago • 1 comments

Version

  • Phaser Version:

3.15.0 Beta 1

  • Operating system:

Windows 7

  • Browser:

Description

If an Ellipse shape is drawn to a RenderTexture and this RenderTexture is saved, the saved texture looks different than the original Ellipse shape. If I turn off antialiasing, they look the same, so probably antialiasing is not used when drawing to texture.

Example Test Code

var r1 = this.add.ellipse(200, 200, 80, 80, 0x6666ff);

var rt = this.make.renderTexture({ width: 100, height: 100 }, false);
rt.draw(r1, 50, 50);
rt.saveTexture('ellipse');

this.add.image(200, 300, 'ellipse');

Additional Information


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

TadejZupancic avatar Oct 05 '18 13:10 TadejZupancic

This is because in WebGL1 FrameBuffers (which is what a RenderTexture uses internally) don't support anti-aliasing. The only work-around is to create an ellipse brush in Photoshop and draw it as a Sprite, or don't use a Render Texture.

photonstorm avatar Jan 24 '19 14:01 photonstorm