Bake to Vertex Colors using Cycles

I just found there is a workaround for merging layers, but it includes some adjustments in the materials (using isCameraRay for textures so only vertex colors are baked using Emit baking mode).
I don’t know, in general new versions offer some nice features, but I think devs should focus on getting back the original features first. Anyway, I think I can now switch to 2.92 for next projects, even though we will have to use these ugly workarounds and get used to that confusing clutter UI which doesn’t make sense to me even after many hours of testing.

Please stay on topic. Especially @1D_Inc, I have asked you multiple times before, don’t derail threads about a specific topic.

Selected to Active is supposed to work, and did work for me in a simple test. If it fails, please report a bug with example .blend.

As for the workflow regarding baking to the active viewport rather than render vertex colors. The baking workflow is planned to be changed significantly in one of the following releases. Rather than using active layer state and global settings, there will be persistent baking settings, likely per material. That should be a more suitable solution that should not involve toggling various settings whenever you want to re-bake.

If we will still keep an operator to directly bake a map (perhaps as a utility in e.g. vertex or texture paint mode), that should continue to work on the active viewport layer. You have to remember that while you are an expert on your own workflow, Blender developers and UI designers are also usually aware of many more user workflows from years of listening to feedback.

12 Likes

Per material? Sounds interesting. This will bring more flexibility, as well as the need for control.
At the moment, it is quite difficult to imagine the need for such a level of fracturing.

the patch is already available in 2.92 ?

Looks that way…

Happy to hear the baking will get some more improvements - great news!
Sorry for my offtopic messages, I was really happy our team can finally switch from 2.79 after bake to vcols was implemented (thank you again for that!), so I was little disappointed when I found there are still some features missing.
I can confirm the Bake Active to Selected works properly, but how can I bake just vertex colors (a vcols layer) from one object to another like in 2.79?
In this example you can see why we need it - we use vertex colors to add some color & shading variability to the terrain, then we bake it to the low vegetation to achieve this nice blending.

2 Likes

It’s indeed not possible to easily bake vertex colors, as there is no mode for that yet. In general to transfer vertex colors and other data between meshes there is the Data Transfer modifier.

We may add vertex colors as a bake mode as well or make it possible in a more generic way.

6 Likes

First big thanks for implementing this!
The problem I see now is vcol precision / clamping.
It is hardly useable to bake cycles lights, as everything above 1.0 gets clamped, and if underexposing the scene in order to grade it later with nodes or code, the 8bit precision of vcols is destroying way too much information.

I know there was a suggestion a while back to ‘unlock’ vertex colors (unclamped floats) and it was rejected as the use cases were mostly hacks to shuffle data around.

I think now would be the time to reevaluate this.
If needed I can make test scene illustrating the problem, but maybe the description here is sufficient.

1 Like

The new sculpt vertex colors under development use floats and are not clamped. The vertex color baking already supports them, it’s just waiting for the rest of the code to be completed.

5 Likes

Thanks for the info,
works nice in 2.93, data is unclamped floats, but still gets clamped in the viewport when using workbench or eevee (works in cycles)
It gets clamped in the input stage. Multiply node after vcol input already has only clamped data.

edit 2: i also get crashes with geometry from 2.91 blend files - once i join them with something created in 2.93 it works

(edit: protip to everyone - you can rebake colors - meaning: grade them with math nodes and use the result to bake it again into a clean/the same vcol channel)

how do you rebake graded colors, using Emit bake type?
BTW if there is a color management settings enabled (like Filmic) and I “rebake” using Emit, the baked colors includes this color management settings, so the resulted colors don’t match. Is this desired behavior?

I switch the output to the emission shader with the baked color data, and bake again. For me color mapping is ignored? I made a simple Reinhardt Color mapper rgb / (rgb+1):

I am doing a bigger project with vertex colors right now - and am very sure that the baked colors are in raw and the srgb conversion is not working correctly. Tried just now in the latest 2.92 and 2.93.
Using standard Vertex Colors - the sculpt colors somehow are not in the current 2.93 build…

Especially visible when baking diffuse light only direct and indirect (no color)
Example:

2 Likes

Thanks, that problem should be fixed in the next build.

6 Likes

I apologize if this is a dumb question, but is this a “critical fix” meaning that it will be ported to 2.83LTS?

There is no vertex color baking in 2.83 LTS, so the fix is not relevant to that version.

I was unclear. I meant “the ability to bake” as the “fix” but I see I replied to a specific fix comment regarding the behavior of the baking in 2.93. I think I know the answer but just for completeness. Will vertex color baking be ported backwards into 2.83LTS? I’m trying to strategize the feasibility of taking a large project from 2.8 to 2.9 or continuing it in 2.83LTS. Thanks for everything.

Best,
Patrick

It will not be backported.

Think of things that are back ported are in the line of hey if i click here and do this blender crashes, that be back ported, but new features newer versions have that 2.83 lacked do not qualify for this.

1 Like

Thank you. Because bake to vertex color was a previous feature that was lost in the 2.7x to 2.8x, I thought it might be a greyish area for consideration. I also understand we have to push forward!

Any chance the option to bake vertex colors from one object to vertex colors of the active one will be re-implemented (2.79 can do that)? Thanks