# How to draw smooth circle in Libgdx

I am trying to draw an circle to Libgdx which is created from Image not ShapeRenderer. But when I try to draw image to SpriteBatch it does not draw smoothly.

I checked the image resolution and Image Dimension is 1673x1673 and Sprite Size is 80x80.

  //This is my GameState code
@Override
public void render(float delta) {
update(delta);
SpriteBatch sb = game.batch;
Color bg = ThemeFactory.getInstance().getTheme().backgroundColor;
Gdx.gl.glClearColor(bg.r, bg.g, bg.b, bg.a);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
sb.setProjectionMatrix(camera.combined);
sb.begin();
for(int i =0;i<elements.size();i++){
if(!(elements.get(i) instanceof Arrow)){
elements.get(i).render(sb);//HERE IS DRAWING HAPPENING
}
}
sb.end();
barriers.render(sb);
renderHud();
}


My circle constructor and rendering code is below.

public Circle(Texture texture, Size size, Vector3 position){
mSprite = new Sprite(texture);
mSprite.setSize(size.width, size.height);//80x80
mSprite.setPosition(position.x, position.y);
mSprite.setOriginCenter();
}
@Override
public void render(SpriteBatch sb) {
mSprite.draw(sb);
}


I tried TextureFilters Nearest Nearest and Linear Linear but nothing has changed. And also increased samples for desktop and android applications, nothing has changed too.

• Did you set the Min or Mag filter? – Charanor Oct 21 '17 at 21:20
• What is min or mag filter ? – Abdullah Tellioglu Oct 21 '17 at 21:30
• When applying the filter you use texture.setFilter(minFilter, magFilter). What did you set the min and mag filters to? I would suggest trying TextureFilter.MipMapLinearNearest on Min and TextureFilter.Nearest on mag and see if it gives a satisfactory result. – Charanor Oct 21 '17 at 22:29
• TextureFilter.MipMapLinearNearest gives me a black rectangle, I have tried Nearest but it did not work – Abdullah Tellioglu Oct 21 '17 at 22:31

Libgdx has to know to build the mip map. Use this constructor with the second parameter set to true

Texture(FileHandle file, boolean useMipMaps)


It's not really clear what you mean by "smoothly", different TextureFilters will affect the way it draws in different ways. In any case, mipmaps should be "best" for drawing a high-res texture at low res.