Color Banding Effect on Point Clouds

I am trying to create a material instance that creates a color banding effect on a point cloud.

Basically taking this color pattern:

and repeating it a number of times based on a scalar parameter (called banding). For banding=3, the color would repeat in thirds:

This is the material blueprint so far:

Any help would be greatly appreciated!

World position, component mask RG, divide, sine, then lerp between your colors. This will produce an oscillating sine wave throughout the world and use the mesh’s position to calculate the coloring.

If you want 3 colors, that’s trickier. I’ve done this before, but I’m not sure if my method is the most appropriate. I imagine at a certain point it would be much cheaper to use a texture to reference colors, and just plug the world position in UVs. That’s what I do to make colored lines over mountain rocks.

Thank you! I have the effect working

I don’t intend on using more than 2 colors to lerp between, but I still appreciate the pointers