This commit is contained in:
2025-01-04 00:34:03 +01:00
parent 41829408dc
commit 0ca14bbc19
18111 changed files with 1871397 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
/**
* A simple shader which purpose is to make the original texture red channel the alpha channel,
* and still keeping channel informations. Used in cunjunction with the AlphaBlurFilterPass and Fog of War.
*/
class FogSamplerShader extends BaseSamplerShader {
/** @override */
static classPluginName = null;
/** @override */
static fragmentShader = `
precision ${PIXI.settings.PRECISION_FRAGMENT} float;
uniform sampler2D sampler;
uniform vec4 tintAlpha;
varying vec2 vUvs;
void main() {
vec4 color = texture2D(sampler, vUvs);
gl_FragColor = vec4(1.0, color.gb, 1.0) * step(0.15, color.r) * tintAlpha;
}`;
}