- Home /
LineRenderer with smoot start/edge
Hello guys. Im trying to make something like this: https://imgur.com/45LjlY1 but the lines I got look like this: https://imgur.com/a/O670GrB It basically makes rhombus, but what I want are round edges and I have no clue how to do it. Any help would be appreciated
Edit: This is what my line renderer looks like. https://imgur.com/a/XqE03HA
Can you post your material? A screenshot of the inspector would be enough
Answer by BBIT-SOLUTIONS · Apr 05, 2020 at 05:55 PM
If you just want to have smooth line endings you can increase the value of the End Cap Vertices parameter.
And if the line itself should be more "smooth" you can increase the value of the Corner Vertices.
The End cap vertices does what I'd like, but only to the end of the line. And Corner vertices doesn't do something I'm able to see for some reasons.
ok, i see. So what you try to create is actually a kind of a dashed line, right?
So i guess ins$$anonymous$$d of using only one lineRenderer you should use a separate line for each single "little line" of the whole full line and then combine them. Each single line can then be created with a lineRenderer. Problem is just for your approach, that the lineRenderer component is acutally meant just for continuous lines.
An alternative approach would be maybe to adapt this approach here, which creates a dotted line. $$anonymous$$aybe you could adapt it a bit, so that you use little Lines (with lineRenderer and End cap vertices) ins$$anonymous$$d of the dot-Sprites. (Or alternatively use also a sprite of a short line)
you should use a separate line for each single "little line" that sounds like a death sentence for performance
Answer by Pangamini · Apr 06, 2020 at 08:05 AM
Don't try to create the effect using line's geometry. Use the texture to benefit from thexture filtering and not get the aliasing you are seeing. Actually make the line even wider than the final visual thickness, and make the texture contain the blank edges. This will improve the anti-aliasing properties even further
What do you mean by texture filtering? How can I use the texture? Are you still talking about the LineRenderer?
Well, LineRenderer has a material and that material might be using a texture and some transparent shader. Texture filtering is just how the color is sampled from the texture data (texels) and used on the screen pixels. This usually involves trilinear filter, mipmapping and anisotropic filtering. That way you can make the edges smooth. By making the geometry larger and using a texture with transparent edges, you are allowing the filtering to be used on a wider area, not showing any hard edges.
Your answer
![](https://koobas.hobune.stream/wayback/20220612230550im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Drawing a direction arrow. 2 Answers
Move to line 0 Answers
3d object outline shader 1 Answer
How to check of a line renderer collides with ground ? 1 Answer
Easy Line drawing 2 Answers