summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2023-11-15 17:57:29 +0000
committerrodri <rgl@antares-labs.eu>2023-11-15 17:57:29 +0000
commit66ce5ae042207689a912bd5b2362905c22d534be (patch)
tree340830aa965ae01f02021c061dc8d75cbd80d42d
parentc0dd49ba85d180293a6537b7f815df930f8cba15 (diff)
downloadtinyrend-66ce5ae042207689a912bd5b2362905c22d534be.tar.gz
tinyrend-66ce5ae042207689a912bd5b2362905c22d534be.tar.bz2
tinyrend-66ce5ae042207689a912bd5b2362905c22d534be.zip
correct zfb color rendering.
-rw-r--r--main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main.c b/main.c
index 3c26cb7..1d7ab4b 100644
--- a/main.c
+++ b/main.c
@@ -488,9 +488,9 @@ modelshader(Sparams *sp)
zbuf[sp->p.x+sp->p.y*Dx(fb->r)] = z;
cbuf[0] = 0xFF;
- cbuf[1] = 0xFF*z;
- cbuf[2] = 0xFF*z;
- cbuf[3] = 0xFF*z;
+ cbuf[1] = 0xFF*fabs(z);
+ cbuf[2] = 0xFF*fabs(z);
+ cbuf[3] = 0xFF*fabs(z);
memfillcolor(sp->frag, *(ulong*)cbuf);
pixel(zfb, sp->p, sp->frag);