How to eliminate the black(gap) line between two plane quads

How could do that?
here is the picture,the gap between two quads is very small but eyeable.
many thanks

the code
[java]
public void simpleInitApp() {
Quad b = new Quad(1, 1);
Geometry geom = new Geometry(“Quad”, b);
Texture tex = assetManager.loadTexture(“Images/CG0000004.png”);
Material mat = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
mat.setTexture(“ColorMap”, tex);
mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
geom.setMaterial(mat);
geom.setQueueBucket(Bucket.Transparent);
camNode.attachChild(geom);
geom.setLocalTranslation(cam.getWorldCoordinates(new Vector2f(0, 0), 0).getX(), cam.getWorldCoordinates(new Vector2f(0, 0), 0).getY(), 0);
Quad b2 = new Quad(1, 1);
Geometry geom2 = new Geometry(“Quad2”, b2);
Texture tex2 = assetManager.loadTexture(“Images/CG0000004.png”);
Material mat2 = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
mat2.setTexture(“ColorMap”, tex2);
mat2.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
geom2.setMaterial(mat2);
geom2.setQueueBucket(Bucket.Transparent);
camNode.attachChild(geom2);
geom2.setLocalTranslation(cam.getWorldCoordinates(new Vector2f(440, 440), 0).getX(), cam.getWorldCoordinates(new Vector2f(440, 440), 0).getY(), 0);
}
[/java]

CG0000004.png

Is there a reason you are drawing a quad with a diamond on it versus just rotating the quad to the proper 3D position?

The issue is rounding and blending. The diamond edges don’t overlap but the edges will be blended. You could turn off min/mag filtering for the texture (will look bad) or scale up your quad a bit… or construct your scene a different way.

1 Like
@pspeed said: Is there a reason you are drawing a quad with a diamond on it versus just rotating the quad to the proper 3D position?

The issue is rounding and blending. The diamond edges don’t overlap but the edges will be blended. You could turn off min/mag filtering for the texture (will look bad) or scale up your quad a bit… or construct your scene a different way.

thank you very much
for you first question :I just want to draw a 2d diamond map with meshes for my game map, 2d diamond shape map is better than 2d square shape map in my opinion
and
when I set
tex.setMinFilter(Texture.MinFilter.NearestNoMipMaps);

the problem is solved.
the black line is gone.

Nearest-style filters give blocky artifacts if the texture gets enlarged or shrunk due to perspective.

A more generally approach is to add a one-pixel border to the texture and copy the opposite texture pixels there.
I think there’s also a texture flag that does that on the fly, with no need to modify your bitmap, but I forgot how to activate it; it should have something with “wrap” in its name.

@harry1315 said: thank you very much for you first question :I just want to draw a 2d diamond map with meshes for my game map, 2d diamond shape map is better than 2d square shape map in my opinion

If you understood what I’m saying, the net effect is the same.

But there may be some other reason you go with your approach. If I were doing an isometric game in JME, I’d do it with 3D objects in ortho mode, personally.

@toolforger said: Nearest-style filters give blocky artifacts if the texture gets enlarged or shrunk due to perspective.

A more generally approach is to add a one-pixel border to the texture and copy the opposite texture pixels there.
I think there’s also a texture flag that does that on the fly, with no need to modify your bitmap, but I forgot how to activate it; it should have something with “wrap” in its name.

Except he wants the transparency. This is not like an atlas. He needs his tiles to overlap sensibly.

So, either there is a fixed zoom (or a range of zooms where his solution is fine)… or there is any kind of zoom in which case there is no border big enough that would prevent the artifacts without looking bad because of the way he’s tiling.