You are on page 1of 14

Thanks for your interest in Texture Baker.

Texture Baker is a utility and a collection of shaders that helps you visualize, tweak and manipulate
textures in Unity .

Using it, you can

-
visualize specular maps without baking them in alpha, for tweaking them faster
-
visualize ambient occlusion maps applied by a AO factor
-
bake ambient occlusion maps ( inuenced by an AO factor ) and the Tint in the diffuse texture,
for use with fast shaders from Unity 4.x
-
extract the specular map from the alpha channel of a diffuse texture, from assets authored for
the Unity 4.x pipeline (e.g Robot Lab)
-
Extract any channel (r, g, b, a) from a composite texture (e.g textures from DOTA or Lux
shaders)
-
Create a composite texture, from many maps, like the ones created in Substance Painter (SSS,
specular, ambient occlusion, etc ), for use in complex shaders.
-
Everything is done in the Unity Editor, through an intuitive interface, without resorting in other
apps
-
Works for Pro and Free, is fast
-
All operations are non - destructive, your original textures remain untouched
-
No need to refresh manually - the texture is immediately available in the Editor



I am open to suggestions, if you have some ideas about how to make this utility better,
please contact me at Unity forums ( Ippokratis Bournellis ), or at my email ippobour at gmail dot
com

Now lets see how this utility works !



FIRST RUN


Inside the package, you will nd 3 shaders and a C# script. Make sure the script will always be in a
folder named Editor, since it is necessary for Unity to recognize it and let it function correctly.


To access the Texture Baker, go to Menu->Window->Texture Baker


After you click it, drop it in a dock zone (online doc)




At the top of the window there is a pop-up menu that lets you use each of the ve modes.


The rst mode is the Bake Specular.
Its purpose is to help you bake a specular map (S) in the alpha channel (A), for use with Unity 4.x
Shaders that support Specular (sometimes referred as Gloss) maps. It is common for artists to ship
their models with separate specular maps. These maps must be baked in the alpha channel of the
diffuse texture to work. For more info, see the online docs.

To create a diffuse texture with specular map in alpha,
-
drag the diffuse map on the Diffuse texture slot
-
drag the specular map in the Specular texture slot
-
press the Bake button, located at the bottom

A Save dialog will show up. Select the location you want to save the texture and it will appear
immediately, ready to use it. There are two shaders in the package that allow for visualization of
the Specular Maps on your models without embedding them in alpha, that can be useful for
tweaking the Specular without baking it every time to see the results.










The second mode is the Extract Specular

This mode is useful when you have a Diffuse texture map (D) with an embedded specular map in
alpha channel (lets call it DS map) and you want to extract the specular map. There are many such
textures in the Robot Lab Unity Project. To extract the specular map (S) from the DS
-
drag the DS texture in the Diffuse(A Specular) slot
-
press the Extract Button
Again, you will be prompted to save the specular map where you wish via a Save dialog.


The third mode is the Bake AO and Tint

This mode allows you to bake a Tint color and an ambient occlusion map in a diffuse map. This
allows you to retain great looks, while using fast performant shaders, like the Mobile Diffuse. There
are three shaders in the package that allow you to visualize the models with an ambient occlusion
map (optional) and a Tint.






The ambient occlusion map effect can be accentuated to diminished by the AO factor. At a value of
one, it shows the AO map as-is, raising the value accentuates the effect, lowering the value
diminishes the effect.

Here is a demonstration of the Ambient occlusion baker. I used the Cartoon Submachine Gun
model from Torry, available at the asset store for free. Torry includes a diffuse and an ambient
occlusion map.





with ambient occlusion factor = 0 ( no AO map)


with ambient occlusion factor = 1 (as-is)


with ambient occlusion factor = 3 (accentuated)

When you are happy with the looks of the AO, move to the Tint






Play with the tint until you nd one that you like. In the Color Picker, if the presets group is closed,
open it. Click on the last swatch to add the color you have chose as a new preset.

Now you are ready to bake the color and the AO in the the Texture Baker








To bake the AO and the Tint in a diffuse texture:
-
drag the diffuse map in the Diffuse slot
-
(optional) drag the AO map in the ambient occlusion slot
-
set the tint (you can recall the color from the presets in the Color Picker)
-
set the AO factor, using the same value you used in the shader
-
press the Bake button at the bottom

The resulting texture can be used as the diffuse texture in any shader, it should be used in shaders
without Tint for speed though, like the Unlit or the Mobile Diffuse.
The fourth mode is the Extract channel

This mode allows you to extract a map from a composite texture. There are shaders (like Lux PBR
or DOTA ) that use different channels of a texture to store maps like specular, SSS (subsurface
scattering), roughness, etc. If you want to extract a map from such a texture

-
drag the composite texture in its slot
-
select a channel
-
click the Extract button


The fth mode is the Compose

There are many shaders ( Antonov suit, Lux, etc ) that use different maps (roughness, cavity
curvature etc) stored in textures channel ( e.g. R = Metallic G = Roughness, B = Ambient
Occlusion, A = Alpha.). There are programs like Substance Painter, ZBrush, Mari or libraries like
Quixel Megascans that lets you create and nd such maps. To make them work though in Unity,
you have to arrange them in a textures channel.

Compose mode lets you do exactly that.
-
drag each map on the corresponding channel
-
if you do not drag a map on a channel, it will be lled by the value specied in the corresponding
value eld
-
click the Compose button.













Contact and acknowledgements

Feel free to contact me about questions, suggestions at unity forums ( Ippokratis ), Skype
( Bournellis Ippokratis ) or at my email : ippobour at gmail dot com.

Many thanks to the beta - testers !
Also, many thanks to Texel, Daniel Brauer, Martin Krauss, Jessy Anders, NeilCarter, Michael
Garforth, Eric Haines, Keli Hlodversson, Tenebrous, fholm, airship, duckets, Tak, LittleAngel, and
all the other people who helped me over time to create this utility.

Kind regards,
-Ippokratis

You might also like