Jump to content
  • Advertisement
Sign in to follow this  
devO6

How to draw non-blurred thick lines in libgGDX?

This topic is 1004 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

 

I'm trying some different ways to draw really thick lines in libGDX, but none of them are really what i was aiming for... I've researched about this and, based on what i saw, here are a couple of example tries:

 

https://gyazo.com/eea05f31fc89bad57d2313171d1d0017

 

The problem is that the lines look really jagged in all of these examples; I also tried using a 1x1 plain white texture region and drawing the lines from it, but the result was similar. Is there actually a somewhat efficient way to make the lines look better? If there isn't, I would probably pick example case 'C' ( using the shape renderer, which ,i guess, looks a bit better than the others ), but i'm really not sure if that's very adequate efficiency-wise. Got any tips, please?

 

Thanks in advance! biggrin.png

Share this post


Link to post
Share on other sites
Advertisement

In general, there isn't an easy answer to this problem. There are a number of potential approaches to blending the edges of lines (for example, this one), or you can enable multisampling, and set the sample count really high. Both approaches tend to see a significant performance hit, but your lines will look a lot nicer.

 

It might be better to integrate an existing library for this sort of thing, such as nanovg.

Share this post


Link to post
Share on other sites

In general, there isn't an easy answer to this problem. There are a number of potential approaches to blending the edges of lines (for example, this one), or you can enable multisampling, and set the sample count really high. Both approaches tend to see a significant performance hit, but your lines will look a lot nicer.

 

It might be better to integrate an existing library for this sort of thing, such as nanovg.

Thank you very much, i will look into it! :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!