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:
    2,085
    This looks good. I will meditate on it tonight and see if I can think of anything that might be causing this. I notice that you applying bones. Is the renderer a Skinned Mesh Renderer?

    I can think of a few things to check.

    1) Look for any errors in the console or device logs.

    2) This is a big step so Unity may have lost the references to the scipt. Check whether the inspector says "missing monobehavior" in the inspector. If so you will need to drag the MB2_TextureBaker, MB2_MeshBaker to their respective scripts in the inspector window.

    3) MeshBaker now uses a namespace for its core classes. you may need to add the namespace using DigitalOpus.MB.Core; to your files.
     
    Last edited: Jul 16, 2013
  2. Bowie-Xu

    Bowie-Xu

    Joined:
    Sep 14, 2011
    Posts:
    28
    Hi I am trying to bake a Wild scene from a package which was also bough from Asset Store. When I followed the step 2: select shader on result material, I found out that the shader they used is in Hidden directory, which mean I can't edit nor select from normal shader list. The shader path is like: "Hidden/Nature/Tree Creator Leaves Optimized", I can't find this one in Combined Mesh Material Inspector window. Did I do something wrong, how can I fix this?

    Thanks.
     
  3. celaeno

    celaeno

    Joined:
    Jan 31, 2013
    Posts:
    64
    Hello, I've a material with tiled textures. Now it's baking one big texture atlas from the tiled material, so a 10x10 tiled wall becomes one big 10x10 wall in the texture atlas. I;m not really getting if it is possible to bake the same material with tiling, so the texture atlas keeps small, I've tried fix out-of-bounds UV, but not sure how to do this?

    Thanks
     
  4. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Originally Posted by rocki
    I just tried this technique on mobile Ipad1 and it performs better than MeshBaker.Update. Only thing is that it's still far from the speed of the source object also, when the object has more geometry, it's gets worse.

    I think your suggestion of turning on/off the triangles in the combined mesh is really great.

    It would be a perfect solution to get the fast interaction without having to use Loom.

    To move an object, I can turn OFF the triangles for that object in the combined mesh, turn on the source object renderer. After moving I can turn ON the triangles and switch off the renderer.

    This would be a Fantastic Feature. The ability to Hide/Show individual object in the combined mesh. This will also save lots of combine/ uncombined CPU.

    Additionally, when we need to highlight individual objects ( very common behaviour), we can do the same thing without having to incur the performance hit of combine/uncombine.




    Posted by Phong

    I will try to add this over the next few days.






    Hi Phong, I've been waiting for this feature.
    Is it in the new 2.8.1 update, if yes, how to use it.

    Thanks.
     
  5. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    I didn't know it was possible to hide a shader. I would suggest duplicating the material. Then drag the duplicate to the Result Material field.
     
  6. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Its not possible to preserve the tiling and have only one copy of the image in the atlas unless its the only texture in the atlas. The best you can do is group all walls that use that texture together and add no other objects to that meshbaker. If you want to include other textures in the atlas baked tiling is you only option.
     
  7. RalphTrickey

    RalphTrickey

    Joined:
    Apr 7, 2013
    Posts:
    76
  8. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Its in the 2.8.2 update which just hit the asset store yesterday. The MB2_MeshBaker and MB2_MeshCombiner have new functions:

    ShowHide
    ApplyShowHide

    Which work pretty much like Update and Apply.
     
  9. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Version 2.8.2 is now available in the asset store.

    This is a big upgrade with three new features.

    1) MeshBaker now includes its own texture packer. You are no longer limited to packing textures into an atlas that is a power of two. The included texture packer will pack an atlas that is just big enough to hold your textures. The included texture packer also packs textures one at a time instead of holding them all in memory at once. This will hopefully eliminate MissingReferenceException problems.

    2) ShowHide has been added to the API. This is a faster AddDelete. Vertex data is not altered in the mesh. Only the triangle array changes.

    3) MeshBaker now tries to choose and configure the result material shader based on the objects to combine. This means that most of the time you won't need to fiddle with the shader on the result material. This is a big workflow speedup particularly when using multiple materials.
     
    Last edited: Jul 18, 2013
  10. celaeno

    celaeno

    Joined:
    Jan 31, 2013
    Posts:
    64
    Ok thanks, sounds logical :)
     
  11. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Wow, Big +3 for all of the Great New Features !!!
    This is making MeshBaker even that much more Powerful.

    Thanks.
     
  12. RalphTrickey

    RalphTrickey

    Joined:
    Apr 7, 2013
    Posts:
    76
    Show/Hide looks like it will be especially useful to me. I've only got a few objects moving at a time and being able to make the rest static is going to be a real boost.
     
  13. Boomsma1995

    Boomsma1995

    Joined:
    Mar 21, 2011
    Posts:
    95
    Hi Phong, I saw that you are working on a way to make Mesh Baker work with the LOD system in unity, Have you made any progress in this by any chance.
     
  14. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    It is almost ready for a beta release although it doesn`t work with Unity`s LOD system. It is basically a re-implementation of LOD. Let me know if you are interested in beta testing.
     
  15. RalphTrickey

    RalphTrickey

    Joined:
    Apr 7, 2013
    Posts:
    76
    I am interested in looking at the API, I'm still a bit aways form being able to help actually test, though. ralphtrickey (at) hotmail (dot) com
     
  16. Boomsma1995

    Boomsma1995

    Joined:
    Mar 21, 2011
    Posts:
    95
    I would love to help in the beta testing. And i do understand why it doesn't work with the Unity's LOD system. Its very limited for scripting wise.
     
  17. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    Good stuff.

    Question about #2... is that sort of how static batching works in Unity? Just curious.
     
  18. Zaffer

    Zaffer

    Joined:
    Oct 21, 2010
    Posts:
    266
    Hi,

    I am just starting to experiment with Mesh Baker and I am very impressed. I am using it initially to bake together rock meshes all with the same texture. The texture baking and mesh baking are working just fine, but I keep getting the console message for each rock like this:
    .
    I have gone back to Blender and remapped the UVs on each rock, but I keep getting this message. I'm not too worried about it because Mesh Baker is working for my purposes, but I would still like to be able to fix this problem if possible. What causes out of bounds UVs and is there any way to fix them? Thanks.

    Zaffer
     
  19. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Good question. I don't know how Unity has implemented static batching. I would imagine they are doing something like this.
     
  20. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Out of bounds UVs are another way of implementing tiling. There is more info in the FAQ http://www.digitalopus.ca/site/mesh-baker-2-faq/ about how it works.

    You should only get this warning if there are UVs outside the range 0,0 .. 1,1. The warning is triggered even if you are out by a tiny amount (for example 1.000000001).
     
  21. RalphTrickey

    RalphTrickey

    Joined:
    Apr 7, 2013
    Posts:
    76
    To be a little more technical, UVs are a set of x,y values, one per vertex in the mesh used to map the vertices to the texture.

    http://answers.unity3d.com/questions/293607/tiling-uv-mapping.html

    In general, they will have values between 0 and 1 (inclusive.) If you have something like a brick wall, you might want to set one corner to 4,4 instead of 1,1 in order to put a 4x4 brick texture instead requiring 16 separate 1x1 textures. The only way that MeshBaker could put the texture into an atlas would be if it put it in as a 4x4 texture instead of a 1x1 texture.

    Whether you want a 4x4 texture in that or a separate atlas or switch the object to having 16 1x1 objects is something you'll have to decide. I don't think that there is a clear cut 'best always' answer, it's just something else to be aware of.
     
  22. Zaffer

    Zaffer

    Joined:
    Oct 21, 2010
    Posts:
    266
    Thanks for the good explanation. I'm really glad you thought of a way to implement tiled textures with Mesh Baker!
     
  23. Zaffer

    Zaffer

    Joined:
    Oct 21, 2010
    Posts:
    266
    Thanks Ralph,

    I took a quick look at your links starting with the one on tiling UV mapping in Answers and I *think* I am beginning to understand what is going on. I am working with 5 different rock materials, some with textures untiled and some with textures tiled times 4. The ones that are tiled times 4 are producing texture atlases with 4 across and 4 down of the original texture. The untiled materials are producing untiled texture atlases which now makes sense to me. :) (Thanks Ralph and Phong) I now understand why the tiled materials are producing the out-of-bounds message. However, the untiled materials are producing them too -- maybe because they are a tiny bit off. In any case, Mesh Baker is producing beautiful rocks (can't tell from the originals) with far few draw calls, so I am happy. Thanks again.

    Zaffer
     
  24. Zaffer

    Zaffer

    Joined:
    Oct 21, 2010
    Posts:
    266
    Hi

    I am having a problem getting a good result using Mesh Baker with tree creator trees. I've tried both the tree creator leaves and the tree creator leaves - fast shaders and get different results with both. With the regular tree creator leaves shader, the Mesh Baker mesh has a piebald effect (see attached). The tree creator fast shader does better, but still not quite satisfactory. If the tree is lit from the front it looks OK, but if backlit, the trunk looks transparent (see attached).

    My question is: Is there some tree creator shader fix that will give good results with Mesh Baker. I am using the builtin shaders I downloaded from the Unity site http://unity3d.com/unity/download/archive and installed as custom in case there was something I could do with them. I don't know much about shaders but am willing to learn to get a good result with Mesh Baker. I have already tried to adapt the Nature Soft tree shaders to work with tree creator trees but was unable to do so. Any help will be greatly appreciated. Thanks.

    Zaffer
    $mesh_baker_problem_2.jpg

    $mesh_baker_problem_1.jpg
     
  25. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Trees normally require a multiple material setup (one for trunk, one for leaves) with fix out of bounds UVs checked because the trunk almost always uses UV tiling. The differences you are seeing are probably due to differences in settings on the shaders. One good way to trouble shoot this is to duplicate the original material, switch the textures to the baked ones and use that on your baked mesh. It should look identical with the possible loss of quality in the trunk if the tiling has been baked many times.
     
  26. Zaffer

    Zaffer

    Joined:
    Oct 21, 2010
    Posts:
    266
    Hi Phong,

    Thanks for your answer. I will try the texture switch later after I figure out how to do the combined materials procedure. I think I set it up wrong because all I got were textures with a file size of 1 kb. I tried to follow the directions in your manual but I think they were written for an earlier version of Mesh Baker. I couldn't find a "Build Source to Combined Mapping from Objects to Combine" button.

    I made the two combined material slots I wanted but I couldn't figure out how to get two different materials for the them. The picture in the manual shows blaa-mat0 and blaa-mat1. I only got one material file when I created the empty asset, so I put that in both slots. Mistake? (see attached) If there is only one material in the "Create Empty Assets for Combined Material" folder, which shader do I assign to it -- the leaves or the bark?

    Basically, I am trying to make a combined material setup for 16 maple trees with one material for the trunks and one material for the leaves. Can you help me with the setup? Thanks.

    $mesh_baker_multi.jpg

    Zaffer
     
  27. Zaffer

    Zaffer

    Joined:
    Oct 21, 2010
    Posts:
    266
    Hi Phong,

    I'm getting closer, but still not there. I found the right directions for setting up multiple materials. All I had to do was scroll down your Mesh Baker 2 manual. Unfortunately, the link "multiple materials" at the top leads to your old setup directions. I also figured out I didn't need "multi mesh" -- that's for big meshes.

    I got things set up correctly -- I think (see attached). But I am still getting results of only 1 kb size that are blank images. Can you give me some pointers on what I might be doing wrong? Thanks.

    $mesh_baker_combined.JPG
     
  28. Zaffer

    Zaffer

    Joined:
    Oct 21, 2010
    Posts:
    266
    Hi Phong,

    I'm running out of ideas and need some help. I am sure I have a multiple materials bake set up correctly. I tested the procedure on a two-materials object I made in Blender and it worked perfectly. But it simply does not seem to work with tree creator materials. I set up a very careful experiment. I made a tree that was completely separate from all my other trees and followed the multiple materials procedure very carefully. What I got at the end of the bake were Mesh Baker materials that had blank textures in the main slot (see attached) instead of textures with images.

    Also, back in the Mesh Baker script in the Inspector there was nothing listed in the Shaders Materials Contained area of the script and when I tried to bake the mesh I got this error message in the console: "Material Bake Results has no materials in material to uvRect map. Try baking materials. Can't combine meshes."

    Is there any way that Mesh Baker will work with tree creator materials/ I have hundreds of trees on my landscape and I was really counting on Mesh Baker to help me optimize them. I will be glad to make an asset package of my test tree and send it to you if you think that will help. Thanks.

    Zaffer (Barbara Parkman)

    $mesh_baker_combined2.JPG
     
  29. Zaffer

    Zaffer

    Joined:
    Oct 21, 2010
    Posts:
    266
    Hi Phong,

    I finally had some limited success making a fairly decent Mesh Baker mesh of my test tree. However, it was by using a single material bake, *not* multiple materials. That didn't work at all. The single material bake produced an acceptable tree (with one problem) if I used the Tree Creator Leaves material as the single material on the empty asset.

    Now the problem, and it's a big one. The Mesh Baker mesh does not seem to be able to receive shadows (see attached). The Mesh Baker tree is behind the tree creator tree in the picture and should have the base of the trunk in shadow but does not. It can cast shadows OK. I checked in the Inspector and both cast and receive shadows are checked for the mesh. Unfortunately, lightmap baked shadows won't work because they don't move with the blowing wind. Is there any way to get Mesh Baker meshes to receive live shadows? Thanks.

    Zaffer

    $mesh_baker_no-shadow.jpg
     
  30. Zaffer

    Zaffer

    Joined:
    Oct 21, 2010
    Posts:
    266
    Hi,

    I checked with my other Mesh Baker meshes and they are receiving live shadows OK. So it's just a problem with the tree creator material. Again, If you are interested in trying to solve this bug, I will be glad to send you an asset with my problem tree creator/Mesh Baker trees. Thanks.

    Zaffer
     
  31. Phong

    Phong

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

    Sorry for being away for a whole day there. Lots of questions. First around the baking of multiple materials. There are a couple of video tutorials that explain it fairly thouroghly. The most complete is this one http://www.youtube.com/watch?v=XCYnNkJ3DSw. There is also this one http://www.youtube.com/watch?v=fvNY9fjhsR8. The missing button you mention is in the latest version. Check if there is an update. Here is a video showing how to use it: http://youtu.be/Ffc8LEfwx0o.

    Your setup for multiple materials looks good. I am not sure why it is not working. I am wondering if the creator tree materials use non standard property names and Mesh Baker isn't finding them. If you want to send me your test tree I will take a look at it. I would be interested to see if I can figure out what the problem is. Do you want to PM me with an email address or a file location?

    Regarding the shadows not working. My guess is that the shader on the combined tree is using transparency. Here is a quote from the unity manual.

    I think the trunk on the original tree works because it is using multiple materials.
     
    Last edited: Jul 24, 2013
  32. HaroldBalls

    HaroldBalls

    Joined:
    Oct 30, 2012
    Posts:
    20
    I'm getting some errors when trying to get my game on to a windows 8 phone, it seems to not like the use of the orderedDictionary. Have you tested with unity 4.2 and a windows 8 phone?
     
  33. Zaffer

    Zaffer

    Joined:
    Oct 21, 2010
    Posts:
    266
    Hi Phong,

    Thanks for the links. I noticed that the trees you use for your demos use tree soft occlusion shaders, not tree creator shaders and that works well, so I'm guessing the problem lies with the tree creator shaders. I put together a Unity package that I think demonstrates the problem pretty well. It has my test tree and all it's materials and textures. With that tree, I made three Mesh Baker objects, one that uses combined materials (leaves and bark) one that uses one material (leaves only) and one exactly the same (leaves only) but with the textures of the finished mesh swapped out for textures that make it look better.

    The first example (the combo material) fails every time. I think this is due to Mesh Baker not liking the tree creator shaders. The second example, the single material, produces a tree with a pibald look that is not what I want -- but does receive shadows. In the third example, I have swapped out the textures in the Mesh Baker mesh for better textures and the result is acceptable looking, but does not receive shadows. I think this is mostly due to the normalmap texture slot in the shader. When I put a different normal map other than the one Mesh Baker produced, the mesh stops receiving shadows.

    I appreciate your help with this. The Unity package I put together is too large to upload here, so I will PM you.

    Zaffer

    $meshBaker_problem3.JPG
     
  34. Zaffer

    Zaffer

    Joined:
    Oct 21, 2010
    Posts:
    266
    Hi Phong,

    I got 100% success on appearance with Mesh Baker and tree creator trees. I did this by using the optimized materials that Unity generates automatically for each tree instead of the materials that you set up. ie: "Optimized Bark Material" and "Optimized Leaf Material" instead of "Maple_leaves" and "Maple_bark". These "optimized" shaders are hidden and greyed out but they can be dragged to the Mesh Baker assets and they work! (I thought I had experimented with these materials earlier, but I guess I didn't -- tried so many things). The Mesh Baker mesh came out with that piebald look I don't like, but I fixed that by substituting textures in the mesh and, as you can see from the picture, I got great looking trees! Bump maps and everything looking great!

    Which brings me to the problem -- no animation. The Mesh Baker mesh doesn't respond to the wind zone and thus no blowing leaves in the wind. Do you think this is fixable, or have we hit a wall? I hope not! Mesh Baker has come so far with tree creator trees! Thanks again.

    Zaffer (Barbara)

    $mesh_baker_success_but.JPG
     
  35. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    I have not tried that build yet. Will look into this.
     
  36. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Glad to see you are getting closer on this. I have downloaded you package and will take a look. I was not aware that it is possible to hide shaders. Another user mentioned hidden shaders as well. I will take a look at the animation problem.
     
  37. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    At first glance the wind animation looks tricky. I found this Unity Answers question http://answers.unity3d.com/questions/179068/converting-polygon-model-to-unity-tree-is-it-possi.html which describes importing tree meshes so they are affected by wind. It looks like the meshes need Soft Occlusion Leaves shader to be affected by wind and the meshes may need to reside in a particular folder although I think this the folder requirement is just to make the trees paintable on terrain. Will keep this updated as I investigate further.
     
  38. Zaffer

    Zaffer

    Joined:
    Oct 21, 2010
    Posts:
    266
    Hi Phong,

    I think I have something for you to work with. Check out this link, http://forum.unity3d.com/threads/138929-batching-trees-%96-and-speed-up-rendering. It's a thread by Unity tree expert LarsBertram who (I think) knows more about Unity trees than anybody else. In his thread he gives a procedure for making a mesh tree from a tree creator tree and attaching a wind script to it that makes the mesh tree respond to Unity's wind zones!

    I tried out his procedure and his script and got some strange and wonderful results! (see attached). It worked very well with the mesh tree I made according to LarsBertram's directions, and it also made the combined mesh that I made with Mesh Baker (from 5 maple trees) dance around and distort. (You have this combined mesh in the package I sent you.) It also made the bark fly off in wild straight distortions.

    LarsBertram's thread is mostly about optimizing Unity tree creator trees (a subject dear to my heart :) ) and includes two ways to optimize his mesh, with static batching and with the "advanced combined children" script that comes with Unity. I am going to experiment further with various meshes (including yours) and LarBertram's script and see what I can get. I'll be very interested to see what you do too! Thanks.

    Zaffer (Barbara)

    $tree_wind_script.jpg
     
  39. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    I spent the morning playing with the wind animation script with some interesting and surprising results. It is a mystery to me how wind has been implemented in Unity. WindZone is a component but there is no class for it in the API and calls to GetCompoent<WindZone>() fail. I can only suppose that the windzone script looks for tree creator scripts and edits the _Wind property on those scripts.

    It appears you can make a mesh be affected by wind by adding a _Wind property to its material however this wind operates independently of any wind zones in the area. I have not been able to find any information on the _Wind property and how it works. It appears that the r,g,b values are some sort of combined displacement scaling value. The alpha value appears to be some sort of pulse frequency. I am curious how these values correspond to the parameters in the wind zone?

    Here is a modified version of Lars wind script that produces better results. It appears to work even if there is no wind zone defined in the scene. Save this in a C# file called MB_Wind and add it to the combined mesh (the component with the MeshFilter on it).


    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class MB_Wind : MonoBehaviour {
    6.    
    7.     //first three values appear to be some sort of scale/displacement
    8.     //last value appears to be some kind of pulse frequency.
    9.     Vector4 Wind = new Vector4(0f,0f,.1f,.05f);
    10.    
    11.     void Start (){
    12.         MeshRenderer mr = GetComponent<MeshRenderer>();
    13. //      applying to the branches appears to severely distort the branches      
    14. //      Material barkMat = mr.materials[0];
    15. //      barkMat.SetColor("_Wind",Wind);
    16.         Material leafMat = mr.materials[1];
    17.         leafMat.SetColor("_Wind",Wind);    
    18.     }  
    19. }
    20.  
     
  40. Zaffer

    Zaffer

    Joined:
    Oct 21, 2010
    Posts:
    266
    Hi Phong,

    I think "_Wind" is a shader property that can be accessed globally on any shader that has that property, but I'm not sure.

    Thanks for the script. I tried it, but to tell you the truth, I like LarsBertram's better because the x,y,z and w variables are exposed in the inspector and you can play with them in realtime. You can adjust the wind movement in x,y,z space -- he uses w for alpha.

    I dealt with the dancing branches problem by simply eliminating the wind from the bark shader. I swapped out the tree creator bark shader for simple bumped diffuse on the branches so they don't respond to the script and don't move.

    I tried Unity "Combine Children" script but I don't like it at all -- did something strange to my leaf materials -- shrunk them or something.

    As far as I'm concerned, I've got all my Mesh Baker tree problems solved -- good looking trees with realtime shadows and wind. I'm really happy with Mesh Baker. Tomorrow, I'm going to experiment and see how many *different* types of trees it can bake together. I've got 6 different kinds so maple, 4 different kinds of oak, 6 birch, 2 misc trees plus 7 types of bushes. Some of these share bark and leaf textures and some don't. Should be fun setting it up :) Wish me luck!

    Zaffer
     
  41. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    I have a feature request if your still looking to do things.

    A function that will automatically split submeshes apart that have different materials.

    A function that will cut up a surface to tile on a portion of an atlased texture.
     
  42. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    @techmage

    Can you list some use cases for these functions.
     
  43. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Is there a way to stop mesh baker from baking multiple textures that are the same?

    eg: I have 3 race track parts, one straight and two corners, all use the same road surface texture. When I bake them, i get the road surface texture 3 times in my atlas, this happens with all the other objects i bake, resulting in a waste of texture space.

    Also is there a way to chose what size in the atlas I want different textures to be? Seems to shrink the most important textures and they look blocky.
     
  44. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Each texture + unique tiling/offset is treated as distinct. If your race track pieces use the same tiling and offset then they will only appear once in the atlas. One good strategy for handling this problem is to use UV tiling (uvs outside the range 0..1) instead of material tiling. If you use UV tiling then you can bake all you track pieces and any other objects that use those textures together. You won't be able to bake any other textures into that atlas but it is offten worth it. You won't use the fix out of bounds UVs feature in this case. More info on this in the FAQ
     
  45. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    Right now, two faces with different materials, and different textures, might be sharing the same vertex. When you make the atlas and combine the meshes, it will not be able to move those two faces separately to their proper place in the atlas, because they share a vertex. This means that unless you manually split all edges that have different materials on their sides, then one of the faces textures will be distorted after baking the meshes.

    The second one is so that you can have tiling meshes that actually end up tiling once atlased. It will cut a face up into a bunch of quads to repeatedly overlay a portion of the atlas to simulate texture tiling.
     
  46. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Thanks for the clarification, that makes a lot of sense.
     
  47. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    @Phong,

    Does MeshBaker support Bitmap2Material?

    I recently noticed this in their forum:
    http://forum.allegorithmic.com/index.php/topic,93.0.html

    Starting with Unity 4.1, theer is now a new way of convrting substance outputs to Texture2D, without using Unity Pro features.

    http://docs.unity3d.com/Documentation/ScriptReference/ProceduralTexture.GetPixels32.html

    The only constraint is that the outputs of the substance need to be set to No Compression, as you can't read form a DXT compressed texture.
     
  48. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Currently MeshBaker only works with Texture2D. I was not aware that the ability to read pixels had been added to the API for procedural textures. I will try to add this to a future version. In the meantime you might be able to write your own script that will grab a procedural texture's pixels and dump it to a .png file.
     
  49. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Thanks for the suggestions. The second one would be very cool if I could get it to work.
     
  50. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    @Phong:

    That would be Great to Add support for Bitmap2Material support.

    Also the Tiling suggestion would be Awesome because we really need to use Tiling in MeshBaker.