Strange Lines 3D Unity

I am working on a project using unity 5.4. In these projects, the blocks are located next to each other.

However, some annoying weird lines appear. Also on android, these lines occur more often than on a PC. For illustration purposes, I have added an image and video. Please enlarge the image to see what I am saying clearly.

Can anyone suggest a solution to get rid of this nuance. Thanks in advance.

Literature:

Block alignment code snippet:

for (int x = 0; x < xSize; x++)
        for (int z = 0; z < zSize; z++)
        {
            Vector3 pos = new Vector3(x, -layerDepth, z);
            InstantiateBlock(pos);
        }

Video link: https://youtu.be/5wN1Wn51d_Y

+2
source share
2 answers

You have object seams!

This occurs when there is a physical or perceived gap between objects.

.


1.

, int, . , , , - . .

, , . A (0,5,0,5, -0,5) B (-0,5,0,5, -0,5). Unity , A.

3 == 1/3 * 3, , float, 1/3 == 0.333333... 3 * 0.333333... == 0.999999... BINGO! !

, ? float . new vector3(1,1,1); new vector3(1f,1f,1f); - . this SOP.


2.

, Wrap-Mode padding.


3. Shadow Acne - ( )

, .

, , , , , , . .

Unity... , Shadow Type > shadow Bias, 0,05, . max, ...

, GameObject . , GameObject , .

+7

, ? , , - ( Y: ). / . , , , .

0

Source: https://habr.com/ru/post/1662361/


All Articles