Search Unity

Mesh Baker by Digital Opus [RELEASED]

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

  1. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,890
    Re: the "d3d11: buffer size can not be zero" using 2019.4.28f1. I will look into this issue.

    It sounds like your other issue is resolved? Let me know if I misunderstand.
     
  2. longshotsg

    longshotsg

    Joined:
    Dec 8, 2014
    Posts:
    11
    Yup both are resolved. Thanks.
    I downgraded to 2019.4.20f1 instead and the issue is gone.
    Thanks.
     
    Phong likes this.
  3. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,890
    I have looked into the 2019.4.28+ skinned mesh error. This is also happening with 2019.4.29. It prevents almost all skinned mesh baking. I will push a fix up to the asset store over the next few days.

    Thanks for reporting this.
     
    eheimburg likes this.
  4. qqepijackxu

    qqepijackxu

    Joined:
    Jun 14, 2019
    Posts:
    23
    Hi! I purchased this tool but I can't get animations working with multiple skinned mesh renderers. It does combine all characters into one skinned mesh renderer and the animations does play but the characters are stuck with static position (t- pose in this case). When I move that combined object under one of these characters the animation will play on that character. I did everything excatly like with this tutorial:


    Thanks for help!
     
  5. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,890
    Hello,

    Here are some things to check:

    1) Errors in the console. Are you using 2019.4.28+ ? If so there is a bug that breaks baking skinned meshes. I pushed a new version up mid-week last week, make sure you are using the latest version.
    2) If you move the bones on the source skeletons does the skinned mesh deform? If not then either the "Mesh Baker Settings is set to MeshRenderer" or "there was an error when baking, 'does the console say successfully baked XX meshes'?"
    3) Check the culling settings on the source Animator components. Are they set to "Always Animate"?

    Let me know if this fixes your problem.
     
  6. qqepijackxu

    qqepijackxu

    Joined:
    Jun 14, 2019
    Posts:
    23
    Hi and thanks for the answer! My animator culling mode was set to Cull Update Transform, but when I switched it to Always Animate everything works fine!

    Btw I also purchased Mesh Baker LOD and can you tell me why objects wont show in build? In editor everything works fine but in build all the objects are gone.

    Thanks!
     
  7. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,890
    Glad to hear the culling settings are working. Re: objects not showing up in the build. That is a strange one. Are there any warnings or errors in the console while building?

    Mesh Baker LOD does all its baking at runtime. Are there any errors in the device log? Are the meshes readable? Check the mesh stripping settings in the Player settings. Try setting these to Managed Stripping level "low", no vertex compression, don't optimize meshes. Let me know if this fixes the issue.

    upload_2021-8-18_8-33-21.png
     
  8. ManuelMeyer

    ManuelMeyer

    Joined:
    Dec 24, 2018
    Posts:
    10
    Hi,

    I had some time.... yeah it took me a while.
    My problem was that I instantiated the TMPs in the same frame I tried to bake them. I added a Coroutine to bake them and yield returned null before baking. That solved the problem. Maybe TMP has some Initialization to do...
    Thank you for your help!

    Kind Regards
    Manuel
     
    Phong likes this.
  9. HumStuff

    HumStuff

    Joined:
    Nov 27, 2018
    Posts:
    11
    Hi! I'm considering buying this asset. Can I still use Unity's occlusion culling while using your asset?
     
  10. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,890
    Mesh Baker includes the Batch Prefab Baker. This will make duplicates of your prop prefabs that use a shared material. You can use these in your scene in place of your regular prop prefabs. Then enable static batching on those props to combine the meshes. Occlusion culling will work with static batches. Unity can hide (not render) occluded parts of the static-batch-combined-meshes.

    If you do regular mesh combining it is hard to use occlusion culling. This may work for some games (eg. dungeon crawler, where you can combine all meshes in a room), but doesn't typically work well for open worlds.

     
  11. HumStuff

    HumStuff

    Joined:
    Nov 27, 2018
    Posts:
    11
    Hi, just bought the asset - and has great hopes for it :)

    I'm trying to combine 2 meshes (simple boxes) that have tiled materials, one for each.
    I follow the tutorial on how to combine different material but the end result is a very low quality, distorted material for the combined mesh.

    As you can see in the image, the 2 right meshes are the source and the 2 on the left (which is actually the combined mesh) are the result, which is distorted.

    I get the warning "Texture T_Ground_Road_Path_2_BC_R has out of bounds UVs that effectively tile by (18.5, 13.3) tiling will be baked into a texture with maxSize:1024"
    but I don't know what to do with it....
    Help is much appreciated.

    Thanks

    Untitled.png
     
  12. natalia_unity948

    natalia_unity948

    Joined:
    Feb 26, 2020
    Posts:
    1
    Hello! I do not have populate prefab rows menu and I do no understand why. ? upload_2021-8-26_11-15-44.png
    I also can not see window replace prefabs upload_2021-8-26_11-26-9.png
    Did someone have same problem or knows what to do??
     
  13. brettjanz1

    brettjanz1

    Joined:
    Dec 21, 2020
    Posts:
    1
    Textures with a lot of tiling like that will have the tiling baked into the combined material if you have the "Consider Mesh UVs" option checked. If the max atlas size is too small this can result in the resolution being bumped down leading to a blurry distorted result.

    I would recommend either bumping up the maximum atlas size, or moving each material to its own submesh using the multiple materials option.




    These tutorials should be able to help you out, let me know if that improves your results!
     
  14. salandananjm

    salandananjm

    Joined:
    Mar 19, 2021
    Posts:
    8
    Hi! I'm currently integrating MeshBaker into our project and encountered some issues with baking materials into a combined material.

    I haven't been able to pinpoint the exact cause and figured it should be faster If I ask here while I continue figuring it out as you may have already encountered it.

    So the issue is when I try to bake my materials they only work if I use the Texture Packer Mesh Baker Texture Packer. Using Mesh Baker Texture Packer_Fast only output a material with a solid blue color as a texture resulting in my level becoming blue.

    This seems to happen on both Runtime and Editor, and I even tried using the `MeshBakerEditorWindow` to bake the same set of materials.

    As for the settings, I haven't really any setting in the `TextureBaker` component aside from the Texture Packer and I'm currently baking around 30 materials

    I should mention that in my case, I have to use the Mesh Baker Texture Packer_Fast option as I would baking this on runtime before I load levels.

    Thanks, and great work on the plugin btw!
     
  15. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,890
    This sounds odd. What is your version of unity, build target, and render pipeline?
     
  16. salandananjm

    salandananjm

    Joined:
    Mar 19, 2021
    Posts:
    8
    Hi Phong.

    I'm using Unity 2020.3.2f1, Mobile(Android/iOS) and using URP. If it's worth knowing, I'm using a custom shader made with shader graph, but I tried switching to URP/Lit as well to see if it was the cause but I got the same issue.

    No errors in the logs as well when I bake.
     
    Last edited: Sep 9, 2021
    Phong likes this.
  17. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,890
    I am having trouble reproducing the issue.

    What version of the URP are you using?

    I am using:
    • Unity 2020.3.1f1
    • URP 10.3.2
    • Lit shader
    • Build platform Android/Mobile
    • Windows
    When I bake the Examples:SceneBasic using the TexturePackerFast it works for me. Also when I bake Examples:SceneBakeTexturesAtRuntime which uses TextuPackerFast it also works at runtime. Both tests are in the editor. I have not tried on a device.

    Can you think of anything in your project that could affect how render textures work?

    Also you could try using "Texture Packer Fast V2 Beta". This texture packer was developed for HDRP pipeline which has a problem like the one you describe (atlases are blue). It uses different APIs to generate the atlas using the GPU. You could try that one. You will need to assign a render layer in the inspector that is not used for rendering other objects.
     
  18. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    321
    You've probably answered this question before... But there are 65 pages in this thread . Is there anything that would prevent this from being used in the DOTS workflow?
     
  19. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,890
    This is actually my first DOTS question.

    Can you describe your workflow that you would like to implement?

    Mesh Baker is all about optimizing props and scenes. These optimized scenes (Scene Objects with Mesh Renderers and Skinned Mesh Renderers) should be convertible to Entities using the Hybrid workflow. As I understand it, content for ECS is typically authored using Scenes with GameObjects and then converted to Entities. This should work.

    If your Entities are being created procedurally at runtime you may be out of luck if you want to use Mesh Baker in that workflow.

    The TextureBaker and MeshBaker components are just wrappers for pure C# implementations of the bakers. These bakers can be used without the compenents and should be callable from ECS code, but the API currently asks for a list of GameObjects as input. These are expected to have MeshRenderer's attached. Also the MeshBaker component creates a SceneObject with either a MeshRenderer or a SkinnedMeshRenderer component.

    I would love to hear about how you would like to fit Mesh Baker into your workflow. I am very interested in supporting DOTS/ECS but could use some guidance regarding how people would like to use it.
     
    lclemens likes this.
  20. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    321
    Thanks! In my workflow I have a normal sub-scene that is full of game objects that have meshes and materials and they are converted whenever the sub-scene runs its conversion. I have a lot of buildings that are prefabs that the player places at runtime so ideally I would merge the textures and meshes for those prefabs ahead of time. Most of us DOTS guys tend to have similar setups. I don't use any skinned mesh renderers, but I know some of the other DOTS devs do. Personally, I don't foresee the need to have meshes or textures merged at runtime, but I can't speak for everyone in that regard. Since I'm not doing any procedurally created meshes... that means I don't need to use TextureBaker or MeshBaker's C# code at runtime right? From what I understand after watching the dice video on the asset store is that pressing the "Bake" button will create the new merged mesh, and then I can disable the old mesh. From then on, whenever the entity conversion happens at game-start, the new merged mesh will be used and everything will continue as normal.

    I'm not sure about the SceneObject though.... not sure how that fits in or if it will be a problem.
     
  21. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,890
    If all baking happens in the editor then I don't forsee any problems. The scene objects, meshes & renderers that MeshBaker creates are just ordinary Unity objects and components. These should get Converted when the sub-scene is converted. You could even do all the baking in a separate scene and generate prefabs that are added to your sub-scene. Then Mesh Baker should not interfere with DOTS at all.
     
    lclemens likes this.
  22. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    321
    Perfect. I think it will work!
     
  23. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,890
  24. aggaton

    aggaton

    Joined:
    Jul 3, 2021
    Posts:
    58
    @Phong I am trying to follow Tutorial 8 Creating Customizable Skinned Mesh Characters
    . Blender has changed immensely since that video has been made and it is virtually impossible to follow it. I seem to be struggling getting Blender to show the same as the video, there are like a gazzilion buttons and menus in Blender, how do you configure it to get the same visual layout as you have, like showing bones etc? What view mode are you in Layout, Modeling, Sculpting etc?
     
  25. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,890
    Hi Aggaton, this tutorial is very much overdue for a re-make. Unfortunately Blender underwent a MAJOR UI redesign with version 2.7. A lot of things were changed to make Blender more user friendly and industry standard. I don't think it is possible to make recent versions of Blender work like it does in this tutorial.

    One option is to install an older version of Blender (pre-2.7). However you have probably done a lot of work with 2.8+ and I doubt you could open in an older version.

    Another option is to get familiar with how Skinned Meshes work and are edited in Blender. Version 2.8 works similarly to older versions of Blender under the hood. It is mainly the UI that has changed. The operations I do in this tutorial are pretty basic/fundamental things so you will definitely be able to do them in 2.8. You will be doing everything in the "Modeling" layout. For you meshes you will be tabbing between "Edit Mode" and "Object Mode". For Armatures you will be working in "Edit Mode" and "Pose Mode"

    There are many tutorials on Youtube like this one showing how to use Blender 2.8 to work with Armatures Bones and Meshes.



    Sorry for the somewhat unsatisfactory answer.
     
  26. SgtLame

    SgtLame

    Joined:
    Nov 26, 2015
    Posts:
    117
    Hi,
    I downloaded Mesh Baker Free, I strictly followed the basic tutorials (video and in manual), but I can't get it to work on a simple example.

    Example is a simple cube, two textures:

    upload_2021-10-14_14-8-2.png

    Texture baking executes without errors or warnings, atlas looks fine. I have checked shader (Unity's standard) is correctly set.

    upload_2021-10-14_14-8-51.png

    Then I go "Bake All Child Meshbakers", and here is the result:

    upload_2021-10-14_14-10-54.png

    There's obviously something I'm doing wrong, but I can't find what it is. Any ideas? :)

    Edit: Im' using Unity 2021.1.18f1.
     
    Last edited: Oct 14, 2021
  27. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,890
    Hello, I think the problem is that the cubes use tiled UVs to tile the textures. You should be able to fix the issue by baking textures with "consider UVs" enabled, then re-bake the meshes.

    These videos have more info on how to handle tiling.



     
  28. saygin

    saygin

    Joined:
    Aug 7, 2014
    Posts:
    3
    Hello Phong! Thanks for the great asset! Need your assistance in this scenario to make a good workflow:
    We use many levels (as prefabs) and in these levels we have other gameobjects as prefabs (characters, environment assets etc.. )
    Level prefabs are dynamically loaded in runtime, so they don't live in a scene.

    We can use Batch Prefab Baker to make the prefabs with combined material. But, in order to replace the prefabs that are used in levels, we have to manually assign meshes and materials. Each time we make a design change we need to repeat this tedious process. Is there any way that you can suggest to make this workflow easier?

    upload_2021-10-15_12-11-34.png

    Looking for something like "Replace Prefabs In Scene" tool, but it needs to work for the prefabs not on the scene and only replace mesh and material. May be we assign Source (prefab from project, used in levels) and Target (created by MB) and save their settings to use it later.
     
  29. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,890
    Hmmm,

    I presume that the game-level-prefabs are nested prefabs like this?

    • MyGameLevel (Top level prefab)
      • ...
      • PropPrefabInstanceA (nested prefab)
      • PropPrefabInstanceB (nested prefab)
      • ...
    Could you do the following?:
    • Have two versions of each PropPrefab:
      • PrefabStep0 Original using imported model meshes.
      • PrefabStep1 Baked prefab using Batch Prefab Baker meshes.
    • Use the PrefabStep1 prefabs in your game-level-prefabs
    • If any props change or you want to change what is in the atlas you just re-bake everything with the batch prefab baker. The level should auto-update for free.
    • If you add a new prop to MyGameLevel that has not been baked, then:
      • Consider this prop's prefab to be NewPropPrefabStep1
      • Duplicated it in the project folder to create NewPropPrefabStep0
      • Assign these in the Batch Prefab Baker and bake. It will convert NewPropPrefabStep1 (used in GameLevel) to use the atlases.
     
  30. saygin

    saygin

    Joined:
    Aug 7, 2014
    Posts:
    3
    Hello Phong,
    Thank you for the reply. The process you suggested works.
    Thanks a lot!
     
    Phong likes this.
unityunity