[RESOLVED] Tiles and Artifacts on Boundaries

I’m working on a 2.5D game, basically 2D platform game made with 3D tiles. My problem is that I sometimes see line artifacts (horizontal/vertical) on the tiles boundary while moving or jumping. Is there a proper way to go rid of? Or do I need to make kind of a “bigger” mesh out of the tiles by somehow connecting the the vertics. Somebody which did that already?

I looked through the forum and couldn’t find something in this direction except with the high terrain tiles (Idk exactly what that might be)…

Could you post an image of the artifacts so we can see what you’re seeing?

just guessing here, but if the tiles are different objects and placed right up against each other, this may be a case of Z-fighting. maybe batching them together into one geometry could alleviate the issue in this case. or possibly by raising/lowering neighboring tiles just a tiny little bit, staggered like in a chessboard pattern.

It’s hard to make a screenshot, as it is flickering. Probably what @decoyhiding is saying. Z-fighting or a tiny little gap. I’ll play a bit with the sizes or look into batching, but I thought only similar objects can be batched, I have different types of 3D tiles…

If not a screen shot then a video?

It’s hard to diagnose visual problems from a text description.

Ok I’ll try that. And from the reaction I got so far it should be perfectly possible to put tiles together without further magic like backing that somehow into one big mesh or the like. So this gives me at least hope and I try to track down and probably come up with a video except I see the solution, then I would post that in this thread :slight_smile:

Thanks so far… I’ll come back soon with something.

Yeah, I’ve done 2D tiles many times in JME without any issues at all.

Actually mine are 3D tiles like cubes or structured cubes in a way, but I guess there is no real different to pure 2D tiles…

Yep, if the vertexes line up then it should work fine. If you’ve overlapped them or left gaps then there will be issues.

And to be clear, tile 1 going 0…1 and tile 2 going 1…2 is not overlap.

Ok that helps a lot. I think I can solve my issue. I also checked and my tiles were not always size of 1 (at least 3 I found which were a tiny bit smaller and one which was a tiny bit bigger). So I think it can be considered solved. I’ll check tomorrow in detail.

1 Like

Ok. So the issue was so simple that I even hesitate to post here the “solution”. Indeed my tiles which I initially had on 1 x 1 x 1 cubes where sometimes a bit shorter sometimes a bit longer, like a tiny tiny bit. I touched now all my tile types and corrected the ones which were not proper. Now I can’t see those artifacts anymore. Can’t believe, but I guess during modeling in blender, maybe scaling or such I messed it accidentally and was too sure it is proper :slight_smile:
Anyway want to say thank you to this incredible helpful community.

1 Like

I was a bit too quick. still have the issue… I checked all object in blender they are perfectly between -0.5 and 0.5 I also printed the geometries and that says the same.

XXXXXXX Inside2: BoundingBox [Center: (0.0, 0.0, 0.0) xExtent: 0.5 yExtent: 0.5 zExtent: 0.5]

So I made now a gif of the problem

I also place the tiles on 0, 1, 2, 3, nothing in between (I also checked that with printf debugging).

Maybe somebody had a similar issue?

EDIT: It doesn’t matter how far away I look at it I have this line flickering even when it is tiny, what I don’t really understand. One note, the boxes are all closed on all side even when they touch each other. Is that the problem?

2 Likes

Have you set the min and mag filter of your tile textures? I think I used nearest neighbor and no mipmaps.

1 Like

My tiles don’t have a texture, I just give the vertex colours. And I don’t really understand what you mean with that filter or with the mipmaps or nearest neighbor. I’ll have to google, I’m still new to that graphical stuff, I’m so much the programmer, but now it’s time to learn a few things about this as the flickering is very disturbing…

EDIT: Or you have some links or code snippet? I couldn’t find something useful in our internal documentation so far about this min/max filter or the nearest neighbor …

EDIT2: I just made cubes and gave them some geometrical structure (like vertexes) and gave them a color. And I don’t know why it is flickering. But seems it’s just me … I also tried to scale up a tiny bit, no difference at all.

So all of those tiny little brick things are actual geometry? And the grass spikes, too?

We’d have never guessed that 100x the necessary geometry was used for this. It’s interesting.

What does it look like if you spread things out by 0.01 or something for force the grid to show?

Is this in the gui node? Or your own ortho camera setup? Or just the regular JME default 3d camera?

Well yeah I thought to have something 3Dish would be nice but in the end it is not at all. So no clue.

Regular camera or my own setup:
//camera.setFrustumPerspective(30, width / height, 1, 300);
doesn’t make any different.

I tried to scale it too, like you said, zero difference too (which is very interesting). I could make it smaller then you see the grid perfectly.

And just before I started to blame my old graphic card on my laptop, I tried on the Desktop computer and same.

EDIT: What is the proposed way to do that tiles stuff? Just images? I wanted to have a 2.5D something…

I checked all object in blender they are perfectly between -0.5 and 0.5 I also printed the geometries and that says the same.

you mean the tiles are each 0.5?

maybe there is something that cause z-fighting?

or if this tiles are different geometries, maybe merge them together, but if terrain is one geometry(or split by chunks) then idk why this happends, maybe because camera is directly 90 degree and openGL see space between them, idk really.

I mean, I’d like to see what it looks like with the grid visible.

No, tiles are 1 each but he offsets them by 0.5 for some reason.

Effectively, they are still 0-1 and things should be fine. But… they are not.

1 Like

I’ll see what I can do with this grid. and post a picture. but I live ina different timezzone and it’s already past midnight :smiley: