Should be noted that `fract(x)` is importantly only equivalent to `x - floor(x)` when x >= 0. Which it was in this case, but often negative values are also possible/expected and the latter should be used instead. This is an easy mistake to make.
No, the latter. To make a lattice, we usually want to decompose x to floor(x) and whatever's left over, which is x - floor(x) and always nonnegative. fract(x) gives the leftover of trunc(x) instead and is negative when x is negative, and it's usually a logic error for a lerp variable to be outside [0, 1]. In this case, it creates artifacts along the coordinate axes.
Sharlin · · focus · HN ↗
SomeonesAccount · · focus · HN ↗
Good catch. OP should probably update the article
Sharlin · · focus · HN ↗
[deleted] · · focus · HN ↗
[deleted]