ComanderKai77 ComanderKai77 - 1 month ago 22
Java Question

LibGDX antialiasing

Is there a way to implement antialiasing in LibGDX?

My lines are verry pixilated.

Screenshot

Answer

To smoothen any line or shape use Multisampling Anti Analysing

replace:Gdx.gl.glclear() with Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT | (Gdx.graphics.getBufferFormat().coverageSampling?GL20.GL_COVERAGE_BUFFER_BIT_NV:0))

and for android open your class file and write : config.numSamples = 2 2 is a good value

for desktopsconfig.sample=3 this will do your work...

Comments