mirror of
https://github.com/open-goal/jak-project
synced 2026-08-10 11:14:50 -04:00
custom models: envmap support (#3777)
Custom models and model replacements now support environment mapping. Also fixed some cases in Jak 3 where tfrags had missing textures (defaulting to texture 0 from tpage 0, which in Jak 3 is the default eye texture) and replaced them with more suitable alternatives. Fixes #3776 https://github.com/user-attachments/assets/7c11b0de-b254-40cb-9719-11238dfb3d43  
This commit is contained in:
@@ -2032,6 +2032,20 @@ s32 find_or_add_texture_to_level(u32 combo_tex_id,
|
||||
if (ok_to_miss) {
|
||||
// we're missing a texture, just use the first one.
|
||||
tex_it = tdb.textures.begin();
|
||||
// some tfrags in jak 3 are missing textures, so we use some suitable
|
||||
// replacements instead of the default eye texture
|
||||
static std::map<std::string, std::string> per_level_tex_hacks = {
|
||||
{"wasintro", "des-rock-01"},
|
||||
{"intpfall", "common-black"},
|
||||
{"powergd", "common-black"},
|
||||
};
|
||||
auto it = std::find_if(tdb.textures.begin(), tdb.textures.end(),
|
||||
[&](const std::pair<u32, TextureDB::TextureData> val) {
|
||||
return val.second.name == per_level_tex_hacks[level_name];
|
||||
});
|
||||
if (it != tdb.textures.end()) {
|
||||
tex_it = it;
|
||||
}
|
||||
} else {
|
||||
ASSERT_MSG(
|
||||
false,
|
||||
|
||||
Reference in New Issue
Block a user