Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.port.postEffects.forEach(e => {
console.log("append effect pass", e);
const renderPass = new RenderPass(this.scene, this.camera);
const pass = new EffectPass(this.camera, e.effect);
pass.renderToScreen = e.renderToScreen;
this.effectComposer.addPass(renderPass);
this.effectComposer.addPass(pass);
});
}
rings: 5,
samples: 5,
showFocus: false,
manualDoF: false,
pentagon: true
});
const bloomEffect = new post_pss.BloomEffect({
blendFunction: post_pss.BlendFunction.ADD,
resolutionScale: 0.5,
distinction: 4.0
});
bloomEffect.blendMode.opacity.value = 2.1;
var bokeh = new post_pss.EffectPass(options.camera, bokehEffect, bloomEffect);
composer.bokeh = bokeh;
composer.addPass(bokeh);
bokeh.renderToScreen = true;
window.bokeh = bokeh;
}
return composer;
}
function coordinateTransform(x, y) {
x -= 0.5;
y -= 0.5;
let dist = screenCurvature * (x*x + y*y);
dist *= 1.0 + dist;
return [x * dist + x + 0.5, y * dist + y + 0.5];
};
return {
passes: [
new POSTPROCESSING.EffectPass(null, burnInEffect),
savePass,
new POSTPROCESSING.EffectPass(null, retroEffect),
new POSTPROCESSING.EffectPass(null, bloomEffect),
new POSTPROCESSING.EffectPass(null, frameEffect),
],
coordinateTransform: coordinateTransform,
};
};
module.exports = ({ hyperTerm, xTerm }) => {
const effect = new Effect(
'chalkEffect',
readFileSync(resolve(__dirname, '../../glsl/chalk.glsl')).toString(),
{
uniforms: new Map([['noiseTexture', new Uniform(null)]])
}
);
new TextureLoader().load(resolve(__dirname, '../../images/noise.png'), texture => {
texture.minFilter = LinearFilter;
effect.uniforms.get('noiseTexture').value = texture;
});
return { pass: new EffectPass(null, effect) };
};
'scaleEffect',
readFileSync(resolve(__dirname, '../../glsl/scale.glsl')).toString(),
{
defines: new Map([['scale', '0.9']])
}
));
effects.push(new Effect(
'sampling',
readFileSync(resolve(__dirname, '../../glsl/sampling.glsl')).toString(),
{
blendFunction: 13
}
));
return { pass: new EffectPass(null, ...effects) };
};
}
);
function coordinateTransform(x, y) {
x -= 0.5;
y -= 0.5;
let dist = screenCurvature * (x*x + y*y);
dist *= 1.0 + dist;
return [x * dist + x + 0.5, y * dist + y + 0.5];
};
return {
passes: [
new POSTPROCESSING.EffectPass(null, burnInEffect),
savePass,
new POSTPROCESSING.EffectPass(null, retroEffect),
new POSTPROCESSING.EffectPass(null, bloomEffect),
new POSTPROCESSING.EffectPass(null, frameEffect),
],
coordinateTransform: coordinateTransform,
};
};
});
*/
//godRaysEffect.dithering = true;
const bloomEffect = new BloomEffect(this._scene, camera, {
width: 240,
height: 240,
luminanceThreshold: 0.2,
});
bloomEffect.inverted = true;
bloomEffect.blendMode.opacity.value = 2.3;
const renderPass = new RenderPass(this._scene, camera);
renderPass.renderToScreen = false;
const effectPass = new EffectPass(
camera,
/*smaaEffect, godRaysEffect*/ bloomEffect,
);
effectPass.renderToScreen = true;
const composer = new EffectComposer(this._renderer);
composer.addPass(renderPass);
composer.addPass(effectPass);
this._composer = composer;
}