excaliburjs / Excalibur

🎮 Your friendly TypeScript 2D game engine for the web 🗡️
https://excaliburjs.com
BSD 2-Clause "Simplified" License
1.83k stars 192 forks source link

Docs: Improve documentation for shaders #3065

Closed KokoDoko closed 6 months ago

KokoDoko commented 6 months ago

Context

The documentation page for post processors : https://excaliburjs.com/docs/postprocessors doesn't seem complete.

The examples for colorblindness work

There is an example for a grayscale shader, but this is missing information on how to implement the grayscale shader. If you just copy the colorblindness example and replace the colorblindness shader with the grayscale shader, it doesn't work.

const gray = new GrayScalePostProcessor();
game.graphicsContext.addPostProcessor(gray);

🚨 error: getShader() is not defined.

Proposal

Include code that explains how to implement the grayscale shader

eonarheim commented 6 months ago

@KokoDoko Totally agree!