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

[f3d] Material tooltips #219

Merged
merged 6 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
46 changes: 23 additions & 23 deletions fast64_internal/f3d/f3d_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,20 @@
]

enumCombKey = [
("G_CK_NONE", "None", "None"),
("G_CK_KEY", "Key", "Key"),
("G_CK_NONE", "None", "Disables chroma key."),
("G_CK_KEY", "Key", "Enables chroma key."),
]

enumTextConv = [
("G_TC_CONV", "Convert", "Convert"),
("G_TC_FILTCONV", "Filter And Convert", "Filter And Convert"),
("G_TC_FILT", "Filter", "Filter"),
("G_TC_CONV", "Convert", "Convert, used for YUV to RGB conversion."),
jesusyoshi54 marked this conversation as resolved.
Show resolved Hide resolved
("G_TC_FILTCONV", "Filter And Convert", "Filter And Convert, used for YUV to RGB conversion."),
jesusyoshi54 marked this conversation as resolved.
Show resolved Hide resolved
("G_TC_FILT", "Filter", "Filter, used for default textures."),
]

enumTextFilt = [
("G_TF_POINT", "Point", "Point"),
("G_TF_AVERAGE", "Average", "Average"),
("G_TF_BILERP", "Bilinear", "Bilinear"),
("G_TF_POINT", "Point", "Point filtering"),
("G_TF_AVERAGE", "Average", "Average filter, not recommended except for pixel aligned texrects"),
("G_TF_BILERP", "Bilinear", "Bilinear, standard N64 filtering with 3 point sample"),
]

enumTextLUT = [
Expand All @@ -188,14 +188,14 @@
]

enumTextLOD = [
("G_TL_TILE", "Tile", "Tile"),
("G_TL_LOD", "LOD", "LOD"),
("G_TL_TILE", "Tile", "Shows selected color combiner tiles"),
("G_TL_LOD", "LoD", "Enables LoD calculations, LoD tile is base tile + clamp(log2(texel/pixel)), remainder of log2(texel/pixel) ratio gets stored to LoD Fraction in the color combiner"),
]

enumTextDetail = [
("G_TD_CLAMP", "Clamp", "Clamp"),
("G_TD_SHARPEN", "Sharpen", "Sharpen"),
("G_TD_DETAIL", "Detail", "Detail"),
("G_TD_CLAMP", "Clamp", "Shows base tile for texel0 and texel 1 when magnifying (>1 texel/pixel), else shows LoD tiles"),
("G_TD_SHARPEN", "Sharpen", "Sharpens pixel colors when magnifying (>1 texel/pixel), always shows LoD tiles"),
("G_TD_DETAIL", "Detail", "Shows base tile when magnifying (>1 texel/pixel), else shows LoD tiles + 1"),
]

enumTextPersp = [
Expand All @@ -206,8 +206,8 @@
enumCycleType = [
("G_CYC_1CYCLE", "1 Cycle", "1 Cycle"),
("G_CYC_2CYCLE", "2 Cycle", "2 Cycle"),
("G_CYC_COPY", "Copy", "Copy"),
("G_CYC_FILL", "Fill", "Fill"),
("G_CYC_COPY", "Copy", "Copies texture values to framebuffer with no perspective correction or blending"),
("G_CYC_FILL", "Fill", "Uses blend color to fill primitve"),
]

enumColorDither = [("G_CD_DISABLE", "Disable", "Disable"), ("G_CD_ENABLE", "Enable", "Enable")]
Expand All @@ -219,20 +219,20 @@

enumAlphaCompare = [
("G_AC_NONE", "None", "None"),
("G_AC_THRESHOLD", "Threshold", "Threshold"),
("G_AC_DITHER", "Dither", "Dither"),
("G_AC_THRESHOLD", "Threshold", "Threshold, writes if alpha is greater than blend color alpha"),
("G_AC_DITHER", "Dither", "Dither, writes if alpha is greater than random value"),
]

enumDepthSource = [
("G_ZS_PIXEL", "Pixel", "Pixel"),
("G_ZS_PRIM", "Primitive", "Primitive"),
("G_ZS_PIXEL", "Pixel", "Z value is calculated per primitive pixel"),
("G_ZS_PRIM", "Primitive", "Primitive, use prim depth to set Z value"),
jesusyoshi54 marked this conversation as resolved.
Show resolved Hide resolved
]

enumCoverage = [
("CVG_DST_CLAMP", "Clamp", "Clamp"),
("CVG_DST_WRAP", "Wrap", "Wrap"),
("CVG_DST_FULL", "Full", "Full"),
("CVG_DST_SAVE", "Save", "Save"),
("CVG_DST_CLAMP", "Clamp", "Clamp if blending, else use new pixel coverage"),
("CVG_DST_WRAP", "Wrap", "Wrap coverage"),
("CVG_DST_FULL", "Full", "Force to full coverage"),
("CVG_DST_SAVE", "Save", "Don't overwrite previous framebuffer coverage value"),
]

enumZMode = [
Expand Down
33 changes: 33 additions & 0 deletions fast64_internal/f3d/f3d_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -2460,45 +2460,54 @@ class RDPSettings(bpy.types.PropertyGroup):
name="Z Buffer",
default=True,
update=update_node_values_with_preset,
description="Turns on/off Z-Buffer. Z-Buffer set to 0 if disabled."
jesusyoshi54 marked this conversation as resolved.
Show resolved Hide resolved
)
g_shade: bpy.props.BoolProperty(
name="Shading",
default=True,
update=update_node_values_with_preset,
description="Turns on/off shading. Shade register set to 0 if disabled."
jesusyoshi54 marked this conversation as resolved.
Show resolved Hide resolved
)
# v1/2 difference
g_cull_front: bpy.props.BoolProperty(
name="Cull Front",
update=update_node_values_with_preset,
description="Turns on/off drawing of front faces"
jesusyoshi54 marked this conversation as resolved.
Show resolved Hide resolved
)
# v1/2 difference
g_cull_back: bpy.props.BoolProperty(
name="Cull Back",
default=True,
update=update_node_values_with_preset,
description="Turns on/off drawing of back faces"
jesusyoshi54 marked this conversation as resolved.
Show resolved Hide resolved
)
g_fog: bpy.props.BoolProperty(
name="Fog",
update=update_node_values_with_preset,
description="Turns on/off fog calculation. Fog variable gets stored into shade alpha"
)
g_lighting: bpy.props.BoolProperty(
name="Lighting",
default=True,
update=update_node_values_with_preset,
description="Enables calculation of shade values from lights and vertex normals. Turn off for vertex colors"
)
g_tex_gen: bpy.props.BoolProperty(
name="Texture UV Generate",
update=update_node_values_with_preset,
description="Generates texture coordinates that maps from norm x/y to [0-1]x/y"
jesusyoshi54 marked this conversation as resolved.
Show resolved Hide resolved
)
g_tex_gen_linear: bpy.props.BoolProperty(
name="Texture UV Generate Linear",
update=update_node_values_with_preset,
description="Generates texture coordinates that linearly maps from cos/sin(norm) to [0-1]x/y"
jesusyoshi54 marked this conversation as resolved.
Show resolved Hide resolved
)
# v1/2 difference
g_shade_smooth: bpy.props.BoolProperty(
name="Smooth Shading",
default=True,
update=update_node_values_with_preset,
description="Shades primitive smoothly using interpolation between shade values for each vertex (Gouraud shading)"
)
# f3dlx2 only
g_clipping: bpy.props.BoolProperty(
Expand All @@ -2513,42 +2522,49 @@ class RDPSettings(bpy.types.PropertyGroup):
items=enumAlphaDither,
default="G_AD_NOISE",
update=update_node_values_with_preset,
description="Applies your choice dithering type to output frambuffer alpha"
jesusyoshi54 marked this conversation as resolved.
Show resolved Hide resolved
)
# v2 only
g_mdsft_rgb_dither: bpy.props.EnumProperty(
name="RGB Dither",
items=enumRGBDither,
default="G_CD_MAGICSQ",
update=update_node_values_with_preset,
description="Applies your choice dithering type to output frambuffer color"
jesusyoshi54 marked this conversation as resolved.
Show resolved Hide resolved
)
g_mdsft_combkey: bpy.props.EnumProperty(
name="Chroma Key",
items=enumCombKey,
default="G_CK_NONE",
update=update_node_values_with_preset,
description="Turns on/off the chroma key. Chroma key requires a special setup to work properly"
)
g_mdsft_textconv: bpy.props.EnumProperty(
name="Texture Convert",
items=enumTextConv,
default="G_TC_FILT",
update=update_node_values_with_preset,
description="Turns on/off the converter for texture color. Can convert color space from YUV into RGB"
jesusyoshi54 marked this conversation as resolved.
Show resolved Hide resolved
)
g_mdsft_text_filt: bpy.props.EnumProperty(
name="Texture Filter",
items=enumTextFilt,
default="G_TF_BILERP",
update=update_node_values_without_preset,
description="Applies your choice of filtering to texels"
)
g_mdsft_textlut: bpy.props.EnumProperty(
name="Texture LUT",
items=enumTextLUT,
default="G_TT_NONE",
description="Changes texture look up table (LUT) behavior. This property is auto set if you choose a CI texture"
)
g_mdsft_textlod: bpy.props.EnumProperty(
name="Texture LOD",
items=enumTextLOD,
default="G_TL_TILE",
update=update_node_values_with_preset,
description="Turns on/off the use of LoD on textures. LoD textures change the used tile based on the texel/pixel ratio"
)
num_textures_mipmapped: bpy.props.IntProperty(
name="Number of Mipmaps",
Expand All @@ -2562,31 +2578,36 @@ class RDPSettings(bpy.types.PropertyGroup):
items=enumTextDetail,
default="G_TD_CLAMP",
update=update_node_values_with_preset,
description="Changes type of LoD usage. Affects how tiles are selected based on texel magnification. Only works when G_TL_LOD is selected"
)
g_mdsft_textpersp: bpy.props.EnumProperty(
name="Texture Perspective Correction",
items=enumTextPersp,
default="G_TP_PERSP",
update=update_node_values_with_preset,
description="Turns on/off texture perspective correction"
)
g_mdsft_cycletype: bpy.props.EnumProperty(
name="Cycle Type",
items=enumCycleType,
default="G_CYC_1CYCLE",
update=update_node_values_with_preset,
description="Changes RDP pipeline configuration. For normal textured triangles use one or two cycle mode"
)
# v1 only
g_mdsft_color_dither: bpy.props.EnumProperty(
name="Color Dither",
items=enumColorDither,
default="G_CD_ENABLE",
update=update_node_values_with_preset,
description="Applies your choice dithering type to output frambuffer"
)
g_mdsft_pipeline: bpy.props.EnumProperty(
name="Pipeline Span Buffer Coherency",
items=enumPipelineMode,
default="G_PM_1PRIMITIVE",
update=update_node_values_with_preset,
description="Changes primitive rasterization timing. For games besides SM64, N-prim is optimal"
jesusyoshi54 marked this conversation as resolved.
Show resolved Hide resolved
)

# lower half mode
Expand All @@ -2595,12 +2616,14 @@ class RDPSettings(bpy.types.PropertyGroup):
items=enumAlphaCompare,
default="G_AC_NONE",
update=update_node_values_with_preset,
description="Uses alpha comparisons to decide if a pixel should be written. Applies before blending"
)
g_mdsft_zsrcsel: bpy.props.EnumProperty(
name="Z Source Selection",
items=enumDepthSource,
default="G_ZS_PIXEL",
update=update_node_values_with_preset,
description="Changes screen-space Z value source used for Z-Buffer calculations"
)

prim_depth: bpy.props.PointerProperty(
Expand Down Expand Up @@ -2639,37 +2662,47 @@ class RDPSettings(bpy.types.PropertyGroup):
)
aa_en: bpy.props.BoolProperty(
update=update_node_values_with_preset,
description="Enables anti-aliasing to rasterized primitive edges. Uses coverage to determine edges"
)
z_cmp: bpy.props.BoolProperty(
update=update_node_values_with_preset,
description="Checks pixel Z value against Z-Buffer to test writing"
)
z_upd: bpy.props.BoolProperty(
update=update_node_values_with_preset,
description="Updates the Z-Buffer with the most recently written pixel Z value"
)
im_rd: bpy.props.BoolProperty(
update=update_node_values_with_preset,
description="Enables reading from framebuffer for blending calculations"
)
clr_on_cvg: bpy.props.BoolProperty(
update=update_node_values_with_preset,
description="Only draw on coverage (amount primitive covers target pixel) overflow"
)
cvg_dst: bpy.props.EnumProperty(
name="Coverage Destination",
items=enumCoverage,
update=update_node_values_with_preset,
description="Changes how coverage (amount primitive covers target pixel) gets retrieved/stored"
)
zmode: bpy.props.EnumProperty(
name="Z Mode",
items=enumZMode,
update=update_node_values_with_preset,
description="Changes Z calculation for different types of primitives"
)
cvg_x_alpha: bpy.props.BoolProperty(
update=update_node_values_with_preset,
description="Multiply coverage (amount primitive covers target pixel) with alpha and store result as coverage"
)
alpha_cvg_sel: bpy.props.BoolProperty(
update=update_node_values_with_preset,
description="Use coverage (amount primitive covers target pixel) as alpha instead of color combiner alpha"
)
force_bl: bpy.props.BoolProperty(
update=update_node_values_with_preset,
description="Always uses blending on. Default blending is conditionally based on depth. Always used when Z Buffering is off"
jesusyoshi54 marked this conversation as resolved.
Show resolved Hide resolved
)

# cycle dependent - (P * A + M - B) / (A + B)
Expand Down