Mesh Smooth Node #86903

Closed
opened 2021-03-24 20:36:56 +01:00 by Hans Goudey · 25 comments
Member

This task is for a port of the "Smooth" modifier to a node.

image.png

Details

  • Mesh smoothing can be thought of as a function of smoothing an arbitrary attribute.
    • This simply requires the use of position vector smoothing.
  • The field evaluation system allows to implement smoothing for different domains. This implies that smoothing will be used for different domains based on the connections of this domain. Extraneous domain interpolations are excluded, no adaptation is required.
    • Domain must be implicitly defined by the context.
    • Geometry, for calculating connections, can also be obtained from the context.
  • All input values can be fields.
    • For qualitative values, everything is simple.
    • Quantitative ones require an auxiliary structure (Count of iteration).

Implementation Questions
The factor is clamped between 0 and 1. This is a consequence of the mixer design used for the attributes. Can be corrected by simply refusing that the factor always accumulates from positive components D16351: BKE_attribute_math: DefaultMixer: remove asserts for negative weight.

This task is for a port of the "Smooth" modifier to a node. ![image.png](https://archive.blender.org/developer/F13808089/image.png) **Details** - Mesh smoothing can be thought of as a function of smoothing an arbitrary attribute. - This simply requires the use of position vector smoothing. - The field evaluation system allows to implement smoothing for different domains. This implies that smoothing will be used for different domains based on the connections of this domain. Extraneous domain interpolations are excluded, no adaptation is required. - Domain must be implicitly defined by the context. - Geometry, for calculating connections, can also be obtained from the context. - All input values can be fields. - For qualitative values, everything is simple. - Quantitative ones require an auxiliary structure (Count of iteration). **Implementation Questions** The factor is clamped between 0 and 1. This is a consequence of the mixer design used for the attributes. Can be corrected by simply refusing that the factor always accumulates from positive components [D16351: BKE_attribute_math: DefaultMixer: remove asserts for negative weight](https://archive.blender.org/developer/D16351).
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Author
Member

Added subscriber: @howardt

Added subscriber: @howardt
Contributor

Added subscriber: @KenzieMac130

Added subscriber: @KenzieMac130
Contributor

Would it be possible to generalize this to other attributes than position? I could see users wanting to smooth things like uv's and normals/direction vectors as well. I'm wondering if this might be a good place to do an attribute smooth/blur.

Would it be possible to generalize this to other attributes than position? I could see users wanting to smooth things like uv's and normals/direction vectors as well. I'm wondering if this might be a good place to do an attribute smooth/blur.
Author
Member

Yeah, that's an interesting idea. I think it's definitely possible. The algorithm is specific to meshes anyway, since it uses edges, so I'm not sure I would make it an attribute node, but an input for an attribute choice could always be added in the future. Though I think it would need to use the point domain.

Yeah, that's an interesting idea. I think it's definitely possible. The algorithm is specific to meshes anyway, since it uses edges, so I'm not sure I would make it an attribute node, but an input for an attribute choice could always be added in the future. Though I think it would need to use the point domain.
Member

After talking with Hans about this some, I think I will generalize this node to have both an input attribute and result attribute. For now, both should be on the Point domain, though I can think of ways to generalize to other domains. On the point domain, the semantics are: the nominal smoothed result attribute value is gotten by taking, for each edge attached to the point, the average attribute value at each end of the edge, and averaging all those together. (This is what the Smooth modifier does for "position".) Then the Factor, which can be per-Point if the Factor input is also on the Point domain, is used as the interpolation factor between the original attribute value and the nominal smoothed result.

Also, upon reflection, a soft range of about -3 to 3 seems approximately right for Factor. There is some usefulness of going outside the range of strictly between "original" and "nominal smoothed value", but it starts to get crazy (at least for position) when the factor is more than about 3.

After talking with Hans about this some, I think I will generalize this node to have both an input attribute and result attribute. For now, both should be on the Point domain, though I can think of ways to generalize to other domains. On the point domain, the semantics are: the nominal smoothed result attribute value is gotten by taking, for each edge attached to the point, the average attribute value at each end of the edge, and averaging all those together. (This is what the Smooth modifier does for "position".) Then the Factor, which can be per-Point if the Factor input is also on the Point domain, is used as the interpolation factor between the original attribute value and the nominal smoothed result. Also, upon reflection, a soft range of about -3 to 3 seems approximately right for Factor. There is some usefulness of going outside the range of strictly between "original" and "nominal smoothed value", but it starts to get crazy (at least for position) when the factor is more than about 3.

Added subscriber: @GregoryS

Added subscriber: @GregoryS
Member

Added subscriber: @Calra

Added subscriber: @Calra
Member

I've made an initial try at this, in D10951.

I've made an initial try at this, in [D10951](https://archive.blender.org/developer/D10951).

Added subscriber: @Zeastin

Added subscriber: @Zeastin
Iliya Katushenock was assigned by Hans Goudey 2022-08-05 17:36:41 +02:00

Added subscriber: @GeorgiaPacific

Added subscriber: @GeorgiaPacific

This issue was referenced by d68c47ff34

This issue was referenced by d68c47ff347bbb3824c27387f3387bd0583158a2
Contributor

Added subscriber: @MysteryPancake

Added subscriber: @MysteryPancake
Contributor

Is there likely to be an "Attribute Sharpen" node in the future? If so, it might be better to generalize this node into a "Filter" node (similar to the compositor) or a "Kernel" node

Is there likely to be an "Attribute Sharpen" node in the future? If so, it might be better to generalize this node into a "Filter" node (similar to the compositor) or a "Kernel" node

So far, no plans, the design of the work will be interesting

So far, no plans, the design of the work will be interesting
Author
Member

We've never talked about a "Sharpen" node. Maybe it would be useful, not sure though. In that case, I'm not sure there would be a benefit compared to having two separate nodes, unless maybe the kernel itself was an input socket.

We've never talked about a "Sharpen" node. Maybe it would be useful, not sure though. In that case, I'm not sure there would be a benefit compared to having two separate nodes, unless maybe the kernel itself was an input socket.
Contributor

Ah nevermind, it is possible to sharpen by using a negative weight. It is cool this is possible :)
image.png
image.png

Ah nevermind, it is possible to sharpen by using a negative weight. It is cool this is possible :) ![image.png](https://archive.blender.org/developer/F14055771/image.png) ![image.png](https://archive.blender.org/developer/F14055782/image.png)

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke

Added subscriber: @AgentA1cr

Added subscriber: @AgentA1cr

It would be quite useful to be able to set the weight of individual neighbor elements. Is that something that might be implemented in the future?

It would be quite useful to be able to set the weight of individual neighbor elements. Is that something that might be implemented in the future?
Member

Yes, might be implemented in the future. We need some more code infrastructure to support that well, but there is no fundamental reason not to support it in the future.

Yes, might be implemented in the future. We need some more code infrastructure to support that well, but there is no fundamental reason not to support it in the future.

Perhaps something similar to what's used for the sorting weight of neighboring elements in the mesh topology nodes?

Perhaps something similar to what's used for the sorting weight of neighboring elements in the mesh topology nodes?

This issue was referenced by blender/documentation@9948

This issue was referenced by blender/documentation@9948
[Docs: Geometry Node: Blur Attribute (D17157)](https://archive.blender.org/developer/D17157)
Iliya Katushenock removed the
Interest
Nodes & Physics
label 2023-02-10 01:10:14 +01:00
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2023-02-10 01:10:21 +01:00
Iliya Katushenock added this to the Nodes & Physics project 2023-02-10 01:10:27 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
12 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#86903
No description provided.