Variable-hardness clipping function¶
- Author or source: Laurent de Soras (moc.ecrofmho@tnerual)
- Created: 2004-04-07 09:36:46
- Linked files:
k >= 1 is the "clipping hardness". 1 gives a smooth clipping, and a high value gives hardclipping. Don't set k too high, because the formula use the pow() function, which use exp() and would overflow easily. 100 seems to be a reasonable value for "hardclipping"
f (x) = sign (x) * pow (atan (pow (abs (x), k)), (1 / k));