coldteam Active Member Licensed User Longtime User Mar 11, 2018 #1 Hi Im using 64x64 tiles on map. when the camera moves, gaps between tiles! i read about this, it is called Texture bleeding how it fix it? i move camera like this: Code: Copy Dim lerp As Float = 1.5f CAMERA.Position.set(CAMERA.Position.x + (PLAYER_BODY.Position.x - CAMERA.Position.x) * lerp * GD.Graphics.DeltaTime,CAMERA.Position.y + (PLAYER_BODY.Position.y - CAMERA.Position.y) * lerp * GD.Graphics.DeltaTime,0)
Hi Im using 64x64 tiles on map. when the camera moves, gaps between tiles! i read about this, it is called Texture bleeding how it fix it? i move camera like this: Code: Copy Dim lerp As Float = 1.5f CAMERA.Position.set(CAMERA.Position.x + (PLAYER_BODY.Position.x - CAMERA.Position.x) * lerp * GD.Graphics.DeltaTime,CAMERA.Position.y + (PLAYER_BODY.Position.y - CAMERA.Position.y) * lerp * GD.Graphics.DeltaTime,0)
Informatix Expert Licensed User Longtime User Mar 12, 2018 #2 coldteam said: Hi Im using 64x64 tiles on map. when the camera moves, gaps between tiles! i read about this, it is called Texture bleeding how it fix it? i move camera like this: Code: Copy Dim lerp As Float = 1.5f CAMERA.Position.set(CAMERA.Position.x + (PLAYER_BODY.Position.x - CAMERA.Position.x) * lerp * GD.Graphics.DeltaTime,CAMERA.Position.y + (PLAYER_BODY.Position.y - CAMERA.Position.y) * lerp * GD.Graphics.DeltaTime,0) Click to expand... You could use TiledMapPacker as suggested by the Maps section in the libGDX introduction. But if that only happens when you move the camera, the reason behind may also be a rounding problem of the coordinates. All coordinates once converted to screen coordinates should give integers. Last edited: Mar 12, 2018 Upvote 0
coldteam said: Hi Im using 64x64 tiles on map. when the camera moves, gaps between tiles! i read about this, it is called Texture bleeding how it fix it? i move camera like this: Code: Copy Dim lerp As Float = 1.5f CAMERA.Position.set(CAMERA.Position.x + (PLAYER_BODY.Position.x - CAMERA.Position.x) * lerp * GD.Graphics.DeltaTime,CAMERA.Position.y + (PLAYER_BODY.Position.y - CAMERA.Position.y) * lerp * GD.Graphics.DeltaTime,0) Click to expand... You could use TiledMapPacker as suggested by the Maps section in the libGDX introduction. But if that only happens when you move the camera, the reason behind may also be a rounding problem of the coordinates. All coordinates once converted to screen coordinates should give integers.
coldteam Active Member Licensed User Longtime User Mar 12, 2018 #3 Ye,Tnx. yesterday i try set camera with int, Code: Copy Dim x,y as int CAMERA.Position.set(x,y,0) the camera is shaking but texture bleeding try gdx-texturepacker with Duplicate Padding and than load to Tiled Map Editor the problem did not disappear Could there be a reason, i use: Code: Copy Dim Batch As lgSpriteBatch . . and . . Dim Renderer As lgMapOrthogonalTiledMapRenderer in LG_RENDER() Batch.Begin ... render background Batch.End Renderer.Begin .... render layers Renderer.End Batch.Begin ... render more Batch.End is it normal? (i draw textures in Pyxel Edit and photoshop) Upvote 0
Ye,Tnx. yesterday i try set camera with int, Code: Copy Dim x,y as int CAMERA.Position.set(x,y,0) the camera is shaking but texture bleeding try gdx-texturepacker with Duplicate Padding and than load to Tiled Map Editor the problem did not disappear Could there be a reason, i use: Code: Copy Dim Batch As lgSpriteBatch . . and . . Dim Renderer As lgMapOrthogonalTiledMapRenderer in LG_RENDER() Batch.Begin ... render background Batch.End Renderer.Begin .... render layers Renderer.End Batch.Begin ... render more Batch.End is it normal? (i draw textures in Pyxel Edit and photoshop)
Informatix Expert Licensed User Longtime User Mar 12, 2018 #4 coldteam said: Ye,Tnx. yesterday i try set camera with int, Code: Copy Dim x,y as int CAMERA.Position.set(x,y,0) the camera is shaking but texture bleeding try gdx-texturepacker with Duplicate Padding and than load to Tiled Map Editor Click to expand... It seems that you make a confusion between TiledMapPacker and TexturePacker. Upvote 0
coldteam said: Ye,Tnx. yesterday i try set camera with int, Code: Copy Dim x,y as int CAMERA.Position.set(x,y,0) the camera is shaking but texture bleeding try gdx-texturepacker with Duplicate Padding and than load to Tiled Map Editor Click to expand... It seems that you make a confusion between TiledMapPacker and TexturePacker.
Informatix Expert Licensed User Longtime User Mar 12, 2018 #5 coldteam said: Could there be a reason, i use: Code: Copy Dim Batch As lgSpriteBatch . . and . . Dim Renderer As lgMapOrthogonalTiledMapRenderer in LG_RENDER() Batch.Begin ... render background Batch.End Renderer.Begin .... render layers Renderer.End Batch.Begin ... render more Batch.End is it normal? (i draw textures in Pyxel Edit and photoshop) Click to expand... Is there a strong reason to have two different Spritebatch objects? Is the performance disappointing on old devices ? Upvote 0
coldteam said: Could there be a reason, i use: Code: Copy Dim Batch As lgSpriteBatch . . and . . Dim Renderer As lgMapOrthogonalTiledMapRenderer in LG_RENDER() Batch.Begin ... render background Batch.End Renderer.Begin .... render layers Renderer.End Batch.Begin ... render more Batch.End is it normal? (i draw textures in Pyxel Edit and photoshop) Click to expand... Is there a strong reason to have two different Spritebatch objects? Is the performance disappointing on old devices ?
coldteam Active Member Licensed User Longtime User Mar 12, 2018 #6 i use Dim Batch As lgSpriteBatch for draw BitmapFonts and Static textures Code: Copy Camera.Initialize2( Scale * 4, Scale * 4 * Height / Width) CameraFont.Initialize2(GD.Graphics.Width,GD.Graphics.Height) in render Code: Copy Camera.Update Renderer.SetCameraView(Camera) .... CameraFont.Update Batch.ProjectionMatrix = CameraFont.Combined Upvote 0
i use Dim Batch As lgSpriteBatch for draw BitmapFonts and Static textures Code: Copy Camera.Initialize2( Scale * 4, Scale * 4 * Height / Width) CameraFont.Initialize2(GD.Graphics.Width,GD.Graphics.Height) in render Code: Copy Camera.Update Renderer.SetCameraView(Camera) .... CameraFont.Update Batch.ProjectionMatrix = CameraFont.Combined
coldteam Active Member Licensed User Longtime User Mar 12, 2018 #7 about TiledMapPacker is it work now ? in extensions no gdx-tiled-preprocessor i use script: java -cp gdx.jar; gdx-natives.jar; gdx-backend-lwjgl.jar; gdx-backend-lwjgl-natives.jar; extensions \ gdx-tools \ gdx-tools. jar; extensions \ gdx-tiled-preprocessor \ gdx-tiled-preprocessor.jar com.badlogic.gdx.tiledmappacker.TiledMapPacker 1) G:\TR\IN G:\TR\OUT 2)\TR\IN \TR\OUT 3)/TR/IN /TR/OUT Nothing happens Upvote 0
about TiledMapPacker is it work now ? in extensions no gdx-tiled-preprocessor i use script: java -cp gdx.jar; gdx-natives.jar; gdx-backend-lwjgl.jar; gdx-backend-lwjgl-natives.jar; extensions \ gdx-tools \ gdx-tools. jar; extensions \ gdx-tiled-preprocessor \ gdx-tiled-preprocessor.jar com.badlogic.gdx.tiledmappacker.TiledMapPacker 1) G:\TR\IN G:\TR\OUT 2)\TR\IN \TR\OUT 3)/TR/IN /TR/OUT Nothing happens
Informatix Expert Licensed User Longtime User Mar 12, 2018 #8 A common case is a Spritebatch for Box2D objects (with a metric coordinate system) and a Spritebatch for background and HUD, so your current use is perfectly OK from my point of view. For performance, it's better to avoid abusing of Spritebatch instances but 2 is not a problem at all. Upvote 0
A common case is a Spritebatch for Box2D objects (with a metric coordinate system) and a Spritebatch for background and HUD, so your current use is perfectly OK from my point of view. For performance, it's better to avoid abusing of Spritebatch instances but 2 is not a problem at all.
Informatix Expert Licensed User Longtime User Mar 12, 2018 #9 coldteam said: about TiledMapPacker is it work now ? in extensions no gdx-tiled-preprocessor i use script: java -cp gdx.jar; gdx-natives.jar; gdx-backend-lwjgl.jar; gdx-backend-lwjgl-natives.jar; extensions \ gdx-tools \ gdx-tools. jar; extensions \ gdx-tiled-preprocessor \ gdx-tiled-preprocessor.jar com.badlogic.gdx.tiledmappacker.TiledMapPacker 1) G:\TR\IN G:\TR\OUT 2)\TR\IN \TR\OUT 3)/TR/IN /TR/OUT Nothing happens Click to expand... Maybe, they removed it or it exists a new tool with a different name. Don't know. Upvote 0
coldteam said: about TiledMapPacker is it work now ? in extensions no gdx-tiled-preprocessor i use script: java -cp gdx.jar; gdx-natives.jar; gdx-backend-lwjgl.jar; gdx-backend-lwjgl-natives.jar; extensions \ gdx-tools \ gdx-tools. jar; extensions \ gdx-tiled-preprocessor \ gdx-tiled-preprocessor.jar com.badlogic.gdx.tiledmappacker.TiledMapPacker 1) G:\TR\IN G:\TR\OUT 2)\TR\IN \TR\OUT 3)/TR/IN /TR/OUT Nothing happens Click to expand... Maybe, they removed it or it exists a new tool with a different name. Don't know.