Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Batching Tools

Discussion in 'Assets and Asset Store' started by Ippokratis, Nov 28, 2011.

  1. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Thanks a lot Essential,
    The "deceiving naming" thing is quite annoying actually, but at least I did not get a death wish yet.
    The thing is that judging from that person's message, he seems very reasonable, except this specific part.
    I do understand that it is annoying when someone's expectations do not come true. Hence I do make an effort to specify as much as possible what this tool can do and friends often criticized me that I kill my marketing plan doing so. Whatever.

    On a different tone : Five fingers just released a new game, Orion Attack.
    They are coming, they are many, they want our gold !!!
    He used Batching Tools and was kind enough to mention it. Good luck Tom !
    http://forum.unity3d.com/threads/156249-2012-Orion-Attack-is-out!?p=1070789&viewfull=1#post1070789
     
  2. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Version 1.5 is available for download at unity asset store.
    It solves the unity 4 compatibility issues.
    Enjoy ;)
     
  3. jmcclure

    jmcclure

    Joined:
    May 5, 2009
    Posts:
    48
    Two questions:

    1) I see in previous posts that you were working on support for your Toon Shader. Does the current version support this?

    2) Will BTDynamic work at runtime? If I am spawning new instances of a mesh prefab at runtime, can I use BTDynamic to batch them into sub-meshes?
     
  4. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    1. No, Toon Shader is not currently supported, I am going to post more on a solution on this shader family plus all other custom shaders possible this weekend.

    2. No, all operations are applied in Editor mode.

    Kind regards,
    -Ippokratis
     
  5. KamiKaze425

    KamiKaze425

    Joined:
    Nov 20, 2012
    Posts:
    207
    I know you have been asked this many times. But what's the update on Toon Shaders for this tool? I will most like buy both batching tools and your toon shader if they work together. currently working on a mobile game with potentially 40 little characters walking around the screen and we wanted to use a toon shader (preferably with outline) for them.
     
  6. KamiKaze425

    KamiKaze425

    Joined:
    Nov 20, 2012
    Posts:
    207
    also, not sure if i missed it, but is it possible for batching tools to work with shaders/materials for skinned meshes?
     
  7. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    Thanks for the interest.
    Batching tools cannot batch skinned meshes.
    You can create the combined meshes using unlit shader and detail texture, then unlit shader and shade texture. You then should manually replace the atlases in the combined meshes. But you can wait until a version that supports toon shader appears, so you do not have to go through this unintuitive route.
    There are some posts regarding batching skinned meshes in the thread above, that sum up in "not faster actually".
    Good luck with your project,
    Ippokratis
     
  8. Psylife

    Psylife

    Joined:
    Apr 17, 2012
    Posts:
    16
    Hello Ippokritis,

    Do you know if the UV's generated for light mapping are preserved once you batch your scene?
    I have tried to go ahead and bake new light maps after batching the scene and it looks like the UV coordinates have been altered.
    Do you have a work around?

    Thank you
     
  9. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    There are two sets of uv.
    UV1 is used for Main texture coords.
    UV2 is used for lightmapping.
    What you describe usually results from using models with overlapping uvs.

    Please try the following :
    For every model you wish to batch, prior to batching, select it and check in the inspector the Generate Lightmap UVs toggle and press apply .
    You can select multiple models ( always in the project panel ) to perform the above only once.
    Then create the lightmaps.
    Then batch.
    If the results are not good, recreate the lightmaps, perhaps increasing the texel resolution this time, on the baked model.

    I hope I do not over explain :)
    If you still have troubles, please send the scene to ippobour at gmail dot com and I will try to sort it out.
    Kind regards,
    -Ippokratis
     
  10. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Update :
    At last I am able to sit and work, without the disturbing pain, for limited time. I slowly resumed freelance work on shaders, as well as toon shader desktop development. But something bad happened.

    First batching tools and now toon shader are hacked.

    I 've already seen a significant drop in batching tools sales and I expect a similar drop to the Toon shader sales as well. We are talking about two assets that started with a price as low as 15$. I kept the price down, so the majority of people can legally benefit from my works, even though I believed they worth more. I even encountered people telling me that they didn't tried the products until someone else suggested them because of the low price. It was a mistake.

    From the moment Toon shader desktop appears, all of my products will be priced at 50$. This will happen in the next three weeks.

    Thanks for your support,
    -Ippokratis
     
  11. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Hi Ippokratis,

    one small question:

    When I batch multiple meshes into one (by using Combine Materials), the newly generated GameObject is located at Vector3(0,0,0) with the actual mesh vertices at the location where the initial objects where.

    Is there any way to generate the combined mesh in such a way, that the generated GameObject is at the "center position" of the initially selected objects?

    I have a level where I have to merge some foreground objects. Those objects are located around the world position -1000, 100, -500. I'd like to keep their "root" at -1000, 100, -500 and not at 0, 0, 0...

    Thanks for your help and info on that.


    BTW. the asset store says your tools are V1,5 but in the (visible) sources, it says 1.4. I've reimported multiple times, so I guess, this is right?
     
  12. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi Metron,
    Try to take the GO at 0,0,0 and place it in another new empty one, positioned at the position you wish.
    You are right, I have not changed the versioning numbers in the source files, it is version 1.5 though.
    Let me know if you need further help,
    -Ippokratis
     
  13. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Thanks for your answer... going to check that.

    Edit: Checked it, but it doesn't change anything...

    I checked it in 2 ways:

    a) I batched the meshes and attached the newly generated GO (which is located at 0,0,0) to my root object (which is at -1000,100,-500). The result is like I though, the transformation is still set up in a way that the newly generated GO is at 0,0,0 (it says 1000, -100, 500 in order do transform the pivot point to 0,0,0).

    b) I attach the GameObject containing the meshes I want to batch to a "root" GameObject which is located at -1000, 100, -500. The relative position of the GameObject are in such a way that their pivot point is transformed to their initial position in the world. Batching those meshes by selecting only the sub-objects containing the meshes still results in a newly generated GameObject at 0,0,0.

    I think it would be a great enhancement to your to to give the option to generate the batches relative to a given position (or GameObject) that can be selected. As far as I understand the batching process, the meshes' vertices are transformed into world position before pushing them into a new mesh.

    Putting them into the world in relation to a given position would mean that you subtract the selected position from the generated mesh vertices position and "relocate" the newly generated GameObject to the selected position.
     
    Last edited: May 14, 2013
  14. Venryx

    Venryx

    Joined:
    Sep 25, 2012
    Posts:
    444
    "I think it would be a great enhancement to your to to give the option to generate the batches relative to a given position (or GameObject) that can be selected. As far as I understand the batching process, the meshes' vertices are transformed into world position before pushing them into a new mesh."

    That sounds like a good plugin addition, to save time. I just thought I'd mention a workaround, though. Make that root object at the center pivot point you want (like you already have), and then instead of dragging the old holder GameObject (the "combined_mesh..." object) into it, just drag the children/objects themselves directly as children of that new, central holder GameObject. This will make their pivot point be that center location, which you want, and you can just get rid of the old "combined_mesh..." holder object. (although you'd have to mark the new holder as Static, of course)
     
  15. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    Metron, I just noticed the edit, sorry for not answering but I do not get notified on edits, only on new posts.
    Perhaps you could try to set the pivot of the combined object using http://wiki.unity3d.com/index.php?title=SetPivot by Yilmaz.
    It is not very clear for me what is the benefit of this approach, or why using new root GO does not suit your workflow, judging by your description, my guess is that you need a new pivot point - is this correct ?

    Vernyx, thanks for the feedback.
     
  16. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,910
    Basic Android/iOS licenses are now free, but have no static batching or occlusion culling. Will this work for the free versions?

    Is this still the case?

    EDIT: I see it working in tutorial videos.
     
    Last edited: May 21, 2013
  17. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Yes, Batching tools do work on ios and android free and pro.
    It is interesting to see IOS and Android basic licences going free.
     
  18. BillyMFT

    BillyMFT

    Joined:
    Mar 14, 2013
    Posts:
    178
    This tool looks amazing - exactly what I was looking for. However, I can't quite get it to work with my game and was hoping for some advice.

    I have a container game object in my scene with a number of children each of which have their own materials. I select the parent and run the script and it all goes fine. However I have code the shows and hides individual children (setactive) as required, but this doesn't appear to have any impact now. The game objects are being activated and deactivated, but they never disappear from view. I notice that the mesh renderer on each child is also switched off, so I'm not sure how it being shown at all.

    I have tried setting static on and off for all the objects but it didn't make any difference. I also noticed that deactivating the parent object in the hierarchy also doesn't hide the objects inside.

    Is what I am trying to do possible?

    Thanks
     
    Last edited: Jul 1, 2013
  19. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    Thanks for your kind words,
    I suggest using the dynamic batching option, since you need to access the gameobjects individually after you created them and instead of turning them off, place them off camera.
    Let me know if you need further help,
    -Ippokratis
     
  20. BillyMFT

    BillyMFT

    Joined:
    Mar 14, 2013
    Posts:
    178
    awesome - seems to be working!

    Question - should the objects be set to static in the inspector?

    Thanks again
     
  21. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    In this specific scenario, no, it will not help.
    It would be beneficial if you use Unity Pro and more than one batched meshes via static batching (BT).
     
  22. BillyMFT

    BillyMFT

    Joined:
    Mar 14, 2013
    Posts:
    178
    thank you again. I'm getting a small amount of artifacting. See attached. I'm doing frame by frame animations and the image quality of each frame is paramount, but some of the frames have a dark line on one of the edges - any idea what is causing that?

    Some other questions:

    1. Does the script take the full sized original texture and add that to the atlas?
    2. Is it ok to change the import settings, shader etc for the atlas that gets created?
    3. What happens if the max size setting is too small to fit all the textures - does it scale them down?
    4. How would I know if the max size was too small?
    5. The texture disappears from the dynamic object when I zoom in on it in the unity editor - any idea why?

    Thanks again
     

    Attached Files:

  23. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    1. Does the script take the full sized original texture and add that to the atlas?
    No, it creates a new atlas every time.
    2. Is it ok to change the import settings, shader etc for the atlas that gets created?
    Yes
    3. What happens if the max size setting is too small to fit all the textures - does it scale them down?
    Yes
    4. How would I know if the max size was too small?
    After you create the atlas, you see some textures that are scaled down. Before, you can calculate the size but it is complicated. I personally use texture packer for 2d atlases.
    5. The texture disappears from the dynamic object when I zoom in on it in the unity editor - any idea why?
    Perhaps you have to set the near field property of the camera at a smaller value than the current, try 0.1

    The artifact seems to be uv coords related, try to set a small offset at the y material texture offset property, perhaps start with a value of 0.1
    Let me know any if you need something else,
    Ippokratis
     
  24. BillyMFT

    BillyMFT

    Joined:
    Mar 14, 2013
    Posts:
    178
    nice one. Thanks again
     
  25. BillyMFT

    BillyMFT

    Joined:
    Mar 14, 2013
    Posts:
    178
    the tool has stopped working for me. When I load it from the window menu, I get this (see attached)

    Thanks $Screen Shot 2013-07-05 at 1.14.04 AM.png
     
  26. BillyMFT

    BillyMFT

    Joined:
    Mar 14, 2013
    Posts:
    178
    never mind. fixed itself.

    Thanks
     
  27. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    If such problem occurs, try to :
    -Close and reopen Unity
    -Restart the computer
    -Delete the batching tools folder and import it again.
    The above steps should fix it.
    Kind regards,
    -Ippokratis
     
  28. BillyMFT

    BillyMFT

    Joined:
    Mar 14, 2013
    Posts:
    178
    cool. Still getting some issues with the offset. moved it by -0.003 on the Y which fixed one bit but broke others.
     
  29. Bloody-Swamp

    Bloody-Swamp

    Joined:
    Jul 30, 2012
    Posts:
    38
    This happens because of the "pixel perfect" issue. On Windows you must set the object's or camera's position to 0.5 pixels (X,Y). Differences between GL and DirectX... or something like that I think. That might be the problem since I'm getting it too and that's how I fix it. ;)
     
  30. Nikul

    Nikul

    Joined:
    Jul 27, 2012
    Posts:
    11
    Assets/BatchingTools/Editor/Plugins/BTHelper.js(745,65): BCE0019: 'TryFastReimportFromMetaData' is not a member of 'UnityEditor.ImportAssetOptions'.

    I just upgraded to unity 4.2, I thought this issue was fixed? I re-downloaded and imported v1.5 of BT and get this compiler error.
     
  31. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    Hmm, that's not good. Been considering getting this. Is everyone having issues with 4.2? Hopefully this asset is still being supported; haven't seen the author in two months now.

     
  32. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    For some reason I do not always get notified in my email when someone answers in this thread.
    I wish to kindly ask you to contact me via pm in the forums or at my email ippobour@gmail.com, describing any problems you might encounter. If you wish reply, please add the invoice number, since I had many issues with piracy.
    You are of course welcome to post anything you wish in this thread as well.
    Thank you
     
  33. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
  34. eric_kog

    eric_kog

    Joined:
    Mar 6, 2013
    Posts:
    11
    Hi @Ippokratis,

    Batching tools looks cool, I was wondering if you had any plans to expand the range of shaders supported? Specifically, I'd be interested in a self-illuminated shader of some kind.

    Cheers,
    Eric
     
  35. eric_kog

    eric_kog

    Joined:
    Mar 6, 2013
    Posts:
    11
    Sorry, to be more clear (since I see you already support Unlit Texture Transparent). I'm interested in an unlit shader with a color/alpha channel I'll still be able to manipulate on a per instance basis after running through your tools.
     
  36. Essential

    Essential

    Joined:
    Sep 8, 2011
    Posts:
    265
    BatchingTools seems to have some warnings in the newest Unity version…

    Assets/BatchingTools/Editor/BatchingTools.js(800,38): BCW0012: WARNING: 'UnityEditor.Undo.RegisterSceneUndo(String)' is obsolete. Use DestroyObjectImmediate, RegisterCreatedObjectUndo or RegisterUndo instead.

    Plus a few others…

    Any plans to fix soon?
     
  37. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    Might want to email the author as it's been 4+ months since his last post.

     
  38. Essential

    Essential

    Joined:
    Sep 8, 2011
    Posts:
    265
    Ippokratis is pretty quick with replies. I'll give him a few days first!
     
  39. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    I don't doubt it, but was drawing attention to the 2 unanswered questions before you left by @eric_kog 2 months ago, and figure perhaps email would be more direct. Good luck!

     
  40. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    Thanks for contacting me,
    I am aware of these warnings. They will not affect the functionality of the product but I agree it is not nice to have them in your project.
    I just submitted a new asset called Colored Shadows and building it consumed most of my time. Batching Tools update will follow, if you have any issues with the package please contact me at ippobour at gmail dot com.

    Eric cog :
    For some reason, I did not receive an email with your question. It would be better to contact me via email directly. Sorry for the late response. The answer is that I cannot support self illum shaders with different shader properties. If you need this functionality, you can contact me via pm for creating a solution catered to your project's needs.

    Lod3 :
    Let me know if you need help with this asset

    Kind regards,
    Ippokratis
     
  41. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    Thanks, Ippokratis!

     
  42. Essential

    Essential

    Joined:
    Sep 8, 2011
    Posts:
    265
    This still happens to me… I end up with three groups: The original (with mesh renderers disabled), a copy of the original that I can reset, and a batched copy. Why doesn't the original get deleted?
     
  43. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi Essential,

    Thanks for contacting me via email, I reproduce the answer here so other users may benefit as well.


    Yes, indeed this is the intended method. You can choose to "Bake" the objects after you combine them, either as dynamic objects or as static objects. Depending on your choice, the resulting meshes are
    - parts of a static object - the best choice for objects that do not move, e.g static 3d background
    - parts of a skinned mesh, or "dynamic objects". This is useful for objects that should move, e.g bullets in a shmup
    - separate meshes that share the same material, if you intend to use unity batching system, static or dynamic.


    I opted to give many choices for more flexibility, I hope it does not seem too complicated :)
    Let me know if you need more info.
     
  44. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
  45. Essential

    Essential

    Joined:
    Sep 8, 2011
    Posts:
    265
    Is there a way to suppress the current error messages?

    Assets/BatchingTools/Editor/BatchingTools.js(800,38): BCW0012: WARNING: 'UnityEditor.Undo.RegisterSceneUndo(String)' is obsolete. Use DestroyObjectImmediate, RegisterCreatedObjectUndo or RegisterUndo instead.
     
  46. Baldwin

    Baldwin

    Joined:
    Apr 1, 2014
    Posts:
    37
  47. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    There is no way I am aware of to suppress warnings in unityscript, so I have to either
    - fix the unityscript code
    - fix and rewrite in C#.

    I ll try the second solution, I hope it will work.
     
  48. Essential

    Essential

    Joined:
    Sep 8, 2011
    Posts:
    265
    Perhaps I've misunderstood the issue but isn't it simply a matter of replacing 'UnityEditor.Undo.RegisterSceneUndo(String)' with one of the recommended functions?
     
  49. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Ok, that was quick.
    Simply comment out the offending lines.
    The undo functionality is still provided by pressing the Reset button on the original objects as always.
    I ll upload an updated version reflecting this change ASAP, in the meantime comment out these lines and everything will be ok.
     
  50. Essential

    Essential

    Joined:
    Sep 8, 2011
    Posts:
    265
    Oh, easy! Thanks Ippokratis. :)