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.
Contributor

The main goals of this rewrite are to add a Userpref that toggles the fresnel effect on mesh overlays(wireframes, vertices, facedots), improve the fresnel effect, and enable colored wires on any shading mode.

In order to add the option to toggle the object mode Fresnel. I've had to rewrite the code for wire color in 'overlay_wireframe_vert.glsl', which resulted in a simplified code with less branching, less calculations, some fixes, and allowed the feature of wireframe colors in any shading mode.

The fresnel was added in 2.80, but was one of the little things that added up for worse selection visibility overall when comparing to Blender 2.79. That's why I wanted to remove it. It was also terrible for the visibility of colored wires. To improve it I simplified the code and applied it to the wire opacity, and it worked well even on colored wires and has a more noticeable effect that is more useful for shape readability. So now it is improved and optional.

The edit mode fresnel is only a bit useful in edge cases, like very dense photogrametry, and the problem is that it causes more eye strain when modeling for many hours. And it's benefit on shape readability is small compared to it's negative impact on selection visibility. It makes the selection color to a darker less saturated color instead of the theme color, which leads to worse contrast between the selection and the mesh or with the background, and also makes the unselected (black) brighter, also reducing contrast. So it's off by Default.

Changes:

  • Added edit mode fresnel toggle.
  • Added object mode fresnel toggle with improved fresnel for better shape readability.
  • Colored wires are now supported in all shading modes.
  • Fixed colored wires fresnel.
  • Fixed colored wires selection color.

I couldn't remove the fresnel from Grease Pencil objects because it is a bit complicated. I won't be able to fix that.

I have decided to not apply the object color alpha to the wire opacity because there already is a wireframe opacity slider that serves this purpose and because faded object with color, and wire colors looks cool.

Based on discussion from https://devtalk.blender.org/t/blender-2-8-wireframes-discussion/
and on Jeroen's original Diff https://archive.blender.org/developer/differential/0010/0010436/

The main goals of this rewrite are to add a Userpref that toggles the fresnel effect on mesh overlays(wireframes, vertices, facedots), improve the fresnel effect, and enable colored wires on any shading mode. In order to add the option to toggle the object mode Fresnel. I've had to rewrite the code for wire color in 'overlay_wireframe_vert.glsl', which resulted in a simplified code with less branching, less calculations, some fixes, and allowed the feature of wireframe colors in any shading mode. The fresnel was added in 2.80, but was one of the little things that added up for worse selection visibility overall when comparing to Blender 2.79. That's why I wanted to remove it. It was also terrible for the visibility of colored wires. To improve it I simplified the code and applied it to the wire opacity, and it worked well even on colored wires and has a more noticeable effect that is more useful for shape readability. So now it is improved and optional. The edit mode fresnel is only a bit useful in edge cases, like very dense photogrametry, and the problem is that it causes more eye strain when modeling for many hours. And it's benefit on shape readability is small compared to it's negative impact on selection visibility. It makes the selection color to a darker less saturated color instead of the theme color, which leads to worse contrast between the selection and the mesh or with the background, and also makes the unselected (black) brighter, also reducing contrast. So it's off by Default. Changes: - Added edit mode fresnel toggle. - Added object mode fresnel toggle with improved fresnel for better shape readability. - Colored wires are now supported in all shading modes. - Fixed colored wires fresnel. - Fixed colored wires selection color. I couldn't remove the fresnel from Grease Pencil objects because it is a bit complicated. I won't be able to fix that. I have decided to not apply the object color alpha to the wire opacity because there already is a wireframe opacity slider that serves this purpose and because faded object with color, and wire colors looks cool. Based on discussion from https://devtalk.blender.org/t/blender-2-8-wireframes-discussion/ and on Jeroen's original Diff https://archive.blender.org/developer/differential/0010/0010436/
Gilberto Rodrigues added 1 commit 2023-07-14 11:51:56 +02:00
Gilberto Rodrigues requested review from Jeroen Bakker 2023-07-14 11:53:26 +02:00
First-time contributor

is this patch an implementation of this request https://blender.community/c/rightclickselect/yXY6/?

is this patch an implementation of this request https://blender.community/c/rightclickselect/yXY6/?
Author
Contributor

@sanek122005 Actually it is not an implementation of that request. Though I agree that that disabling that gradient should be themeable, and is important specially for people that come from a certain software. cough cough M.... It's not what this patch is about. The fresnel affects the whole mesh, not only the unselected edges around vertices. In fact, with this patch, those unselected edge gradients will be even a little stronger by default, like in 2.79. But it's for your health.

@sanek122005 Actually it is not an implementation of that request. Though I agree that that disabling that gradient should be themeable, and is important specially for people that come from a certain software. cough cough M.... It's not what this patch is about. The fresnel affects the whole mesh, not only the unselected edges around vertices. In fact, with this patch, those unselected edge gradients will be even a little stronger by default, like in 2.79. But it's for your health.
Jeroen Bakker requested review from Pablo Vazquez 2023-07-14 13:40:12 +02:00
Jeroen Bakker added the
Module
EEVEE & Viewport
label 2023-07-14 13:40:56 +02:00
Jeroen Bakker added this to the 4.0 milestone 2023-07-14 13:41:00 +02:00
Jeroen Bakker added this to the EEVEE & Viewport project 2023-07-14 13:41:03 +02:00
Jeroen Bakker requested changes 2023-07-14 13:54:44 +02:00
Jeroen Bakker left a comment
Member

Some changes of passing the setting to the shader.

  • Add a float to GlobalUboStorage named fresnel_factor.
  • In stead of branching in the shader mix the result of the non_linear_blend_color calls with the input using this factor.

Any changes in user prefs and its defaults I recommend to pass by Pablo.

Some changes of passing the setting to the shader. - Add a `float` to `GlobalUboStorage` named `fresnel_factor`. - In stead of branching in the shader mix the result of the `non_linear_blend_color` calls with the input using this factor. Any changes in user prefs and its defaults I recommend to pass by Pablo.
Gilberto Rodrigues added 1 commit 2023-07-16 04:37:52 +02:00
First-time contributor

those unselected edge gradients will be even a little stronger by default, like in 2.79. But it's for your health.

in Edit mode it is okay to have markers of selection.
But whats about object mode with wireframe look? Or for wireframe objects?
Fresnel sometimes makes them less visible and managable.
Look at this! Wire mode for mesh line On/Off

107112046.png
107122946.png

> those unselected edge gradients will be even a little stronger by default, like in 2.79. But it's for your health. in Edit mode it is okay to have markers of selection. But whats about object mode with wireframe look? Or for wireframe objects? Fresnel sometimes makes them less visible and managable. Look at this! Wire mode for mesh line On/Off ![107112046.png](/attachments/b79a6e88-7ce4-4a64-b9f3-367b423a08b8) ![107122946.png](/attachments/5156e7b2-6d6a-4091-9a1d-7d8823241f4e)
Gilberto Rodrigues requested review from Jeroen Bakker 2023-07-16 07:01:13 +02:00
Gilberto Rodrigues changed title from Add Toggle for Edit Mode Fresnel to Add Slider for Edit Mode Fresnel 2023-07-16 07:12:55 +02:00
Jeroen Bakker reviewed 2023-07-16 09:24:01 +02:00
Jeroen Bakker left a comment
Member

I expected it still to be a boolean in the user pref, just when sending it to the shader fill the fresnel_effect_factory with 0.0 or 1.0. Codewise the rest seems as expected, we still need approval from Pablo when he is back and want to test drive it to make sure it is working on other devices as well.

I expected it still to be a boolean in the user pref, just when sending it to the shader fill the fresnel_effect_factory with 0.0 or 1.0. Codewise the rest seems as expected, we still need approval from Pablo when he is back and want to test drive it to make sure it is working on other devices as well.
First-time contributor

@Vyach I plan to add an option for object mode too, and fix object mode's colored wire selection color.

That will be good, thanks!

> @Vyach I plan to add an option for object mode too, and fix object mode's colored wire selection color. That will be good, thanks!
Gilberto Rodrigues added 1 commit 2023-07-17 05:51:38 +02:00
Gilberto Rodrigues added 2 commits 2023-07-18 04:50:07 +02:00
Gilberto Rodrigues changed title from Add Slider for Edit Mode Fresnel to Add Userpref to toggle the fresnel effect on mesh overlays 2023-07-18 04:54:29 +02:00
Gilberto Rodrigues added 1 commit 2023-07-18 05:00:25 +02:00
Gilberto Rodrigues changed title from Add Userpref to toggle the fresnel effect on mesh overlays to WIP: Add Userpref to toggle the fresnel effect on mesh overlays 2023-07-18 05:02:02 +02:00
Gilberto Rodrigues added 1 commit 2023-07-19 06:30:25 +02:00
Gilberto Rodrigues changed title from WIP: Add Userpref to toggle the fresnel effect on mesh overlays to WIP: Rewrite overlay's wire colors 2023-07-19 06:43:48 +02:00
Gilberto Rodrigues changed title from WIP: Rewrite overlay's wire colors to WIP: Rewrite overlay wire colors 2023-07-19 06:45:07 +02:00
Gilberto Rodrigues changed title from WIP: Rewrite overlay wire colors to WIP: Refactor/Rewrite overlay wire colors 2023-07-19 06:56:26 +02:00
Gilberto Rodrigues added 1 commit 2023-07-19 07:15:52 +02:00
Gilberto Rodrigues added 1 commit 2023-07-19 11:25:37 +02:00
Gilberto Rodrigues added 1 commit 2023-07-19 12:24:33 +02:00
Gilberto Rodrigues added 1 commit 2023-07-20 00:32:03 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
124f2634f6
Improve fresnel on bright wireframes
Gilberto Rodrigues changed title from WIP: Refactor/Rewrite overlay wire colors to Refactor/Rewrite overlay wire colors 2023-07-20 03:30:19 +02:00
Gilberto Rodrigues requested review from Julien Kaspar 2023-07-20 10:27:38 +02:00
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR110097) when ready.
Member

Hi, thanks for working on this. An initial +1 for this idea, with some notes and mockups below.

At first I was undecided about having two separate settings for Edit and Object modes, since we should always strive for having a good experience for everyone. After using it for a while it is clear that mesh density is key, and these settings are tailored for different workflows, so +1 on having both.

However, the name Object Mode is misleading since it also applies to Sculpt, Weight Paint, and all other modes except Edit. So how about having two options:

  • All Modes
  • Edit Mode

image

To turn all Fresnel off, disable both All Modes and Edit Mode.
image

When All Modes is enabled but Edit Mode is disabled, All Modes's checkbox uses the new intermediate state by Harley.
image

Defaults

Regarding defaults, I think Edit Mode is indeed much better without the fresnel effect because we are constantly working on the topology. While in other modes or workflows it can be useful depending on the use case, for example to see the volume of dense meshes. So the last example image where All Modes is on but Edit Mode is off, would be a good balance as default.

image

Tooltips would need to be reworded, also the words Toggle can be excluded since it's implied by the widget.


I can't give feedback regarding the code itself, but I think since these options are booleans they should start with use_? Like use_fresnel and use_fresnel_edit.

Hi, thanks for working on this. An initial +1 for this idea, with some notes and mockups below. At first I was undecided about having two separate settings for Edit and Object modes, since we should always strive for having a good experience for everyone. After using it for a while it is clear that mesh density is key, and these settings are tailored for different workflows, so +1 on having both. However, the name `Object Mode` is misleading since it also applies to Sculpt, Weight Paint, and all other modes except Edit. So how about having two options: * All Modes * Edit Mode ![image](/attachments/09e3799d-877f-40ae-aba3-c65c0c968b3a) To turn all Fresnel off, disable both `All Modes` and `Edit Mode`. ![image](/attachments/af1c4e7c-c375-4f10-bbb5-c2128c034632) When `All Modes` is enabled but `Edit Mode` is disabled, `All Modes`'s checkbox uses the new [intermediate state](https://projects.blender.org/blender/blender/pulls/108210) by Harley. ![image](/attachments/0c6918fd-82c9-4b1f-81af-69d71922f4f0) ## Defaults Regarding defaults, I think Edit Mode is indeed much better without the fresnel effect because we are constantly working on the topology. While in other modes or workflows it can be useful depending on the use case, for example to see the volume of dense meshes. So the last example image where `All Modes` is on but `Edit Mode` is off, would be a good balance as default. ![image](/attachments/c6333bc3-17c5-4dfc-947f-83f3a3dfe88c) Tooltips would need to be reworded, also the words `Toggle` can be excluded since it's implied by the widget. ---- I can't give feedback regarding the code itself, but I think since these options are booleans they should start with `use_`? Like `use_fresnel` and `use_fresnel_edit`.
First-time contributor

two options:

  • All Modes
  • Edit Mode

IMO it looks too obscure and unobvious
Partial check is okay when there is a hierarchy under the main checkbox.
And «All modes» that «not actually all» confuses me.
So I suggest another approach:

  1. Edit mode
  2. Other modes (or all other modes)

So it looks like two parts of whole set: one + others.

> two options: > * All Modes > * Edit Mode IMO it looks too obscure and unobvious Partial check is okay when there is a hierarchy under the main checkbox. And «All modes» that «not actually all» confuses me. So I suggest another approach: 1. Edit mode 2. Other modes (or all other modes) So it looks like two parts of whole set: one + others.
Gilberto Rodrigues added 1 commit 2023-07-24 04:25:03 +02:00
Author
Contributor

@pablovazquez Hi, thank you for testing! I agree it's wrong to call it 'object mode', so I changed it, but I went with @Vyach suggestion, ok?

I think the fresnel is too strong to be on by default as it is, because it makes flat surfaces like a subdivided plane, or grease pencil object harder to see in wireframe view with wire color black. I can lower the fresnel intensity, to look subtle like the old fresnel and make it the default, but it becomes less useful to see the object's shape, so I am thinking of adding a slider to control the intensity of the fresnel.

By the way why is there fresnel on grease pencil objects wireframe?? I will try to remove that.

@pablovazquez Hi, thank you for testing! I agree it's wrong to call it 'object mode', so I changed it, but I went with @Vyach suggestion, ok? I think the fresnel is too strong to be on by default as it is, because it makes flat surfaces like a subdivided plane, or grease pencil object harder to see in wireframe view with wire color black. I can lower the fresnel intensity, to look subtle like the old fresnel and make it the default, but it becomes less useful to see the object's shape, so I am thinking of adding a slider to control the intensity of the fresnel. By the way why is there fresnel on grease pencil objects wireframe?? I will try to remove that.
Member

@Gilberto.R I've tried out the patch.

I think the fresnel is too strong to be on by default as it is, because it makes flat surfaces like a plane harder to see in wireframe view with wire color black. I can lower the fresnel intensity, to look subtle like the old fresnel and make it the default, but it becomes less useful to see the object's shape, so I am thinking of adding a slider to control the intensity of the fresnel. That slider would be shown in the viewport shading panel.

Imo the object mode fresnel should be turned way down to how it looked like before. It makes it subtle but just useful enough to help with readability on high res meshes, especially when selecting objects.

If people want to have the wireframes more subtle, they are able to turn down the wireframe opacity.
If the wireframe opacity is turned down, the shading of the surface will contribute heavily to the sense of curvature. The wires don't need to contribute that much to that with fresnel.

But here's a comparison on the wireframes on a sculpted character with flat shading, as well as lowered wireframe opacity with shading.
Note how it becomes entirely pointless to lower the opacity on the new fresnel.

Version Flat Unselected Flat Selected 0.7 Opacity with Shading
Current fresnel_old.png fresnel_old_selected.png fresnel_old_opacity.png
New fresnel_new.png fresnel_new_selected.png fresnel_new_opacity.png

There's various other models this can be tested on of course. The topology could be way denser than this or way lower. But the effect is still the same.

@Gilberto.R I've tried out the patch. >I think the fresnel is too strong to be on by default as it is, because it makes flat surfaces like a plane harder to see in wireframe view with wire color black. I can lower the fresnel intensity, to look subtle like the old fresnel and make it the default, but it becomes less useful to see the object's shape, so I am thinking of adding a slider to control the intensity of the fresnel. That slider would be shown in the viewport shading panel. Imo the object mode fresnel should be turned way down to how it looked like before. It makes it subtle but just useful enough to help with readability on high res meshes, especially when selecting objects. If people want to have the wireframes more subtle, they are able to turn down the wireframe opacity. If the wireframe opacity is turned down, the shading of the surface will contribute heavily to the sense of curvature. The wires don't need to contribute that much to that with fresnel. But here's a comparison on the wireframes on a sculpted character with flat shading, as well as lowered wireframe opacity with shading. Note how it becomes entirely pointless to lower the opacity on the new fresnel. | Version | Flat Unselected | Flat Selected | 0.7 Opacity with Shading | | -------- | -------- | -------- | -------- | | Current | ![fresnel_old.png](/attachments/9e197826-b880-42c6-8058-9dc61a8ea062) | ![fresnel_old_selected.png](/attachments/aec84466-56b1-405a-ad12-991858aef3bf) | ![fresnel_old_opacity.png](/attachments/9a92c136-35ca-4b7c-9555-53d1c86d1325) | | New | ![fresnel_new.png](/attachments/c4413d15-0800-496d-9fc1-c7ba52952612) | ![fresnel_new_selected.png](/attachments/5856bb21-7d41-4294-b6e7-8ae888fa2571) | ![fresnel_new_opacity.png](/attachments/7e956e7f-000c-4fa7-af35-fc40e0dd6d86) | There's various other models this can be tested on of course. The topology could be way denser than this or way lower. But the effect is still the same.
Member

Apart from that:

  • The "Single" color field for wireframes is not exposed. It actually never was. I think this options should be renamed to "Theme", as that's where the color is defined.
  • "Attribute" and "Texture" are not working and I'm not sure they should? What's the plan on that? How will vertex/face corner and pixel colors be transferred to wires?
Apart from that: - The "Single" color field for wireframes is not exposed. It actually never was. I think this options should be renamed to "Theme", as that's where the color is defined. - "Attribute" and "Texture" are not working and I'm not sure they should? What's the plan on that? How will vertex/face corner and pixel colors be transferred to wires?
Author
Contributor

@JulienKaspar thank you for testing! I'm looking into how to hide the "attribute" and "texture" from wire color . I agree on changing the name from 'Single' to 'Theme', but I would have to create a different enum, because right now both color_type and wire_color_type share the same enum. Edit: Done.

@JulienKaspar thank you for testing! I'm looking into how to hide the "attribute" and "texture" from wire color . I agree on changing the name from 'Single' to 'Theme', but I would have to create a different enum, because right now both color_type and wire_color_type share the same enum. Edit: Done.
First-time contributor

so I am thinking of adding a slider to control the intensity of the fresnel. That slider would be shown in the viewport shading panel when fresnel is 'on'.

Yes, please, because visible power of effect depends on few things:
Color of frame,(that depends too)
Density
User’s monitor
User’s taste/sight ofc
Type of workflow
Complexity of scene

So there is no best solution once for all. Also I know, Paul (@1dinc) suggested amplifier for effect, so slider may be from 0 to 2 4 example, where 1 is default and as it is before.

>so I am thinking of adding a slider to control the intensity of the fresnel. That slider would be shown in the viewport shading panel when fresnel is 'on'. Yes, please, because visible power of effect depends on few things: Color of frame,(that depends too) Density User’s monitor User’s taste/sight ofc Type of workflow Complexity of scene So there is no best solution once for all. Also I know, Paul (@1dinc) suggested amplifier for effect, so slider may be from 0 to 2 4 example, where 1 is default and as it is before.
Gilberto Rodrigues added 1 commit 2023-07-24 16:20:56 +02:00
Gilberto Rodrigues added 1 commit 2023-07-24 16:43:34 +02:00
Gilberto Rodrigues added 1 commit 2023-07-24 17:02:30 +02:00
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR110097) when ready.
Author
Contributor

@JulienKaspar I will lower the fresnel to be subtle like the old fresnel by default. But we will still need the fresnel slider as an option for stronger fresnel. Reducing wireframe opacity in wireframe shading mode would make the bright wires look muted, so it wouldn't be possible to achieve this result:

@JulienKaspar I will lower the fresnel to be subtle like the old fresnel by default. But we will still need the fresnel slider as an option for stronger fresnel. Reducing wireframe opacity in wireframe shading mode would make the bright wires look muted, so it wouldn't be possible to achieve this result:
Jeroen Bakker reviewed 2023-08-07 08:39:12 +02:00
@ -112,2 +65,2 @@
if (isObjectColor || isRandomColor) {
wire_object_color_get(rim_col, wire_col);
/* Base Color */
if (isRandomColor) { /* Dim random color. */
Member

We might want to split this into multiple functions for readability.
We currently store 3 uniform bools what can due to changes in this patch be reduced
to a single int (colorType). For reference on a GPU a bool is 32 bits same as an int. Although not important for OpenGL, but when all uniforms space together are smaller then 256 bytes it can be optimized by the backend as push constants so we try to keep them as small as possible.

We should always test uniform values before local variables as these are constant in all cores of the same compute unit (for GPU hardware this can matter)

vec3 wire_color_get() {
  if (useColoring && is_selected) {\
    return wire_selection_color_get();
  }
  else if (colorType == V3D_SHADING_SINGLE_COLOR)
    ..
  }
  else if (colorType == V3D_SHADING_RANDOM_COLOR)
    ..
  } else /* V3d_SHADING_OBJECT_COLOR */ {
    ..
  }
}

The defines can be added to overlay_shader_shared.h

This part would then be reduced to

finalColor.rgb = wire_color_get();

/* Fresnel */
...
We might want to split this into multiple functions for readability. We currently store 3 uniform bools what can due to changes in this patch be reduced to a single int (colorType). For reference on a GPU a bool is 32 bits same as an int. Although not important for OpenGL, but when all uniforms space together are smaller then 256 bytes it can be optimized by the backend as push constants so we try to keep them as small as possible. We should always test uniform values before local variables as these are constant in all cores of the same compute unit (for GPU hardware this can matter) ``` vec3 wire_color_get() { if (useColoring && is_selected) {\ return wire_selection_color_get(); } else if (colorType == V3D_SHADING_SINGLE_COLOR) .. } else if (colorType == V3D_SHADING_RANDOM_COLOR) .. } else /* V3d_SHADING_OBJECT_COLOR */ { .. } } ``` The defines can be added to `overlay_shader_shared.h` This part would then be reduced to ``` finalColor.rgb = wire_color_get(); /* Fresnel */ ... ```
Gilberto.R marked this conversation as resolved
Jeroen Bakker reviewed 2023-08-07 08:39:37 +02:00
@ -136,1 +136,4 @@
float size_vertex_gpencil;
float fresnel_mix_edit;
float fresnel_mix;
float _padd[2];
Member

typo

typo
Gilberto.R marked this conversation as resolved
Gilberto Rodrigues added 1 commit 2023-08-13 04:44:48 +02:00
Gilberto Rodrigues added 1 commit 2023-08-21 09:31:51 +02:00
Author
Contributor

Now I just have to add the Versioning.

Now I just have to add the Versioning.
Member

@Gilberto.R I've been testing this out a bit more. The fresnel slider is still, not really solving the issues I've mentioned.
One reason is because the slider is for both the edit and object mode, even though their look and behavior is very different.

For Edit Mode a value between 0.3 or 0.4 is already enough and helps readability without making wires too transparent. It's easy to get the old fresnel look.

But for object mode any value below 0.6 is not having any perceivable effect on the overall fresnel and instead just overall opacity. Any value above is visibly affecting the fresnel but at that point having too big of an impact on the opacity to be readable.

A notable difference is that the fresnel effect is inverted in the old behavior.
The silhouette of the object mode has muted wires instead of the center when using colored wires. This is crucial.

Off Old New (0.5) New (0.75) New (1.0)
example3_fresnel_off.png example3_fresnel_old.png example3_fresnel_new_050.png example3_fresnel_new_075.png example3_fresnel_new_100.png

The example image that you showed above is also not ideal imo. While the strong fresnel is making the silhouette of objects very readable, the actual wires are not.
Any wires that face the view directly or halfway are too transparent, making it necessary to toggle fresnel in the preferences when working with wires. With this behavior the wireframes are just becoming a colored outline, losing the usefulness of visualizing the wires.

Off Old New (1.0)
example1_fresnel_none.png example1_fresnel_old.png example1_fresnel_new.png

The old fresnel also seemed to have a much different effect on selected objects while in solid shading. So there was already some different behavior depending on the color of the wireframes.

Notable here is:

  • Unselected object have a fresnel opacity
  • Selected objects have a fresnel darkening, which keeps wires dark and readable while the silhouette is fully colored
Off Old New (1.0)
example2_fresnel_off.png example2_fresnel_old.png example2_fresnel_new_100.png
@Gilberto.R I've been testing this out a bit more. The fresnel slider is still, not really solving the issues I've mentioned. **One reason is because the slider is for both the edit and object mode**, even though their look and behavior is very different. For Edit Mode a value between 0.3 or 0.4 is already enough and helps readability without making wires too transparent. It's easy to get the old fresnel look. But for object mode any value below 0.6 is not having any perceivable effect on the overall fresnel and instead just overall opacity. Any value above is visibly affecting the fresnel but at that point having too big of an impact on the opacity to be readable. **A notable difference is that the fresnel effect is inverted in the old behavior.** The **silhouette** of the object mode has muted wires **instead of the center** when using colored wires. This is crucial. | Off | Old | New (0.5) | New (0.75) | New (1.0) | | -------- | -------- | -------- | -------- | -------- | | ![example3_fresnel_off.png](/attachments/c757f003-9fa3-42d2-85b5-1e0b5378fd3c) | ![example3_fresnel_old.png](/attachments/bcbffaa4-7fa9-43af-a886-ba8bee0ea745) | ![example3_fresnel_new_050.png](/attachments/772da3a2-1541-419e-9917-dc108b0d79ee) | ![example3_fresnel_new_075.png](/attachments/3c4b3681-7f47-44ab-a244-257fdb2de55f) | ![example3_fresnel_new_100.png](/attachments/a4e8385b-abe8-4ebb-ab50-6045fdd6f30a) | The example image that you showed above is also not ideal imo. While the strong fresnel is making the silhouette of objects very readable, the actual wires are not. Any wires that face the view directly or halfway are too transparent, making it necessary to toggle fresnel in the preferences when working with wires. With this behavior the wireframes are just becoming a colored outline, losing the usefulness of visualizing the wires. | Off | Old | New (1.0) | | -------- | -------- | -------- | | ![example1_fresnel_none.png](/attachments/81aa44c3-362b-44a1-a5b8-b45261740905) | ![example1_fresnel_old.png](/attachments/2f21ea69-6972-4a17-98f0-df794ce14a6c) | ![example1_fresnel_new.png](/attachments/51d560c0-0b34-46aa-bfe6-f48425010e0f) | The old fresnel also seemed to have a much **different effect on selected objects** while in solid shading. So there was already some different behavior depending on the color of the wireframes. **Notable here is:** - Unselected object have a fresnel **opacity** - Selected objects have a fresnel **darkening**, which keeps wires dark and readable while the silhouette is fully colored | Off | Old | New (1.0) | | -------- | -------- | -------- | | ![example2_fresnel_off.png](/attachments/0ad0eedd-25e6-4e31-b26a-0f76084582dd) | ![example2_fresnel_old.png](/attachments/4abaa98c-cecc-4cea-8f3b-21f8077cfb35) | ![example2_fresnel_new_100.png](/attachments/c5138e41-b31c-4180-b501-6c4ce13b77a4) |
Member

If it would just be the preferences to toggle the fresnel, I'd be happy to have this in Blender already. The new fresnel will take some more time.

If it would just be the preferences to toggle the fresnel, I'd be happy to have this in Blender already. The new fresnel will take some more time.
Gilberto Rodrigues added 1 commit 2023-08-22 02:49:04 +02:00
Author
Contributor

@JulienKaspar thanks for the feedback.

The sides of the mesh wireframe often look more dense because of the view perspective, so the silhouette boundaries seem "brighter" with colored wires, and "darker" with black wires. I had tried making the fresnel more sinergic with that, as doing it the other way, the fresnel on opacity would flatten the wireframe for low fresnel intensity values. But that isn't a big deal as the fresnel wasn't really noticeable with low fresnel intensity, so I have inverted it back to look more like the old behavior, now most of the opacity of colored wires should be controlled with the wire opacity slider.

The fresnel is inverted for selection in the old behavior though (boundary is brighter than center). Should I do that? I think it can help differentiate selection from unselected.

@JulienKaspar thanks for the feedback. The sides of the mesh wireframe often look more dense because of the view perspective, so the silhouette boundaries seem "brighter" with colored wires, and "darker" with black wires. I had tried making the fresnel more sinergic with that, as doing it the other way, the fresnel on opacity would flatten the wireframe for low fresnel intensity values. But that isn't a big deal as the fresnel wasn't really noticeable with low fresnel intensity, so I have inverted it back to look more like the old behavior, now most of the opacity of colored wires should be controlled with the wire opacity slider. The fresnel is inverted for selection in the old behavior though (boundary is brighter than center). Should I do that? I think it can help differentiate selection from unselected.
Gilberto Rodrigues added 1 commit 2023-08-22 11:26:57 +02:00
Member

I'd like us to take a few steps back and have a look at what we're trying to fix or improve in the first place.

Why is the fresnel now using transparency instead of just changing the wire color?

This has a very bad negative impact. The wires lose a lot of contrast the moment they turn transparent. This was already an issue when using the opacity slider in the overlays.
We should aim to avoid this.

Screenshot_20230822_105800.png
This is a comparison when using a value of 0.03 for the fresnel preferences. It shows the change in contrast quite clearly.

Why are the wires overlayed additive instead of overlaying them normally?

Especially with the recent changes this is even more clear. The old behavior shifted the colors of the wires instead of blending them with whatever is underneath.

Screenshot_20230822_105818.png


As it stands right now I vastly prefer the old fresnel for readability, so there's not much improved on that front.
If we can address the core complaints that were raised on the readability we can also leave the fresnel enabled by default without the need for a slider.

For example it would help to reduce the fresnel effect or strengthen the contrast of the colors for selected wires specifically. Fine tweaking it to achieve something that's readable in more cases.

I'd like us to take a few steps back and have a look at what we're trying to fix or improve in the first place. #### Why is the fresnel now using transparency instead of just changing the wire color? This has a very bad negative impact. The wires lose a lot of contrast the moment they turn transparent. This was already an issue when using the opacity slider in the overlays. We should aim to avoid this. ![Screenshot_20230822_105800.png](/attachments/45abdedb-7316-4b59-b14b-27abdb753cc9) This is a comparison when using a value of 0.03 for the fresnel preferences. It shows the change in contrast quite clearly. #### Why are the wires overlayed additive instead of overlaying them normally? Especially with the recent changes this is even more clear. The old behavior shifted the colors of the wires instead of blending them with whatever is underneath. ![Screenshot_20230822_105818.png](/attachments/5a028393-a11e-4c60-b454-82a22b19c7fe) --- As it stands right now I vastly prefer the old fresnel for readability, so there's not much improved on that front. If we can address the core complaints that were raised on the readability we can also leave the fresnel enabled by default without the need for a slider. For example it would help to reduce the fresnel effect or strengthen the contrast of the colors for selected wires specifically. Fine tweaking it to achieve something that's readable in more cases.
Member

I think a good way to continue for now is to split the PR up.

These aspects of the PR are all good to me on the usability side:

  • The preference toggle to turn fresnel off in both object and edit mode
  • Wire color options for solid object shading
  • The improved selection color for colored wires

It would be a shame for this discussion to block the these to get in.

Any big changes or fine tweaks to the fresnel drawing can be handle separately:

  • New fresnel look
  • Use of transparency
  • Strength slider preference
I think a good way to continue for now is to split the PR up. These aspects of the PR are all good to me on the usability side: - The preference toggle to turn fresnel off in both object and edit mode - Wire color options for solid object shading - The improved selection color for colored wires It would be a shame for this discussion to block the these to get in. Any big changes or fine tweaks to the fresnel drawing can be handle separately: - New fresnel look - Use of transparency - Strength slider preference
Author
Contributor

Ok, I will split it. The first part, the edit mode toggle, is here #111494

Ok, I will split it. The first part, the edit mode toggle, is here https://projects.blender.org/blender/blender/pulls/111494
Author
Contributor

Another part. Colored wireframes option on all shading modes #111502

Another part. Colored wireframes option on all shading modes https://projects.blender.org/blender/blender/pulls/111502
First-time contributor

But whats about object mode with wireframe look? Or for wireframe objects?

Object mode still need both appearances. Fresnel helps read volume in wire mode, no Fresnel helps to see silhoettes/areas.
So it should be overlay setting, not a general setting IMO

> But whats about object mode with wireframe look? Or for wireframe objects? Object mode still need both appearances. Fresnel helps read volume in wire mode, no Fresnel helps to see silhoettes/areas. So it should be overlay setting, not a general setting IMO
Author
Contributor

@Vyach they probably won't let me add anything to that panel, because it is too cluttered. For seeing just the sillhoette, it is better to set Solid mode Lighting from Studio to Flat on the shading panel.

@Vyach they probably won't let me add anything to that panel, because it is too cluttered. For seeing just the sillhoette, it is better to set Solid mode Lighting from Studio to Flat on the shading panel.
First-time contributor

@Vyach they probably won't let me add anything to that panel, because it is too cluttered. For seeing just the sillhoette, it is better to set Solid mode Lighting from Studio to Flat on the shading panel.

Yes, it is loaded full. But Fresnel is still overlay.
And in 4.0 overlay panel was splitted into 2 menus and freed from clutter.
image

There is no flat coloring in wire mode.
And it will not help with wire contours in solid mode. Issue shown here: #110097 (comment)

> @Vyach they probably won't let me add anything to that panel, because it is too cluttered. For seeing just the sillhoette, it is better to set Solid mode Lighting from Studio to Flat on the shading panel. Yes, it is loaded full. But Fresnel is still overlay. And in 4.0 overlay panel was splitted into 2 menus and freed from clutter. ![image](/attachments/14dd8ab3-8763-409b-93a8-5a1661635ede) There is no flat coloring in wire mode. And it will not help with wire contours in solid mode. Issue shown here: https://projects.blender.org/blender/blender/pulls/110097#issuecomment-980623
161 KiB

Pull request closed

Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
8 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#110097
No description provided.