抗锯齿不在Three.js中工作 [英] Antialiasing not working in Three.js

查看:375
本文介绍了抗锯齿不在Three.js中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是three.js的新手并且最近开始使用它。我真的很喜欢它,我创造了一些令人难以置信的东西。但是,我不确定为什么但是当设置抗锯齿为真时我看不出有什么区别。

I am new to three.js and have starting working with it a lot recently. I really enjoy it and I have created some incredible things. However, I'm unsure why but when setting antialiasing to true I see no difference.

 renderer = new THREE.WebGLRenderer({ antialiasing: true });

我搜索过可能的解决方案,但我似乎无法找到或理解为什么这不会工作。是否有一些我缺少或需要的东西才能使抗锯齿工作?

I have searched for possible solutions, yet I can't seem to find or understand why this doesn't work. Is there something I am missing or need to in order to get antialiasing to work?

编辑:

链接这有助于我解决这个问题:
https://github.com/mrdoob /three.js/blob/master/examples/webgl_materials_normalmap2.html
https://github.com/mrdoob/three.js/tree/master/examples/js

Links that helped me fix this issue: https://github.com/mrdoob/three.js/blob/master/examples/webgl_materials_normalmap2.html https://github.com/mrdoob/three.js/tree/master/examples/js

这需要一些挖掘但三个开发人员。 js已覆盖!

It took some digging but the developers for three.js have it covered!

推荐答案

您在 WebGLRenderer的参数对象中使用的属性名称构造函数不正确。根据文档
该属性的名称应该是'antialias' 'antialiasing'

The property name you are using in the argument object of the WebGLRenderer constructor is incorrect. According to the documentation, the name of the property should be 'antialias', not 'antialiasing'.

我在Google Chrome for Mac OS中进行了测试,并且在带有旋转立方体的演示中边缘渲染有明显的平滑。

I tested it in Google Chrome for Mac OS and there was a noticeable smoothing in the rendering of edges in a demo featuring a spinning cube.

这篇关于抗锯齿不在Three.js中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆