ref: 22e341ed6fc92f7bd547b0e6b1d5501d3eb9a7db
dir: /shadeop.c/
#include <u.h> #include <libc.h> #include <thread.h> #include <draw.h> #include <memdraw.h> #include <geometry.h> #include "libobj/obj.h" #include "graphics.h" #include "internal.h" double step(double edge, double n) { if(n < edge) return 0; return 1; } double smoothstep(double edge0, double edge1, double n) { double t; t = fclamp((n-edge0)/(edge1-edge0), 0, 1); return t*t * (3 - 2*t); }