Why have I black edges? (Painting UVs maps)

I want to do a performance test (draw calls). Six materials versus six UV maps.
To do this I made a UV map for each face of a cube.

UVCube.fbx (17.9 KB)

And I’m painting each map from a single material.
Using a material like this.

The problem is that the edges of the cube appear black.

The whole experiment is pointless if the faces of the cube are not painted perfectly.

How can I fix this problem?
Thank you so much!!


EDITED


I tried to add the inverse, because it seems that the black color is due to the color being multiplied by values ​​close to zero when approaching the origin of the coordinate axis.

However doing this breaks the colors of all the faces (There is no longer a different color on each face of the cube)… so this doesn’t work.

Any other solution is welcome.

Thank you so much!!

UVs go from 0 to 1 on 1UV face.

So you multiply your color by gradient that goes from 0 to 1, ofc, one edge will be black and opposite full color.

All faces are in same 1UV space? Then you cannot separately paint them by using uvs (they all are same foe each face).

Instead you can get face normal , calculate dot product to (1,0,0) and if its > 0.95. Face points in same direction. Dot Product is cosine, so to be accurate you can use some trigonometry to find smallest value for that cosine. But i think 0.95 should work.

Do it for all 6 faces, you will have way to find which face it is. Then use IF node. So If Dot product >0.95 = color for that face.

1 Like

Hi @Nawrot

Nope… I have 6 different UV maps (one for each face).

I want to check that it is more efficient (that it makes fewer draw calls).
Six different materials (one for each face) or six UV maps and a single material).

Apparently power at 0.1 seems to work with solid colors..

I haven’t tested what effect this would have with a texture yet. But it probably affect the scale so I think it is not a good idea after all.

Thank you very much for the help @Nawrot


DITED:


This guy is doing something similar what i want to do.
But i want to use severals UV maps and solid colors.

In case anyone is interested in the test results.

There is not difference between using six materials or a single material and six UV maps.
The drawing calls are exactly the same. Performance doesn’t improve or slow down at all.

I did the tests with 1200 cubes each.

Cubes with six materials (about 260 draw calls).

Cubes with six UV maps and a single material (about 260 draw calls).

Well, matter resolved…
If anyone would like to add any comments on this, I’d love to read them.

Thank you very much and greetings!!


EDITED:


Same test but all meshes are merged to a single actor (only six materials and only a single UV map)

177 draw calls

Empty level: (136 draw calls)