Page MenuHome

Curves: Further split of curves draw code from particles
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Apr 20 2022, 5:51 AM.

Details

Summary

This commit completely separates much of the DRW curves code from
the particle hair drawing. In the short term this increases duplication,
but the idea is to simplify development by making it easier to do larger
changes to the new code, and the new system will replace the particle
hair at some point.

After this, I believe only the shaders themselves are shared, so that
would be a next step.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Apr 20 2022, 5:51 AM
Hans Goudey (HooglyBoogly) created this revision.
Clément Foucault (fclem) requested changes to this revision.Apr 21 2022, 3:49 PM

Looks fine, except for the obvious code duplication. However if you feel this is worth/needed to avoid breaking hair drawing, then it is fine.

The only change I would make is to wrap the old DRW_hair_update() inside DRW_curves_update(). This way only one callback is necessary. The other is a legacy detail.

This revision now requires changes to proceed.Apr 21 2022, 3:49 PM

Remove duplication of DRW_hair_update()

Regarding the duplicate code, I do see it as the lesser evil in this case, since I think writing proper drawing code for the new curves object will be harder if it's nested in a bunch of if statements. The old code should be easier to remove this way when the time comes too.

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

Can we also merge DRW_hair_init();?

  • Merge DRW_hair_init and DRW_hair_free to avoid more duplication
This revision is now accepted and ready to land.Apr 22 2022, 5:31 PM