diff options
author | rodri <rgl@antares-labs.eu> | 2024-01-30 19:34:55 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-01-30 19:34:55 +0000 |
commit | feecec6c4d7f3798c2298cd6c68b06d77eab719d (patch) | |
tree | dcd4dc45afa0b1e5345322702380c9c8c8a71442 | |
parent | 19c85d5ea0a31fd311a4ca0cbe75e0d1a0c2cc0d (diff) | |
download | libgraphics-feecec6c4d7f3798c2298cd6c68b06d77eab719d.tar.gz libgraphics-feecec6c4d7f3798c2298cd6c68b06d77eab719d.tar.bz2 libgraphics-feecec6c4d7f3798c2298cd6c68b06d77eab719d.zip |
make the vertex shader process actual vertices.
-rw-r--r-- | camera.c | 1 | ||||
-rw-r--r-- | graphics.h | 3 | ||||
-rw-r--r-- | render.c | 9 |
3 files changed, 5 insertions, 8 deletions
@@ -92,6 +92,7 @@ shootcamera(Camera *c, OBJ *m, Memimage *tex, Shader *s) c->vp->fbctl->reset(c->vp->fbctl); t0 = nanosec(); + /* TODO let the user choose the nproc value (left at 1 for now) */ shade(c->vp->fbctl->fb[c->vp->fbctl->idx^1], m, tex, s, 1); /* address the back buffer */ t1 = nanosec(); c->vp->fbctl->swap(c->vp->fbctl); @@ -35,8 +35,7 @@ typedef Vertex Triangle[3]; struct VSparams { SUparams *su; - Point3 *p; - Point3 *n; + Vertex *v; uint idx; }; @@ -253,16 +253,13 @@ shaderunit(void *arg) t[0].n = t[1].n = t[2].n = mulpt3(n, -1); } - vsp.p = &t[0].p; - vsp.n = &t[0].n; + vsp.v = &t[0]; vsp.idx = 0; t[0].p = params->vshader(&vsp); - vsp.p = &t[1].p; - vsp.n = &t[1].n; + vsp.v = &t[1]; vsp.idx = 1; t[1].p = params->vshader(&vsp); - vsp.p = &t[2].p; - vsp.n = &t[2].n; + vsp.v = &t[2]; vsp.idx = 2; t[2].p = params->vshader(&vsp); |