So, pruning did not go well, My project is not too large, but it’s several inter-related classes and several assets that are required to get it working, so I zipped the whole project and uploaded it HERE. (EDIT: zip has been updated) The related mesh is generated in matrixpeckham.zombiegame.map.MapChunk.generateMesh(). Which I will paste below, because I assume it’s the most relevant thing.
The things in the matrixpeckham.zombiegame.sprites package can be ignored as they are not relevant. I hope my code is commented enough to follow, and I do apologize for its size.
@t0neg0d The scaling I mention is not scaling in the normal geometric sense, during my initial test it was just one the tiles, when the seams appeared, I changed from generating a tile in model coordinates as (-tileSize/2 + tileCoordX,0,-tileSize/2+tileCoordZ) through (tileSize/2 + tileCoordX,0,tileSize/2+tileCoordZ) which I changed to this : (-tileSize/2 * eps + tileCoordX,0,-tileSize/2eps+tileCoordZ) through (tileSize/2eps + tileCoordX,0,tileSize/2*eps+tileCoordZ) where eps = 1.01 this causes the tiles to overlap very, slightly, and on solid tiles it does cause issues, but with semitransparent tiles it does.
It is true the problem could be in a number of places, it could possibly be between two of the chunks of my map. Unfortunately I don’t see a way to share vertices between quads in this scenario because two adjoining quads can have very different texture coordinates. Here is the actual mesh creation code:
[java] private Mesh generateMesh(float len){
Mesh mesh = new Mesh();
final int VERTS_PER_TILE = 4;
final int NUM_PER_VERT = 3;
final int NUM_PER_TEXT = 2;
final int INDS_PER_TILE = 6;
int numTiles = chunkSizechunkSize;//field for tiles per side of chunk
FloatBuffer verts = BufferUtils.createFloatBuffer(numTilesVERTS_PER_TILENUM_PER_VERT);
FloatBuffer norms = BufferUtils.createFloatBuffer(numTilesVERTS_PER_TILENUM_PER_VERT);
FloatBuffer texts = BufferUtils.createFloatBuffer(numTilesVERTS_PER_TILENUM_PER_TEXT);
IntBuffer inds = BufferUtils.createIntBuffer(numTilesINDS_PER_TILE);
int vertInd = 0;
int normInd = 0;
int indInd = 0;
int uvInd = 0;
int indAdd = 0;
float eps = 1.00f;//EPS OF 1.01 causes opposite problem
float xf = 0;
for(int xi = 0; xi<chunkSize; xi++){
float yf = 0;
for(int yi = 0; yi<chunkSize; yi++){
//VERT 1
verts.put(vertInd++, xf);
verts.put(vertInd++, 0);
verts.put(vertInd++, yf);
//VERT 2
verts.put(vertInd++, xf);
verts.put(vertInd++, 0);
verts.put(vertInd++, yf+len*eps);
//VERT 3
verts.put(vertInd++, xf+len*eps);
verts.put(vertInd++, 0);
verts.put(vertInd++, yf+len*eps);
//VERT 4
verts.put(vertInd++, xf+len*eps);
verts.put(vertInd++, 0);
verts.put(vertInd++, yf);
//NORM1
norms.put(normInd++,0);
norms.put(normInd++,1);
norms.put(normInd++,0);
//NORM2
norms.put(normInd++,0);
norms.put(normInd++,1);
norms.put(normInd++,0);
//NORM3
norms.put(normInd++,0);
norms.put(normInd++,1);
norms.put(normInd++,0);
//NORM4
norms.put(normInd++,0);
norms.put(normInd++,1);
norms.put(normInd++,0);
//UV1
texts.put(uvInd++,0);
texts.put(uvInd++,0);
//UV2
texts.put(uvInd++,0);
texts.put(uvInd++,1);
//UV3
texts.put(uvInd++,1);
texts.put(uvInd++,1);
//UV4
texts.put(uvInd++,1);
texts.put(uvInd++,0);
inds.put(indInd++,0+indAdd);
inds.put(indInd++,1+indAdd);
inds.put(indInd++,2+indAdd);
inds.put(indInd++,0+indAdd);
inds.put(indInd++,2+indAdd);
inds.put(indInd++,3+indAdd);
indAdd+=4;
yf+=len;
}
xf+=len;
}
mesh.setBuffer(VertexBuffer.Type.Position, 3, verts);
mesh.setBuffer(VertexBuffer.Type.TexCoord, 2, texts);
mesh.setBuffer(VertexBuffer.Type.Index, 3, inds);
mesh.setBuffer(VertexBuffer.Type.Normal, 3, norms);
mesh.updateBound();
return mesh;
}
[/java]
Again sorry about the large amount of code in the project, I’m hoping that someone can give me some pointers for what to look for. Thanks for taking the time to help me out.
EDIT: I realized that I had not included the JSON parsing stuff. In order to run the project you will need to remove the dependency to a project named BasicJSON. This project was simply the http://json.org/java/ implementation I threw into a project. I updated the .zip file and now the sources from http://json.org/java/ are included directly, however I did not remove the dependency. Sorry about the mistake.