ucupumar / ucupaint

Ucupaint is Blender addon to manage texture layers for Eevee and Cycles renderer.
GNU General Public License v3.0
874 stars 31 forks source link

Feature request: Can bake a channel onto a vertex color(Color Attribute) #78

Closed morirain closed 3 months ago

morirain commented 6 months ago

I exported the model to the Unreal Engine and used the four channels of vertex color to control the material. But it's hard for me to draw vertex alpha channels, which is a bit cumbersome. If we can treat the vertex color as a texture, it will be easy to paint in Ucupaint, just do a little work on the final bake.

ucupumar commented 6 months ago

You can already do it if you're turned on experimental features. But I don't think it works with alpha yet, that's one reason it's still on experimental. image

morirain commented 6 months ago

Wow, that's good news, your work is amazing

ucupumar commented 6 months ago

@morirain Hey, thanks for the PR! I'm thinking about closing this issue if bake vertex color can become an option for bake all channels. So the bake result can be switched between vertex colors or texture, something like that. Feel free to propose something or even an implementation.

morirain commented 6 months ago

This is a good idea, perhaps need to add a vertex color channel type, or add an option “Bake as Vertex Color” for all channel types.

ucupumar commented 6 months ago

I'm sorry but I'm not sure that I understand what you meant. Can you create a UI mockup of how will it behave?

morirain commented 6 months ago

2024-01-07 I think the "Bake all channels" button should remain the same. As shown, if I need to bake a channel into a vertex color, i can just turn on the option in the channel options. If the channel also has the "Base Alpha" option turned on, the alpha will also be baked to the vertex color(may cause confusion?)

so the point is how to know the channel needs to be baked to the vertex color, and the preview of the vertex color. for me I don't connect the vertex color channel to the material, I just open "Preview mode" to see if the color is correct, i will need to manually bake later to see the real vertex colors

ucupumar commented 5 months ago

Hmm, that can be a solution. So the baked channels can be mixtures of a texture or a vertex color? Is the option visible after using 'Use Baked'?

morirain commented 5 months ago

Vertex colors and maps should be separated, the resolution of vertex colors and maps can be very different depending on the polygon count, maybe there should be a separate "Preview Vertex Color" option if ”Baked As Vertex Color“ is enable? This allows you to see the actual vertex colors

ucupumar commented 5 months ago

So the map will also baked even when the 'Bake as vertex color' is enabled? Maybe you can prototype this already if you want. I can give feedback along the way.

morirain commented 5 months ago

So the map will also baked even when the 'Bake as vertex color' is enabled? Maybe you can prototype this already if you want. I can give feedback along the way.

https://github.com/morirain/ucupaint/tree/bake_vertex_color Check this branch, I didn't write any comments, nor did I check it carefully

ucupumar commented 5 months ago

Ok, maybe you can create another pull request for this, since easier to test and give the feedback that way.

frkntlr commented 4 months ago

Any progress on this issue? Addition or discarded clone.

ucupumar commented 4 months ago

Any progress on this issue? Addition or discarded clone.

You can follow the progress on #83

ucupumar commented 3 months ago

@morirain I just replaced 'use_bake_as_vcol' with 'bake_target' enum property so the UI can also be usable for packed channels baking. Bake as vertex color can now be accessed here: image

I'm closing this issue now since the feature has already been implemented.