Retopology: Use Material Colors In Overlay #114969

Open
Jeroen Bakker wants to merge 8 commits from Jeroen-Bakker/blender:viewport/retopo-material-colors into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

This PR adds an option to the retopology overlay to switch between the theme
color or the material color. It is a common workflow to color faces based
on their importance during retopology. This change allows you to see the
colors during the retopology process.

image

Request from the Blender Studio. Implements design #114843. By this design
the alpha of the material color is overwritten by the theme alpha value of the
retopology overlay. In order to make this more visible to the user we might
want to split the theme retopology overlay color into two separate options
a: the color, b the opacity

This PR adds an option to the retopology overlay to switch between the theme color or the material color. It is a common workflow to color faces based on their importance during retopology. This change allows you to see the colors during the retopology process. ![image](/attachments/60ba31ff-a1c4-4728-a2d3-1e38b3a8016f) Request from the Blender Studio. Implements design #114843. By this design the alpha of the material color is overwritten by the theme alpha value of the retopology overlay. In order to make this more visible to the user we might want to split the theme retopology overlay color into two separate options a: the color, b the opacity
4.5 MiB
Jeroen Bakker added this to the 4.1 milestone 2023-11-16 09:43:50 +01:00
Jeroen Bakker added the
Module
EEVEE & Viewport
label 2023-11-16 09:43:50 +01:00
Jeroen Bakker self-assigned this 2023-11-16 09:43:50 +01:00
Jeroen Bakker added 1 commit 2023-11-16 09:44:03 +01:00
buildbot/vexp-code-patch-coordinator Build done. Details
95a2ebc3af
Retopology: Use Material Colors In Overlay
This PR adds an option to the retopology overlay to switch between the theme
color or the material color. It is a common workflow to color faces based
on their importance during retopology. This change allows you to see the
colors during the retopology process.

Request from the Blender Studio. Implements design #114843.
Jeroen Bakker added this to the EEVEE & Viewport project 2023-11-16 09:45:12 +01:00
Jeroen Bakker requested review from Julien Kaspar 2023-11-16 09:45:41 +01:00
Jeroen Bakker requested review from Clément Foucault 2023-11-16 09:48:37 +01:00
Author
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/PR114969) when ready.
Contributor

If I may suggest, just Single and Material doesn't tell you what that is at all. Little text on the left like Retopology Color or something like that is necessary for UX I think

If I may suggest, just Single and Material doesn't tell you what that is at all. Little text on the left like Retopology Color or something like that is necessary for UX I think
Jeroen Bakker added 2 commits 2023-11-16 13:41:54 +01:00
Author
Member

Yes I reused what was already present. I think (or it was decided not to) to add some padding so it communicates more clearly that the setting belongs to retopology. @pablovazquez any reason why padding wasn't done in other sections of this panel?

Yes I reused what was already present. I think (or it was decided not to) to add some padding so it communicates more clearly that the setting belongs to retopology. @pablovazquez any reason why padding wasn't done in other sections of this panel?
Member

Overall works great!
I love that the overlay color is separated from the shading color!

Some notes from testing:

Default alpha needs to be raised

Something between 0.15 and 0.2. That would be a good general default for now to both see the single and the material colors better.

Face Selection color is not used when set to material

Not clear what is best here.
Currently the Single and Material color are behaving inconsistently.
But it's actually great to see material colors on selected faces. Maybe the overlay color can be blended with the material colors?

"Single" is not a good name

The Shading options changed this recently to use "Theme" when the color is coming from the preferences and "Single" when the color can be defined in the options

Theme color is used when no Material on object

When set to "Material" while there are none, it will keep using the theme color. It should instead fall back to white, same as when setting the shading color to Material

Overall works great! I love that the overlay color is separated from the shading color! Some notes from testing: ### Default alpha needs to be raised Something between 0.15 and 0.2. That would be a good general default for now to both see the single and the material colors better. ### Face Selection color is not used when set to material Not clear what is best here. Currently the Single and Material color are behaving inconsistently. But it's actually great to see material colors on selected faces. Maybe the overlay color can be blended with the material colors? ### "Single" is not a good name The Shading options changed this recently to use "Theme" when the color is coming from the preferences and "Single" when the color can be defined in the options ### Theme color is used when no Material on object When set to "Material" while there are none, it will keep using the theme color. It should instead fall back to white, same as when setting the shading color to Material
Jeroen Bakker added 1 commit 2023-11-16 15:26:27 +01:00
Author
Member
  • I changed Single to Theme.
  • The selection/active color is now working again. Currently replaces the retopology color. Blending can be experiment with
  • Still need to change using white color when material slot is not used.
  • Changing the alpha in the theme should be done outside this patch.

For stress testing we should be check if assigning materials would update immediatly or other artifacts happen when using this patch.

* I changed `Single` to `Theme`. * The selection/active color is now working again. Currently replaces the retopology color. Blending can be experiment with * Still need to change using white color when material slot is not used. * Changing the alpha in the theme should be done outside this patch. For stress testing we should be check if assigning materials would update immediatly or other artifacts happen when using this patch.
Jeroen Bakker added 1 commit 2023-11-16 15:49:41 +01:00
buildbot/vexp-code-patch-coordinator Build done. Details
5e68756f0b
Use white color when material slot is empty
Author
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/PR114969) when ready.
Member

Using Material colors now instantly crashes Blender.

Using Material colors now instantly crashes Blender.
Jeroen Bakker added 2 commits 2023-11-17 14:14:50 +01:00
Jeroen Bakker added 1 commit 2023-11-17 14:48:47 +01:00
buildbot/vexp-code-patch-coordinator Build done. Details
3facdee70e
Fixed memory leak
Author
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/PR114969) when ready.
Member

One more issue I've found:
Material colors not visible when using Subdiv modifier with "Edit Mode" enabled and "On Cage"

Apart from that it seems all good!

One more issue I've found: Material colors not visible when using Subdiv modifier with "Edit Mode" enabled and "On Cage" Apart from that it seems all good!

I'm wondering if this is a good idea design wise. All material coloring is better be handled by the render engine (as in Workbench) and overlays only blend on top while avoiding to cover all the shading information.

But at the same time there is a request for arbitrary attribute viewing and material ID could be considered one.

I'm wondering if this is a good idea design wise. All material coloring is better be handled by the render engine (as in Workbench) and overlays only blend on top while avoiding to cover all the shading information. But at the same time there is a request for arbitrary attribute viewing and material ID could be considered one.
Clément Foucault requested changes 2023-11-21 20:19:28 +01:00
Clément Foucault left a comment
Member

Rather than requesting the IBO for each material, I would rather request the MatID directly and color the overlay using a UBO of all the material colors. Multiple IBOs make sense if your state or resources can change between drawcalls, but here it does'nt.

Benefits:

  • It doesn't require sorting of triangles.
  • It doesn't require special draw loop.
  • It adds basic support for custom attribute display.

Drawback:

  • It's a UINT worth of data.
  • Have to manage a UBO.

Should that be a Retopology only feature? One might still want to use it in wireframe mode? Should it be part of attribute viewer?

Rather than requesting the IBO for each material, I would rather request the MatID directly and color the overlay using a UBO of all the material colors. Multiple IBOs make sense if your state or resources can change between drawcalls, but here it does'nt. Benefits: - It doesn't require sorting of triangles. - It doesn't require special draw loop. - It adds basic support for custom attribute display. Drawback: - It's a UINT worth of data. - Have to manage a UBO. Should that be a Retopology only feature? One might still want to use it in wireframe mode? Should it be part of attribute viewer?
@ -1087,3 +1116,3 @@
{
MeshBatchCache &cache = *mesh_batch_cache_get(me);
mesh_batch_cache_add_request(cache, MBC_EDIT_TRIANGLES);
// mesh_batch_cache_add_request(cache, MBC_EDIT_TRIANGLES);

I'm not sure about always requesting the material IBOs even for normal edit mode.

I'm not sure about always requesting the material IBOs even for normal edit mode.
Member

@fclem About the design question of using material colors:
The main reason I recommended to use them is because they were already used for this purpose and are straight forward to add, edit and assign.
It's not introducing something completely new. Just adding support for this overlay.

I could also see us using face sets instead or any other kind of face integer attribute, but that seems to overcomplicate this feature, since there isn't proper support for this yet.
The uses and operations that are required for face sets in edit mode are not clear.
And adding even more options and operations are likely not worth it 'for now'.
I'm happy to be in conversation about this for the future though.

@fclem About the design question of using material colors: The main reason I recommended to use them is because they were already used for this purpose and are straight forward to add, edit and assign. It's not introducing something completely new. Just adding support for this overlay. I could also see us using face sets instead or any other kind of face integer attribute, but that seems to overcomplicate this feature, since there isn't proper support for this yet. The uses and operations that are required for face sets in edit mode are not clear. And adding even more options and operations are likely not worth it 'for now'. I'm happy to be in conversation about this for the future though.
Member

I talked with @fclem and we agreed to go aim for a face set implementation instead.
The integration of face sets would be beneficial for these uses:

  • Selection Sets
  • Color customization of face loops & grids (Like for the retoplogy overlay)

Not a lot is needed for this for now:

Essential

  • Add an edit mode overlay option to display face sets in edit mode
  • If the retopology overlay is enabled it will automatically use the face set colors instead of the single theme color
  • Add essential face set operators =
    • 'Assign New Face Set' (Creates a new face set from the selection. Also new random color. Same behavior as sculpt mode)
    • 'Select Similar -> Face Set'

Long Term

  • 'Select Linked Pick' operator support to use Face Sets
  • Operator support for hiding active/inactive face set(s) (Active = Under cursor)
  • Unify with the generic attribute overlay options
  • A way to set a specific face set color
I talked with @fclem and we agreed to go aim for a face set implementation instead. The integration of face sets would be beneficial for these uses: - Selection Sets - Color customization of face loops & grids (Like for the retoplogy overlay) Not a lot is needed for this for now: ### Essential - Add an edit mode overlay option to display face sets in edit mode - If the retopology overlay is enabled it will automatically use the face set colors instead of the single theme color - Add essential face set operators = - 'Assign New Face Set' (Creates a new face set from the selection. Also new random color. Same behavior as sculpt mode) - 'Select Similar -> Face Set' ### Long Term - 'Select Linked Pick' operator support to use Face Sets - Operator support for hiding active/inactive face set(s) (Active = Under cursor) - Unify with the generic attribute overlay options - A way to set a specific face set color
All checks were successful
buildbot/vexp-code-patch-coordinator Build done.
This pull request has changes conflicting with the target branch.
  • source/blender/draw/engines/overlay/overlay_edit_mesh.cc
  • source/blender/draw/intern/draw_cache_impl.hh
  • source/blender/draw/intern/draw_cache_impl_mesh.cc

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u viewport/retopo-material-colors:Jeroen-Bakker-viewport/retopo-material-colors
git checkout Jeroen-Bakker-viewport/retopo-material-colors
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
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
5 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#114969
No description provided.