Refactor/Rewrite overlay wire colors #110097

Closed
Gilberto Rodrigues wants to merge 19 commits from Gilberto.R/blender:temp-fresnelpref into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
4 changed files with 6 additions and 9 deletions
Showing only changes of commit e69fc0b12e - Show all commits

View File

@ -749,7 +749,7 @@ class USERPREF_PT_viewport_display(ViewportPanel, CenterAlignMixIn, Panel):
layout.separator()
col = layout.column(heading="Fresnel")
col.prop(view, "fresnel_effect_factor")
col.prop(view, "fresnel_effect")
class USERPREF_PT_viewport_quality(ViewportPanel, CenterAlignMixIn, Panel):

View File

@ -82,7 +82,7 @@ void DRW_globals_update(void)
UI_GetThemeColor4fv(TH_TRANSPARENT_CHECKER_PRIMARY, gb->color_checker_primary);
UI_GetThemeColor4fv(TH_TRANSPARENT_CHECKER_SECONDARY, gb->color_checker_secondary);
gb->size_checker = UI_GetThemeValuef(TH_TRANSPARENT_CHECKER_SIZE);
gb->fresnel_mix = U.fresnel_mix_factor;
gb->fresnel_mix = ((U.gpu_flag & USER_GPU_FLAG_FRESNEL) == 0 ) ? 0.0 : 1.0;
UI_GetThemeColor4fv(TH_V3D_CLIPPING_BORDER, gb->color_clipping_border);
/* Custom median color to slightly affect the edit mesh colors. */

View File

@ -993,9 +993,6 @@ typedef struct UserDef {
struct WalkNavigation walk_navigation;
/** Fresnel */
float fresnel_mix_factor;
char _pad[4];
/** The UI for the user preferences. */
UserDef_SpaceData space_data;
@ -1191,6 +1188,7 @@ typedef enum eUserpref_GPU_Flag {
USER_GPU_FLAG_NO_EDIT_MODE_SMOOTH_WIRE = (1 << 1),
USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE = (1 << 2),
USER_GPU_FLAG_SUBDIVISION_EVALUATION = (1 << 3),
USER_GPU_FLAG_FRESNEL = (1 << 4),
} eUserpref_GPU_Flag;
/** #UserDef.tablet_api */

View File

@ -4694,11 +4694,10 @@ static void rna_def_userdef_view(BlenderRNA *brna)
"overlay while animation is played back");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "fresnel_effect_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, nullptr, "fresnel_mix_factor");
RNA_def_property_range(prop, 0, 1.0);
prop = RNA_def_property(srna, "fresnel_effect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, nullptr, "gpu_flag", USER_GPU_FLAG_FRESNEL);
RNA_def_property_ui_text(prop,
"Fresnel Factor",
"Fresnel",
"Intensity of the fresnel effect on edit mesh overlays.\n"
"It improves a bit the shape readability of very dense meshes, "
"but increases eye fatigue when modeling lower poly");