Pixels inbetwen non conected polygons.

Hi.
I have chunks(separate game objects) of polygons and i see pixels (of the skybox) in between them even if they are perfectly aligned. Pixels flashes when i move the camera. How to make them stop? If I have one pixel visible and don’t move the camera but change the Anti Aliasing the pixel seams to move around or sometimes disappear.

I made a video showing the problem. Project null - Post 3 "Asking for technical help" - YouTube

Every block in the chunk is 1 unity unit.

The shader don’t affect the problem. When I have a pixel fixed on the screen and don’t “look around”(fixed rotation and position of camera) and change the shader(have tried 10 different) the pixel stays the same.

The only thing affecting the shader is anti aliasing(the fix pixel disappear but as i move the screen new ones reapers a little bit darker) and changing the sky box(the pixel is clearly corresponding to the skybox color at that spot).

SOLUTION
I did add 0.00005f on all sides. The faces got from being 1x1 to 1.00005x1.00005. I did initially add 0.00001f but eventually did find one pixel and did increas to 0.00005f.

/Johan

The workaround you found is probably the only way to go. The pixels result from floating point imprecisions in the vertex calculations. These imprecisions are not a problem/not existent if it’s a single mesh GameObject, but as every GameObject has its (float) transformation matrix, floating point errors are unavoidable.

With anti-aliasing on you just re-distribute these pixels to several different pixels, averaging (=dimming) them.

There are two other workarounds I can think of, but both have serious drawbacks - one will reduce your performance, the other will take some programming work and makes your scene static, so you can no longer move cubes around:

  • Draw another plane/object behind your actual objects, or close up your objects (=make them fill cubes, or add separationg planes inbetween), in the same/similar color as your foreground object. This will at least prevent skybox pixels and make them the same/similar color. This will increase your polygon count and probably kill your fillrate.
  • Write a script that merges vertices from different GameObjects together if they are close together (=smaller some eps). There is the CombineChildren script, which might already do that. However, this will essentially merge meshes of different GO’s together, so they can no longer be transformed individually.

Make sure the textures’ settings are ‘clamped’ and not ‘repeat’