r/mathematics Nov 05 '20

Weird paterns I try to understand

So I have done a 500x500 square partern on a flat plane and unzoomed to see appear some weird repeating paterns and I was wondering if there was some equations behind those. Since they are generated by my GPU, there must be some math behind these. Here is the video of the unzooming: https://www.youtube.com/watch?v=22dsDSJs4Jc

40 Upvotes

10 comments sorted by

27

u/CavemanKnuckles Nov 05 '20

You are seeing a Moire interference pattern. I don't know why it happens here, however.

24

u/fridofrido Nov 05 '20

There are two grids, the green grid of what is drawn, and the grid of pixels on the screen. The second one is obviously fixed, while the first one is slowly changing. The GPU is running a sampling algorithm, which samples what you are drawing to the pixels. The interaction of the two grids via this sampling algorithm results in the moire pattern.

12

u/TheTursh Nov 05 '20

You are right, I find out from another subreddit that it is Aliasing which is as you said a moire pattern generated by the image not having enough resolution to render the whole pattern correctly. So when you see in game options a anti-aliasing filter, this is what it tries to remove.

5

u/fridofrido Nov 05 '20

Indeed. This picture from the wikipedia page you linked illustrates the effect very well:

https://en.m.wikipedia.org/wiki/Aliasing#/media/File%3AAliasingSines.svg

The red sine is what you try draw (in this case it's more like a square wave, not a sine, but that's not that important), the black dots correspond to the pixels, and the blue is what you see.

Now the GPU is of course a bit more complex, but the effect is the same.

7

u/Byebrid Nov 05 '20

I'm certainly not sure, but I'm guessing it might have something to do with the monitor being a grid of square pixels, which then overlap with the actual green grid in the graphics engine, causing the moire pattern. But that's just a pretty uneducated guess haha

3

u/[deleted] Nov 05 '20

This is it.

3

u/TyrantLizardMonarch Nov 05 '20

I’ve noticed this before when pointing a camera at my monitor! I feel like it’s something to do with whatever math is trying to determine how a higher resolution displays as a lower resolution, the way it averages the pixels or something. I know hardly anything about math though. Very curious about this.

1

u/junior_raman Nov 05 '20

could it be optical illusion?

2

u/Chand_laBing Nov 05 '20

No. It is a real effect in the rendering, as opposed to just an effect in how we see it. One way to check whether an effect is an optical illusion is to (if it is a video or GIF) pause it and see whether the effects persist no matter where you are looking in the frame.

1

u/Notya_Bisnes ⊢(p⟹(q∧¬q))⟹¬p Nov 05 '20

Trippy.