Applying a shader/effect to the entire canvas/game

I’m working on a game and I’d like to add a CRT screen effect to the graphics (similar to WebGL Fake CRT Effect for HTML5 Games - zachstronaut) but I don’t understand the examples for adding shader pipelines to the camera. Would anyone mind explaining how to apply a shader to the camera?

Had exactly the same problem, tried the same tutorial and gave up :'D So I’m also very interested in a solution with some example code

  1. Register post-fx pipeline
    import PostFxClass from 'path';
    var config = {
        // ...
        pipeline: [PostFxClass]
        // ...
    };
    var game = new Phaser.Game(config);
    
  2. Add post-fx pipeline
    camera.setPostPipeline(PostFxClass);
    

Example

3 Likes