0
\$\begingroup\$

I'm trying to piece together some very simple placeholder models that I intend to use as tiles in Unity and I'm seeing odd pixel artifacts along the seams of the tiles that only show up when using an isometric camera. You can see them in this image.

Example of isometric artifacts

And the same geometry but just from a perspective camera shows no artifacts.

Example of perspective with no artifacts

I verified that the two models are exactly aligned right along the seam by checking the actual vertex data. The artifacts are dependent on the camera itself and shift along the seam as the camera is panned and zoomed.

I've disabled shadows, set the texture filter mode to point, disabled mipmap generation

The geometry is quite simple and is imported from the OBJ file below.

# normals
vn -1 0 0
vn 1 0 0
vn 0 0 1
vn 0 0 -1
vn 0 -1 0
vn 0 1 0

# texcoords
vt 0.970703 0.5
vt 0.974609 0.5

# verts
v 0 2 0
v 0 2 -4
v 0 2.3 0
v 0 2.3 -4
v 0 2.5 0
v 0 2.5 -4
v 4 2 0
v 4 2 -4
v 4 2.3 0
v 4 2.3 -4
v 4 2.5 0
v 4 2.5 -4

# faces
f 3/2/1 2/2/1 1/2/1
f 4/2/1 2/2/1 3/2/1
f 5/1/1 4/1/1 3/1/1
f 6/1/1 4/1/1 5/1/1
f 7/2/2 8/2/2 9/2/2
f 9/2/2 8/2/2 10/2/2
f 9/1/2 10/1/2 11/1/2
f 11/1/2 10/1/2 12/1/2
f 7/2/3 3/2/3 1/2/3
f 9/1/3 5/1/3 3/1/3
f 9/2/3 3/2/3 7/2/3
f 11/1/3 5/1/3 9/1/3
f 2/2/4 4/2/4 8/2/4
f 4/1/4 6/1/4 10/1/4
f 8/2/4 4/2/4 10/2/4
f 10/1/4 6/1/4 12/1/4
f 2/2/5 7/2/5 1/2/5
f 8/2/5 7/2/5 2/2/5
f 5/1/6 11/1/6 6/1/6
f 6/1/6 11/1/6 12/1/6

With the following texture applied as Albedo on a default Unity material (a bit odd since it was originally generated in MagicaVoxel)

Texture

I'm really at a loss for what could be causing these to show up. Only spotted them because I was testing an outline shader and it was outlining all the artifacts as the normals on those pixels were odd. With a pixel shader set to display _CameraNormalsTexture instead of the color the artifacts are still visible as variances in the normals as you can see in the image below.

Same image but of camera normals

\$\endgroup\$
  • \$\begingroup\$ How are your near & far plane distances configured on your camera? \$\endgroup\$ – DMGregory Jan 4 at 11:50
  • \$\begingroup\$ Just the default 0.3 and 1000. Setting the near plane lower doesn't change anything but the more I up the far plane the more artifacting I see. At 100000 they form almost an entire solid line across the seam. \$\endgroup\$ – Brian Jan 4 at 19:24
  • \$\begingroup\$ What happens if you increase the near distance and decrease the far? Say something like (1, 100) \$\endgroup\$ – DMGregory Jan 4 at 20:18
  • \$\begingroup\$ Still showing up with (1, 100) but less frequently as I drop the far distance. \$\endgroup\$ – Brian Jan 4 at 20:34
  • \$\begingroup\$ I was able to resolve the issue by removing the invisible vertical faces between the tiles. As I don't 100% understand why they were causing issues with the surface normals I won't post that as an answer here. Still curious what exactly is going on even though the problem is resolved. \$\endgroup\$ – Brian Jan 4 at 20:36
1
\$\begingroup\$

This appears to be due to some Z fighting between the edge of the horizontal quad and the edge of the vertical quad of the tile. Removing the vertical quads (and adding them back as individual pieces on just the edges of the terrain) resolved the issue.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.