Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-1794

White stitching on polygon edges / White lines or black dots between blocks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.4.1, Minecraft 1.4.2, Minecraft 1.4.3, Minecraft 1.4.5, Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w02b, Snapshot 13w03a, Snapshot 13w04a, Snapshot 13w05a, Snapshot 13w05b, Snapshot 13w06a, Snapshot 13w07a, Snapshot 13w09a, Snapshot 13w09b, Snapshot 13w09c, Snapshot 13w10a, Snapshot 13w10b, Minecraft 1.5, Snapshot 13w11a, Minecraft 1.5.1, Minecraft 1.5.2, Minecraft 14w08a, Minecraft 1.7.5, Minecraft 14w11b, Minecraft 1.7.9, Minecraft 14w17a, Minecraft 14w18a, Minecraft 14w29b, Minecraft 14w30a, Minecraft 14w30b, Minecraft 14w31a, Minecraft 14w33a, Minecraft 1.8-pre1, Minecraft 1.8, Minecraft 1.8.1, Minecraft 1.8.8, Minecraft 15w39b, Minecraft 15w44b, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1 Pre-Release 2, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.2, Minecraft 1.9.3 Pre-Release 1, Minecraft 1.9.3 Pre-Release 2, Minecraft 1.9.3 Pre-Release 3, Minecraft 1.9.4, Minecraft 16w20a, Minecraft 16w21a, Minecraft 16w21b, Minecraft 1.10 Pre-Release 1, Minecraft 1.10 Pre-Release 2, Minecraft 1.10, Minecraft 1.10.1, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w42a, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13b, Minecraft 1.12 Pre-Release 6, Minecraft 1.12, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, Minecraft 1.12.2, Minecraft 17w43b, Minecraft 18w03b, Minecraft 18w06a, Minecraft 18w07a, Minecraft 18w21b, Minecraft 18w22c, Minecraft 1.13-pre1, Minecraft 1.13-pre2, Minecraft 1.13-pre3, Minecraft 1.13-pre5, Minecraft 1.13-pre7, Minecraft 1.13-pre8, Minecraft 1.13, Minecraft 18w30b, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, Minecraft 19w02a, Minecraft 19w03a, Minecraft 19w03b, Minecraft 19w03c, Minecraft 19w12b, Minecraft 19w13b, Minecraft 19w14a, Minecraft 19w14b, Minecraft 1.14 Pre-Release 1, Minecraft 1.14 Pre-Release 2, Minecraft 1.14, 1.14.4, 19w35a, 19w41a, 1.15 Pre-release 1, 1.15 Pre-Release 2, 1.15, 1.15.1, 1.15.1 Pre-release 1, 1.15.2 Pre-Release 1, 1.15.2 Pre-release 2, 1.15.2, 20w06a, 20w07a, 20w08a, 20w09a, 20w10a, 20w11a, 20w12a, 20w13a, 20w13b, 20w15a, 20w16a, 20w17a, 20w18a, 20w19a, 20w20a, 20w20b, 20w21a, 20w22a, 1.16 Pre-release 1, 1.16 Pre-release 2, 1.16 Pre-release 3, 1.16 Pre-release 5, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w27a, 20w28a, 20w30a, 1.16.2 Pre-release 1, 1.16.2 Release Candidate 1, 1.16.2 Release Candidate 2, 1.16.2, 1.16.3 Release Candidate 1, 1.16.3, 1.16.4 Pre-release 1, 1.16.4 Pre-release 2, 1.16.4 Release Candidate 1, 1.16.4, 20w45a, 20w46a, 20w48a, 20w49a, 20w51a, 21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, 21w07a, 21w08b, 21w11a, 21w14a, 21w15a, 21w17a, 21w19a, 1.17 Pre-release 2, 1.17 Pre-release 3, 1.17 Pre-release 4, 1.17, 1.17.1 Pre-release 1, 1.17.1, 21w37a, 21w38a, 21w39a, 21w40a, 21w41a, 21w43a, 1.18 Pre-release 1, 1.18 Pre-release 2, 1.18 Pre-release 5, 1.18 Release Candidate 4, 1.18, 1.18.2, 22w12a, 22w16b, 22w18a, 1.19, 1.19.2, 1.19.3, 23w04a, 23w05a, 23w06a, 1.19.4, 23w12a, 23w14a, 1.20, 1.20.1, 1.20.2, 1.20.4, 24w04a, 24w10a, 1.21, 24w40a, 1.21.3
    • None
    • Confirmed
    • Rendering
    • Low
    • Platform

      Mod notice

      This issue is often caused by settings within Nvidia graphics drivers. These can be edited through the NVIDIA Control Panel, which can be opened by right-clicking on your PC desktop, or by searching in the Windows start menu. The following settings can be changed:

      • Under Adjust image settings with preview, set the default to Let the 3D application decide
      • Under Manage 3D settings:
        • Disable Anisotropic Filtering
        • Disable Antialiasing

      Some users have also reported this issue to be reduced when changing the level of Mipmap under the Minecraft Video Settings (lowering to 0).

      Optifine has some advanced settings that might fix this issue. Note however that this might have performance penalties and Optifine is not supported by Mojang or this bug tracker.

      Update: The cracks between 16x16x16 sections have existed for a long time, and still do. Crack theory has been, is, and will still be applicable. The lines that started to appear in between every block in the 1.5 snapshots and should be fixed in 1.5.1 were caused by texture coordinates overflowing their tile slightly in the rasterizer.

      Crack theory

      Cracks occur in rasterizers like OpenGL when edges that should align don't match exactly. This can happen if an inexact calculation is used, and vertices that should be the same end up in slightly different places. The errors may seem minuscule, but they invariably result in severe flickering along the cracks. The rasterizer will miss a few pixels and fill others twice. Using different OpenGL transformations to move different vertices to the same place counts as inexact:

      glRectf(0, 0, 1, 1);
      glRectf(1, 0, 2, 1);
      
      glRectf(0, 0, 1, 1);
      glTranslatef(0, 0, 1);
      glRectf(0, 0, 1, 1);
      

      The former will always, unquestionably align. The latter will have a crack. While associativity would tell us that both examples are the same, rounding error does not succumb to associativity. 32-bit floats are exact for integers in [-2^24, 2^24], scaled by a power of two. 64-bit doubles reach a whopping 2^53. If both operands of an addition are round enough (in binary), the result will be exact. This would be typical for code like the first example. Rolling the same addition into a transformation matrix will almost certainly be inexact, because the matrix is polluted by everything else in it. Really the only way to get it right is to perform a separate addition before the matrix.

      If you perform the addition in a vertex shader, keep it separate and it should be okay, save for the hypothetical implementation that optimizes both into a matrix (if they're still technically allowed to optimize willy-nilly nowadays):
      Edit: Uniform state is slow to change, so an attribute used like a uniform would likely be faster than a uniform.

      uniform vec3 translation;
      void main() {
          vec4 vertex = gl_Vertex;
          vertex.xyz += translation;
          gl_Position = gl_ModelViewProjectionMatrix * vertex;
      }
      

      What's cool about this is that even if you're very far from the world origin, you can still keep everything that matters exact. It also doesn't have a stepping or distortion problem in the Far Lands. The CPU code should do something like this:

      dvec3 camera;
      dvec3 roundedCamera = camera.roundToMultipleOf(16); // Assuming your world transformations are normally a multiple of 16. Can be demoted to float if you stay within 16 * 2^24 blocks. This is half of the magic, by reducing the translation fed into OpenGL to almost nothing.
      dvec3 difference = offset - rounded; // Not critical and rather small; can be demoted to float, and will be when fed to OpenGL.
      // Substitute difference for camera when calculating the camera transformation.
      

      Then, before drawing each batch:

      dvec3 translationOfBatch; // Can be float if roundedCamera can be.
      dvec3 translation = translationOfBatch - roundedCamera; // This is the other half of the magic. Two potentially huge numbers are reduced to a small, exact multiple of 16. Can certainly be demoted to float, and will be.
      // Load the uniform.
      

      I hope this is enough theory to help you understand and fix cracks. Now, on to the actual problem description:

      Description

      Previously, cracks would only appear in between 16x16x16 sections. Not as it should be either, but hardly worth reporting. In the latest snapshots, however, they appear in between every single block. That is too much.

      The screenshot shows a superflat world with preset "2;7,62x0,49;2", viewed from below. It should be viewed at its full 1920x1200 size to see the speckles. Incidentally, Minecraft thinks it should light the underside of the obsidian when I get close to it.

      Addendum: textures?

      After noticing the directionality of the cracks, I realized it's crossing over into adjacent tiles on the texture. That could explain some or all of this bug. I will upload a second screenshot demonstrating that. It's of a similar superflat world, but using purple wool (35:10) instead of obsidian.

      What you see is a close-up of the vertex joining four blocks. You can see some yellow seeping through one edge, and blue through the other. Indeed, those are wool blocks adjacent to the right and below, respectively, in stitched_terrain.png generated by an older snapshot. There is also some sky showing through next to the blue wool (I know it's the sky because it becomes black at night). I'd expect it to be orange wool as that is located above it in stitched_terrain.png, but then that file is probably outdated. It may well be that the adjacent texture is transparent. Indeed, green wool doesn't have this 'crack'. Texture coordinates should be the only difference between wool colors, therefore this should be responsible.

      Older versions of Minecraft used to move their texture coordinates inward just a tiny amount to avoid this issue. Was that tweak removed when the rendering engine was overhauled?

        1. RST (2).zip
          189 kB
        2. newsnap2.png
          newsnap2.png
          63 kB
        3. newsnap.png
          newsnap.png
          67 kB
        4. MC-1794 RGB and Black Lines - 7.97mb.mp4
          7.98 MB
        5. MC1_14Bug.jpg
          MC1_14Bug.jpg
          3.00 MB
        6. dark cave.jpg
          dark cave.jpg
          83 kB
        7. 2018-08-08_16.26.51.png
          2018-08-08_16.26.51.png
          2.29 MB
        8. 2017-03-07_12.41.09.png
          2017-03-07_12.41.09.png
          269 kB
        9. 2016-12-31_09.48.42.png
          2016-12-31_09.48.42.png
          1.28 MB
        10. 2016-12-31_09.48.37.png
          2016-12-31_09.48.37.png
          989 kB
        11. 2016-12-31_09.48.28.png
          2016-12-31_09.48.28.png
          980 kB
        12. 2016-04-27_09.33.59.png
          2016-04-27_09.33.59.png
          473 kB
        13. 2014-09-06_18.39.00.png
          2014-09-06_18.39.00.png
          773 kB
        14. 2014-07-27_18.51.47.png
          2014-07-27_18.51.47.png
          1.84 MB
        15. 2014-05-01_17.01.17(2).png
          2014-05-01_17.01.17(2).png
          472 kB
        16. 2014-02-20_14.07.16.png
          2014-02-20_14.07.16.png
          187 kB
        17. 2013-04-12_13.00.35.png
          2013-04-12_13.00.35.png
          299 kB
        18. 2013-03-15_17.13.41.png
          2013-03-15_17.13.41.png
          56 kB
        19. 2013-03-15_17.07.57.png
          2013-03-15_17.07.57.png
          258 kB
        20. 2013-03-07_15.56.58 - Lines Thru Blocks Transpencey.png
          2013-03-07_15.56.58 - Lines Thru Blocks Transpencey.png
          67 kB
        21. 2013-03-07_15.56.58 - Lines Thru Blocks Tranceparencey - Zoomed.png
          2013-03-07_15.56.58 - Lines Thru Blocks Tranceparencey - Zoomed.png
          178 kB
        22. 2013-03-06_14.50.13.png
          2013-03-06_14.50.13.png
          195 kB
        23. 2013-03-03_16.17.47.png
          2013-03-03_16.17.47.png
          447 kB
        24. 2013-03-03_16.16.17.png
          2013-03-03_16.16.17.png
          138 kB
        25. 2013-03-03_16.10.04.png
          2013-03-03_16.10.04.png
          521 kB
        26. 2013-02-18_18.31.49.png
          2013-02-18_18.31.49.png
          190 kB
        27. 2013-01-28_15.19.37.png
          2013-01-28_15.19.37.png
          1.96 MB
        28. 2013-01-27_17.17.01.png
          2013-01-27_17.17.01.png
          135 kB

            Unassigned Unassigned
            jonathan2520 jonathan2520
            Votes:
            597 Vote for this issue
            Watchers:
            121 Start watching this issue

              Created:
              Updated:
              CHK: