Search Unity

Total Baker - Texture Baking System

Discussion in 'Assets and Asset Store' started by fra3point, Aug 21, 2018.

  1. liudian208

    liudian208

    Joined:
    Aug 30, 2018
    Posts:
    59
    I'm using 1.4 btw.
     
  2. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
  3. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Hi, at the moment bent normal maps aren't supported by Total Baker. They're in the to-do list, but their implementation will require some time.

    Francesco
     
    keeponshading likes this.
  4. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    UPDATE April, 15 2019

    Total Baker 1.5 has been released!

    Release notes:

    • Now, it's possible to use multi-mesh lowpoly objects. Multiple meshes will be automatically combined
    • Added multi material per mesh support for highpoly objects. Such meshes will beautomatically split into multiple single-material meshes.
    • Fixed an issue related with cage placement
    • Cage visibility is now on by default
     
    sjm-tech likes this.
  5. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Hello,

    Total Baker 1.4 and 1.5 have a memory issue that sometimes causes automatic memory fill after the baking process.
    In a few days I'll release a new version with a fix for this issue and some other features.

    If you can't wait for the new version and you are experiencing this issue, please PM me so that I can send you the patched script.

    EDIT: the new version has been submitted to the Asset Store team and will be online in few hours/days.

    Francesco
     
    Last edited: Apr 18, 2019
  6. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    UPDATE April, 19 2019

    Total Baker 1.6 has been released!

    Release notes:
    • Added SkinnedMeshRenderer support. This means you can use models/prefabs with SkinnedMeshRenderer as input objects.
    • Fixed cage scale/rotation when using prefabs with scaled/rotated children.
    • Fixed memory filling bug.

    Tips:

    • You may want to bake AO on a highpoly model (self AO). You can do this in Total Baker by assigning the same model to both lowpoly and highpoly slots. The quality of the AO map depends on the polycount. Note: the input model must be UV-unwrapped.
    • When possible, create good prefabs that fit well with the baking process. Some criteria can be:
      • Avoid using children with missing meshes/materials
      • Remove disabled children with renderers (they will be computed!)
      • Remove any collider, they are added during the process

    Francesco
     
    AthrunVLokiz likes this.
  7. HiWill

    HiWill

    Joined:
    Jun 2, 2013
    Posts:
    18
    can bake all maps to one texture , it's good for mobile platform
     
  8. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Hi! What maps do you want to bake into a single texture?
    In Total Baker you can bake Diffuse, AO and lights/shades into one texture, this would be the result:





    but there are other maps like Metallic, Normal or Height that cannot be baked in a single map all toghether. It just wouldn't make sense.

    Francesco
     
  9. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Hello everyone!

    Some days ago I've opened a poll to ask you if it's fine for you if that the new Total Baker versions will only support Unity 2018.1+ due to some new multithreaded functionalities. Thanks to your feedback I could take better decisions on Total Baker's future.

    Most of you have no problem with this change but someone is still working with Unity 2017. And since for me it's impossible to mantain two separate versions, I'll wait a bit more before releasing the multithreaded version.

    By the way, I'm working on Total Baker v1.7 in which you will find some useful features, such as:
    • Button to save auto-generated cage as .obj (as requested by @sjm-tech )
    • Bilateral blur to reduce artifacts (as requested by @Pode )
    • Realtime brightness/contrast filter for AO map
    • Restore last used models after closing and re-opening the window
    • Baking statistics
    • Save/Load baking configurations (models, settings, etc.)
    I'll release it in few days/weeks!

    Regards,
    Francesco
     
    Last edited: May 5, 2019
    sjm-tech and wetcircuit like this.
  10. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    UPDATE May, 20 2019

    Total Baker 1.7 has been released!

    Release notes:
    • Save/Load configurations as .txt file with json content
    upload_2019-5-20_18-53-7.png
    • Save auto-generated cage as .obj model
    upload_2019-5-20_18-55-17.png
    • Replaced gaussian blur with bilateral blur for Normal and AO maps
    upload_2019-5-20_19-14-26.png

    • Added brightness/contrast filter for AO maps
    • Auto restore last used models in new sessions
    • Improved stability
    • Bug fixes
    Each model comes with a ready-to-use configuration. Just open it and press the Bake button!​
     
    Last edited: May 20, 2019
    sjm-tech likes this.
  11. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Hello bakers! Today i'll go a bit off-topic.

    I've recently created an Instagram account called 3PointSoft in which I put stuff related to my works, and I want to focus its contents on Total Baker a little more. The main idea is to create an album called "Made with Total Baker".
    I'm looking for users that want to share some screenshots of their best bakes so that I can publish them in the page. Of course I'll give full credits to authors.

    Can't wait to see your beautiful bakes! =)

    You can contact me by email at 3pointsoft@gmail.com, by PM, or simply by replying to this message.

    Francesco
     
    sjm-tech likes this.
  12. pedroasecas

    pedroasecas

    Joined:
    Mar 25, 2018
    Posts:
    4
    Hello Francesco,

    I'm getting this error when importing Total Baker:

    Assets\TotalBaker\Editor\TotalBaker.cs(1231,76): error CS0103: The name 'ambientColor' does not exist in the current context

    and it stops compiling. I'm using Unity 2019.1.4f1. Could you please look into it? Thanks
     
  13. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Hello, I'll look at your issue this evening.

    EDIT: I've found the problem. It affects users with Unity 2018+.
    Please, write to 3pointsoft@gmail.com so I can send you the fixed script. I'll upload the fixed version on the asset store today. Sorry for the mistake.
     
    Last edited: May 28, 2019
  14. pedroasecas

    pedroasecas

    Joined:
    Mar 25, 2018
    Posts:
    4
    Hi again Francesco,

    is it normal that the dilated texture area shows this crosshatch pattern?

    It makes the model look strange at the seams. I've tested in the main scene from the project I'm working on and in a clean scene, and the results are the same, regardless of the dilation amount (tested from 2 to 20), map type and texture resolution. Could it be a graphics driver issue? I'll test again with a newer one. I'm using Unity 2019.1.4f1 and a Radeon RX 580.

    Thanks. Crosshatch_dilated_area.jpg Seams.jpg
     
  15. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    The dilation algorithm is indipendent from graphics drivers, it's implemented a simple "max filter" shader. I'm pretty sure it depends on the generated texture itself. Can you please send me the baked texture with 0 dilation? I'll check it immediately.

    Francesco
     
  16. pedroasecas

    pedroasecas

    Joined:
    Mar 25, 2018
    Posts:
    4
    Sent you the texture by e-mail.
     
    fra3point likes this.
  17. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    UPDATE June, 3 2019

    Total Baker 1.8 has been released!

    Release notes:

    • Enhanced dilation filter
    • Fixed missing AO map dilation when using Fast algorithm
    • Fixed compile error with Unity 2018+
     
  18. pedroasecas

    pedroasecas

    Joined:
    Mar 25, 2018
    Posts:
    4
    Hi Francesco,

    thanks for the enhanced dilation filter! It's working great. One thing I'm missing is a working dilation slider when baking normals from geometry or by interpolation. The slider works with Heightmap based normal bakes, but not in the other two cases and it causes visible artifacts at the model's seams. Other than that, I'm happy with the quality of the bakes and the easy workflow. Are you planning to add any other map types to the tool?

    Thanks.
     
    fra3point likes this.
  19. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Hello, glad to hear you are enjoying Total Baker!

    I've just tested the Normal Map dilation slider in Interpolation and Geometry modes, and it works properly. Could you please show me what results do you get?

    Well, this is a delicate topic.
    • First, I have some requests for bent normal maps. There are two main problems here:
    • Unity doesn't have a native support for bent normals. Maybe the HDRP does, but I'm not planning to add support the new render pipelines at the moment.
    • From my (basic) knowledge of bent normal maps, they can be represented in tangent space or object space, and maybe even in some other spaces. I couldn't find any information about the standard space for bent normals, so different custom shaders may require different maps types.
    • If there will be enough requests, I'll add object space normal maps.
    • I'm planning to support the specular setup for Standard Shader because as of now Total Baker can generate metallic maps but not specular maps.
    • When there will be a standard native support for sub-surface scattering I will look at thickness/curvature/cavity maps.
    Francesco
     
    Last edited: Jun 6, 2019
  20. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    Hi, does this only work for low poly models? I want to create normal maps and AO for my high poly human models (30k polys) and I only have albedo textures.
     
  21. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Hi, Total Baker works by transferring surface details from a high poly model to a low poly model.

    -What you can do for the normal map is to treat your model A as it was lowpoly. Of course you will need a much more detailed model B from which the system will get the normals.

    -For AO, you can use these two models for better results, or just use the same model for both lowpoly and highpoly inputs to get an AO map whose quality will depend on the model polycount (high: good, low: bad).

    P.S. A 30k model isn't something I would call highpoly. From my experience, in order to create good normal maps for a full human model, you may need a very detailed highpoly model.
     
  22. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    I dont have more detailed than 30k, is it going to still work and generate normals and ao from that?
     
  23. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    It can work for AO since the algorithm will basically compute per-vertex self occlusion. The model has to be UV-unwrapped.

    But you cannot bake nornal maps without 2 models, and this isn't a limitation of Total Baker. This is a common technique, also the famous products like Substance or Xnormal need 2 models.
     
    Last edited: Jul 9, 2019
  24. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    great work it's look very well done !
    got question just for know it's possible to bake projector ?
    thank's
     
    fra3point likes this.
  25. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Hello! Thanks for your interest in Total Baker.
    Unfortunately projectors are not supported.

    Francesco
     
  26. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    This looks fantastic and something I definitely need for my game project. I will definitely be picking this up next pay day. I'm glad you've held off on pushing to 2018 or newer only. I really need on 2017.
     
  27. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Does this work with skinned meshes? I have some higher poly character models that I can make lower poly versions using SimpleLOD, but without this tool they would look pretty bad. I can imagine getting these characters way down on poly count and still looking great using Total Baker.
     
  28. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Hello, thanks for your interest on Total Baker! :)

    Let me clarify some points:

    • You can use as input models with skinned mesh renderer, the system will convert them into static models for the bake.
    • The minimum supported Unity version is 2017.3
    • Something like SimpleLOD+Total Baker would be awesome! I've tried to integrate this into the baking workflow, but I couldn't get the results I wanted in terms of topology. Maybe one day I'll be able to add the auto LOD feature into Total Baker.
    Francesco
     
  29. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    So, they would no longer be usable as skinned meshes? Or is there some way to get them working again after the bake?
     
  30. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Sorry, I wasn't clear enough. Your original models won't be modified. The system creates copies of the input models, adapts them to fit some internal requirements and destroys these copies when you close the Total Baker window. Once you have the generated textures you can simply put them into your original skinned characters' materials as usual. :)
     
  31. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Perfect. That makes sense now. I will definitely get this as soon as possible.
     
    fra3point likes this.
  32. skyLark9

    skyLark9

    Joined:
    May 2, 2018
    Posts:
    135
    Does Total Bake support LWRP ?
     
  33. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Not yet. It can produce LWRP-compatibile maps (diffuse, tangent space normal, height, etc.), but at the moment it requires the old pipeline in order to correctly execute the baking process. However, I'll investigate the possibility of making TB work with LWRP.

    Francesco
     
    skyLark9 likes this.
  34. AshyB

    AshyB

    Joined:
    Aug 9, 2012
    Posts:
    191
    Hey this looks cool, it sounds like it could help me with my issue.

    I'm looking for a way to load multiple models into a unity scene, turn it into a prefab, light it, bake it all into one texture, then in another scene instantiate the prefab at runtime with all the lighting baked into the textures (no lights in the scene).

    Is this possible?
     
  35. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Hello,

    you came across a very old and common problem. What you need is per-prefab lightmap baking, and this is not directly possible in Unity. Just for your information, you could take a look to this great Article which describes a workaround.

    But now, let's talk about Total Baker...
    Although this isn't something TB has been made for, it's possible to use it to bake lighting on a prefab.

    The workflow would be the following:
    1. Compose your prefab in scene with all the objects you need
    2. Save it in the project
    3. Open Total Baker
    4. In the Models panel, drag the prefab in BOTH lowpoly and highpoly slots
    5. In the Maps panel, choose the Diffuse map
    6. In the Lights panel, enable the "Bake Lights" and "Bake all active lights" options
    7. Add your lighting (only directional, spot and point lights are supported)
    8. Click on the Bake button
    9. After the bake, modify your lights to see the result in realtime
    10. You can even add other lights. When you have added all the lights, click on the "refresh" button in the Lights panel to make them being tracked in realtime

    Limitations:
    • The objects in the prefab should lie in different UV areas. Total Baker won't change/adjust the UV coordinates of your models.
    • Shadows are no supported
    • As of now, you may need to import your models so that their scale in scene is (1,1,1) - that's something I could actually fix in the code

    Since this is a special/custom workflow, if you decide to use Total Baker for your bakes, write me an email at 3pointsoft@gmail.com to get support.

    P.S. There was a little bug in the lighting system which has been fixed in the version 1.9, it will be available in a few days.

    Francesco
     
    Last edited: Aug 26, 2019
  36. AshyB

    AshyB

    Joined:
    Aug 9, 2012
    Posts:
    191
    Thank you for your reply! I will definitely give it some thought.
     
    fra3point likes this.
  37. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    UPDATE August, 27 2019

    Total Baker 1.9 has been released!

    Release notes:

    • Added message dialog when Linear color space is detected
    I've tried to add Linear color space support to Total Baker, but I found that the effort would be too big if compared to the importance of the issue. So, for the moment I've only added a prompt which lets the user automatically switch to Gamma color space if Linear color space is detected.
    • Added specular (PBR) map support
    Specular maps can now be generated. Specular maps are mutually exclusive with metallic maps, this means that you can choose only one of the two. This is something I implemented by design, and not a technical limitation. It may be changed in future basing on users feedback.
    • Fixed a bug for which sometimes the "Refresh all lights" button failed to collect scene lights
    The bug was caused by the SetFloatArray function, which basically can't assign arrays with a bigger size than the first created ones, so the collected lights were at maximum the initial ones. Now, Total Baker deletes the whole material and instantiates a new ne with the correct array size when lights are collected and before they are applied in the lighting shader.
     
    Last edited: Aug 27, 2019
    skyLark9 likes this.
  38. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Wait, what? This doesn't support Linear color space? I'm really baffled. It sounds like you don't think this is important, but almost no one uses Gamma color space.
     
  39. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    When I say that TB doesn't support Linear Color Space I mean that when in linear mode the generated textures have incorrect colors. Of course, the jpg/png images that are produced by the baking process can be later used in linear mode. So, as of now, you have to do your bakes while in gamma mode.

    There are several technical reasons why I couldn't add the linear color space. I'm still investigating for a solution which could work with all the different rendering phases of the bake (texture writing, real-time preview, jpg/png writing).

    When I say "I found that the effort would be too big if compared to the importance of the issue", I mean that the only solution I've found would require a lot of work and it will probably slow down the baking process, so it's not worth it. I have to find a better solution which requires less development time and less computation.

    Francesco
     
    Last edited: Sep 6, 2019
    wetcircuit likes this.
  40. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Oh, thanks for clarifying. It had me worried. I still want to buy this, but haven't had the funds yet.
     
    fra3point likes this.
  41. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    Ok, call me a complete noob (I'm not but should really know this by now) but doesn't this package create a "sprite sheet" of the textures or is this more like a Mesh reducer? It seems as if this just reduces your meshes instead of just packing textures.
     
  42. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Hello,

    this system doesn't create any spritesheet and, for the moment, it doesn't reduces meshes.

    Its main purpose is to generate textures for your lowpoly models so that they will look like their highpoly versions. This technique is called "Detail Transferring", and it answers the following question:
    Let's make an example: normal mapping. As you may know, with a good normal map your model L can appear more detailed, and the goal is to make it look like H. Total Baker will analyze the surface differences between your models and will write for you the right normal map.

    With the same algorithm it is possible to bake other kind of textures, for example diffuse maps, specular maps, AO maps, etc..

    Let's make a more complex example: material combining. Let's suppose that H has 5 materials with 5 different diffuse textures and L has a totally different uv map, but it perfectly approximates H's shape. You choose to bake the diffuse map only (you can do it in the settings). Total Baker will bake all those materials into a single material with a unique texture which will be mapped onto L. This is what texture baking is all about.

    Just to be clear, the input will be:
    • Lowpoly model (provided by user, uv-unwrapped)
    • Highpoly model (provided by user)
    • Settings
    And the output will be:
    • A list of distinct textures (the ones selected in the settings)


    Francesco
     
    skyLark9 and magique like this.
  43. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    Sweet, thanks
     
  44. stanislavdol

    stanislavdol

    Joined:
    Aug 3, 2013
    Posts:
    282
    Hi, I am curious if it works with custom shaders or only with standard one?
     
  45. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    good question
     
  46. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Hello,

    at the moment custom shaders aren't supported.


    Since this is one of the most frequently asked questions, I'll try to explain something about Total Baker's implementation and about the problem with custom shaders.
    Let's make an example: Custom Map baking

    Let's suppose that Total Baker supports custom shaders with custom maps and you use a shader with a map named "_MyFancyMap". How can the system know how to manipulate that map to produce the desired colors? This information is only accessible in the shader code, but the C# part of the system can't access shaders code.

    Another example: Diffuse Map baking

    This is just a more special case which is included in the previous one.
    Let's suppose that you have your custom lit shader with a Diffuse map named "_MainTex" and a color named "_Color" and you use it for the baking the Diffuse Map.
    In this case, the system theoretically supports your custom shader, because the texture and color names are the same of the predefined ones for the Diffuse Map ("_MainTex", "_Color").
    Of course I could modify the code to support custom properties names, but what I really can't do is to predict every single custom shader's behaviour.
    In fact, the classic shaders usually compute colored textures like this:
    Code (csharp):
    1. float4 col = tex2D(_MainTex, i.uv) * _Color;
    but you may want to use a slightly different computation to produce your output colors, like this:
    Code (csharp):
    1. float4 col = tex2D(_MainTex, i.uv) * _Color * 2;
    The problem here is that the diffuse map baking algorithm is hard-coded, and can only reproduce the first case. I can't support every kind of custom shader except the ones that act normally, which means, as I said, computing the final color using the basic texture*color formula.
    So, using a shader with the second example code in it, would produce an incorrect Diffuse Map because the *2 won't be taken into account.

    One possible solution would be to create a "scriptable" baking system to allow user to specify custom code to be executed instead of or additionally to the default one. This would mean making a huge effort for me and a double-huge effort for users (even if they are expert programmers) because there are other things to specify for each map/property, like post-processing filters.


    I hope I was clear enough, but let me know if I didn't.

    Can you please tell me what kind of custom shaders you would like to use and what are the results you expect from the baking?


    Francesco
     
  47. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    Hey @fra3point, this is an interesting piece of software, thanks for making it.

    From reading this thread, here's a link you might find helpful:
    https://github.com/Fewes/BNAO - a GPU-based Bent Normal + AO baker for Unity

    Do you have any comparions from other bakers and Total Baker? E.g. Render to Texture in 3ds max with automatic cage etc, or other systems? I'm thinking about moving parts or all of our current baking pipeline into Unity, but that would not make sense if quality suffers.
     
    fra3point likes this.
  48. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Thank you so much! I'll take a look to BNAO as soon as possible.

    At the moment the only softwares I can compare Total Baker to are xNormal and Blender because I don't own any other software licence. I'm not a 3D modeler and I'm not an expert Blender user, but I'll ask some friends to help me making these comparisons. I'll post some results here.

    Francesco
     
    wetcircuit and fherbst like this.
  49. danilonishimura

    danilonishimura

    Joined:
    Jul 13, 2010
    Posts:
    70
    Baking textures in real time would be very useful for procedural character customization. You can setup a lot of different features in the character skin such as tattoos, body paint, scars, etc, and bake them to diffuse and normal textures, so you can use a simpler shader and keep the details intact.
     
    kilik128 and fra3point like this.
  50. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    You're right. If i'm not wrong you're thinking about multi-layered body painting (decals) for character editing in real-time. This can be done with a much simpler and faster algorithm than Total Baker's one. So I wouldn't recommend TB for this kind of bake. Time ago I worked on a Car Decal System which basically baked up to infinite decal layers into one single texture. I can say the baking techniques are very different.