Baking with combined shaders

Question

Hi there,


This makes total sense if all my materials are connected to a BSDF node. But what if I have materials on top of it, and would like to bake it all in one texture to export my model?

It's not the pothead project, but I've been following the same steps from this course.

This is what I mean... I have decals added after the BSDF: 

4 at 11.59.44 AM.png

4 at 12.00.16 PM.png

Let me know if you have any insight on how to go about it.


Thanks!

  • Omar Domenech replied

    Did you try baking it? You should be able to bake it either way I think. If not. you can at the end of the chain, just plug the BSDF you need the info baked to. So if you need the diffuse, maybe just add a Diffuse BSDF for the baking info to be piped through? But I think what gets baked in the combined is whatever goes into the surface output? I'm not sure. Try and report what happens Nat.

  • nathitappan replied

    I'm sorry Omar... I tried and it's likely that I just couldn't quite follow what you mean, but I don't know how to plug in the respective BSDF to the end of the material to get it baked.


     Riding Helmet44.png


     Riding Helmet45.png

  • Adrian Bellworthy replied

    You can't plug a shader output into a color input.
    And can't just have one final texture, you will need to bake each element separately.
    Diffuse, Roughness, Glossy, etc., etc..

    1 love
  • Omar Domenech replied
    You can bake each element separately, but you can bake the combined pass as well, so it's everything in one, even the shadows and light, stickers, everything, it should work. Can you consider uploading the file, to run some tests? You could also delete everything that is not needed, just leave one or two pieces that are essential to use them of a simulacrum of the whole thing.
    1 love
  • nathitappan replied

    Hi Adrian! Yes, I know it will end up being one texture for each of the "properties" (I guess lol). But in this scenario my decals combined with a mix shader node AFTER the BSDF, so I'm unsure on how to separate this material to make a separate texture that encompasses everything for the diffuse, including the decals.

    Same for the glossy element, it is added after the main BSDF...

    I have a couple different materials where the last nodes on the tree are not a BSDF and am curious how to bake this kind of material. One of them is the Carbon fiber from the shader forge, this one I assume I can just use a reroute node from before the output? Since there are no other properties being piped in... 

     Riding Helmet45.png

  • nathitappan replied

    Hi Omar! That makes sense... so I can just select "diffuse", "glossy", and so on instead of the combined setting, use a reroute node at the very end, right before material output, and it should only bake the appropriate property?

    Let me give that a try! If it doesn't work I'll upload the file. Is there a place here where we add them, or just a dropbox link?

  • Omar Domenech replied

    No you can just change the Bake Type to get the other passes into a texture. Have you seen the Texturing of the Sci-Fi Helmet? Kent does a lot of baking and it's exactly the sort that you need for what you're trying to do.

    1 love
  • nathitappan replied

    Awesome! I'll watch that one. I watched the modeling the helmet, not the texturing. Thank you!

  • Omar Domenech replied
    1 love
  • Adrian Bellworthy replied

    Yeah you don't need to add anything, just change the Bake Type, and bake what you need.

    For the Diffuse, disable Direct and Indirect contributions. This will give you only the color from your materials, with no influence from lighting.

    1 love
  • nathitappan replied

    Alrighty, I tried many different ways and the more I search the more I think it is not quite possible. I'd have to choose between being able to bake the textures to export the model with the decals done in a different way, or not export it after all.

    I never shared a file before and that was looking tricky and huge to pack everything, so I made a  simpler file with just the two problematic materials that I can't bake and added it here: Texture Problems File 

    Let me know if I messed up the process... again, never packed or shared a file before.

  • Adrian Bellworthy replied

    The file download is perfect.

    First question, Why are you using v4.2 alpha?
    Alpha and Beta versions are for bug testing and development, they should never be used for a project. You are likely to encounter issues with these.
    And you also have experimental enabled.

    Q2. Did you UV unwrap the model?

    In the file I downloaded the model has not been unwrapped. When baking materials, models need to be UV unwrapped.
    You have, 2? parts to this model, the Default UV's are one on top of the other.

    I think your best bet is to learn the full process, start with the Fundamentals of Texturing, then I suggest Pothead.
    Follow the Pothead course, start to finish.
    Picking out what you think is relevant on your project is likely to result in you missing something, like UV unwrapping.

    1 love
  • Martin Bergwerf replied

    Hi Nathalia,

    Baking seems to work fine with the decals. There are 2 Materials, I don't think you can Bake them at once:

    Baking_01.png

    And:

    Baking_02.png

    And yes, like Adrian said, make sure you are using UV Coordinates where appropriate and that the model is unwrapped properly.

    But the main thing is: the decals are not the problem.

    1 love
  • nathitappan replied

    Thanks guys!

    Sorry about that! Yes, my model is fully unwrapped, I just forgot to do it in this test file. I also unwrapped it all into one texture like in the Pothead video, so I could bake multiple materials in one set of textures, following Jonathan's steps.

    I can do the bake like you did, using the combined setting, but that bakes all portions at once, not just color, metallic, normal, and so on. Or do I understand that wrong?

    My main struggle is on how would I separate those for baking, since I don't pipe everything through a principled BSDF like Jonathan. 

    Same happens with the Carbon fiber material... how would I bake that?

    And finally, to answer your questions about 4.2. I built the model with 4.1 but I'm following Kent's laptop session and wanted to check the difference between Eevee and Eevee Next (even if still under development). I can revert it to 4.1 if you think it is affecting the baking.

    And for the experimental setting, I usually enable that so I can toggle the stopwatch that randomizes the noise when I'm rendering animations with cycles.


  • Omar Domenech replied

    You can choose which pass to bake, you don't have to have things separated yourself. Think of it like the render passes in compositing, Blender is calculating the bounce lights, the raw color, the reflections, the refraction's, shadows, etc. All the things that make the surface of your object behave as a material. You have access to all those calculation when you change the bake type.

    In the case of the carbon fiber , you can also choose what to bake yourself by modifying your material and choosing what is going into the surface output to get a specific part of your material. If it's going into the surface of your object, it gets capture in the baking process. I think you should watch the Shading of the Sci-Fi Helmet, see Kent choosing and picking what to bake so you get an idea of it all.