Jump to content

Cycles - baking mulitple materials in one map


Chic Aeon
 Share

You are about to reply to a thread that has been inactive for 3243 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

So - the first time I tried to combine bake this map I got all but the base of the candle holder (rough part) to bake. Now I can only get the rim. Obviously missing something.

All materials are mapped and assigned.   Can't find any info on this. Each material has an image texture associated with it. No error messages. What I am seeing now is that the rough area bakes then seemingly shift to a background layer and is "covered over" maybe (?) by the black area that appears when the rim renders.

 

Obviously I can put the parts together in graphics software but I am thinking it is just me not knowing something -- like wouldn't be the first time.

 

Thanks.

 

notbaking.png

Link to comment
Share on other sites

So - the first time I tried to combine bake this map I got all but the base of the candle holder (rough part) to bake. Now I can only get the rim. Obviously missing something.

All materials are mapped and assigned.   Can't find any info on this. Each material has an image texture associated with it. No error messages. What I am seeing now is that the rough area bakes then seemingly shift to a background layer and is "covered over" maybe (?) by the black area that appears when the rim renders.

 

Obviously I can put the parts together in graphics software but I am thinking it is just me not knowing something -- like wouldn't be the first time.

 

Thanks.

 

notbaking.png

Link to comment
Share on other sites

Hi

Looks like you are baking out one of the materials to one texture and the second material to a different texture.

Check that you are baking each material to the same texture.

In the screen shot below for the material called Mat 1 I have selected Texture1 in the Node Editor.

                                       For the material called Interier I have selected Texture 1 in the node editor.

                                      And with the mesh selected, in the UV/image Editor iI have selected the Texture 1 to bake out to .

Cycles bake.png

Link to comment
Share on other sites

OK. The good news is that I think I know what you are saying LOL -- better than the olden days.

 

I changed each of the textures in the three Texture Image nodes to "blank.png" (an all white file I had used for one of the textures.  I got something akin to an ambient map.

 

bakedtoblank.jpg

 

My ORIGINAL object had an actual concrete texture in the Image Texture node and it used that texture to generate a normal (bump) for that same material area. Another material used a different texture (blank) etc.  Soooo, it seems like if each bake needs to match the image in the image texture pane then the only way to get what I actually want is to do three bakes? 

 

NOOOOOOOO - LOL.   I just baked again using "concrete" to "concrete" in the image editor. It made ALL the maps but they are on separate layers. I didn't even know you could see other layers there. NOT something I do.     I will have to test that again a few times to get it straight, but that looks like what happened.  I need to bump up my sampling too. I was just practicing.

 EDIT: It is likely I was getting all the bakes all along and I just didn't KNOW that there were all there in that list.   Well DUH. Remember I said it seemed like one "drew" over the other?  It was covering up one rendered map with another. I had the sampling so low that it went really fast and so it wasn't obvious what was happening. 

And when I baked a coffee cup with just ONE material, I just baked it to a new image and it came out very well. There was no color in that image though inherently so I WAS getting that grayscale with the cycles lighting effects and bump in there.   

finaldeco.jpg

 

So that really did help and a good way to get texture map in only grayscale which actually is what I wanted :D.

 

Will have to wrap my head around this a bit more. Thanks again!  You are always so helpful and SO SMART!!!!!!! LOL.

 

 

 

 

Link to comment
Share on other sites

  • 2 weeks later...

OK. So I did figure out a workaround and did a tips post on a Google + group that you can read here:

 

https://plus.google.com/100190052320604204973/posts/5szFex7HBS9

 

THAT being said, someone I was chatting with on that post says she has "the answer" (well that should be in caps) and will post a tutorial on that tomorrow maybe. So if that works I will make an effort to put that info up here.   

Meanwhile my system will get you there. You could also make a patchwork texture combining the textures you want to use and then bake that same texture for all materials. That isn't My preferred method but might be yours :D

 

Here is my example photo; the pot is a combo texture of three or four materials (late and I don't remember LOL.  Each obviously has the TEXTURE in the bake, not just an "enhanced ambient".

 

planter2.jpg

Link to comment
Share on other sites

I'm sure I am not following this entirely, but I am guessing (some of) the problem is that you may have missed one important point that also took me a while to realise: The target image for baking is the one referenced in the selected Image Texture node in the node setup for each material. There can be other Image Texture nodes, unselected, that can refer to other, source, images. So you have to make sure (a) that each mayetrial node setup has an Image Texture node selected, and (b) that that node references the intended output image. Then to bake multiple materials to one image, use UV map where the materials' islands don't overlap*; select the target image in the output each of the materials' output Image Texture nodes, make sure those nodes are selected, and bake. It is very easy to forget, but vitally important to remember, to reselect the output Image Texture node when you have been adjusting other nodes. If you do this, I don't think there should be a problem.

*I think the currently selected UV map is used by default. If you have different UV maps for applying and baking, you can add UVmap input nodes, select the appropriate maps, and connect them to the vector input of source and/or target Image Texture nodes, to make sure the right map gets used for each purpose.

Here's an example. The planter has three materials, base, wood, and compost. There are two UV maps, UVsources, with overlapping maps for applying the textures, and UVtarget for baking, where thye materials don't overlap. UVsources is shown in the blue image surrounded with green. It is applied to the vector input of all the input Image Texture nodes. UVtarget is applied to the vector input of the output Image texture of all three materials. The image selected in all these three are the same, as indicated by the yellow lines.  The images selected in the input Image Texture nodes are different, and are shown by the green connecting lines.

The base texturing is a straightforward application of the input diffuse texture. The compost is complicated just by the addition of a normal map. The wood is more complicated because the input texture has to be repeated and rotated, by the Mapping node. It also uses the diffuse texture as a displacement map, and uses a mixture of diffuse and glossy shading.

Notice that the output Image Texture nodes are selected (orange outline) for each material. In this state, the "combined" bake produces the image shown (given suitable lighting). The rendered image is shown in the second picture (i.e. I forgot to include it!).

cyclesbakemm.jpg

cyclesbakerend.jpg

 

 

Link to comment
Share on other sites

Hmm. Although that works, it isn't that simple. The UV map used by the baking doesn't come from either a map input to the Image Texyure node vector input, nor from the seexted UV maop, nor from the one marked as render (small camera icon). I'm still trying to find out where it does come from.  Anyone know?

Link to comment
Share on other sites

OK, I think I have made some progress with understanding this ...

1) The camera icon that is supposed to specify the UV map used in rendering does not appear to have any effect in Cycles, rendering or baking. Instead, it is always the selected UV map (blue bar) that gets used. Whether this is a bug, or whether the camera icon is only for the Blender renderer, I don't know. I haven't tested that.

2) Specifying a UV map by connecting a UV Mp node to the Vector input of the Image Texture node for the baked image doesn't work. So the only way to specify the UV map for baking is to select it in the object data properties.

3) Specifying a UV map by connecting a UV Map node to the Vector input of the Image Texture node for input textures does work. Then the selected UV map in the object data properties does not change which map is used. So that is the way to use different maps simultaneously for input mapping and baked output mapping.

All that provides a way of combining input and painted texture, using different (or the same) UV maps for input and baking. The example illustrating this is the same model used above. Just the "wood" node setup is altered. For simplicity, the repeat and rotation mapping has been omitted, and a different input wood texture is used. That is combined with a new image called "paintme", which starts off blank black, using a Color:MixRGB node (here called "Lighten" because that mode was selected). Now you can paint on the model directly and still bake out the result, if you follow the conditions below. I'm not going to try to explain why or detail the consequences of doing otherwise, because it's just too complicated (and I'm not sure I understand it). You just have to do what you are told!

To paint: View->Texture Paint; In Object Data properties, select the source UV map; In the node editor, select the Image Texture node with the "paintme" image; In the 3D view, set the view type to "Material". Now you can paint.

To bake: In Object Data properties, select the target UV map; In the node editor, select the Image Texture node for the baked image; In the 3D view, set the view type to either Rendered or Texture. (Remember the output Image Texture node must be selected in the other materials too). Now you can bake.

This can be simplified if the same UV map is used for input and baking and/or the paintme texture is used alone instead of being combined with another image.

This is the setup and view during painting ...

cybakepaint1.jpg

And this is the setup and view for baking (after the bake finishes) ...

cybakepaint2.jpg

ETA: Note - the bake here is Diffuse color only, for speed. It all works the same with combined bake too.

Link to comment
Share on other sites

  • 2 weeks later...

Well Drongle you worked really hard on this and I didn't come back to see it. Bad girl.

 

The GOOD news (and honestly it is late and I am tired so I didn't read your comments too carefully even though you are my FAVORITE MESH MENTOR (well one of two anyway)) is that I got it.

 

Later: I looked a bit more at your example and see that you did it a little differently than she did so when I am more awake I will come back and reread :D. TY!  

 

A gal on the Opensim Virutual figured it out and it is quite easy really. My issue was that I never EVER baked combined maps in Blender Render so had no basis to go from. I always made ambient maps and added textures in my graphics program.

 

The bottom line is that you need a base UV map and image to bake to that is the COMBINED UV map as well as individual maps for each material that you want to be part of your finished map. You use a UV mapping node for input and have to be sure and the the COMBINED map in EACH of the material node setups AND selected before baking.

 

I have been having a lot of issues with UV maps and baking in cycles when it gets complex and I have been doing a LOT of complex lately :D. My fault as I didn't understand the way UVs work now. I have been using an old version of Blender for a long while. So her video helped me understand all that better also.

 

She made a tutorial for anyone that needs to know. Note that the tutorial (because of computer lag it seems and the software) had the mouse pointer FAR from what she is talking about so that is confusing, but in general most folks should be able to work it out.

 

I believe that as long as you have materials, individual maps and the combined map all together before baking that the order of doing things doesn't matter -- her method is definitely not my workflow. But I have been busy doing other stuff and so can't confirm this -- it does make sense though and she agreed.

 

Really liking cycles once I finally got to the "ah ha" moment. Thanks for taking the time to look into this!!!!  It is very handy to know how to do it.

 

 

Here is the video link:  

Of course it works the same for SL.

 

Link to comment
Share on other sites

Just another note as I read a bit more although still have droopy eyes.

If you look at her video, it DOES work as I followed it and it worked perfectly. She doesn't CONNECT the combined map to any of the node group, it is just "there" unattached (I have done that a few times when I have had an error message about "no texture image" and it doesn't need to be attached to the node group to be considered a part of it evidently.

 

So take a look at her method too as I think it shows that something you thought wouldn't work, does. As with many things in Blender there are MANY ways to "get there".

 

Thanks again.

 

 

Link to comment
Share on other sites

I don't think it's significantly different. The video is just about the same as in my second message, with nothing connected to the output texture image node. In the earlier one I had the combined UV map attached to it, but that doesn't have any effect. Instead, that UV map has to be selected during the bake. The other difference is that she uses a separate input UV map for each of the materials. That is fine, but you can do equally well with just one. In fact at one point you see one of her input UV maps, and you can see that it has the three maps superimposed. So it could have been used for all of them. Probably I shouldn't have complicated mine with the extra nodes for different purposes!

Link to comment
Share on other sites

OK. I think I WAS looking at the one that had the main UV connected (again - late as I was reading :D).   All those extra nodes didn't confuse me. Actually by the time you get to worrying about making a single combined texture for all your materials (or the ones you are baking anyway) --- I would expect that watching the node patterns should be pretty easy *wink*.  

 

I am going off to practice a bit more and make sure things are cemented in my brain. I will pass your info along to her also Thanks again.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3243 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...