0
$\begingroup$

I have a problem with baking in blender cycles: I have an interior model and every part of it uses repeating texture (the floor for example uses a 256x256 texture which repeats itself). My aim is to bake the texture so it includes shadows and lighting. As soon as I UV unwrap e.g. the floor, the UV grid only uses the 256x256 texture one(!) time. I can scale the selection in the UV editor so it looks good on the object editor but this seems to only affect the view. I also tried checking the repeat option, but after baking, the baked texture gets repeated as well (when scaled, only a part of it).

before UV unwrapping before UV unwrapping

after UV unwrapping after UV unwrapping

scaling in the UV editor makes the texture look alright in the object viewer but it only bakes the initial smaller area scaling in the UV editor makes the texture look alright in the object viewer but it only bakes the initial smaller area

Hope this seems understandable, I’m relatively new to blender. Thanks in andvance.

$\endgroup$
  • $\begingroup$ If you want to bake all UVs should be in 0-1 space since everything that isn't in there won't be used while baking (what is shown on your last screnshot). To bake you will create additional UV map and bake from scaled one to new one. Note that baking will dramatically decrease resolution of tileable texture and it isn't what you might want to get. I'd recommend baking light separately and e.g overlay it on top of tileable texture $\endgroup$ – Mr Zak Apr 14 at 16:10
  • $\begingroup$ thanks, that solved it for me! $\endgroup$ – tobias Apr 16 at 15:53
1
$\begingroup$

You can use two different UV Maps for the floor: the first for the wood texture and the second for baking shadows and lights.

uvmaps

Moreover, since the wood texture is seamless, you can scale the islands of the wood UV Map in the UV editor to get the size you prefer (i.e. the islands can be bigger than the 0-1 UV space). Contrariwise, all the islands of the shadows UV Map must be placed in the 0-1 UV space. Make sure you have selected the correct UV Map before baking (use the camera icon), and save externally the baked map.

When you deal with two (or even more) UV Maps, your shader is a bit more complicated. Just create a group of nodes to control the repetition of the main wood texture, and another to control the baked map. To do this, use the Input > UV Map node in the shader editor, and type the right UV Map's name.

This image shows a simple idea to create a shader which manage the two UV Maps:

shader

Of course, your shader can be more complex, but the idea here is how to separate the nodes that control the shadows and the nodes that control the wood texture.

P.S.: I suggest to save the baked map in PNG format with transparency, so you can use it as a mask to blend the two main node groups.

$\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.