# Custom shader on camera flipY

**URL:** <https://phaser.discourse.group/t/custom-shader-on-camera-flipy/6435>\
**Category:** Phaser 3\
**Created:** [May 25, 2020, 4:26pm UTC](https://phaser.discourse.group/t/custom-shader-on-camera-flipy/6435 "2020-05-25T16:26:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabriel\_Cho](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/gabriel_cho/32/1327_2.png) [@Gabriel\_Cho](https://phaser.discourse.group/u/Gabriel_Cho)\
**Post date:** [May 25, 2020, 4:26pm UTC](https://phaser.discourse.group/t/custom-shader-on-camera-flipy/6435/1 "2020-05-25T16:26:21Z")

</div>

Hi, I want to use a custom shader on a sprite object as well as on a camera. But when I do that, the sprite object with a custom shader flips vertically. Copy and paste the following code in the playground (to simplify, i am using Phaser’s TextureTintPipeline shader):

```
var config = {
  type: Phaser.WEBGL,parent: 'phaser-example',width:500,height:500,
  scene: {preload: preload,create: create}
};

var game = new Phaser.Game(config);
function preload() {
  this.load.image('atari', 'assets/sprites/atari400.png');
  this.game.renderer.addPipeline("custom",
  new Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline({
    game:game,
    renderer:game.renderer
  }));
}

function create() {
  this.add.sprite(150, 100, 'atari').setPipeline('custom')
  this.add.sprite(350,100,"atari")
  this.cameras.main.setRenderToTexture("custom");
}

```

 ![image](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/3/300b00982af523e2967de51c739ad630ee582919.png)

As you can see the sprite on the left is flipped. I can “fix” this by flipping Y on the main camera and ALL game objects in a scene that aren’t using custom shaders, but this hackish workaround requires me to keep track of all the game objects in the scene myself. Am i missing something? This cannot be an expected behaviour. Thanks.

---

<div class="post-metadata">

**Author:** ![BlunT76](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/blunt76/32/1454_2.png) [@BlunT76](https://phaser.discourse.group/u/BlunT76)\
**Post date:** [May 25, 2020, 8:00pm UTC](https://phaser.discourse.group/t/custom-shader-on-camera-flipy/6435/2 "2020-05-25T20:00:53Z")

</div>

I have the same problem, and fixed it with a shader that only flipY, iterate on all scene childrens and apply this flipY shader if no custom shader on it.
