502 |
bool performGL() { return false; } |
bool performGL() { return false; } |
503 |
|
|
504 |
float nonlinearity(const ZPt &p, float radius) { |
float nonlinearity(const ZPt &p, float radius) { |
505 |
|
float magfact = 10 * (mmax/mmin-1); |
506 |
|
float clampmagfact = magfact > 1 ? 1 : magfact; |
507 |
|
|
508 |
float wh = 0.5*(w+h); |
float wh = 0.5*(w+h); |
509 |
float dist = hypot((p.x-x)/w, (p.y-y)/h) - radius/wh; |
float dist = hypot((p.x-x)/w, (p.y-y)/h) - radius/wh; |
|
if(dist < 0) dist = 0; |
|
510 |
if(!finite(dist)) return 1; |
if(!finite(dist)) return 1; |
511 |
return 1 + 10 / (dist + 1); |
if(dist < 0) dist = 0; |
512 |
|
|
513 |
|
float nonl_at_zero = clampmagfact * 12; |
514 |
|
|
515 |
|
float half_dist = 1.5; |
516 |
|
return nonl_at_zero * half_dist / (dist + half_dist); |
517 |
} |
} |
518 |
}; |
}; |
519 |
|
|