在Unity中绘制流畅的线条真的那么困难吗? [英] Is it really so difficult to draw smooth lines in Unity?

查看:413
本文介绍了在Unity中绘制流畅的线条真的那么困难吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了一段时间在Unity中绘制平滑线,但是使用Line Renderer,我仅获得了锯齿形的线,这些线的角没有圆化,特别是当曲率角很小时.我在质量设置中增加了抗锯齿的价值,并尝试了不同的材料,但没有任何变化.我还尝试在每次鼠标移动时实例化一个球体,但是它会在各个球体之间造成一些间隙,尤其是当鼠标快速移动时.我知道有一个名为Vectrosity的插件,但是有办法实现这一目标吗?

I been trying for a while to draw smooth lines in Unity but with Line Renderer I obtained only jagged lines with the corners not rounded, in particular when the angle of curvature is really small . I incresed the value of antialiasing in quality settings and tried different materials but nothing changed. I also tried to instantiate a sphere every time the mouse move but it creates some gaps between the various spheres, in particular when the mouse go fast. I know there is a plugin called Vectrosity for this but there is a way to achieve this whitout it?

推荐答案

在 特别是在曲率角很小的情况下.

I obtained only jagged lines with the corners not rounded, in particular when the angle of curvature is really small .

这是 Unity 5.4 及以下版本中的问题.完全重新设计了LineRenderer后,此问题已在 Unity 5.5 及更高版本中得以解决.

This was a problem in Unity 5.4 and below. This problem has been fixed in Unity 5.5 and above after LineRenderer was completely re-designed.

您所要做的就是将其更新为 Unity 5.5 或更高版本,并且此问题将消失.

All you have to do is update to Unity 5.5 or version above and this problem should go away.

有一个名为LineRenderer.numCornerVertices的新变量.您可以使用它来设置线条的平滑程度. 5 的值似乎很好.

There is a new variable called LineRenderer.numCornerVertices. You can use that to set how smooth you want the line to be. The value of 5 seems fine for this.

还有另一个名为LineRenderer.numCapVertices的新变量,可用于设置线的 end 的平滑程度.

There is also another new variable called LineRenderer.numCapVertices that can be used to set how smooth the end of the line should be.

这是一个截图,演示了 5.4 5.5 之间的更改:

This is a screenshot that demonstrate between 5.4 and 5.5 the changes:

这篇关于在Unity中绘制流畅的线条真的那么困难吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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