[jak 2] add lightning renderer (#2203)

Implements the jak 2 lightning renderer as an alternate path through
Generic2. Also set up some generic stuff in the goal code.

There is a problem with the texture pool, which doesn't support the case
where two textures have the same tbp, but different cluts. So lightning
is often the wrong color (usually red).
This commit is contained in:
water111
2023-02-09 19:11:13 -05:00
committed by GitHub
parent 722ffa3f19
commit e26efcc4f3
27 changed files with 706 additions and 123 deletions
+56 -8
View File
@@ -372,20 +372,68 @@
)
(cond
((zero? a1-1)
(set! (-> v1-3 base-strgif qword vector4w y) #x303e4000)
(set! (-> v1-3 base-strgif qword vector4w x) #x303ec000)
(set! (-> v1-3 base-strgif str-prim)
(new 'static 'gif-tag-prim
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
(set! (-> v1-3 base-strgif fan-prim)
(new 'static 'gif-tag-prim
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
((= a1-1 1)
(set! (-> v1-3 base-strgif qword vector4w y) #x303d4000)
(set! (-> v1-3 base-strgif qword vector4w x) #x303d4000)
(set! (-> v1-3 base-strgif str-prim)
(new 'static 'gif-tag-prim
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
(set! (-> v1-3 base-strgif fan-prim)
(new 'static 'gif-tag-prim
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
((= a1-1 2)
(set! (-> v1-3 base-strgif qword vector4w y) #x30364000)
(set! (-> v1-3 base-strgif qword vector4w x) #x3036c000)
(set! (-> v1-3 base-strgif str-prim)
(new 'static 'gif-tag-prim
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
(set! (-> v1-3 base-strgif fan-prim)
(new 'static 'gif-tag-prim
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
((= a1-1 3)
(set! (-> v1-3 base-strgif qword vector4w y) #x30354000)
(set! (-> v1-3 base-strgif qword vector4w x) #x3036c000)
(set! (-> v1-3 base-strgif str-prim)
(new 'static 'gif-tag-prim
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
(set! (-> v1-3 base-strgif fan-prim)
(new 'static 'gif-tag-prim
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
)
)