Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = ({ hyperTerm, xTerm }) => {
return {
pass: new EffectPass(null, new Effect(
'vt220',
readFileSync(resolve(__dirname, '../../glsl/vt220.glsl')).toString(),
{ blendFunction: BlendFunction.NORMAL },
)),
coordinateTransform: function(x, y) {
let r = 4;
x = (x - 0.5) * 2;
y = (y - 0.5) * 2;
x = r * x / Math.sqrt(r * r - x * x - y * y) * (0.465 / 0.4);
y = r * y / Math.sqrt(r * r - x * x - y * y) * (0.473 / 0.4);
x = x / 2 + 0.5;
y = y / 2 + 0.5;;
return [x, y];
},
};
};
module.exports = ({ hyperTerm, xTerm }) => {
return {
pass: new EffectPass(null, new Effect(
'mattias-crt',
readFileSync(resolve(__dirname, '../../glsl/mattias-crt.glsl')).toString(),
{ blendFunction: BlendFunction.NORMAL },
)),
coordinateTransform: function(x, y) {
x = (x - 0.5) * 2;
y = (y - 0.5) * 2;
x *= 1.1 + Math.pow(x / 6, 2);
y *= 1.1 + Math.pow(y / 6, 2);
x = x / 2 + 0.5;
y = y / 2 + 0.5;
x = x * 0.91 + 0.045;
y = y * 0.91 + 0.045;
return [x, y];
},