Black line between geometries

I have a weird bug that just appeared during some AppState refactoring. I wouldn’t think anything I did would have affected rendering at all. I was really just refactoring dependencies so some of my constructors weren’t so big and re-ordering my GUI app states.

I will throw out that I have recently started using Lemur and maybe I have caused some GUI app state to stay attached that shouldn’t.

This is a voxel based game and the screenshot shows the line appearing between chunk boundaries. Each chunk has it’s own opaque and transparent geometries. It’s only visible when the camera is in just the right position. So if I pan left to right the line appears to flicker. The screenshot is where I positioned the camera to the thickest point at which the line appears.

It goes away if I break the block which causes the chunk and neighboring chunks to be rebuilt.

Any help is appreciated.

Just to add more info in case it’s relevant. My Material I am using is configured like so:

public class ChunkMaterial extends Material
{
    public ChunkMaterial(AssetManager assetManager, String blockTextureFilePath)
    {
    	super(assetManager, "MatDefs/Blocks.j3md");
    	Texture texture = assetManager.loadTexture(blockTextureFilePath);
    	texture.setMagFilter(Texture.MagFilter.Nearest);
    	texture.setMinFilter(Texture.MinFilter.NearestNoMipMaps);
    	setTexture("ColorMap", texture);
    	
    	setBoolean("VertexColor", true);
    	getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
    	setFloat("dayNightLighting", 1.0f);
    	setFloat("AlphaDiscardThreshold", 0.1f);
    }
}

Seems like maybe there is a slight gap between the chunks, either due to rounding errors or other.

Things to check:
-largeish coordinates when it happens.
-double check the mesh sizes relative to chunk distances
-errors creeping into the camera quaternion… or if the chunks are rotated then their own world rotation.

Even at the horizon it seems like one chunk is a little off from the other.

Actually, I guess even the material could be complicit depending on how the vertex positions are calculated.

I hoped you wouldn’t say that. :slight_smile: I was hoping for a magical material parameter that I had missed somewhere.

I’ve recently been testing in x,z over 1000,1000 and I just tested it at x,z 100,100 and it’s not happening there. So it’s most likely a rounding error of some kind happening.

I’m using a Vector3Int class for my chunk locations but at some point that has to get translated to Vector3f for JME.

Your first suggestion is probably it. I’ll investigate. Thank you!

Lemur rocks by the way! I’ve gotten more done in 2 days with it than I ever did with nifty. Not to bash nifty, it’s a powerful framework but just doesn’t work like I work. Lemur(Swing style) is what I’m used to.

Thanks!