3
$\begingroup$

From:

https://docs.blender.org/manual/en/latest/render/cycles/baking.html

Bake Type: UV

Mapped UV coordinates, used to represent where on a mesh a texture gets mapped too. This is represented through the red and green channels of the image, the blue channel is encoded with a constant value of 1 but does not hold any information.

(Ok, first of let me blow off some steam by saying that baking things is the worst part of blender.)

What does the Bake UV do? Especially with the 'Active Color Attribute'? I'm expecting that in the color the X and Y gets stored based on the UVMap. The thing is, no matter if I use Output 'Image Textures' or 'Active Color Attribute' I always end up with black. And online I can only find people talking about bake options, but I can't find anyone using the Bake Type UV option.

Please show me how to use this.

$\endgroup$
4
  • $\begingroup$ maybe share your blend file where the problem is and we can check it out? How should we be able to help you if you didn't show us what you tried? $\endgroup$
    – Chris
    Commented Nov 25, 2022 at 11:28
  • $\begingroup$ It's not related to a project, it's just understanding UV Baking in general. Like I said, I always end up with black. $\endgroup$
    – clankill3r
    Commented Nov 26, 2022 at 7:48
  • $\begingroup$ this sounds a bit like that you are asking for a tutorial...but this site is more for one very specific problem you have. maybe tell us all the steps you took in detail so we can tell what's wrong? $\endgroup$
    – Chris
    Commented Nov 26, 2022 at 8:07
  • $\begingroup$ Well a tutorial would be fine as well. The thing is I can't find a tutorial that uses the "UV" option. $\endgroup$
    – clankill3r
    Commented Nov 28, 2022 at 7:47

2 Answers 2

9
+50
$\begingroup$

What does the UV Bake Type do?

The UV bake type is used to bake the UV coordinates of your geometry. As stated by the documentation, the red channel represents the U value and the green represents the V value, the blue channel will be a constant 1.

This bake type would allow you to bake the UV pass in the View Layer passes (this link is for the 2.7 doc but passes work the same in 2.8 and I couldn't find the corresponding doc for 2.8+).

With the defauld cube, if you go to Properties>View Layer>Passes>Data and check UV (you have to be in Cycles, of course, otherwise you wouldn't see those), and render the scene, you will have an UV pass :

UV pass

Render with UV pass

It's like you render the object but each point of its surface is colored according to where that point is mapped on the UV coordinates. The picture below illustrates what I mean by that :

enter image description here

If the square in the middle is the UV grid, then your faces will be colored depending on where their UV islands are on this UV grid and those colors are the ones who would get baked on the image if you chose UV as bake type.

How to have a decent UV Bake Type result?

Now, why do you always get a black image when you try to bake with UV bake type?

The reason is quite simple, Blender bakes whatever you have in your shaders (unless, of course, if you are baking from Selected to Active).

If you bake the normals for example, Blender will search for whatever you plugged on the normal inputs of the shaders and if nothing is found, you will have a "blank" image, or if you try to bake the diffuse but all you have in your nodes is an emission shader, you will have a "blank" image.

Long story short, you need to somewhat have the UV map "present" in your node tree and having its output contribute to the Material Output (sorry for the bad explanation, I don't know any other way to say this).

You can try with the default cube and its default material. Click on the principled BSDF node and press CTRLT and replace the Texture Coordinate node with a UVMap node (SHIFTA>Input>UVMap) and select the UV Map you want to bake :

Node tree

You can leave the image texture with no image on it, it doesn't matter since all we need is the UVMap node connected to the material output. You can even plug it directly to the output like so :

UVMap connected directly to material output

The bake result will be the same (as long as there is a link from the UVMap node to the Material output, if you disconnect them, you'll have a black image).

Now you can bake (make sure to have the correct image texture node as active for the bake target to avoid Circular Reference) and you will have your UV baked :

bake result

This is how UV bake type works. May be there is a simpler way to make it work but this is how I could make it work.

What's the deal with Color Attributes?

And for your question about the Color Attributes, this represents the bake target.

When baking Blender allows you to select a bake target. You have two options : Images Textures and Color Attributes. Those two options are available for all bake type as far as I know (not only UV bake type).

Baking to an Image texture will store the bake result to an image while the Color Attributes option will store the bake result on the object itself as a Color Attribute (as a Vertex Color or Face Corner color), you will need to have an active Color Attribute before doing this :

Color attribute

There is no Color Attribute by default, you can add one with the + button on the right. You can use a Color attribute in the shader node editor with a Color Attribute node :

Color Attribute node

There is on important thing to note : just as the quality of the bake results depends on the image resolution if you bake to an image, the quality of your bake also depends on the resolution of your mesh if you bake to a color attribute. The Color Attribute is an attribute relative to each vertex (or each face corner if you chose the face corner type) so the more vertices you have, the more detailed your bake is going to be.

Now, if you want to bake to a color attribute, you can select it as a bake target in the bake section and click Bake. If you have multiple Color Attributes Blender will bake on the one that is active i.e. the one highlighted in the Color Attributes section of the Object Data properties :

enter image description here

When the bake is finished, you can use the color attribute as you please :

enter image description here enter image description here

There are still a lot of things that need to be said about Bake Types and Bake Targets but this answer is already very long, anyway I hope I helped you in some way.

And no, Baking is not the worst part of Blender. It is actually one of the coolest things about it when you understand it properly ;).

$\endgroup$
0
$\begingroup$

Bonus: Depending on the subject, a UV map or UV texture can have a huge difference.

This is the UV texture (Notice the hard line): enter image description here

This can not be done when baking to a UV map (correct me if I'm wrong): enter image description here

Here with a texture based on UV coords from a texture: enter image description here

And here from a baked UV Map: enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .