Depth buffering

This commit is contained in:
FroggyGreen 2024-05-16 03:43:05 -05:00
parent 29b7e4b50b
commit 6e32539435
3 changed files with 594 additions and 407 deletions

File diff suppressed because it is too large Load Diff

View File

@ -327,9 +327,9 @@ You should have received a copy of the GNU General Public License along with Sha
(cffi:with-foreign-object (quad-instances '(:struct %pos3-pos3-color4) 2)
(setf
(cffi:mem-aref quad-instances '(:struct %pos3-pos3-color4) 0)
(make-pos3-pos3-color4 :posa (vector 10.0 10.0 1.0) :posb (vector 100.0 100.0 10.0) :color (vector 0.7 0.0 0.0 1.0))
(make-pos3-pos3-color4 :posa (vector 100.0 100.0 2.0) :posb (vector 100.0 100.0 1.0) :color (vector 0.7 0.0 0.0 1.0))
(cffi:mem-aref quad-instances '(:struct %pos3-pos3-color4) 1)
(make-pos3-pos3-color4 :posa (vector 200.0 200.0 1.0) :posb (vector 100.0 100.0 10.0) :color (vector 1.0 0.4 0.4 0.6)))
(make-pos3-pos3-color4 :posa (vector 150.0 150.0 1.0) :posb (vector 200.0 200.0 1.0) :color (vector 0.2 0.8 0.2 1.0)))
(cffi:with-foreign-object (instance-data '(:struct %mesh-instance-data))
(cffi:with-foreign-slots ((instances instance-count) instance-data (:struct %mesh-instance-data))
(setf

View File

@ -91,7 +91,7 @@ You should have received a copy of the GNU General Public License along with Sha
(defun mult-mat4-vec (m v) (mult-mat-vec m v 4))
(defun versor->mat3 (vrs)
(let* ((w (aref vrs 0)) (x (aref vrs 1)) (y (aref vrs 2)) (z (aref vrs 3))
(let* ((x (aref vrs 0)) (y (aref vrs 1)) (z (aref vrs 2)) (w (aref vrs 3))
(xx (* x x)) (yy (* y y)) (zz (* z z))
(wx (* w x)) (wy (* w y)) (wz (* z w))
(xy (* x y)) (xz (* x z)) (yz (* y z)))