Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider aliasing with FXAA #70

Open
CommanderTvis opened this issue Jan 23, 2022 · 3 comments
Open

Consider aliasing with FXAA #70

CommanderTvis opened this issue Jan 23, 2022 · 3 comments
Labels
feature New feature or request

Comments

@CommanderTvis
Copy link
Contributor

CommanderTvis commented Jan 23, 2022

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.

Usage example for FXAA:

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();
@CommanderTvis CommanderTvis added the feature New feature or request label Jan 23, 2022
@altavir
Copy link
Member

altavir commented Jan 23, 2022

OK, I will try, but we need to check if it will affect performance for large geometries.

@CommanderTvis
Copy link
Contributor Author

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?

@altavir
Copy link
Member

altavir commented Jan 23, 2022

Yes, it is possible. We can pass almost any option through Canvas3DOptions or its specialized descendant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants