Skip to content

Commit

Permalink
get_textlut_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilaa3 committed Aug 20, 2024
1 parent d04fd8c commit e3cdfc8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions fast64_internal/f3d/f3d_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -3737,7 +3737,7 @@ def geo_mode_from_dict(self, data: dict):
("chromaKey", "g_mdsft_combkey", "G_CK_NONE", "G_CK_"),
("textureConvert", "g_mdsft_textconv", "G_TC_CONV", "G_TC_"),
("textureFilter", "g_mdsft_text_filt", "G_TF_POINT", "G_TF_"),
# ("lutFormat", "g_mdsft_textlut", "G_TT_NONE", "G_TT_") # TODO: Get tlut changes pr merged before glTF
("lutFormat", "g_mdsft_textlut", "G_TT_NONE", "G_TT_"),
("textureLoD", "g_mdsft_textlod", "G_TL_TILE", "G_TL_"),
("textureDetail", "g_mdsft_textdetail", "G_TD_CLAMP", "G_TD_"),
("perspectiveCorrection", "g_mdsft_textpersp", "G_TP_NONE", "G_TP_"),
Expand All @@ -3747,8 +3747,8 @@ def geo_mode_from_dict(self, data: dict):

def other_mode_h_to_dict(self, remove_prefix=False, lut_format=None):
data = self.attributes_to_dict(self.other_mode_h_attributes, remove_prefix)
if lut_format:
data["lutFormat"] = lut_format
if lut_format is not None and lut_format != "G_TT_NONE":
data["lutFormat"] = lut_format[len("G_TT_") :] if remove_prefix else lut_format
return data

def other_mode_h_from_dict(self, data: dict):
Expand Down
8 changes: 7 additions & 1 deletion fast64_internal/f3d/glTF/f3d_gltf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
createScenePropertiesForMaterial,
get_f3d_node_tree,
update_all_node_values,
get_textlut_mode,
F3DMaterialProperty,
RDPSettings,
TextureProperty,
Expand Down Expand Up @@ -525,7 +526,12 @@ def gather_material_hook(self, gltf2_material, blender_material: Material, expor
n64_data = {
"combiner": f3d_mat.combiner_to_dict(),
**f3d_mat.n64_colors_to_dict(use_dict),
"otherModes": ({**rdp.other_mode_h_to_dict(True), **rdp.other_mode_l_to_dict(True)}),
"otherModes": (
{
**rdp.other_mode_h_to_dict(True, lut_format=get_textlut_mode(f3d_mat)),
**rdp.other_mode_l_to_dict(True),
}
),
}
if rdp.g_mdsft_zsrcsel == "G_ZS_PRIM":
n64_data["primDepth"] = rdp.prim_depth.to_dict()
Expand Down

0 comments on commit e3cdfc8

Please sign in to comment.