Dyntopo + Snake tool produce weird artifacts after grab tool #65523

Closed
opened 2019-06-05 13:05:25 +02:00 by Michael Soluyanov · 8 comments

System Information
Operating system: Linux-4.15.0-47-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.116

Blender Version
Broken: version: 2.80 (sub 74), branch: blender2.7, commit date: 2019-06-04 22:32, hash: e80cbdac33
Worked: not found

2019-06-05 13-54-21.mp4

Short description of error
Dyntopo + Snake tool produce weird artifacts after grab tool

Exact steps for others to reproduce the error

  1. Open sculpting UI setup.
  2. Enable dyntopo.
  3. move some geometry with grab tool.
  4. Set big brush size then use snake tool.
  5. Some weird artifacts will be shown. Like part of original mesh stay in original location.
    Снимок экрана от 2019-06-05 14-04-15.png
  6. Press Ctrl+Z - artifacts will disappear.
**System Information** Operating system: Linux-4.15.0-47-generic-x86_64-with-debian-buster-sid 64 Bits Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.116 **Blender Version** Broken: version: 2.80 (sub 74), branch: blender2.7, commit date: 2019-06-04 22:32, hash: `e80cbdac33` Worked: not found [2019-06-05 13-54-21.mp4](https://archive.blender.org/developer/F7088201/2019-06-05_13-54-21.mp4) **Short description of error** Dyntopo + Snake tool produce weird artifacts after grab tool **Exact steps for others to reproduce the error** 1. Open sculpting UI setup. 2. Enable dyntopo. 3. move some geometry with grab tool. 4. Set big brush size then use snake tool. 5. Some weird artifacts will be shown. Like part of original mesh stay in original location. ![Снимок экрана от 2019-06-05 14-04-15.png](https://archive.blender.org/developer/F7088203/Снимок_экрана_от_2019-06-05_14-04-15.png) 6. Press Ctrl+Z - artifacts will disappear.
Author
Member

Added subscriber: @crantisz

Added subscriber: @crantisz

Added subscriber: @StanislavOvcharov

Added subscriber: @StanislavOvcharov

Added subscriber: @tomjk

Added subscriber: @tomjk

Can duplicate (Linux Mint 18.3, NVIDIA GeForce GTX 750 Ti, today's official build e80cbdac33)

Does not require to grab or perform any other operation before snake hook.

Edit: Does not actually require snake hook at all, I think any tool that will collapse geometry will do it.

Artifacts also disappear if you enter another mode (object, edit etc.)

Screencast 2019-06-05 22:03:02.webm

Can duplicate (Linux Mint 18.3, NVIDIA GeForce GTX 750 Ti, today's official build e80cbdac331a) Does not require to grab or perform any other operation before snake hook. Edit: Does not actually require snake hook at all, I think any tool that will collapse geometry will do it. Artifacts also disappear if you enter another mode (object, edit etc.) [Screencast 2019-06-05 22:03:02.webm](https://archive.blender.org/developer/F7088783/Screencast_2019-06-05_22_03_02.webm)

Probably duplicate of #58920.

Probably duplicate of #58920.

Added subscribers: @Psy-Fi, @mano-wii

Added subscribers: @Psy-Fi, @mano-wii

The problem is that within the BVH node, the drawing buffer (ie the batch) and the mesh lose their synchrony when the resulting amount of triangles is 0.
What happens is that while the mesh in the BVH node gets 0 vertices, the batch is untouched.

Something similar happened before and was solved by @Psy-Fi here: e60b18d51d
In this solution vert_buff and index_buff were deleted.

But another solution was found in 52af5fa31f
There vert_buff and index_buff were untouched but their drawing was ignored.

Here an adaptation of the first solution:

diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index e30fccbf29d..a232327e1d3 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -827,6 +827,11 @@ void GPU_pbvh_bmesh_buffers_update(GPU_PBVH_Buffers *buffers,
   }
 
   if (!tottri) {
+    GPU_BATCH_DISCARD_SAFE(buffers->triangles);
+    GPU_BATCH_DISCARD_SAFE(buffers->lines);
+    GPU_INDEXBUF_DISCARD_SAFE(buffers->index_lines_buf);
+    GPU_INDEXBUF_DISCARD_SAFE(buffers->index_buf);
+    GPU_VERTBUF_DISCARD_SAFE(buffers->vert_buf);
     buffers->tot_tri = 0;
     return;
   }

An adaptation of the second solution would be to check the buffers->tottri in sculpt_draw_cb.

The problem is that within the BVH node, the drawing buffer (ie the batch) and the mesh lose their synchrony when the resulting amount of triangles is 0. What happens is that while the mesh in the BVH node gets 0 vertices, the batch is untouched. Something similar happened before and was solved by @Psy-Fi here: e60b18d51d In this solution `vert_buff` and `index_buff` were deleted. But another solution was found in 52af5fa31f There `vert_buff` and `index_buff` were untouched but their drawing was ignored. Here an adaptation of the first solution: ``` diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index e30fccbf29d..a232327e1d3 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -827,6 +827,11 @@ void GPU_pbvh_bmesh_buffers_update(GPU_PBVH_Buffers *buffers, } if (!tottri) { + GPU_BATCH_DISCARD_SAFE(buffers->triangles); + GPU_BATCH_DISCARD_SAFE(buffers->lines); + GPU_INDEXBUF_DISCARD_SAFE(buffers->index_lines_buf); + GPU_INDEXBUF_DISCARD_SAFE(buffers->index_buf); + GPU_VERTBUF_DISCARD_SAFE(buffers->vert_buf); buffers->tot_tri = 0; return; } ``` An adaptation of the second solution would be to check the `buffers->tottri` in `sculpt_draw_cb`.

Closed as duplicate of #58920

Closed as duplicate of #58920
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 project
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#65523
No description provided.