[jak3] fix envmap texture and strength (#3704)

Fix the envmap texture using the eye texture by default (will require a
re-extract to fix), fix envmap strength in all three games being off by
2x. (oops)

With envmap scale fix:

![image](https://github.com/user-attachments/assets/3b0ef8b7-cbdc-4402-8a12-af368538c16e)

without envmap scale fix (but with texture fix):

![image](https://github.com/user-attachments/assets/fd72d75b-f0bb-455c-a7c9-56916fbd4a67)

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
This commit is contained in:
water111
2024-10-05 12:53:57 -04:00
committed by GitHub
parent b8c77c65f5
commit 452f1329dd
4 changed files with 13 additions and 6 deletions
+9 -2
View File
@@ -853,12 +853,19 @@ ConvertedMercEffect convert_merc_effect(const MercEffect& input_effect,
u32 tidx = (env >> 8) & 0b1111'1111'1111;
tex_combo = (((u32)tpage) << 16) | tidx;
} break;
case GameVersion::Jak2:
case GameVersion::Jak3: {
case GameVersion::Jak2: {
u32 tpage = 0x1f;
u32 tidx = 2;
tex_combo = (((u32)tpage) << 16) | tidx;
} break;
case GameVersion::Jak3: {
// (define *generic-envmap-texture* (get-texture pal-environment-front environment-generic))
// (defconstant environment-generic 2) tpage
// (def-tex pal-environment-front environment-generic 1) texture
u32 tpage = 2;
u32 tidx = 1;
tex_combo = (((u32)tpage) << 16) | tidx;
} break;
default:
ASSERT_NOT_REACHED();
}
-2
View File
@@ -1085,8 +1085,6 @@ u64 type_typep(Ptr<Type> t1, Ptr<Type> t2) {
u64 method_set(u32 type_, u32 method_id, u32 method) {
Ptr<Type> type(type_);
if (method_id > 255)
printf("[METHOD SET ERROR] tried to set method %d\n", method_id);
auto existing_method = type->get_method(method_id).offset;
@@ -1423,7 +1423,8 @@
)
(cond
((or (nonzero? (-> bucket-info must-use-mercneric-for-clip))
(or (< 0.0 t-amount) (logtest? (-> geo effect effect-idx effect-bits) (effect-bits cross-fade)))
;; force envmap mode, even if strength is zero - PC renderer will handle this case.
(or #|(< 0.0 t-amount)|# #t (logtest? (-> geo effect effect-idx effect-bits) (effect-bits cross-fade)))
)
(let ((a0-33 (&-> tint-info tint))
(v1-74 (the-as object (-> bucket-info effect effect-idx)))
@@ -2102,7 +2102,8 @@
)
(cond
((or (nonzero? (-> bucket-info must-use-mercneric-for-clip))
(or (< 0.0 t-amount) (logtest? (-> geo effect effect-idx effect-bits) (effect-bits cross-fade)))
;; force envmap mode, even if strength is zero - PC renderer will handle this case.
(or #t #|(< 0.0 t-amount)|# (logtest? (-> geo effect effect-idx effect-bits) (effect-bits cross-fade)))
)
(let ((a0-33 (&-> tint-info tint))
(v1-74 (the-as object (-> bucket-info effect effect-idx)))