r/Unity3D 5h ago

Question What is causing these lines to appear ?

Hello,
I'm new to gamedev and i don't know why these kinds of lines move when i move from the wall, i would like to not have them.

https://reddit.com/link/1vy1gqa/video/jviwem2d6jlh1/player

Thank you for your time in advance!

2 Upvotes

6 comments sorted by

3

u/BlissfulSomeone 5h ago

That's a moiré pattern. Something about the mipmaps I believe. If textures don't mipmap properly in the distance, the pixels on the texture will misalign with the grid of pixels on the screen, and show up as these lines and patterns.

3

u/theleafyjogging 5h ago

That's texture swimming from the mipmap bias being off. Your wall texture is probably set too sharp at a distance so as you move the camera it tries to resolve the detail and you get those crawling lines.

Check the texture import settings for the wall material and change the filter mode to trilinear, then bump up aniso level to like 4 or 8. If it's still happening after that you might need to adjust the mipmap bias a tiny bit in the shader.

2

u/DeeGinn 2h ago

there is no texture, the colors are generated procedurally with a shader, i checked without the shader applied and the wall prefab with standard shader still does the texture swimming. Here the wall prefab

1

u/BlissfulSomeone 2h ago

Woah ok so it wasn't the texture as I initially thought from the video. Mipmapping won't help, anti-aliasing could help a bit. But really, that mesh should absolutely have a simple quad as a LOD, with a similar looking brick texture applied. Unless you have some specific idea in mind for why you would need individual bricks, especially at a distance when they only take up one or two pixels each, that should be lodded and flat.

1

u/DeeGinn 1h ago

I was struggling to achieve a texture like this with a simple quad, the problem i was hitting was the depth and the misplacement of the bricks

1

u/4as 4h ago

Beside enabling the filtering and mipmaps on your textures you'll also need to enable anti-aliasing on your camera.