Vector displacement for the sculpting draw brush #104481
No reviewers
Labels
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 project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#104481
Loading…
Reference in New Issue
No description provided.
Delete Branch "robin.hohni/blender:sculpt-vector-displacement"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Sculpt: Added vector displacement for the sculpting draw brush (area plane mapping only for now)
Vector displacement maps (VDM) provide a way to create complex displacements that can have overhangs in one brush dab.
This is unlike standard displacement with height maps that only displace in the normal direction.
Forms like ears, curled horns, etc can be created in one click if VMDs are used.
There is a checkbox on the draw brush in the texture settings "Vector Displacement" that enables/disables this feature.
Technical description: The RGB channels of a texture in a brush stroke are read and interpreted as individual vectors, that are used to offset vertices.
As of now, this is only working for the draw brush using the area plane mapping. Symmetry and radial symmetry are working.
(vector displacement applied with symmetry)
There are two files attached: The first one a demo scene with a prepared VDM brush. The second is a setup to bake vector displacement maps from a plane, since Blender doesn't support VDM baking directly.
A few things to consider when making VD-Maps:
And when using them:
This patch was inspired by this right-click-select proposal Thanks for the post!
(Moved this patch to here.)
Marked as WIP since I need to address a few things:
WIP: sculpt-vector-displacementto WIP: Vector displacement for the sculpting draw brushCode wise seems fine. I still need to investigate the Apple issue.
@ -1144,0 +1146,4 @@
col.active = tex_slot.map_mode == 'AREA_PLANE'
col.prop(brush, "use_color_as_displacement", text="Vector Displacement")
Python has some rules about the number of lines between statements. Here it is max 1.
@ -2902,0 +2902,4 @@
prop = RNA_def_property(srna, "use_color_as_displacement", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", BRUSH_USE_COLOR_AS_DISPLACEMENT);
RNA_def_property_ui_text(prop, "Vector Displacement",
"Handles each pixel color as individual vector for displacement. Works only with area plane mapping");
Can you ensure that you use the correct code formatting. You can install clang-format or run
make format
in the source folder.Fixed the brush inversion and size of vdm texture works as expected
WIP: Vector displacement for the sculpting draw brushto Vector displacement for the sculpting draw brushRemoved the WIP status since the patch seems good from my end as a first working version of VDM sculpting
All my notes are addressed. I couldn't find any more relevant issues for this PR.
Just a small improvement, the rest seems fine so should be able to be added this week.
@ -2656,0 +2723,4 @@
rgba[1] *= -1;
}
rgba[0] *= 1.0f /
For readability would suggest to first square the size, and then do the inf check using
math::safe_divide
. Seems we currently don't have a safe divide in math for 2 vector types.rgba[i] *= math::safe_divide(1.0f, POW2(brush->mtex.size[i]));
perhaps?Thanks for the hint! Made a commit :)
We had a short chat with @brecht to see if there are reasons to post-pone this patch.
Thanks for your work and patience.
Hello! Faced the problem of baking the VDM card. I follow all the instructions, but my texture when sculpting does not match the result.
The screenshot shows your brush and next to it is my sculpting and the result of baking and applying.
@vkragize, please use appropriate channels for support. For now it seems you're looking for support how to use the VDM bake node tree, what isn't code related. If it is a bug inside Blender code base please add a bug report.