Reading through the math node docs, I came across a math function named "ping-pong".
The docs state that ping-pong does the following
The output value is moved between 0.0 and the Scale based on the input value.
What in the world does that mean? Can anyone tell me what the actual ping-pong function is? What input values lead to an output of 0, and what input values lead to an output of "scale"?




..but someone else might come up with a neater way.. :)
You can remove the inner abs:
Start with abs(input), then flip it with a negative sign:
-abs(input)Then add scale to move it up:
scale - abs(input)Then get it in range:
scale - abs(input%2*scale)Finally shift the peak so that it sits at scale:
– Nickolai Oct 28 '23 at 19:23scale - abs(input%(2*scale)-scale)