visionforge
visionforge copied to clipboard
Consider aliasing with FXAA
As for my PC, current WebGLRenderer usages result in quite a visible aliasing, so an explicit FXAA shader should be considered.
There are also other options like SMAA, SSAA, TAA.
import { FXAAShader } from 'https://threejs.org/examples/jsm/shaders/FXAAShader.js';
...
const fxaaPass = new ShaderPass(FXAAShader);
const pixelRatio = renderer.getPixelRatio();
fxaaPass.material.uniforms['resolution'].value.x = 1 / (container.offsetWidth * pixelRatio);
fxaaPass.material.uniforms['resolution'].value.y = 1 / (container.offsetHeight * pixelRatio);
composer1 = new EffectComposer(renderer); // renderer: WebGLRenderer
...
composer1.addPass(fxaaPass);
...
composer1.render();
OK, I will try, but we need to check if it will affect performance for large geometries.
OK, I will try, but we need to check if it will affect performance for large geometries.
Maybe there just should be an option to disable it?
Yes, it is possible. We can pass almost any option through Canvas3DOptions or its specialized descendant.