Skip to main content
Added some things I tried.
Source Link

I've got a problem with libgdx.

First off, im working with libgdx and box2d on a little physics game.

Im using the aproach mentioned in this answer and thereby setting my camera to some smallish numbers and it worked out fine so far.

Now I've ran into following problem. When drawing my background (1920x1080) I am experiencing artifacts ingame and I am not sure where they are coming from.

I tried linear and nearest Filtering on the Texture with no differing results and I scale the image once via

beachSprite.setScale(camera.viewportWidth/Gdx.graphics.getWidth(), camera.viewportHeight/Gdx.graphics.getHeight());

This is what the background image looks when opening it With a regular image viewer: Image how it is supposed to look.

And this is what it looks like ingame: enter image description here

Oddly enough, there seem to appear no artifacts with smaller images, like the player character, or they are just too small to notice.

Thanks in advance for any help.

I've got a problem with libgdx.

First off, im working with libgdx and box2d on a little physics game.

Im using the aproach mentioned in this answer and thereby setting my camera to some smallish numbers and it worked out fine so far.

Now I've ran into following problem. When drawing my background (1920x1080) I am experiencing artifacts ingame and I am not sure where they are coming from.

This is what the background image looks when opening it With a regular image viewer: Image how it is supposed to look.

And this is what it looks like ingame: enter image description here

Oddly enough, there seem to appear no artifacts with smaller images, like the player character.

Thanks in advance for any help.

I've got a problem with libgdx.

First off, im working with libgdx and box2d on a little physics game.

Im using the aproach mentioned in this answer and thereby setting my camera to some smallish numbers and it worked out fine so far.

Now I've ran into following problem. When drawing my background (1920x1080) I am experiencing artifacts ingame and I am not sure where they are coming from.

I tried linear and nearest Filtering on the Texture with no differing results and I scale the image once via

beachSprite.setScale(camera.viewportWidth/Gdx.graphics.getWidth(), camera.viewportHeight/Gdx.graphics.getHeight());

This is what the background image looks when opening it With a regular image viewer: Image how it is supposed to look.

And this is what it looks like ingame: enter image description here

Oddly enough, there seem to appear no artifacts with smaller images, like the player character, or they are just too small to notice.

Thanks in advance for any help.

Source Link

LIBGDX - Artifacts when scaling background image

I've got a problem with libgdx.

First off, im working with libgdx and box2d on a little physics game.

Im using the aproach mentioned in this answer and thereby setting my camera to some smallish numbers and it worked out fine so far.

Now I've ran into following problem. When drawing my background (1920x1080) I am experiencing artifacts ingame and I am not sure where they are coming from.

This is what the background image looks when opening it With a regular image viewer: Image how it is supposed to look.

And this is what it looks like ingame: enter image description here

Oddly enough, there seem to appear no artifacts with smaller images, like the player character.

Thanks in advance for any help.