Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jak3] fix envmap texture and strength #3704

Merged
merged 3 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions decompiler/level_extractor/extract_merc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 0 additions & 2 deletions game/kernel/jak3/kscheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion goal_src/jak2/engine/gfx/foreground/foreground.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
3 changes: 2 additions & 1 deletion goal_src/jak3/engine/gfx/foreground/foreground.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
Loading