A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Now in Beta! Get 1:1 live lessons on any Unity topic or help troubleshooting your project – Connect with an expert on Unity Live Help
Discussion in 'Assets and Asset Store' started by Phong, Nov 20, 2012.
Thanks for letting me know. Will take a look.
Looked into this. The problem is that the example scene is mis-configured. The "Texture Bake Results" has no materials. If click bake on the TextureBaker, this will bake the materials on the source objects. After this has been done the scene will run correctly.
Will fix this in the next release.
Thanks, that fixed the problem.
Hello and gongrats for
One of the best assets in assetstore
Im using it for a while now and sholud tell its awsome!
I only have one question and that is what about baking terrain stuffs?i mean tree,grass,stone or whatever that painted on terrain
Doese mash baker capable of baking its textures and meshes?
Any help will appreciated
Hi, i am using this asset it works great but there is some problem
this is my windows build and it is prefect.
but this happens with my android build.lighting issues.
help me solve this problem
Hey Phong, quick question for you. I am trying to apply Texture/Mesh Baker in a prefab in Unity 2019, but as soon as I drag objects into the "Objects to be combined" array the Mesh Baker game asset disappears from the hierarchy. Any idea why this is happening? Does it not work in a prefab?
I noticed that there are plans to improve the Unity Mesh API:
The ability to update only part of the mesh instead of uploading the entire mesh is especially useful for modifying baked meshes I think.
Is there any reason why a lightmap generated by meshbaker would get cannibalized during runtime? When I hit the play button, our baked lightmap vanishes. Poof! It is clearly visible in the editor, and when I rebake it returns.
Sorry for the slow reply. For some reason the email alerts from the forums don't seem to work.
Re: Baking terrain stuff.
It is always a good idea to reduce the number of materials as much as possible. The Batch Prefab Baker is great for this. If many terrain props share a material then Unity has a much easier time batching them.
Regarding Mesh Baking. For vegetation and grass I would recommend letting the Unity Terrain system manage things for you. The terrain LOD system handles this fairly efficiently and uses billboards for distant trees. For mesh props it is also a good idea to use Unity's mesh system if possible too however you can often help it by baking a few clusters of pebbles and such together. Then Unity needs to manage far fewer instances of detail meshes.
Try to make sure that the details all use "instancing" materials. Unity can be much more efficient if the props use instancing.
Sorry for the slow response. Sometimes the forum email notifications don't arrive.
You need to use scene object instances in the list of objects to combine. The reason is that many of the things that effect how things are baked (lightmap indexes, negative scaling on one axis) are only available in the context of a scene.
Try setting the lightmapping UVs settings to "generate new UV2 layout" or "copy UV2 to separate rects". The preserve_current_lightmapping is only reliable in certain versions of Unity. I should remove that option.
Hi there no problem at all
And thank you for the tips!
Wish luck for you and your project
How do I combine materials without combining meshes?
Edit - I found "Preparing Models For Static/Dynamic Batching (Batch Prefab Baker) AKA Combining Textures Without Combining Meshes" but it doesn't work. While it swaps the mesh, the material remains the original. If I manually assign the new material that mesh baker created, certain meshes have a bad appearance
Edit 2 - After manually assigning the new materials, I also had to change the Mesh Renderer number of materials to 1.
Edit 3 - So I got it working, but there are a lot of unnecessary manual steps, such as dragging the prefab in the scene and duplicating the prefab because "Batch Bake Prefabs" can't take the source and destination the same. There's no reason you can't have a one-click solution "Combine Materials" that finds all materials on the objects, creates a new material that combines them, then replaces all materials with the new material on the same prefab.
Hi. I am considering buying mesh baker but I am wondering if it's compatible with HDRP or scriptable rendering pipeline in general?
Hi! MeshBaker bake all geometry with LODs into single mesh or it bake only LOD 0 without other LODs ?
Yes, Mesh Baker works with Unity Materials and the assigned textures. It does not care what rendering pipeline is being used.
Thanks for the feedback. Are you using the full version of Mesh Baker?
There should be no problem with the HDRP pipeline. Mesh Baker works with Unity Materials and the textures used by those materials. It doesn't care what is happening within the shaders themselves.
You can set up a baker for each LOD level so that all geometry in several LOD0s will be baked together into a combined LOD0 mesh and all geometry for the LOD1 meshes will be baked together into a combined LOD1 mesh etc...
I have a question regarding combining skinned mesh renderers at runtime. I have a MeshBaker object in my scene. I can combine the meshes without an issue. This is the code I'm using to do so:
SkinnedMeshRenderer skinnedMeshRenderers = playerHolder.GetComponentsInChildren<SkinnedMeshRenderer>(true);
GameObject objectsToCombine = new GameObject[skinnedMeshRenderers.Length];
for (int i = 0; i < skinnedMeshRenderers.Length; i++)
objectsToCombine[i] = skinnedMeshRenderers[i].gameObject;
Debug.Log("smrCount = " + skinnedMeshRenderers.Length);
playerBaker.AddDeleteGameObjects(objectsToCombine, null, true);
The problem I am running into is when I try to remove meshes. It'll often give me an error, but never seems to actually remove the meshes. In fact, the meshes that I'm attempting to remove stop animating and move to the local origin of the mesh baker object. This is the code I'm using.
playerBaker.AddDeleteGameObjects(null, skins, true);
where skins is an array of game objects with skinned mesh renders that I'd like to remove.
The errors I get are:
Could not get bounds. Not updating skinned mesh bounds
DigitalOpus.MB.Core.MB3_MeshCombiner:UpdateSkinnedMeshApproximateBoundsFromBoundsStatic(List`1, SkinnedMeshRenderer) (at Assets/MeshBaker/scripts/core/MB3_MeshCombiner.cs:414)
go paramater was null
DigitalOpus.MB.Core.MB_Utility:GetBounds(GameObject, Bounds&) (at Assets/MeshBaker/scripts/core/MB_Utility.cs:375)
DigitalOpus.MB.Core.MB3_MeshCombiner:UpdateSkinnedMeshApproximateBoundsFromBoundsStatic(List`1, SkinnedMeshRenderer) (at Assets/MeshBaker/scripts/core/MB3_MeshCombiner.cs:411)
Any ideas what I could be doing wrong here?
I was able to resolve this. I'm using a mesh baker on a bunch of skinned meshes in my scene. I instantiate them and add them at the start of the scene. As they are killed in the game, I flag them for removal and add them to a list. I was handling the removal in LateUpdate. Instead, I now copy that flagged list to a new one, clear that initial list, and then remove all of the objects in a coroutine. This does the trick in a not too convoluted manner.
Hi again. Now that I've managed to resolve the previous issues, I'm running across a new problem. When I remove skinned meshes and apply the changes, I get a whole flood of errors along the lines of:
Assertion failed on expression: 'IsFinite(distanceForSort)'
Invalid AABB inAABB
Invalid AABB in a
Assertion failed on expression: 'IsFinite(distanceAlongView)'
I've done some googling and saw the previous mention in this thread but nothing there seems to help with the issue. Any ideas?
And... never mind on this as well. I managed to fix it. Thanks!