From b34446e7025a15bd5b74fd5f88bb952028cc8a4a Mon Sep 17 00:00:00 2001 From: rodri Date: Sat, 23 Dec 2023 00:12:34 +0000 Subject: organize the code better. --- shadeop.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 shadeop.c (limited to 'shadeop.c') diff --git a/shadeop.c b/shadeop.c new file mode 100644 index 0000000..c9d3353 --- /dev/null +++ b/shadeop.c @@ -0,0 +1,28 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include "libobj/obj.h" +#include "dat.h" +#include "fns.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); +} -- cgit v1.2.3