Hi, i have a simple “grayscale” shader as follows:
var gray = `
#define SHADER_NAME GRAY_SHADER
precision mediump float;
uniform sampler2D uMainSampler;
varying vec2 outTexCoord;
varying float outTintEffect;
varying vec4 outTint;
void main() {
vec4 color = texture2D(uMainSampler, outTexCoord);
float c = color.r*0.3+color.g*0.4+color.b*0.3;
gl_FragColor = vec4(c,c,c,color.a);
}`;
and in my preload():
this.gray = new Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline({
game:this.scene.game,
renderer:this.scene.game.renderer,
fragShader:gray
});
this.scene.game.renderer.addPipeline(“gray”, this.gray);
and in my create(), i add one sprite and one graphics:
var g = this.scene.add.graphics();
g.clear();
g.fillStyle(0xff000000);
g.fillRect(0, 0, this.width, this.height);
var img = this.scene.add.sprite(0, 0, “someImageKey”);
img.setPipeline(“gray”);
When I run this, graphics doesn’t show. If I comment out img.setPipeline(“gray”), the graphics shows up fine. Is this a bug?
gabe