Page MenuHome

Normals' baker from multires mesh
Closed, ArchivedPublicPATCH

Description

Hi everybody!

Last few weeks Morten Mikkelsen and me were working under baker, which could bake normals directly from mesh with multi-resolution modifier without using much of additional memory. Now, we've got quite usable patch.

To use new baker you should choose "Sculpt baker" in Baker panel, select object with sculpted data on multires modifier, choose subdivision level you want to bake to and hit "Bake". Note, that mesh should be unwrapped and texture should be assigned to this UV map.

Baking happens in "locked" mode, so there'll be no UI refresh during baking (that's the downside of not using additional memory).

Some additional work is needed before we could say "yep, it's finished and could be commited", but you could alreayd have fun!

Event Timeline

ubuntu 11.04 64bits

I gave it a quick try with a sculpted default cube.
Having a good result is easier than with a selected to active workflow.

It does not work correctly when multires preview level is lower or higher than bake level.

Yep, it was issue with space transformation here.. I was thinking about additional check to prevent baking to higher level. Or this would not good solution?

Re-newed patch. Fixed issues with baking to multiplie textures and fixed minor issue with lo-res mesh.

Patch which is almost ready to commit is attached. Ni functional changes -- just styling.

Next version of patch: with some minor fixes and implementation of heights baking.

Baker could now switch to job-related work and "Cancel" button would be shown for it, but it still needs object editing (and probably 3dview refresh freeze), so this option is disabled by default.

Oops, One uninitialized memory usage issue fixed.

After Brecht's review some things were changed. fixed, improved:
- Now baking happens from highest level of multires to current viewport level
- To bake using sculpt-baker you should:
1) choose what you want to bake (normals/displacement).
2) enable "Bake from Multires" checkbox.
- Baking became thread-safe due to it shouldn't share hi-res mesh used in viewport and holds it's own hi-res and lo-res versions (lo-res doesn't add so many memory overhead). Now you've got progress bar and "Cancel" button.
- I've found incorrect calculation when using "Smooth Heights" option. Not it should behave correct.
- Now baking happens for all selected objects (be careful due to hi-res mesh for each of them would be stored in memory at the same time).

Looks like list of major things is over.

- Fixed incorrect image cleaning when baking multiple objects
- Fixed incorrect JobData structure which lead to incorrect baking several objects and memory leak

Next step in making patch ok to be commited.

Patch has been commited, closing.

Sergey Sharybin (sergey) changed the task status from Unknown Status to Unknown Status.Jun 13 2011, 10:55 AM