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.
This is the Image that I am using

This is the Image that drawing

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

  //This is my GameState code
    public void render(float delta) {
        SpriteBatch sb = game.batch;
        Color bg = ThemeFactory.getInstance().getTheme().backgroundColor;
        Gdx.gl.glClearColor(bg.r, bg.g, bg.b, bg.a);
        for(int i =0;i<elements.size();i++){
            if(!(elements.get(i) instanceof Arrow)){
                elements.get(i).render(sb);//HERE IS DRAWING HAPPENING

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);
public void render(SpriteBatch 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.

  • 1
    \$\begingroup\$ Did you set the Min or Mag filter? \$\endgroup\$ – Charanor Oct 21 '17 at 21:20
  • \$\begingroup\$ What is min or mag filter ? \$\endgroup\$ – Abdullah Tellioglu Oct 21 '17 at 21:30
  • \$\begingroup\$ 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. \$\endgroup\$ – Charanor Oct 21 '17 at 22:29
  • \$\begingroup\$ TextureFilter.MipMapLinearNearest gives me a black rectangle, I have tried Nearest but it did not work \$\endgroup\$ – 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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.