0
$\begingroup$

Help!

I've searched on the internet for this issue but I can't seem te find it. So hopefully you can help me.

I have build an object in Blender, I want to give it texture and color so it can be implemented in Unity.

As soon as I unwrap the object, added an image texture and give it a beautiful pink colour.

enter image description here

then, added nodes.

enter image description here

I hit the button "Bake". The whole thing turns black. enter image description here

It even happens with the default box.. What am I doing wrong?

$\endgroup$
  • 1
    $\begingroup$ Please edit your question to include images of your setup and nodes - rather than relyingnon someone downloading and opening your blend file. This makes the question more accessible to others experiencing the same problem. Use the Add Image button in the editor to add screenshots. $\endgroup$ – Rich Sedman Feb 28 at 8:26
  • $\begingroup$ Sorry! I edited the question. $\endgroup$ – Nurdianna Mar 5 at 9:20
  • $\begingroup$ Please make it easier to help you. You don't show the complete node tree, you don't show the outliner or your render settings. How can we guess if there a light in the scene? The file is downloadable only through an insecure connection (I will not download it then).... Please use blend-exchange.giantcowfilms.com to share files and edit your question again adding the link and more information on your file. $\endgroup$ – cegaton Mar 5 at 18:40
  • $\begingroup$ @cegaton Oh ok. Wasn't aware that you can upload files like that, I will keep that in mind. Thanks for the advice. $\endgroup$ – Nurdianna Mar 6 at 7:50
3
$\begingroup$

You need to plug the Texture into the shader, then the shader to the output :

"Image texture"->"Diffuse BSDF"->"Material Output"

The color of the inputs and outputs is important. You can't expect plugging a Yellow output (Color information) into a Green input (Shader information), and get a result. More informations.

Also, in the blend you shared the texture is black, so of course the materal will be black.

$\endgroup$
  • $\begingroup$ Thanks for clearing that up. I did what you suggested but the box still turns black after baking it. I don't seem to understand where it's coming from.. $\endgroup$ – Nurdianna Mar 5 at 9:20
2
$\begingroup$

The problem here is that the Image Texture that you are baking is connected to the shader at the point you are baking the texture. When you click 'Bake', by default Blender will 'blank out' the image prior to baking. With the Image Texture connected to the shader this means that it is being rendered as if the surface is black and the result of that render is being stored back in image. The Image Texture node being used for the bake should be disconnected (and a suitable 'color' set to drive the shader) when you perform the bake. Once the image has been baked you are then free to reconnect the image texture - this time typically via an Emission shader node rather than, say, Diffuse - to show the baked result.

Rather than actually disconnect and reconnect the nodes, you can achieve this by way of multiple Material Output nodes - with the last one 'selected' becoming the 'active' one. For example, you could use the following nodes :

baking setup

To render the scene using the Diffuse shader you can simply click the top Material Output node to make it active - and then render the scene.

To bake the image texture, first select the top Material Output node as above, then select the Image Texture node (this tells Blender which image to bake), then click Bake. This will overwrite the image with the results of the bake.

Once the texture is baked, simply click the bottom Material Output node to use the baked result.

With this setup there is no need to disconnect and reconnect the nodes when baking images - you just need to select the relevant Material Output node to switched to/from the baked result.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.