Brush rotation doesn't update as frequent as Spacing #116736

Open
opened 2024-01-03 10:54:06 +01:00 by Julien Kaspar · 5 comments
Member

System Information
Operating system: Linux-6.6.7-gentoo-x86_64-AMD_Ryzen_Threadripper_1950X_16-Core_Processor-with-glibc2.37 64 Bits, X11 UI
Graphics card: AMD Radeon RX 7900 XT (radeonsi, navi31, LLVM 16.0.6, DRM 3.54, 6.6.7-gentoo) AMD 4.6 (Core Profile) Mesa 23.3.1

Blender Version
Broken: version: 4.1.0 Alpha, branch: main, commit date: 2024-01-03 00:09, hash: 29b1658124b8
Worked: (newest version of Blender that worked as expected)

Short description of error
Many brushes use the default Stroke Spacing value of 10%. The rotation of the brush tip and texture (if Rake is enabled in the texture mapping) seems to be hard coded to update with that spacing in mind.

If the Spacing value is lowered (commonly to increase the quality of the brush stroke),
the rotation of the texture and brush tip shape should also update more frequently.

In this video the Spacing of the Paint brush in sculpt mode was changed to 3%.
The "Tip Roundness" and "Tip Scale X" was also lowered to make the shape rotation more visible.
On a Spacing of 3% the square shape is applied roughly 3 times in the same rotation before updating the rotation again.

An interesting observation is that the "Clay Strips" brush is the only one that doesn't suffer from this issue.

Exact steps for others to reproduce the error

  • Open the attached .blend file
  • Subdivide the cube a few times for higher resolution and apply the modifier
  • Use the Draw or Paint brush in Sculpt Mode
  • Try out different Spacing values
**System Information** Operating system: Linux-6.6.7-gentoo-x86_64-AMD_Ryzen_Threadripper_1950X_16-Core_Processor-with-glibc2.37 64 Bits, X11 UI Graphics card: AMD Radeon RX 7900 XT (radeonsi, navi31, LLVM 16.0.6, DRM 3.54, 6.6.7-gentoo) AMD 4.6 (Core Profile) Mesa 23.3.1 **Blender Version** Broken: version: 4.1.0 Alpha, branch: main, commit date: 2024-01-03 00:09, hash: `29b1658124b8` Worked: (newest version of Blender that worked as expected) **Short description of error** Many brushes use the default Stroke Spacing value of 10%. The rotation of the brush tip and texture (if Rake is enabled in the texture mapping) seems to be hard coded to update with that spacing in mind. If the Spacing value is lowered (commonly to increase the quality of the brush stroke), the rotation of the texture and brush tip shape should also update more frequently. In this video the Spacing of the Paint brush in sculpt mode was changed to 3%. The "Tip Roundness" and "Tip Scale X" was also lowered to make the shape rotation more visible. On a Spacing of 3% the square shape is applied roughly 3 times in the same rotation before updating the rotation again. <video src="/attachments/9523b029-9073-4a44-bde2-21e6e540f192" title="2024-01-03 10-42-29.mp4" controls></video> An interesting observation is that the "Clay Strips" brush is the only one that doesn't suffer from this issue. **Exact steps for others to reproduce the error** - Open the attached .blend file - Subdivide the cube a few times for higher resolution and apply the modifier - Use the Draw or Paint brush in Sculpt Mode - Try out different Spacing values
Julien Kaspar added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2024-01-03 10:54:06 +01:00
Iliya Katushenock added the
Interest
Sculpt, Paint & Texture
label 2024-01-03 11:04:41 +01:00
Member

Can confirm, will check

Can confirm, will check
Philipp Oeser added
Status
Confirmed
Module
Sculpt, Paint & Texture
and removed
Status
Needs Triage
labels 2024-01-04 09:18:09 +01:00
Member

An interesting observation is that the "Clay Strips" brush is the only one that doesn't suffer from this issue.

This is because it uses a different spacing for the clay strips brush

/* Threshold to move before updating the brush rotation, reduces jitter. */
static float paint_rake_rotation_spacing(const UnifiedPaintSettings * /*ups*/, const Brush *brush)
{
  return brush->sculpt_tool == SCULPT_TOOL_CLAY_STRIPS ? 1.0f : 20.0f;
}

Will dig a bit in git history to make sense of the values used (would also thing that brush stroke spacing should definitely be considered when coming up with those values...)

>An interesting observation is that the "Clay Strips" brush is the only one that doesn't suffer from this issue. This is because it uses a different spacing for the clay strips brush ``` /* Threshold to move before updating the brush rotation, reduces jitter. */ static float paint_rake_rotation_spacing(const UnifiedPaintSettings * /*ups*/, const Brush *brush) { return brush->sculpt_tool == SCULPT_TOOL_CLAY_STRIPS ? 1.0f : 20.0f; } ``` Will dig a bit in git history to make sense of the values used (would also thing that brush stroke spacing should definitely be considered when coming up with those values...)
Member

Hm, not so sure anymore how to best tackle this.

Stroke spacing is already indirectly considered (it affects how often paint_brush_stroke_add_step is called -- and therefor also how often paint_calculate_rake_rotation is called), it is now up to paint_calculate_rake_rotation to determine how often it really updates the angle [which atm. is based on the distance the last two mouse positions differ in a way to "reduce jitter"].

What is a bit puzzeling is that 351034891e considered a much smaller distance threshold for the SCULPT_TOOL_CLAY_STRIPS then for any other tool..

If I use the same (low) threshold for all tools, one can indeed observe a noticeable jitter, so that does not sound ideal...

We could investigate other means of reducing jitter (e.g. some sort of blending between previous and current angle), but that might come with its own issues.

So a bit uncertain at this point in time if this could really be considered a bug tbh...
For now, will leave as confirmed though (from a triaging point of view), rest is up to the module to decide.

Hm, not so sure anymore how to best tackle this. Stroke spacing is already indirectly considered (it affects how often `paint_brush_stroke_add_step` is called -- and therefor also how often `paint_calculate_rake_rotation` is called), it is now up to `paint_calculate_rake_rotation` to determine how often it really updates the angle [which atm. is based on the distance the last two mouse positions differ in a way to "reduce jitter"]. What is a bit puzzeling is that 351034891e433e83248203fada4c4a3d55bfae0c considered a much smaller distance threshold for the `SCULPT_TOOL_CLAY_STRIPS` then for any other tool.. If I use the same (low) threshold for all tools, one can indeed observe a noticeable jitter, so that does not sound ideal... We could investigate other means of reducing jitter (e.g. some sort of blending between previous and current angle), but that might come with its own issues. So a bit uncertain at this point in time if this could really be considered a bug tbh... For now, will leave as confirmed though (from a triaging point of view), rest is up to the module to decide.
Member

@Marcelo-Mutzbauer might be interested (since working on !116539)

@Marcelo-Mutzbauer might be interested (since working on !116539)
Author
Member

We could investigate other means of reducing jitter (e.g. some sort of blending between previous and current angle), but that might come with its own issues.

It would be worth it to try this.

> We could investigate other means of reducing jitter (e.g. some sort of blending between previous and current angle), but that might come with its own issues. It would be worth it to try this.
Julien Kaspar added this to the Sculpt, Paint & Texture project 2024-02-13 17:52:19 +01:00
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
2 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#116736
No description provided.