Search Unity

One draw call for each shader, with dynamic meshes : The Bob script.

Discussion in 'Made With Unity' started by Ippokratis, May 9, 2011.

  1. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi legend411,
    Thanks for your interest in Batching tools.
    What you describe is very interesting indeed. It is a custom batching solution regarding skinned meshes.
    The first and probably the second version of Batching tools will not provide this facility.
    I am interested in working out this solution, but I have no assets to work with. My 3d modelling skills do not permit me to create a rigged character. If you have some assets I can work with, as fbx files, I could start working in this solution earlier. Thanks for bringing this up, it has some potential.

    Update : Some first attempts for implementing mobile/bumped diffuse shader are not so bad :

    $Screen shot 2011-11-18 at 8.52.30 PM.png

    Original knife model by elias_t. Still much work to do :)
     
    Last edited: Nov 18, 2011
  2. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    Sent you some PM's :)
     
  3. Ippokratis

    Ippokratis

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

    Batching Tools now supports the following shaders :

    1. Diffuse
    2. Transparent/Diffuse
    3. Unlit/Texture
    4. Unlit/Transparent
    5. Mobile/Diffuse
    6. Mobile/Unlit (Supports Lightmap)
    7. Mobile/Bumped Diffuse
    8. Mobile/Bumped Specular
    9. Mobile/Bumped Specular (1 Directional Light)
    10. Mobile/Particles/Additive
    11. Mobile/Particles/Alpha Blended
    12. Mobile/Particles/Multiply
    13. Mobile/Particles/VertexLit
    14. Mobile/Particles/VertexLit (Only Directional Lights)
    Some results from the mobile diffuse shader, using the "9 square wooden shields" unitypackage by Mister Necturus from the asset store :

    $Screen shot 2011-11-21 at 10.25.35 AM.png


    I have finished developing the first version of Batching Tools, now I will start making some examples and some video tutorials. I have found some 3d assets ( thanks a lot the 3d artists who provided them ) and I will use them for demonstration purposes. So we are closing to a release date, hopefully in less than two weeks.
    Thanks for the support,
    -Ippokratis
     
    Last edited: Nov 21, 2011
  4. Schlumpfsack

    Schlumpfsack

    Joined:
    May 30, 2010
    Posts:
    608
    Sorry for the late package, was ill/sick :( It was rushed and the texturing+UV map are pretty nasty. Still hope it helps a bit.
     

    Attached Files:

  5. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi Sclumpfsack,
    Thanks a lot for the assets provided, they look great ! Hope you get well soon.
    Is it possible ( do you allow me ) to use them for demonstrative purposes ( i.e. post images with them ) or distribute them ?
    With credits attribution of course.
    Thanks anyway,
    -Ippokratis
     
  6. Schlumpfsack

    Schlumpfsack

    Joined:
    May 30, 2010
    Posts:
    608
    to be honest...they are not that great^^ and yes, of course you can use them.
     
  7. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    Many thanks to all the people who send their character models !
    For the moment I have frozen new features addition, I must develop now a web page and some video tutorials...

    The reason is that I released Batching Tools v 1.0 :)

    It is available at the Asset Store, since yesterday.
    Forum thread : http://forum.unity3d.com/threads/113508-Batching-Tools
    I would prefer to continue the discussion there, thanks everybody for the support !
    -Ippokratis

    P.s Please read carefully the description and the documentation in the forum thread before you buy the product. Version 1.0 provides a solution for combining materials and its intended use is with Unity built - in batching system. It does not provide custom batching, i.e character batching. I will try to include some custom batching in following versions but please do not base your purchase on this expectation. Thank you.
     
  8. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Recommending this to people now, its a solid tool.
     
  9. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi hippocoder,
    Thanks for supporting Batching Tools :) I am very interested in suggestions - feedback, if you have any, I would love to hear them.
    -Ippokratis
     
  10. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    It has only a little downside, if your meshes are bigger than dynamic batch limit (around 300 vertices) you will need to combine them to a single huge mesh if you want a single draw.

    This means you need to use either the CombineChilren scripts at runtime on the whole bunch of shared material meshes, but this will. of course kill lightmapping, but if you dont need lightmapping, this is the best approach, as it allows you to do fast level editing.

    or

    the furnished CombineObjects scripts which is precalculated. This. approach has the down side of not being able to edit the position and scale of your objects after you baked into a single mesh. But will run great with lightmaps !

    Well, we could just start to call this: Static Batching for Unity Indie ;)
     
    Last edited: Jan 9, 2012
  11. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
  12. ayrton2388

    ayrton2388

    Joined:
    Oct 25, 2011
    Posts:
    11
    Hey there. I got a problem, and you guys might be able to help.
    So... i`m trying to reduce the number of the draw calls. I already have tons of prefabs. i`m just using the TexturePacker for now.
    Thing is, i have a list of prefabs, which will be instanced later on, not placed manually in the scene.

    Let`s say one of them has 3-4-5 models with different textures.Same shader. For every texture, i manually change it`s properties, from the Texture importer. I set them to "texture type: advanced" and "read/write enabled".
    Next, i drag and drop the TexturePacker script on the gameobject that has those 3-4-5 models, and it works, for the moment.

    But after i click "apply", to save the changes to the prefab, and change the scene, or refresh this one, every object in the prefab loses his mesh and material. So it`s invisible. How can i fix that?
     
  13. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    At this point, this script isn't supported anymore, so your best bet is to just get the official Batching Tool that Ippo posted above you...