diff options
author | rodri <rgl@antares-labs.eu> | 2024-06-10 15:59:57 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-06-10 15:59:57 +0000 |
commit | 213c3a4e99c3085ee89fda550897213abbc888ad (patch) | |
tree | 6dead68a5f64ca4d23285ab3dd13a7a36e4fea92 /util.c | |
parent | 239a319b41474a35e4c9c4b7c6ae3c6e0b0b7185 (diff) | |
download | libgraphics-213c3a4e99c3085ee89fda550897213abbc888ad.tar.gz libgraphics-213c3a4e99c3085ee89fda550897213abbc888ad.tar.bz2 libgraphics-213c3a4e99c3085ee89fda550897213abbc888ad.zip |
add spotlight params and a light color shading routine. other things.
among these other things are clamping the color
channels to [0,1] internally, and adding a
modulation function for mixing colors/points.
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -52,6 +52,18 @@ swappt(Point *a, Point *b) *b = t; } +Point2 +modulapt2(Point2 a, Point2 b) +{ + return (Point2){a.x*b.x, a.y*b.y, a.w*b.w}; +} + +Point3 +modulapt3(Point3 a, Point3 b) +{ + return (Point3){a.x*b.x, a.y*b.y, a.z*b.z, a.w*b.w}; +} + void memsetd(double *p, double v, usize len) { |