Page MenuHome

Workbench: Deformed Sculpting Mesh
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Apr 24 2019, 1:53 PM.

Diff Detail

Repository
rB Blender

Event Timeline

@Clément Foucault (fclem) we should check these generic sculpting stuff and put them somewhere centralized. draw_sculpt.c for example?
Should we also add this to wireframe drawing?

After applying this patch, a PBVH_FACE sculpt does not longer update in the viewport with an empty modifier stack and workbench enabled. It works as expected when you have another viewport in the same window with EEVEE/LookDev enabled.

Rebased with latest master

@Pablo Dobarro (pablodp606) still need to check on the issue you raised. Will need to check if there is something that eevee does on top of the mesh drawing.

What eevee is doing is a hack asked by @Julien Kaspar (JulienKaspar) that is really not what we should do everywhere for performance reason. If you want to bypass pbvh drawing globally you can change DRW_object_use_pbvh_drawing. I don't see the benefit of creating a draw_sculpt.c since much of what is needed is already in DRW.

Jeroen Bakker (jbakker) planned changes to this revision.May 16 2019, 4:27 PM

enable basic support for deformed sculpt mesh drawing in workbench

Jeroen Bakker (jbakker) planned changes to this revision.

Also activate for wireframe drawing

Wireframe sculpting

I was looking that sculpting isn't working when you turn off the subdiv modifier (or remove it from the stack). It is not related to the drawing.
Something I noticed:

  • Drawing renders the correct mesh, but the sculpt session isn't updating this mesh. When switching the modifier on and off again (also in the same session) the sculpt mesh is updated correctly. Not sure if this is time related or that sculpting is done on the wrong data.
  • the first frame is always drawn incorrecly. you can check this by turning off the AA of workbench engine. When switching modifiers the old state is still drawn. With the first draw the sculpt is updated with the correct modifiers.
Brecht Van Lommel (brecht) requested changes to this revision.May 29 2019, 5:35 PM

This patches no only fixes deforming modifiers, but other modifiers like mirror too.

I think DRW_object_use_pbvh_drawing and sculpt_flush_update should have matching logic? When we can avoid the DEG_id_tag_update in sculpt_flush_update and use the PBVH fast path, that means we can use the PBVH for drawing. So there could be a shared function to determine this.

source/blender/draw/intern/draw_manager.c
229

This seems to disable PBVH drawing even when there are no modifiers? For example just sculpting in the Sculpting template

source/blender/editors/sculpt_paint/sculpt.c
5205 ↗(On Diff #15509)

Removing all this code seems wrong, that means we always go through the slow full depsgraph update, even when there are no modifiers.

Lookdev/render needs texture coordinates which are not available for PBVH drawing. But for workbench, we should be able to use PBVH still.

This revision now requires changes to proceed.May 29 2019, 5:35 PM
source/blender/editors/sculpt_paint/sculpt.c
5205 ↗(On Diff #15509)

Probably texture color mode for workbench should also be considered "shaded mode" here.

Ah I see now, the reason this worked was that the geometry was fully recalculated.... Need to dive deeper in what is actually going wrong.

Basically the ss->modifiers_active is not correct... and should have nothing to do with the use_shaded_mode.

Imo the goal of this patch is to keep the existing use_shaded_mode evaluation and not alter it.

Synced DrawManager with sculpt_update_flush

Jeroen Bakker (jbakker) marked an inline comment as done.May 31 2019, 10:30 AM

Reverted EEVEE drawing

This revision is now accepted and ready to land.May 31 2019, 12:31 PM
This revision was automatically updated to reflect the committed changes.