Page MenuHome

Sculpt: Render Mask and Face Sets with modifiers active

Authored by Pablo Dobarro (pablodp606) on Aug 21 2020, 8:34 PM.
"Love" token, awarded by MetinSeven."Hungry Hippo" token, awarded by lopoIsaac."Love" token, awarded by jmztn."Love" token, awarded by gilberto_rodrigues."Love" token, awarded by andruxa696."The World Burns" token, awarded by Frozen_Death_Knight.



This removes the limitation of the sculpt overlays not being visible
with modifiers active.

Diff Detail

rB Blender

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Aug 21 2020, 8:34 PM
Pablo Dobarro (pablodp606) created this revision.
  • First working version
Pablo Dobarro (pablodp606) edited the summary of this revision. (Show Details)
Pablo Dobarro (pablodp606) edited the summary of this revision. (Show Details)
  • Face Sets Overlay working
  • Fix crash when rendering without mask layer
Clément Foucault (fclem) requested changes to this revision.Sep 17 2020, 2:52 PM
Clément Foucault (fclem) added inline comments.

Style: Use uchar r_color[4] to show how many element are needed.


I don't really like the name overlays. Prefer sculpt_data. Keep sculpt_overlay for the batch.


You are falling into a pitfall not guarded by any assert (this is my fault).

Using the vbo->data (as in gpuSculptOverlay *vbo_data = (gpuSculptOverlay *)vbo->data;) buffer dirrectly is dangerous and needs to be done ONLY if the format has no padding. But yours have.
To workaround this, I would suggest to double the size of the VBO (yes i know it's a bit much but this is needed by some hardware) and use this format:
uchar4, float. The good side is that it make the data filling a bit easier (no conversion needed).

See attr_align(const GPUVertAttr *a) definition for more information.


Can't this use threading? I don't see any data dependency here.

This revision now requires changes to proceed.Sep 17 2020, 2:52 PM
Pablo Dobarro (pablodp606) marked 4 inline comments as done.
  • Rebase
  • Review Update
Clément Foucault (fclem) added inline comments.

Declaration is not updated.


What I meant here, is to make use of the range extract functions. This is not mandatory but if you don't do it, add a TODO comment so someone can pick it up. (and don't set use_threading = true if you are not actually doing it)

This revision is now accepted and ready to land.Sep 18 2020, 7:02 PM