Reimplement one-hit KO effect
This commit is contained in:
1 parent
5fa7921e41
commit
c62cb27cdb
6 files changed
+76
-16
No files matched your search
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user