Search Unity

Mesh Baker by Digital Opus [RELEASED]

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

  1. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    902
    Just checking this out in the Spring Sale. In theory it sounds great, but the info I'm seeing actually leaves a HUGE question mark on the value of this. In the first video about mesh with the red and blue stacked dice, although the drawcalls is reduced, the framerate is significantly lower in the baked version. Similarly in this example image:



    Drawcalls is reduced from 2890 to 233, but the actual render timings shows a GPU render time increase from 2.9 ms to 521 ms (though the same fps, so not sure why the discrepancy).

    Can anyone provide real-world data on FPS results for different platforms to illustrate the difference this asset actually makes? Cheers.
     
  2. Eclectus

    Eclectus

    Joined:
    Oct 29, 2012
    Posts:
    20
    Thanks Phong - I would love to test and provide feedback!
    I have sent you an email,

    Gratefully
     
    Phong likes this.
  3. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Performance improvement will vary depending on your situation. It is easy to construct scenes that result in 2x performance improvement. It is also easy to construct scenes that have no-improvement or negative improvement. Mesh Baker does "draw call optimization". Drawcalls are are a very common bottleneck with most games.

    I would suggest you test your game on the target hardware to see if it is CPU bound (too many drawcalls) or GPU bound (shaders are too complex or there is too much overdraw or too many verts/tris). It may also be the case that performance is not bound by rendering at all. It could be that your game is bound by physics, scripts or something else.

    If your game is CPU bound then using atlases to reduce materials will almost certainly speed up your game. If your game is not CPU bound then, you will probably see no or worse improvement.

    Re: the screenshots you mention. It is important to test performance in a build on target hardware. Many scenes will have worse performance in the editor but better performance on a mobile phone, VR headset, console etc... The screenshots were chosen to show the possible reduction in drawcalls. Usually it is best not to go for absolute minimum of drawcalls because you end up combining a lot of off screen geometry that can no longer get culled. Mesh Baker is not a one-click solution. It is a flexible suite of tools that make it easy to quickly generate atlases for a diverse set of props to let you quickly experiment to find the most optimal performance setup for your game.
     
  4. bsy50642

    bsy50642

    Joined:
    Aug 9, 2021
    Posts:
    9
    Using MultiMeshBaker and MeshBaker, DrawCall was reduced, but in turn, Verts increased significantly, resulting in more serious lags.

    I was looking for a different way to solve it, but when I used 'MeshBaker Group', I solved it completely.

    However, when using Texture Bake, you have to use Culling off and Back Culling for each material when using Custom Shader(Using 'Unity Chan Toon Shader 2'), but it is regrettable that the functions are not properly distinguished.
     
    Last edited: Apr 18, 2022
    Phong likes this.
  5. kjetilhj

    kjetilhj

    Joined:
    Oct 23, 2019
    Posts:
    3
    Whats the recommended approach with MeshBaker when you bake a number of prefabs that have lods in them. Selecting each lod and baking is quite cumbersome when you try to bake tens of objects.
     
  6. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    I would recommend using the Batch Prefab Baker. It will create duplicate prefabs that are exactly the same as the original prefabs except that the UVs are adjusted and the prefabs share a combined material. You can use these prefabs in your scene and set them to static. Unity's static batching will combine them and LODs still work.
     
    Shamantiks likes this.
  7. bsy50642

    bsy50642

    Joined:
    Aug 9, 2021
    Posts:
    9
    I would like to use Mesh Baker group only for Mesh Baker, not Multi Mesh Baker when generating.
    However, there are so many objects that it is too difficult to set up one by one. Is there any solution?
     
  8. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    I don't have a switch in the UI for that, but you can easily modify the code so it always uses a MeshBaker:

    In MB3_MeshBakerGrouper.cs around line 366 inside function AddMeshBaker look for these lines:


    Code (CSharp):
    1.  
    2.             ...
    3.  
    4.             if (numVerts >= 65535)
    5.             {
    6.                 newMeshBaker = nmb.AddComponent<MB3_MultiMeshBaker>();
    7.                 newMeshBaker.useObjsToMeshFromTexBaker = false;
    8.             }
    9.             else
    10.             {
    11.               newMeshBaker = nmb.AddComponent<MB3_MeshBaker>();
    12.                 newMeshBaker.useObjsToMeshFromTexBaker = false;
    13.             }
    14.  
    15.             ...
    16.  
    Switch them to:

    Code (CSharp):
    1.  
    2.               newMeshBaker = nmb.AddComponent<MB3_MeshBaker>();
    3.                 newMeshBaker.useObjsToMeshFromTexBaker = false;
    4.  
    5.  
     
    bsy50642 likes this.
  9. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    You can try to enable the "multiple materials" option. That usually works. However you mention that there is no seam. If there are are submeshes that share vericies then these need to be fixed in a modelling program.

    More info on the multiple materials feature here:

     
  10. AndreiMarian

    AndreiMarian

    Joined:
    Jun 9, 2015
    Posts:
    77
    I'm about to get Mesh Baker and I went through the tutorials beforehand. I've just dropped in for a little feedback: congratulations and thanks to the creator of Mesh Baker! It seems it fills up just the right gaps Unity is missing to make Unity's rendering powerful. The appropriate tutorials and rich feature list makes it worth the relatively high price compared to other similar assets.
     
    Phong likes this.
  11. PaoloAm

    PaoloAm

    Joined:
    Jul 15, 2019
    Posts:
    28
    Hello there,

    first of all, nicely done for this asset, seems pretty cool!

    We are considering using this tool to improve our draw calls but I am not 100% sure that this would solve it.

    Here is our case:
    Imagine 10 tables, each table is growing 260 very small plants and each plant is skinned mesh renderer and has a blend shape to make it grow. Each plant also has a LOD with 3 levels (320 vertex, 40 vertex and 8 vertex). Each plant is the same and has always the same value of blend shape, only difference is the rotation. Do you think we could solve the issue with your tool and also maintain the LOD? (I saw that you haven't released an update on the lod asset in 4 years so I was wondering if it's still active.

    Thanks!
     
  12. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Hi Paolo,

    It will be a challenge to handle the LOD and have the meshes be combined.

    You could combine all the meshes on a single table into three different combined meshes LOD0, LOD1, LOD2. The MeshBakerGrouper can help with this. Then build an LODGroup with the combined meshes. This should work but the whole table will shift LOD level at the same time. That may not be acceptable to you.

    Also you may run into a performance issues with that many blend shapes if the blend shapes for each plant need to be independent. If we consider a simple case where each plant has two blend shapes and we want the blend shapes to be independent for each plant, then that will be 520 blend shapes that we are blending every-vertex-every-frame. That is a lot of blending!
     
  13. crowmaster

    crowmaster

    Joined:
    Jul 6, 2012
    Posts:
    83
    Is MeshBaker performance good enough to bake assets on the fly? Does it stall main thread while baking? I have project with quite large scenes and a lot of draw calls, up to 40k+, performance is suffering heavily. But i dont want to keep combined version of the meshes in my project to avoid bloating build size.
     
  14. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Baking textures is slow. I would not recommend doing this at runtime other than at the start of a level. Baking meshes is quick and is practical to do at runtime. If you are on mobile then you can probably only bake 20k meshes or less without a frame drop. On PC you should be able to bake 100k meshes without a frame drop.
     
  15. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    Hi Phong
    Any idea why there is such a large size discrepancy with the final packed texture atlas ?

    The original textures are all 256x256, but once packed the ratio isn't the same. One of the textures is mega-super-shrunk down. How can we ensure the packing ratio is close to their original sizes? (As an optimization fanatic, I can't bear seeing all that wasted empty space in the texture too :D)

    I tried playing around with the material bake settings, but no luck. :oops:

    MeshBaker-Universal Render Pipeline-Lit-LM-1-mat-_BaseMap-atlas-0.jpg
    1.jpg 2.jpg
    2.jpg

    Thanks for the help
     

    Attached Files:

    • 3.jpg
      3.jpg
      File size:
      67.7 KB
      Views:
      212
    Last edited: May 30, 2022
  16. paolo-rebelpug

    paolo-rebelpug

    Joined:
    Sep 27, 2021
    Posts:
    22
    Thanks for the feedback, we will work out another way to make the plants grow since it's destroying our performances. Then we'll look into your suggestion on how to manage the situation with lod groups. Even though I am worried about changing the whole table lod due to the fact that plants are added to the table at game start dynamically based on what you are growing.

    Thanks for the feedback!
     
  17. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Hi Paolo,

    Is this game for PC? I am wondering if you could do this using a tessellation shader. It would be complicated but you might be able to build the mesh and skin it in on the GPU side.
     
  18. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Hi CrowaL,

    There are a couple of things to check:

    Look in the console after baking the textures. There should be a "report" line that describes which textures were baked into each rectangle.

    Are there more maps than just BaseMap/MainTex? The big texture might have been scaled up if the normalMap,glossMap etc... was much bigger. The report should reveal this.

    Check the max-size of the source textures in the texture inspector in the project. Mesh Baker uses this for the source size. The small texture might be set to a very small size, or the large texture might be set to a large size.

    The other thing that could be affecting texture size is "Consider UVs". Is that little texture the whole texture or just a small part of the source texture? When "Consider UVs" is checked then Mesh Baker will extract only the part of the texture that is actually used by your mesh.
     
  19. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    1. PERFECT! That was it. The normal maps \ spec maps were 2048x2048. :eek:
    2. In regards to the amount of white space. Are there any other settings that I can check to use that empty texture space?
    3. I noticed something else. If the original mesh didn't have any specular maps, Mesh Baker will placeholder a pure WHITE value. Is there a way to have it be BLACK instead? The WHITE tetris shapes are the geometry that didn't have any specular maps in their respective shaders
    upload_2022-5-30_17-33-42.png



    Thanks again for the help :rolleyes:
     
    Last edited: May 30, 2022
  20. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Re: white space. I usually use "resize power of two textures". If you don't have that enabled then the texture dimensions get boosted by the padding and they can pack extremely inefficiently.

    Re: specular maps, you could try enabling blend-non texture properties. It might work if you are using a shader that Mesh Baker understands. Otherwise you will need to edit the atlas after it gets generated.
     
  21. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    At the top of the file MB3_TextureCombinerEditorMethods.cs

    Switch line 20 from:

    private saveTextureFormat SAVE_FORMAT = saveTextureFormat.png;

    to:

    private saveTextureFormat SAVE_FORMAT = saveTextureFormat.tga;
     
  22. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    Ok got it! Thanks for he help :)
     
  23. matiasges

    matiasges

    Joined:
    Jan 24, 2021
    Posts:
    142
    Hello,
    After baking a static object should I also mark the combine mesh as static?
    When I bake the lights which one will receive the lightmaps, the source or the combine mesh (because the source renderer will be uncheck)?
    Oh never mind about this question, just read in a Youtube comment that I should mark it as static.

    Also when baking a prefab with LOD, I checked to cluster it by LOD level so it created 3 separate meshes, which is good. However how I should proceed with LOD1 and LOD2 for example? Create an LOD group in the first LOD mesh? Hide the LOD1 and LOD2 combines mesh?
     
    Last edited: Jun 20, 2022
  24. MrDummy

    MrDummy

    Joined:
    May 16, 2019
    Posts:
    4
    How can i combine skinned mesh avatar which seems have some null bones in the face part. Is there tool that can fix it?

    Other tools on store can combine it, but MB gives only errors and i cannot combine it. Kinda sucks.
    So what can i do here?
     
  25. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Hi Matiasges,

    Re: LOD you will need to build an LOD group. I would recommend building the hierarchy like this:

    • LODGroupGameObject
      • GameObjectWithCollidersAndScripts
      • CombinedMeshGameObjectLOD0
      • CombinedMeshGameObjectLOD1
      • CombinedMeshGameObjectLOD2
    The LODGroup component will enable and disable the various child LOD game objects. It is a good idea to have colliders and scripts on a separate unscaled game object (or the root) that has no renderers on it.
     
    matiasges likes this.
  26. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Hello, currently Mesh Baker can't combine skinned meshes with Null bones.

    How did the bones become null? I don't think Unity ever allows a mesh to be imported with null bones. I suspect that you are combining a prefab in which someone has deleted some of the transforms (bones) in the face. This would create null bones. If you re-create your prefab from the model prefab and don't delete the extra face bones then you should have a skinned mesh with all the bones and you should be able to combine it.
     
  27. matiasges

    matiasges

    Joined:
    Jan 24, 2021
    Posts:
    142
    Al right, thanks for the answer.

    Is there any solution for the lose of quality?

    texture baker:


    normal:


    texture baker:


    normal:


    I have tried many combinations of settings, but there is always a lose in quality. I even had to take some objects out of the texture baking using different materials because the texture quality loss was too much.
     
  28. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085

    What does the atlas look like? If there are large blocks of blank space I would recommend using the "resize power-of-two" textures. That can help a lot.

    Also check that the "max atlas size" setting is reasonable for your platform and number of textures you are combining.

    The most common culprit for downsampling is tiling. Mesh Baker bakes tiling when it copies data to the atlas. For some models this can result in a HUGE texture which gets downsampled when copied to the atlas. You should be able to see this in the atlas if it is happening. Also there will be a "report" line in the console that explains how and why the textures are being resized as they are added to the atlas.

    If you have some textures that have huge amounts of tiling you can put these on their own submesh using the multiple materials feature (they are left out of the atlas). You will have an extra drawcall for these textures. See this video for more info on this technique:



    Another solution is to use TextureArrays, however this is a giant commitment for your project and an advanced-huge topic of its own. There are a few videos explaining how it works on my youtube-tutorial- playlist and there is a PDF document included with Mesh Baker that explains how Texture Arrays work.

     
    Willbkool_FPCS likes this.
  29. HarleyInfinity

    HarleyInfinity

    Joined:
    Nov 29, 2021
    Posts:
    2
    I'm currently considering Mesh baker but I have a question regarding the use of this with multiple trim sheet materials. The upside of trims is that we can rapidly create new meshes with great detail without needing to create many materials or use a lot of polygons, but it does make combining the meshes - a pain for performance.

    Let's say I have an empty parent gameobject with several objects with multiple trim sheet materials. In this case, we can assume that many of the UVs are going to extend horizontally beyond 0~1.

    Can Mesh Baker take these childed objects, separate them into groups by their material and them combine them into prefabs?

    We're currently considering using trim sheets at our studio for a mobile title, and if we could pack as many of the meshes as possible, that would be understandably huge for performance. Thank you!
     
  30. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Hi Harley,

    Mesh Baker does have a "Analyse Scene" tool that I believe you could use to do what you want. See this video:



    Re: UVs outside the range 0~1 (tiling). Mesh Baker can either bake this tiling into a block of tiled material in an atlas (this block can be shared by multiple different meshes) or you can use the "multiple materials" feature to put the tiled texture on its own submesh. I recommend the extra-submesh appraosch if there is a lot of tiling. See this video for more info.

     
  31. jinzoquang

    jinzoquang

    Joined:
    May 30, 2019
    Posts:
    4
    Hi. Im running into some problem using MeshBaker. Somehow when i enable both consider Mesh UV and Blend Non-texture Properties, the map baked will not be correct as the original mesh. The tilting of the new baked mesh will not be tile as the old mesh in Unity and will be reverted back to 1 / 1 ( Image 1 ) . Some of the material will be display uncorrect too.( Image 2 )
     

    Attached Files:

  32. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Hi Jinzoguang,

    I just tested this and it worked for me. The combined mesh tiles correctly.

    Did you remember to re-bake the combined mesh after baking the atlases? This is a mistake I often make. I change something that changes the atlas and then need to re-bake the combined mesh or the textures do not display correctly.

    If you did re-bake the meshes and it still displays incorrectly, were there any errors in the console? Please contact me if this is the case as this sounds like a bug.
     
  33. jinzoquang

    jinzoquang

    Joined:
    May 30, 2019
    Posts:
    4
    hi im baking the default template scene for unity URP. I did bake the combined mesh and the console appear no error at all.
     
  34. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Hi Jinzoquang,

    I did some testing on that scene.

    There are some things about this scene that make it very difficult combine these meshes.

    The drywall panel mesh uses three separate materials (submeshes). There is a warning when baking the meshes that these submeshes share vertices. These are difficult to combine because the vertices that are shared need three different UV values.

    There are also numerous errors that some of the source materials store Smoothness in the albedo texture alpha and some store smoothness in "Metallic/Specular texture alpha". At this time Mesh Baker does not support combining these.

    I am not able to reproduce the tiling problems with ground when using the latest version of Mesh Baker. (Which version are you using?)

    upload_2022-7-5_12-28-4.png
     
  35. jinzoquang

    jinzoquang

    Joined:
    May 30, 2019
    Posts:
    4
    Hi Im using the latest version which is 3.34.3. I have rebake the ground only and i found out that the albedo layer is tiltting correctly but the other layer like normal and Metal/smoothness isnt . Here is the setting that i use to bake
     

    Attached Files:

  36. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Hi jinzoquang,

    Thanks for bringing this to my attention. I am able to reproduce the problem now. I see that the ground material has a single tiling setting that is being applied to all the maps, but Mesh Baker is only applying it to the albedo. I will be sure to include a fix for this in the next release. Unfortunately this will require special code specific the the URP shader it appears that Material.GetTextureScale() does not work for URP texture properties other than baseMap.
     
  37. whitewidowmaker

    whitewidowmaker

    Joined:
    Aug 17, 2017
    Posts:
    7
    Hi!
    I am trying to bake a skinned mesh on runtime so I can then use SkinnedMeshRenderer.BakeMesh to easily create a *mesh* snapshot of the combined skinned mesh so I can slice it to pieces. BakeMesh() doesn't work from scratch for me, I have to combine the skinned mesh at first, so I can instantiate a single gameobject with no children, but only with a skinned mesh renderer and a combined material and then apply SkinnedMeshRenderer.BakeMesh() on the combined (via MeshBaker) skinned mesh. The first time that I am trying this in scene(first enemy prefab instance-right platform), it works as expected but when I am trying to do this again with the next (same) prefab instance, I am getting something strange. The combined mesh results in this white boulder on the right and also, the skinned mesh bounds are extended, encapsulating both the second prefab instance(<skinned mesh that I want to combine, on the left) and the boulder and I also get these two error messages when the combining is trying to happen. I am assigning the right gameobjects (the same as the first prefab but for the second prefab this time) on the inspector for the second combining attempt and I checked a lot of times that they are the correct-active ones in the hierarchy for the specific gameobject. Any kind of help would be really appreciated...



    MeshBaker settings:



    the combine mesh method that results in errors on the second combining attempt after loading the scene:

    Code (CSharp):
    1. public void CombineMesh()
    2.     {
    3.         //Add the objects to the combined mesh
    4.         //Must have previously baked textures for these in the editor
    5.         //meshbaker.AddDeleteGameObjects(objsToCombine, null, true);
    6.         meshbaker.AddDeleteGameObjects(objsToCombine, null, false);
    7.         //apply the changes we made this can be slow. See documentation
    8.         meshbaker.Apply();
    9.  
    10.         objectToDeactivate.SetActive(false);
    11. }
    EDIT:

    I managed to find a solution. I removed MeshBaker for this situation and managed to make it work with just only SkinnedMeshRenderer.BakeMesh()... :) But if there is any explanation for the previous question, I would love to hear it + thanks
     
    Last edited: Jul 7, 2022
  38. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    ----------------------
    Hi whitewidowmaker,

    It sounds like you are re-using a MeshBaker to bake a different combined mesh with different source objects. It is likely that this is causing the problem you describe. To do this you need to set the cached mesh and resultSceneObject to null before the second bake:

    Code (CSharp):
    1.        
    2.        MB3_MeshBaker mb;
    3.         mb.meshCombiner.resultSceneObject = null;
    4.         ((MB3_MeshCombinerSingle)mb.meshCombiner).SetMesh(null);
    5.  
    If you don't do this then MeshBaker is trying to re-use the mesh from the first bake. You will have the very strange situation where two different skinned meshes are trying to use the same combined mesh. If you set the meshCombiner mesh and resultSceneObject to null, then MeshBaker will use a new, independent mesh for the second bake.
     
    whitewidowmaker likes this.
  39. tconkling

    tconkling

    Joined:
    Jul 13, 2012
    Posts:
    17
    Hi @Phong - Mesh Baker is great!

    I have a little UI issue with the `MB3_MeshBakerGrouper` component: my team would love to be able to edit multiple grouper objects simultaneously, in order to assign them all the same grid cluster origin and cell size. But if multiple groupers are selected in the hierarchy, edits only get applied to one.

    meshbaker.jpeg

    Any chance of getting this fixed? Thanks!
     
  40. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    I will add this to the todo list. Probably won't make it into the next release coming this month, but likely the next one.
     
    tconkling likes this.
  41. jinzoquang

    jinzoquang

    Joined:
    May 30, 2019
    Posts:
    4
    Hi , tks for trying to fix my problem. But do u have any solution right away that can be able to fix the problem so we can modify the code by ourself since the deadline of our project is close.
     
  42. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    I will PM you with a fix. You can also contact email support at contact.digitalopus@gmail.com if you don't get the file via PM.
     
  43. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    I'm having an issue trying to combine a modular skinned mesh into one material. The one on the left is the modular, the one on the right is combined. It's using the wrong parts of the texture or color or something. Any ideas how to fix this?
    upload_2022-7-22_9-57-41.png
     
  44. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    This is probably a tiling issue caused by UVs outside the range 0..1. You should be able to fix it by enabling "consider UVs" more information here:



    You will need to re-bake the textures and the meshes.

    You can also check the console after baking the textures. There should be a "report" message that describes the tiling of the source textures.

    Let me know if this does not fix your problem.
     
  45. epare025

    epare025

    Joined:
    Oct 9, 2017
    Posts:
    10
    Can Combined Meshes created through TextureBaker be turned into prefabs?

    Just bought Mesh Baker. Followed the Texture Baker Tutorial but creating a Prefab out of the output "CombinedMesh-MeshBaker-mesh" GameObject that's created when "Bake All Child MeshBakers" is pressed results in the new prefab having a null Mesh in the MeshFilter component. Searching for an unamed mesh in assets yields no result.

    Checking "Auto Generate Prefabs" doesn't seem to do anything as there is nothing in the "Prefab Output Folder".

    Back in the Scene, the MeshFilter of "CombinedMesh-MeshBaker-mesh" has no characters for the mesh name.

    Was Mesh Baker intended to not have combined Meshes be turned into prefabs?
     
  46. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Yes, you can bake into a prefab. You need to set the "Output" field on the MeshBaker component to "Bake Into Prefab". If you bake into a scene object then the combined mesh is part of the scene and is not visible to project prefabs.

    This video shows the workflow 3:16 into the video.



    --------------
    Re: the "Auto Generate Prefabs" checkbox. That is part of the Mesh Baker Grouper component. See this video for more info:

     
  47. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    I'm a new user and I'd really like to group my levels into chunks.
    - Is there any type of automatic occlusion for fully obscured objects?
    - Is there any way to trim faces from the baked mesh? For example faces which are fully below the ground surface.
     
  48. Brenton

    Brenton

    Joined:
    Apr 4, 2013
    Posts:
    18
    I am currently trying to compare tools on the asset store. I have tried to sort through questions (but 67 pages is just too much for me..) So I apologize if this has been covered. Here is the scenario:
    • Multiplayer Game, players can choose various clothing items (A - Z).
    • Player 1 chooses A,B,F,G clothing options
    • Player 2 chooses B,D,Z clothing options
    • Game starts, now we need to combine player skinned meshes from body+clothing options, based on choices (so these can not be defined beforehand without making an absurd amount of prefabs in every possible combination)
    I am looking into the runtime section of the documentation, but I am not sure I understand the ideas on making calls during Update/Late Update, etc.

    Is there not a way to generate the combined mesh ONCE locally on level load (destroyed on match end) then just use that mesh during the match without need to make "Mesh Baker updates" every frame?

    Hopefully that makes sense, thanks.
     
  49. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Currently Mesh Baker does not do any occlusion for fully obscured faces.

    If you want to trim faces, you will need to export the mesh using a tool like Unity's FBX Exporter. Then open the mesh in an external modeling tool like Blender or Max and edit the mesh there.
     
  50. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Yes you can use the workflow described in this tutorial. The video is a bit old but the workflow works as shown. The workflow shows how you can mix and match skinned mesh body parts and bake them into a single skinned mesh. These can be baked once when the scene is loaded and used for the duration of the scene.