Anti Aliasing Three.js / WebGL

2019-09-02 05:37发布

I have an issue with anti aliasing when i spin model with orbiter

i am using

renderer = new THREE.WebGLRenderer({ preserveDrawingBuffer: true, antialias: true });

it is helping but not resolving the issue fully.

antialiasing

in this position it looks ok:

anti aliasing works

Does anyone know how to resolve this? or have any idea what else can i try? ( code sample would be appreciated )

Thanks

EDIT:

Ok i have added this:

renderer.setPixelRatio(2);

and it has improved a LOT ( see result bellow ), but still shows a bit,

anyone has any other idea suggestion?

improved

2条回答
2楼-- · 2019-09-02 05:38

Are the lines textures?

If so, I had a simular issue then depending on the camera position not completely on top my texture would get blurry. Maybe this helps for you:

texture.minFilter = THREE.LinearFilter;
查看更多
乱世女痞
3楼-- · 2019-09-02 06:02

I am not completely sure if this will do the trick but it might be worth a try. Using the example below, set your textures anisotropy to the renderers max anisotropy. (i am using the webglrenderer) this should enabel antialiasing on this texture and reduce jagged lines like in the first image.

texture.anisotropy = renderer.getMaxAnisotropy().

查看更多
登录 后发表回答