Artifacts along the joins of geometries

Hi all,

Still fairly new to jMonkey, experiencing a bit of a problem. Instead of one large ground plane I’m trying to place square plots of land next to each other, each one may or may not have different textures. They are all lined up with each other, no gaps or overlaying, but I’m seeing this horrible join line (see image)

http://i.imgur.com/HpQhu.png



I have a for loop running the following code to place each ‘plot’



[java]

Box b=new Box(15.1f,0.01f,15.1f);

b.scaleTextureCoordinates(new Vector2f(5f,5f));

plot=new Geometry(“Plot”,b);

Material mat_forGeo = new Material(Main.assman, “Common/MatDefs/Light/Lighting.j3md”);

Texture tex=assetManager.loadTexture(“assets/GravelGround.jpg”);

tex.setWrap(WrapMode.Repeat);

mat_forGeo.setTexture(“DiffuseMap”,tex);

plot.setMaterial(mat_forGeo);

plot.setQueueBucket(Bucket.Opaque);

plot.setLocalTranslation(cityBlockOrigin.x-3, 0, cityBlockOrigin.z-3);

root.attachChild(plot);

[/java]



Anything I can do to make the joins less noticeable?

first of all you do it wrong. you have “overlay”.



http://hub.jmonkeyengine.org/groups/free-announcements/forum/topic/simple-voxel-engine-starter-kit/



it is not created from boxes… and you should not create your “scene” from plains… you need to create one mesh.

I didn’t quite understand the voxel engine starter kit, doesn’t it get any simpler than that? I’m not looking to make a Minecraft engine, I guess I just start with something simple, like make a few quads and join the edges together so the seam isn’t visible for starters.

Why don’t you just use a 3d editor for that? Else I agree with @oxplay2, you should generate the meshes procedurally, based on your needs. See this: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:custom_meshes

@satscape said:
I didn't quite understand the voxel engine starter kit, doesn't it get any simpler than that? I'm not looking to make a Minecraft engine, I guess I just start with something simple, like make a few quads and join the edges together so the seam isn't visible for starters.


Everyone else is right about batching. But I thought I'd point out that your desired approach is not the approach you implemented. You want quads but you made boxes... so now you see the sides of the boxes and wonder why. What you really want is quads, though.

Thanks for clarifying it everyone.

I will need to use custom meshes then, but… I’ve changed line 01 to:

[java]Quad b=new Quad(30f,30f);[/java]



and rotated it to sit on the floor with:

[java]plot.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));[/java]



and it looks perfect, no join lines… so is that going to be ok or do they really need to be made into one big mesh?

I want to dynamically change them at run time, adding new quads, removing some, changing textures on some of them etc.



Sorry if I being ‘thick’, it’s just a steep learning curve, even for a geek like me :slight_smile:

Performance goes down as the number of Spatials goes up. Whereas your GPU can happily gobble up millions of triangles with ease.



It’s always better to batch as much as you can… keeping all other constraints in mind.

For the seam issue there, I’ve had something similar when my tiled object had normal maps. The very edge of the normal map was one pixel “off” (all pointing in the same direction) so it made this line when set next another tile.

It doesn’t look like you are using a normal map, but when you do, this is something to look out for. It annoyed me for a few hours until I found out what was causing it.

Got the same problem on Android:

http://i.imgur.com/e2Z6K.png

Haven’t found a solution yet though…

if it dont work, then



you can always fix a model(i mean android rendering of model) by joining this meshes(for example by boolean operation) or making them longer to hide free space.



here it have door / etc, only way with that fix would be this second option.



im not sure if this is free spaces, becouse in some places it should not be “white”…



BTW: check face culling too :wink: maybe its the problem too.