Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Mesh Baker by Digital Opus [RELEASED]

Discussion in 'Assets and Asset Store' started by Phong, Nov 20, 2012.

  1. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    265
    There are materials without textures.... But those were not the troublesome ones. They are 3rd party shaders with textures assigned to non-standard keywords, ie not MainTex,etc.
     
  2. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    265
    Also sometimes when I click the 'Build Source to Combined Mappings' button I get the following error. It seems random because deleting the gameobject and recreating and following the exact series of steps causes this error about half the time.
    I'm now using Unity 5.6.0f3, as recently upgraded project.

    ArgumentNullException: Argument cannot be null.
    Parameter name: key
    System.Collections.Generic.Dictionary`2[UnityEngine.Material,UnityEngine.Mesh].ContainsKey (UnityEngine.Material key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:458)
    DigitalOpus.MB.Core.MB3_TextureBakerEditorInternal.ConfigureMutiMaterialsFromObjsToCombine (.MB3_TextureBaker mom, UnityEditor.SerializedProperty resultMaterials, UnityEditor.SerializedObject textureBaker) (at Assets/MeshBaker/scripts/Editor/MB3_TextureBakerEditorInternal.cs:402)
    DigitalOpus.MB.Core.MB3_TextureBakerEditorInternal.DrawGUI (UnityEditor.SerializedObject textureBaker, .MB3_TextureBaker momm, System.Type editorWindow) (at Assets/MeshBaker/scripts/Editor/MB3_TextureBakerEditorInternal.cs:231)
    MB3_TextureBakerEditor.OnInspectorGUI () (at Assets/MeshBaker/scripts/Editor/MB3_TextureBakerEditor.cs:33)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1229)
    UnityEditor.DockArea:OnGUI()​
     
  3. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    265
    I'll supply more useful information when it's finished generating clusters for my scene... Been going 24 hours now.
     
  4. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    Thanks for the feedback. If there is a shader that uses unusual property names you can enter them in the "Custom Shader Properties" section of the editor. However that shouldn't cause the index out of bounds problem, I will look into that. Thanks also for the heads up on the build source to combined mapping issue.

    Regarding the clusters, how many Renderers are there in the scene? I have tested up to 5000 where it took a few hours. Perhaps I should take a look at optimizing that more.
     
  5. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    265
    a bit over 75,000 so far.
     
    Last edited: Jun 5, 2017
  6. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    265
    Found the problem... was a corrupted UV attached to a single mesh.
     
    hopeful likes this.
  7. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    75,000 ... Wow!

    I don't think the agglomerative clustering is going to be possible on that scene. I will take another look at the algorithm to see if I can find a way to make it work for huge numbers of objects.
     
    Ninlilizi likes this.
  8. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    265
    Clustering finished.... eventually.... The part of the process that was problematic was baking the texture atlas' where the mono heap spiked to 80GB.

    It's a large open world area I'm working on.... Which I plan to use with World Streamer for the geometry & use Granite for streaming in the textures. I figure the ideal workflow would be to generate one large set of texture atlas' for the entire scene... Then break it up into smaller pieces for clustering a piece at a time, as I complete them.

    So, if anything. If there's something that would be really useful in making life easier, it would be the texture atlasing process.
     
    Last edited: Jun 6, 2017
  9. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    Thanks for the feedback. I worked a bit on the Clustering yesterday. I think I have a dramatic speedup. I need to do a bit more work so that it will scale to hundreds of thousands of objects.

    Wow! 80GB! How much ram do you have in your machine? I am surprised that the atlas baking spiked that high, it should only require ram for the atlas that is being baked (max 8k) and the texture it is trying to add (8k). Although it does store a reference to all the objects to be combined and some info about each shared mesh. If there are 60k objects perhaps that is using the memory. Definitely something I will investigate..

    [Edit] I am trying a test scene with 32k cubes (16 Gig ram) and am finding things very slow. I am amazed you can work with 60k objects.
     
    Last edited: Jun 7, 2017
  10. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    265
    64GB RAM.... 5Ghz 8core CPU, GTX1080, SSD's everywhere. As I'm sure your well aware, when it comes to Unity development you can never have enough hardware.
     
    Last edited: Jun 7, 2017
  11. projectonemotion

    projectonemotion

    Joined:
    Jan 20, 2017
    Posts:
    16
    Hi again, i have a strange problem, if pivot points lie on cluster lines, mesh baker will not combine meshes. whats the problem?! also there is a problem with not centered pivot points.
     
    Last edited: Jun 8, 2017
  12. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    Hi projectonemotion,

    I take it this happens when using the grid based clustering? I will check the code. It is possible I am not including the lines when testing the interval.

    Can you describe the problem with not centered pivot points. Is this objects not being included in the correct cluster?

    [Edit] I had a look, the cluster tool does not create a baker if there is only one object in the cluster.
     
    Last edited: Jun 10, 2017
    projectonemotion likes this.
  13. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    265
    Can I possibly make a feature request for the prefab texture builder mode?

    That being as well as being able to drop in prefabs manually.... Have it recurs an entire direction structure and automatically add ALL the prefabs it finds to it? That way I could fire it up on an asset tree and a week later have everything shiny and atlased up?
     
  14. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    265
    Last edited: Jun 10, 2017
  15. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    265
    This is basically how it's mangling the scene... Gray textures, invisible geometry and you can see the UV's being off on the ground texture.
     
  16. projectonemotion

    projectonemotion

    Joined:
    Jan 20, 2017
    Posts:
    16
    thank you and sorry for delay!
    Yes, grid based clustering is not working as expected but i figured out it is not because of grid lines, as you said the problem is "only one object in a cluster". for now we switched back to the previous version and the problem has gone.

    For not centered pivot points, imagine that there is a bunch of meshes that their pivot points are located at same position but meshes actually are located in different positions and distributed in several grids. mesh baker will combine all of that meshes in a way that they are located in one grid (in the grid that pivot points located at).
     
    Last edited: Jun 11, 2017
  17. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    I appreciate suggestions very much. No promises, but I will add this to the proposed features list.
     
  18. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    I can't tell how the asset works by looking at the description in the asset store. I would suggest experimenting with just a few assets to see if you can get it to bake. In most cases a troublesome asset is due to multiple materials (submeshes, combined with tiling). In these cases it is usually necessary to use the Multiple materials feature. Also look carefully at the console messages after baking. Mesh Baker provides a lot of information and suggestions about the bake.

    This video helps explain the issues with multiple materials and tiling:



    Also note that there are meshes that are impossible to combine. This can happen if there are submeshes that share vertices.
     
  19. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    Hi projectonemotion,

    I have made some fixes that will be published in the next update (early next week).
    • Excluding clusters with only one mesh can be toggled on and off
    • Clustering is now based on Renderer.Bounds.Center. Not the pivot point
    • Massive performance improvements for creating Agglomerative clusters
    • Some bug fixes
     
    projectonemotion likes this.
  20. Alberto-Mastretta

    Alberto-Mastretta

    Joined:
    Jan 1, 2015
    Posts:
    56
    Hi @Phong,

    I'm in the process of optimizing my game, and I'm thinking of buying this asset and replace my current mesh combiner asset, since it has features the other one doesn't. I have a question that I want to figure out before I make my purchase, so here it is:

    With the current combiner I have, my UV2s are ignored and it generates UVs for lighmapping using Unity's UV generator. However, I like having control of my UVs.
    I read the description of Mesh Baker at the beginning of the thread, but to me it wasn't clear if I could use my own UV2s for lightmaps. Is there an option to use them after being baked? Or something different, like baking first and then combining?

    Cheers,

    Alberto
     
  21. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    Hi Alberto, for UV2 there are two options that work with lightmapping:
    • Generate new UV2 layout which works as you describe
    • Copy UV2 to separate rects. Which packs the UV2 layout rectangles on the source meshes into a 0..1 rectangle. The UV2 layouts rectangles are scaled by object size in scene.
     
  22. Alberto-Mastretta

    Alberto-Mastretta

    Joined:
    Jan 1, 2015
    Posts:
    56
    Awesome! That second option is what I'm looking for.

    Thanks for the quick reply!

    Cheers!
     
  23. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    265
    Yay... Finally had a successful bake. Turning off the 'Combine Non-Texture things' feature made it work.
     
  24. f0ff886f

    f0ff886f

    Joined:
    Nov 1, 2015
    Posts:
    117
    Hi Phong, there are some warnings in the latest MB 3.20 on Unity 5.6.1p3. WebPlayer/WebPlayerStreamed are obsolete, and UpdateIfDirtyOrScript should be UpdateIfRequiredOrScript:

    Code (CSharp):
    1. // MB3_MBVersionConcreteEditor.cs L34-35
    2.             if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.WebPlayer ||
    3.                 EditorUserBuildSettings.activeBuildTarget == BuildTarget.WebPlayerStreamed){
    4.                 return "Web";
    5.             }
    6.  
    7. // MB3_MeshBakerEditorWindow.cs L986
    8.         tbr.UpdateIfDirtyOrScript();
    9.  
    10. // MB3_TextureBakerEditorInternal.cs L444
    11.             textureBaker.UpdateIfDirtyOrScript();
    They seem to be pretty straightforward to fix, just thought I'd let you know.
     
  25. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    Thanks for the heads up. I will fix those.
     
  26. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    @Phong Unity 2017.1.0b9 getting tons of errors in the console:

    Running the TextureBaker and MultiMeshBaker replaces materials for all baked objects in the scene after baking materials into combined material, completely destroying them. This also occurs after baking MultiMeshBaker. Is there a workaround?

    Which was the last stable Unity release for MeshBaker?

    Code (CSharp):
    1. TextureFormat is invalid!
    2. UnityEditor.AssetDatabase:ImportAsset(String, ImportAssetOptions)
    3. DigitalOpus.MB.Core.MB3_EditorMethods:SetTextureFormat(Texture2D, TextureFormatInfo, Boolean, Boolean) (at Assets/MeshBaker/scripts/Editor/core/MB3_TextureCombinerEditorFunctions.cs:240)
    4. DigitalOpus.MB.Core.MB3_EditorMethods:AddTextureFormat(Texture2D, Boolean) (at Assets/MeshBaker/scripts/Editor/core/MB3_TextureCombinerEditorFunctions.cs:179)
    5. DigitalOpus.MB.Core.<__Step2_CalculateIdealSizesForTexturesInAtlasAndPadding>c__Iterator4:MoveNext() (at Assets/MeshBaker/scripts/core/MB3_TextureCombiner.cs:1101)
    6. DigitalOpus.MB.Core.MB3_TextureCombiner:RunCorutineWithoutPause(IEnumerator, Int32) (at Assets/MeshBaker/scripts/core/MB3_TextureCombiner.cs:492)
    7. DigitalOpus.MB.Core.MB3_TextureCombiner:RunCorutineWithoutPause(IEnumerator, Int32) (at Assets/MeshBaker/scripts/core/MB3_TextureCombiner.cs:505)
    8. DigitalOpus.MB.Core.MB3_TextureCombiner:RunCorutineWithoutPause(IEnumerator, Int32) (at Assets/MeshBaker/scripts/core/MB3_TextureCombiner.cs:505)
    9. DigitalOpus.MB.Core.MB3_TextureCombiner:RunCorutineWithoutPause(IEnumerator, Int32) (at Assets/MeshBaker/scripts/core/MB3_TextureCombiner.cs:505)
    10. DigitalOpus.MB.Core.MB3_TextureCombiner:RunCorutineWithoutPause(IEnumerator, Int32) (at Assets/MeshBaker/scripts/core/MB3_TextureCombiner.cs:505)
    11. MB3_TextureBaker:CreateAtlases(ProgressUpdateDelegate, Boolean, MB2_EditorMethodsInterface) (at Assets/MeshBaker/scripts/MB3_TextureBaker.cs:352)
    12. DigitalOpus.MB.Core.MB3_TextureBakerEditorInternal:DrawGUI(SerializedObject, MB3_TextureBaker, Type) (at Assets/MeshBaker/scripts/Editor/MB3_TextureBakerEditorInternal.cs:320)
    13. MB3_TextureBakerEditor:OnInspectorGUI() (at Assets/MeshBaker/scripts/Editor/MB3_TextureBakerEditor.cs:33)
    14. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    Code (CSharp):
    1. Could not create texture from Assets/Rocks/_art/AdamDemoAssets/Art/World/Cliffs/Textures/Cliff_5x14_V04_D.tif: Failed to initialize texture!
    2. UnityEditor.AssetDatabase:ImportAsset(String, ImportAssetOptions)
    3. DigitalOpus.MB.Core.MB3_EditorMethods:SetTextureFormat(Texture2D, TextureFormatInfo, Boolean, Boolean) (at Assets/MeshBaker/scripts/Editor/core/MB3_TextureCombinerEditorFunctions.cs:240)
    4. DigitalOpus.MB.Core.MB3_EditorMethods:AddTextureFormat(Texture2D, Boolean) (at Assets/MeshBaker/scripts/Editor/core/MB3_TextureCombinerEditorFunctions.cs:179)
    5. DigitalOpus.MB.Core.<__Step2_CalculateIdealSizesForTexturesInAtlasAndPadding>c__Iterator4:MoveNext() (at Assets/MeshBaker/scripts/core/MB3_TextureCombiner.cs:1101)
    6. DigitalOpus.MB.Core.MB3_TextureCombiner:RunCorutineWithoutPause(IEnumerator, Int32) (at Assets/MeshBaker/scripts/core/MB3_TextureCombiner.cs:492)
    7. DigitalOpus.MB.Core.MB3_TextureCombiner:RunCorutineWithoutPause(IEnumerator, Int32) (at Assets/MeshBaker/scripts/core/MB3_TextureCombiner.cs:505)
    8. DigitalOpus.MB.Core.MB3_TextureCombiner:RunCorutineWithoutPause(IEnumerator, Int32) (at Assets/MeshBaker/scripts/core/MB3_TextureCombiner.cs:505)
    9. DigitalOpus.MB.Core.MB3_TextureCombiner:RunCorutineWithoutPause(IEnumerator, Int32) (at Assets/MeshBaker/scripts/core/MB3_TextureCombiner.cs:505)
    10. DigitalOpus.MB.Core.MB3_TextureCombiner:RunCorutineWithoutPause(IEnumerator, Int32) (at Assets/MeshBaker/scripts/core/MB3_TextureCombiner.cs:505)
    11. MB3_TextureBaker:CreateAtlases(ProgressUpdateDelegate, Boolean, MB2_EditorMethodsInterface) (at Assets/MeshBaker/scripts/MB3_TextureBaker.cs:352)
    12. DigitalOpus.MB.Core.MB3_TextureBakerEditorInternal:DrawGUI(SerializedObject, MB3_TextureBaker, Type) (at Assets/MeshBaker/scripts/Editor/MB3_TextureBakerEditorInternal.cs:320)
    13. MB3_TextureBakerEditor:OnInspectorGUI() (at Assets/MeshBaker/scripts/Editor/MB3_TextureBakerEditor.cs:33)
    14. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    EDIT: MeshBaker working in 5.6, but some meshes bake out as black - can't seem to stop this.
     
    Last edited: Jun 20, 2017
  27. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    I am working on a 2017 compatible version at the moment.

    The meshes baking out as black is probably due to meshes with out of bounds UVs and/or submeshes. This video explains the issue and various solutions:

     
    buttmatrix likes this.
  28. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    Unity Technologies is promoting Mesh Baker as part of their "Mobile Essentials" package!

    For marketing purposes, I would like to provide a list of published games that have used Mesh Baker. I would really appreciate if anyone whose game has used Mesh Baker could send me the name of their game and a website link. Thanks!

    Please reply via PM or email me at contact.digitalopus@gmail.com
     
  29. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,311
    I have a group of about 100 CircuitBreakers which are fused using a TextureBaker and Meshbaker. When one CB is pulled, I call UpdateGameObjects() on the meshbaker component, providing it an array of gameObjects with a size of 1, and with only the changed CB in that array. All other function parameters are set to false, except updateVertices.

    Unfortunately, MeshBaker throws this error:
    "Object CB small has not been added"

    When stepping through the MeshBaker code, I can't figure out what the problem is and the documentation doesn't state anything to watch out for either.

    Any idea what might be wrong?
     
  30. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    Check if "Clear Buffers After Bake" is checked. If it is then try unchecking it.

    Another problem could be baking in the editor, then modifying the bake at runtime. This is a bit sketchy since Mesh Baker relies on the InstanceID of the game objects to record what objects are in the combined mesh. The problem is that when you press Run, Unity makes duplicates of the game objects which can have different Instance IDs.
     
  31. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,311
    I bake the mesh in the Editor and modify it at runtime. I un-checked the box "clear buffers after bake", re-baked the mesh in the Editor, and Run it. This time no errors, but the mesh is not updated at runtime.

    Things I tried:
    Code (CSharp):
    1. meshBaker.UpdateGameObjects(objectsToUpdate, true, true, false, false, false, false, false, false, false);
    2. meshBaker.Apply(true, true, false, false, false, false, false, false, false, false, false);
    3.  
    4. meshBaker.UpdateGameObjects(objectsToUpdate, false, true, false, false, false, false, false, false, false);
    5. meshBaker.Apply(false, true, false, false, false, false, false, false, false, false, false);
    And I tried the functions above but the Apply() function in LateUpdate. None of these combinations make the CB move, and some of them just remove the texture.
     
    Last edited: Jun 23, 2017
  32. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    There is an example scene that uses the updating.
    There is a scene SceneRuntimeExample that does runtime updating. Does that scene work?
     
  33. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    Hi ButtMatrix,

    I have been working with MeshBaker and Unity 2017 for a bit now. The texture import errors are a bug in Unity. They are not importing correctly. If you remove the files from the project and add them by dragging them into the project window then they work, but importing them from a UnityPackage results in un-importable files. I am sure this is a bug with Unity 2017 that will be fixed, but as this software is in beta I am not going to spend a lot of time on it.
     
    buttmatrix likes this.
  34. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    No problem. I did all my optimizations in 5.6 and then packaged and imported into 2017. No use in chasing the beta for now.
     
  35. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,311
    Yes, that scene does work.
    But I found the problem. I needed to set updating the triangles to false to prevent the texture from disappearing. Not sure why.
     
  36. YamiuchiProject

    YamiuchiProject

    Joined:
    Mar 14, 2015
    Posts:
    7
    Hi!
    If you use "Mesh Baker" to put Texture together, the boundary line will appear like an image.
     

    Attached Files:

  37. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    Hi YamiuchiProject,

    That is an unusual result. I can think of a few possible causes:

    1. Is the original image very small (less than 32x32)? When combining very small images into an atlas the mipmaps can have issues at the boundaries of textures. It is very important in these situations to bake a power of 2 atlas, have some padding. Also switching the filter mode to point can help, as can increasing the size of the atlas in Photoshop after the atlas has been baked using nearest neighbor sampling.
    2. Is the original texture a non-power of two
    3. Do the original texture UVs extend slightly beyond the edge of the texture? If so try enabling the "consider UVs" feature.
     
  38. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    Planning to discontinue support for Unity 4

    Hi folks, with Unity 2017 soon to be released I will soon be discontinuing support for Unity 4.
     
  39. BlackRainbowFT

    BlackRainbowFT

    Joined:
    Nov 28, 2015
    Posts:
    17
    Hi there,
    back in 2013 somebody mentioned the fact that you couldn't atlas procedural textures because Mesh Baker would throw "[...] uses a Texture that is not a Texture2D". Have you implemented a workaround? I'm aware that it wouldn't be procedural anymore. Thank you for your answer!
     
  40. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    Hi BlackRainbowFT,

    I did spend some time a few months ago looking into support for ProceduralTextures. I backed away from the feature because it was turning into significantly more work than I had hoped. The API for ProceduralTextures is significantly different from Texture2D which would mean adding a lot of code to allow Mesh Baker to work with both.

    There is a way to export procedural textures. Once exported the textures can be used with Mesh Baker:
     
  41. projectonemotion

    projectonemotion

    Joined:
    Jan 20, 2017
    Posts:
    16
    I think it is not a good idea to atlas procedural materials outside of substance designer.
     
  42. guidoponzini

    guidoponzini

    Joined:
    Oct 4, 2015
    Posts:
    55
    I use extensively Mesh Baker but I have a very hard bug... In three projects I went literally mad as in iOS building deploy the export got stuck at "Packaging shared assets(0)", with Unity shader compiling at 99% of CPU... I went mad, optimizing, trying to find what was wrong... In all the three project, deleted the Mesh Baker asset and everything went smooth... Very strange, to be sincere... If I put it back again, stuck... Unity5.6 latest release, OSx on Mac Mini, iOS deploy
     
  43. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    Thanks for the heads up. I will test it. It sounds like it is a bug with the shaders. Mesh Baker includes two shaders that are used for the "Texture Packer Fast". If you don't use the texture packer fast then those shaders can be deleted which should fix your problem. You can also select the shader file in the project and try to build that shader for a specific platform (metal) to see if there are errors. I will be doing this later to see if this is causing the bug.
     
  44. lzardo2012

    lzardo2012

    Joined:
    Apr 11, 2013
    Posts:
    34
    Hi.

    I have another question:

    I´m creating a game with several levels, each of those will be built uwing objects that share the same materials and so, I want to atlas them.

    But I want a single atlas to all of them, I could solve that by putting them into a single scene and baking the atlas with all of them together so it would make sure that it´s a single atlas for all of them.

    But I intend also to add more levels to the game and it would not be really practical to have to go to this procedure every time.

    So, the question is, is it possible to force a new object to create an atlas that´s is identical to the atlas the previous object uses?

    Or, is it possible to reorder the materials so they create an atlas in which each of the textures use a specified position?

    Or, perhaps, simply that the created atlas is organized in alphabetical order?
     
  45. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    I may not understand your question correctly but I think Mesh Baker will do what you want out. The "Combined Material Asset" that is generated contains a list of materials and which rectangles in the atlas those map to. It does not store the objects that were used in the texture bake. You can mesh-combine any object that uses those materials, even if the object did not exist at the time the textures were baked.

    There is one caveat to this. If you are using 'consider uvs' then the unknown new object may have a UV layout that is not contained within the UV layout of the original objects that were baked. If this is the case then the atlas won't have the texture you need.
     
    Last edited: Jul 4, 2017
  46. lzardo2012

    lzardo2012

    Joined:
    Apr 11, 2013
    Posts:
    34
    Hi

    I think that´s the answer I needed, I´ll make a try

    Thanks for your reply
     
  47. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,464
    I will be on vacation 8th to July 14th. Apologies in advance but support will be unavailable at this time.
     
  48. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    319
    I used mesh baker to combine materials into 1 material. The issue is that the new mesh that was created has the UVs not lined up. Why is that?

    Looks like someone else found the solution..
     
    Last edited: Jul 8, 2017
  49. flywoof

    flywoof

    Joined:
    Oct 18, 2016
    Posts:
    2
    Hi is Mesh baker able to bake lightmap?
     
  50. LunaTrap

    LunaTrap

    Joined:
    Apr 10, 2015
    Posts:
    105
    Hello! I'm using Mesh Baker in combination with Octave 3D
    I set the pieces of the wall and then I bake them to make a single mesh solid wall, it works great, but when I bake it, they look like separate:



    Here is a video that describes the problem better:

    https://www.dropbox.com/s/5nlebc65k2pnirl/2017.07.13-07.08.mp4?dl=0

    I would appreciate greatly if you could help me! thanks!