1
$\begingroup$

Cube with artifacts

This happens with the following node configuration:

Modulo node configuration

It is caused by the modulo (or Fract) operation. I stumbled upon this problem while trying to repeat coordinates on a cube. It works fine on a plane.

Any idea why is this happening? The effect is similiar to z-fighting and only happens in perspective view. In orthographic that side is black. Is the modulo operation for some reason unable to determine a value at that side of the cube ?

$\endgroup$
3
$\begingroup$

The Modulo node, when used with vector input repeats the output values at regular intervals, in this case $1$ unit.

You are using Generated texture coordinates as input which uses the objects size for coordinates, meaning it that maximum X,Y or Z are always considered at coordinate $1$ regardless off absolute dimensions.

Since in this case geometry is a cube, there is a planar face at precisely the coordinate X=$1$ which is the boundary point exactly where the Modulo pattern repeats itself and goes from black to white.

And that is what you are seeing, it is not Z-Fighting per-se but it is exactly the same kind of mathematical imprecision computers can't really solve well.

enter image description here

$\endgroup$
  • 2
    $\begingroup$ For the math minded, Modulo is the remainder of input after division by value. In this case value is 1.0. $\endgroup$ – batFINGER Jul 19 at 14:21
  • $\begingroup$ Indeed, thanks for the correction, math is really not my forte. Answer corrected $\endgroup$ – Duarte Farrajota Ramos Jul 19 at 16:15

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.