21
\$\begingroup\$

If you place a large number of identical elements in a regular pattern, then look at them from a distance, they will make strange warped grid patters that shift as you move your viewpoint, as shown in this video. This is found not only in Minecraft, but also in any program.

Stills from video, showing regular pattern of blocks close up, and enlarged distorted grid at a distance

I'm wondering if this effect has a name and how it can be explained.

\$\endgroup\$
2
  • 27
    \$\begingroup\$ We can even explain it in song! ♫ When a grid's misaligned / With another behind / That's a moiré... ♫ When the spacing is tight / And the difference is slight / That's a moiré ♫ \$\endgroup\$
    – DMGregory
    Aug 26, 2022 at 10:29
  • \$\begingroup\$ @RosieF that's exactly where the link in my comment points. \$\endgroup\$
    – DMGregory
    Aug 29, 2022 at 11:07

1 Answer 1

40
\$\begingroup\$

It's a moiré pattern caused by aliasing. In your examples, the Moiré patterns occur when a repetitive pattern of high spatial frequency is sampled at low resolution.

Consider the Wikipedia example reference image:

high resolution brick wall

The bricks form a repetitive pattern. Because there's many bricks, the resulting texture has a high spatial frequency. Here's the same image with a reduced resolution:

same wall with lower resolution

Lowering the resolution has lowered our sample rate to the point that an obvious moiré pattern occurs. Because there are fewer pixels, information has been lost. And because the brick texture isn't perfectly aligned to the pixel grid, the information isn't lost evenly - some bricks lose more red brick pixels than their neighbors & the similarly for the white mortar pixels. This puts the periodic spatial signal of the brickwork out of phase. The threshold for this problem is determined by the Nyquist–Shannon sampling theorem.

Mipmapping can be used to reduce the artifacts on moiré prone textures. But in your Minecraft example, the 'texture' is effectively made across multiple blocks, so it can't be mitigated by mipmaps. Spatial anti-aliasing could help, but only to a point as we are limited by the finite nature of the screen. Generally speaking, the goal is to get something that's good enough through some combination of graphics techniques (to reduces the artifacts), art / texture choices (to avoid error prone visuals) and game design (to make occurrences brief &/or less impactful).

\$\endgroup\$
4
  • \$\begingroup\$ Minecraft has a mipmapping option but in my experience it doesn't resolve some of the issues. \$\endgroup\$
    – qwr
    Aug 27, 2022 at 5:17
  • 2
    \$\begingroup\$ @qwr Yes, it has mipmapping, but it only addresses the problem with respect to the texture on a given block or a collection of blocks with the same texture. In the images shown in the question, a variety of different blocks are being put together to emulate an RGB screen & the spatial frequency of the RBG 3x3 blocks (plus the black grid around them) is what is contributing to the moiré pattern. Mipmapping can't help with that because the signal is spread across multiple blocks & the signal is made dynamically by the player at runtime. \$\endgroup\$
    – Pikalek
    Aug 27, 2022 at 16:39
  • 1
    \$\begingroup\$ The solution (which is alluded to with mipmapping) is to remove the high frequency image components by applying a low-pass filter. \$\endgroup\$
    – DrMcCleod
    Aug 28, 2022 at 11:29
  • \$\begingroup\$ THANKS! This is a good answer \$\endgroup\$
    – bum3n
    Sep 10, 2022 at 5:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .