shithub: 3dee

Download patch

ref: 02fff2dc22f7ed79aea7dfddd8d5e8f180052f25
parent: 3000f7986489f01ecda0d20af68dc73c2f074fa9
author: rodri <rgl@antares-labs.eu>
date: Tue Jan 30 14:39:26 EST 2024

adapt the vertex shaders.

--- a/main.c
+++ b/main.c
@@ -109,12 +109,12 @@
 Point3
 vertshader(VSparams *sp)
 {
-	*sp->n = qrotate(*sp->n, Vec3(0,1,0), θ+fmod(ω*sp->su->uni_time/1e9, 2*PI));
-	sp->su->var_intensity[sp->idx] = fmax(0, dotvec3(*sp->n, light));
-	*sp->n = world2vcs(maincam, *sp->n);
-	*sp->p = qrotate(*sp->p, Vec3(0,1,0), θ+fmod(ω*sp->su->uni_time/1e9, 2*PI));
-	*sp->p = ndc2viewport(maincam, world2ndc(maincam, *sp->p));
-	return *sp->p;
+	sp->v->n = qrotate(sp->v->n, Vec3(0,1,0), θ+fmod(ω*sp->su->uni_time/1e9, 2*PI));
+	sp->su->var_intensity[sp->idx] = fmax(0, dotvec3(sp->v->n, light));
+	sp->v->n = world2vcs(maincam, sp->v->n);
+	sp->v->p = qrotate(sp->v->p, Vec3(0,1,0), θ+fmod(ω*sp->su->uni_time/1e9, 2*PI));
+	sp->v->p = ndc2viewport(maincam, world2ndc(maincam, sp->v->p));
+	return sp->v->p;
 }
 
 Memimage *
@@ -264,7 +264,7 @@
 Point3
 ivshader(VSparams *sp)
 {
-	return ndc2viewport(maincam, world2ndc(maincam, *sp->p));
+	return ndc2viewport(maincam, world2ndc(maincam, sp->v->p));
 }
 
 Memimage *