jak-project icon indicating copy to clipboard operation
jak-project copied to clipboard

[merc2] fade-out effect is not implemented.

Open water111 opened this issue 3 years ago • 1 comments

In bones.gc, there's a block of code to set some magic in the w component of the light info. This is probably the fade-out effect, and merc2 currently ignores it.

                  (when (= (-> arg0 cur-lod) (-> arg0 lod-set max-lod))
                    (let ((f0-13 (- (-> arg0 lod-set lod (-> arg0 cur-lod) dist) arg2)))
                      (when (< f0-13 81920.0)
                        (when (zero? (logand (-> geom effect 0 effect-bits) 2))
                          (let* ((a1-25 (the int (* 0.0015625 f0-13)))
                                 (v1-147 (min 128 (max 0 a1-25)))
                                 (a0-56 (-> *merc-bucket-info* light))
                                 )
                            (set! (-> a0-56 direction 1 w) 0.000000000000000000000000000000000000011755084)
                            (set! (-> a0-56 direction 2 w) (the-as float v1-147))
                            )
                          0
                          )
                        )
                      )
                    )

water111 avatar Jul 18 '22 00:07 water111

worth pointing out 0.000000000000000000000000000000000000011755084 = 0x00800064

ManDude avatar Jul 18 '22 00:07 ManDude