Information:
tile’s GameObject scale is Vector3.one(1, 1, 1).
The distance between tiles is 1.
This is originally a 32 bit texture game, but the GIF tool was made into low quailty. (it’s not exactly 16bit. thx jvo3dc)
plz consider this.
Question:
Outline(it just mesh & texture. not a shader things) of these tiles are very flickering. how can I fix it?
(At first I thought this was a z-fighting problem. then I try to control near-far plane values but not working.)
Changing the clip planes doesn’t guarantee a solution to z-fighting. The best solution in my opinion is to actually have 0 distance between the two objects. Any small difference can lead to z-fighting, but rendering the exact same object twice won’t. You do have to make sure the vertex shader is exactly the same for the part that calculates the clip space position of the vertices.
Offtopic: GIF uses a 8 bit index (or palette) with 24 bit colors. 16 bit and GIF don’t really make sense.
I knew now about GIF details. Thank you very much for sharing your knowledge.
So are you sure this is z-fighting? If so, I will look for more ways in that direction.
I’m not sure it’s z-fighting, but I am sure that changing clip planes doesn’t always solve it. It’s a bit hard to see on the gif. Maybe turn it in to an actual video?
Well, if the lines are separate objects, z-fighting. You should always try to avoid these type of overlay solutions. These lines can simply be applied to the boxes by a texture.
On the white cubes, that’s probably an artifact of MSAA causing it to sample the texture outside the UVs. You probably want to fill the white area with the outline color, and maybe increase the gutter between faces.
The way MSAA works is it tests if a triangle is overlapping one or more of N subpixel points (i.e.: 4x MSAA tests 4 subpixel locations), but it still renders at the center of the pixel. That means it’s possible the position being rendered is actually outside the surface of a triangle.
Actually, I was testing with MSAA off and tried most of the ways - like fill white area with outline color, or fill with transparent, increase gutter, reduce gutter, add some paddings with outline color, transparent, white and etc. so Im out of idea