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)…
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…
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
Thanks so far… I’ll come back soon with something.
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.
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
Anyway want to say thank you to this incredible helpful community.
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?
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.
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.