pokerogue/src/pipelines/invert.ts
2023-11-07 22:23:42 -05:00

27 lines
575 B
TypeScript

import { Game } from "phaser";
const fragShader = `
precision mediump float;
uniform sampler2D uMainSampler;
varying vec2 outTexCoord;
void main()
{
gl_FragColor = 1.0 - texture2D(uMainSampler, outTexCoord);
}
`;
export default class InvertPostFX extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline {
constructor (game: Game) {
super({
game,
name: 'InvertPostFX',
fragShader,
uniforms: [
'uMainSampler'
]
} as Phaser.Types.Renderer.WebGL.WebGLPipelineConfig);
}
}