From a tutorial to antialias procedural textures, i dont know how to convert the BumpInt line. I’d like to understand how the code works.
AntiAliased CheckerBoard:
float checker(float2 uv)
{
float width = filterwidth(uv);
float2 p0 = uv - .5 * width, p1 = uv + .5 * width;
#define BUMPINT(x) \
(floor((x)/2) + 2.f * max(((x)/2) - floor((x)/2) - .5f, 0.f))
float2 i = (BUMPINT(p1) - BUMPINT(p0)) / width;
return i.x * i.y + (1 - i.x) * (1 - i.y);
}