Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

ProDrawcallOptimizer, reduce the number of drawcalls drastically on your project

Discussion in 'Assets and Asset Store' started by jmunozar, Mar 27, 2014.

  1. eventropy

    eventropy

    Joined:
    Oct 4, 2012
    Posts:
    249
    Can you elaborate on this? I'm getting the "Atlas is TOO BIG" error and I'm not sure how I'm supposed to deal with that.
     
  2. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hey @eventropy, yes of course.

    Basically when it says is "TOO BIG" it means that all your objects textures combined will result on a bigger texture than the max supported by Unity.

    The way to solve this is to do 2 bakes so you have some objects in one texture and some others in the other texture.

    Don't forget to uncheck the remove before bake checkbox on the options so when you do the 2nd bake the 1rst one doesn't get deleted.

    Let me know if it's not clear, I'll try to help as much as possible ;)
     
  3. eventropy

    eventropy

    Joined:
    Oct 4, 2012
    Posts:
    249
    Thanks for your quick reply!

    So for the first pass, I would click the "-" button next to some number of objects underneath the problematic shader, until the atlas size gets under Unity's limit. And then click Bake, then clear objects, then select the objects that I removed in the first pass in the Scene Heirarchy, then click "Add Selected Objects", then click bake again?
     
  4. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Yes!, sorry for the late reply, I've been out of the office. Make sure to uncheck the checkbox that says "Remove before bake" so it doesn't remove your already baked objects ;)
     
  5. imgumby

    imgumby

    Joined:
    Nov 26, 2015
    Posts:
    122
    Pro Draw Call Optimizer
    Category: Editor Extensions
    Publisher: PencilSquareGames


    Unfortunately, Pro Draw Call Optimizer is no longer available.

    This package has been deprecated from the Asset Store. This means that new purchases of the package are not allowed and that only users who already purchased or downloaded the package before it was deprecated, are allowed to download it.

    In most cases, package deprecation happens because the publisher is unable or unwilling to support the package anymore. We suggest looking for alternative packages or contacting the publisher directly.

    If you’ve already purchased it and need to download a copy, you can do so here.


    When did this happen and why ?? o_O
     
  6. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hello @imgumby,

    That was unexpected, don't worry about it guys, is just that I had to deprecated the old pro drawcall in order to release ProDrawCall 4.0 (which is on review right now).

    It contains a full refactoring of the code base and among other changes new multiple atlasses are supported when all your objects don't fit in one atlas =). I expect pro drawcall 4.0 will come out around the next couple of days ;)
     
  7. imgumby

    imgumby

    Joined:
    Nov 26, 2015
    Posts:
    122
    Version 4.0 sounds great .Does that mean an update for current users or are we going to have to buy an upgrade ??
     
  8. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    I was planning to release it as a normal upgrade but there have been so many deep changes in how the code works that I'm releasing it as a paid upgrade. STILL. I have gave a 3 month window for free upgrades.
    When the new version gets accepted I'll post and update all links ;)
     
  9. gcqinging

    gcqinging

    Joined:
    Nov 10, 2014
    Posts:
    2
    Hi jmunozar, i want to know if the new version only supports Unity5, or Unity 4.6 is also OK
     
  10. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hello @gcqinging,

    Yes, 4.6, 5.x are still going to be supported =)
     
  11. imgumby

    imgumby

    Joined:
    Nov 26, 2015
    Posts:
    122
    Thanks
    I just purchased this plugin and hate to think that it's already dead and won't get any future updates,
    Will you post the update in message #1 or #2 of this thread ??
    Thanks in advance
     
  12. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Will do, no worries, I'm fully committed with ProDrawCall for the time being =).
     
  13. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hey Guys!, Great News!, after ~2weeks of poking the asset store guys for reviewing the new upgraded ProDrawCall, they finally accepted it!.

    You can go and grab it from:
    https://www.assetstore.unity3d.com/en/#!/content/54360

    If you guys have any issue with the newest version, do let me know, as always, I'll try my best to be ASAP with your issues/concerns/comments ;-)
     
  14. imgumby

    imgumby

    Joined:
    Nov 26, 2015
    Posts:
    122
    Hi
    Thanks for the update.I was going to ask about the small file size until I read the examples read me text file and saw the examples download link.
    thanks again
     
  15. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Yup, Unity doesn't seem to like to have Unity packages inside the packages and people already complained on the import times so easier to have a Dropbox link for the examples ;)
     
  16. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    301
    I want to buy this asset but I have three questions ?

    1. Lets say I have 3 objects, and I just want to make them use single material ( with textured atlas ) without combining meshes, still separated as object ? Is this possible ?

    2. Lets say I have 3 objects, but this time I want to combine meshes and materials ( textured atlas ) all together 1 mesh, 1 material, 1 texture atlas ?

    3. Does it support multiple atlas textures, lets say I want my textures in 3 to 4 textured atlas with multiple materials, so I can go for higher resolutions ?

    Regards.
     
  17. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hey @MoribitoMT , My answers:

    1. yes, totally possible, just tell the tool to not combine the meshes.

    2. Yes, totally possible, the tool lets you select which objects are going to be mesh combined.

    3. Not really directly. The tool creates several atlasses if it doesnt have enough space in the atlas texture. but what you want to do of create different materials for different resolutions is totally possible. You just need to create for each object the different resolutions and then bake the atlasses with each of the resolutions (Bare in mind that the textures should have the same increased scale). it takes more time but definitely doable.

    Hope is clear :) else let me know i can create a small example ;-)
     
    MoribitoMT likes this.
  18. Rainking

    Rainking

    Joined:
    Jun 10, 2013
    Posts:
    41
    Can you please send me an Update too? I got the same issue with Unity 5.4

    Assets/ProDrawCallOptimizer/Scripts/Editor/Core/ShaderManager.cs(125,39): error CS0019: Operator `==' cannot be applied to operands of type `UnityEngine.Rendering.TextureDimension' and `UnityEditor.ShaderUtil.ShaderPropertyTexDim'

    akunin@gmx.de

    Thank you!
    Kind regrads
     
  19. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hello @Rainking

    There is a specific version for 5.4 that you can download =). Just use that and you should be alright =).

    Let me. Know if you have any issue ;]
     
  20. Rainking

    Rainking

    Joined:
    Jun 10, 2013
    Posts:
    41
    I used the version from Asset Store with Unity 5.4. (checked newest available stable version and the beta) but still see the error (it takes a long time to convert my project between those versions - so I stopped testing). I switched back to Unity 5.3. - its working again.. I'll wait some time before I update again.

    Thx, and kind regards,
    Tino
     
  21. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hey Tino,

    That's quite strange, I will check on latest 5.4 and will get back to you because as far as I know it just works. did you deleted completely the old version of pro draw call and replaced it with a fresh one?
     
  22. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    hey @Rainking ,

    I just run the latest version (5.4.0f3) with the 5.4 version of ProDrawCall and it just works without any error, are you sure you checked against the latest version ? :S, if you want send me through a private message your order number and I can send you the version I just tested out. Whenever you have time of course!.

    Cheers
    Juan
     
  23. Rainking

    Rainking

    Joined:
    Jun 10, 2013
    Posts:
    41
    Is there something special I need to know about the update from a very old version of ProDrawCall to newest one? I just did a update over the old one without deleting anything... Currently Iam not able to check the new Unity version again. I ll stay on 5.3.5 for a while. You can ignore my question and I'll come back later after updating to a newer unity version.. Thank you for the support! Kind regards, tino
     
  24. Brutusomega

    Brutusomega

    Joined:
    Jul 30, 2013
    Posts:
    56
    Im getting error "divide by zero exception " when i try to bake atlas, and the baking never completes.
    Unity 5.4.
    Full error:

    DivideByZeroException: Division by zero
    ProDrawCall.TextureScale.ThreadedScale (UnityEngine.Texture2D tex, Int32 newWidth, Int32 newHeight, Boolean useBilinear) (at Assets/ProDrawCallOptimizer/Scripts/Editor/Core/Utils/TextureScale.cs:66)
    ProDrawCall.TextureScale.Point (UnityEngine.Texture2D tex, Int32 newWidth, Int32 newHeight) (at Assets/ProDrawCallOptimizer/Scripts/Editor/Core/Utils/TextureScale.cs:46)
    ProDrawCall.TileManager.TileTexture (UnityEngine.Texture2D tex, Vector2 scale, Vector2 offset) (at Assets/ProDrawCallOptimizer/Scripts/Editor/Core/TileManager.cs:40)
    ProDrawCall.Atlasser.SaveAtlasToFile (System.String pathOfAtlas, System.Collections.Generic.List`1 texturesOfMaterial, System.Collections.Generic.List`1 scales, System.Collections.Generic.List`1 offsets) (at Assets/ProDrawCallOptimizer/Scripts/Editor/Core/Atlasser.cs:159)
    ProDrawCall.OptimizableShader.CreateAtlasMaterialAndTexture (ProDrawCall.Atlasser generatedAtlas, System.String shaderToAtlas, ProDrawCall.TextureReuseManager textureReuseManager, Int32 atlasNumber, Int32 start, Int32 end) (at Assets/ProDrawCallOptimizer/Scripts/Editor/Core/OptimizableShader.cs:404)
    ProDrawCall.OptimizableShader.OptimizeShader (Boolean reuseTextures, Boolean generatePrefabs, Boolean generatePowerOf2Atlases) (at Assets/ProDrawCallOptimizer/Scripts/Editor/Core/OptimizableShader.cs:207)
    ProDrawCall.ProDrawCallOptimizerMenu.OnGUI () (at Assets/ProDrawCallOptimizer/Scripts/Editor/GUI/ProDrawCallOptimizerMenu.cs:131)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
     
  25. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hey @Rainking,

    Yes!, delete. Completely the older folder and just replace. It with the new one ;)
     
  26. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hey @Brutusomega,

    Do you have a small (2 scene objects) scene that can accurately reproduce this error?.

    Are you combining multiple material fame objects or just normal objects =). Are you using the latest update (pro drawcall 4.0) and is giving you this error?. Are you on latest 5.4.0f?

    Let me know ;)

    Juan
     
  27. Xain

    Xain

    Joined:
    Aug 3, 2013
    Posts:
    68
    Hello i tried free version it's really nice but before i buy it i have a question is this works with terrain tree ? Because it didn't see trees in the scene.
     
  28. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hey @Xain

    It should work with any type of mesh and shader. make sure the meshes are in known formats (fbx, mb /etc), the light version only works only with Legacy Diffuse and Legacy Bumped Diffuse shaders.

    let me know ;-)
     
  29. Xain

    Xain

    Joined:
    Aug 3, 2013
    Posts:
    68
    I tried with Legacy Diffuse but it didn't see it.It only shows object in the scene and since we can't see terrain trees in Hierarchy i don't think it's possible.I think only solution is manually placing tree prefabs to the scene.
     
  30. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    hey @Xain

    Now I understand; unfortunately it will not work, you need to see the actual game objects in the scene view to be able to bake them :(.

    if you have prefabs of the trees then yes and what the tool will do is generate other prefabs with the baked atlases so you can use them in other scenes :)
     
  31. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    hey @Erenyx ,

    I couldnt manage to be able to reply you through the private message, for some reason it didnt appear, just mail me a support at pencilsquaregames dot com and I will happily reply ASAP. regarding your voxel. increase the texture size, that happened to me before with another user :), let me know if you have any other issue I will reply ASAP ;-)
     
  32. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    I saw it on sale today and was wondering that i can upgrade this asset, which i bought a time ago and never used so far. :(
    So you wrote from a free update for old users, is this possible or do i have to buy again with the update price?
     
  33. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hey Hormic!,

    if you bought the tool within 3 months then you are elegible for a free upgrade! :).
     
  34. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    Ok i see thank you for your quick reply,
    It seems my tactic of collecting assets on sales for later use is not very smart in the long run.
     
  35. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,081
    @jmunozar Great tool! It's working well for me, but I'm a bit disappointed in the full version. The free version states that it does not support the Standard shader, which implied that the full version would parse and atlas all the referenced textures IN a material using the Standard shader. Unfortunately, it appears as if it only does _MainTex. I'd also like it to atlas the metallic/smoothness texture as I'm still using it. I can't atlas the assets until that support is there. I'll have to make unique materials with the metallic/smoothness texture in the _MainTex slot, but it's worth mentioning that I could've just done all this with the free version and the legacy shader support..

    Also, power of 2 isn't ideal for iOS. Their PVRTC compression can't load rectangular textures (say, 2048x1024) so Unity makes them square, stretching the pixels vertically which results in low quality crap. I would recommend forcing a square packing. Even though there may be wasted space on the texture, the quality will remain.

    One other thing: Your forum post link in the UAS description points to the defunct forums.
     
    Last edited: Nov 21, 2016
  36. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hey Quantum,

    Thanks!, indeed there is an issue with metallic/smoothness textures, I'm working on it when I can. Thanks for the iOS feedback!, I didnt know that, I will check on it! :). Regarding the forum post, I've fixed it in a small update that is in pending review.

    again, thanks ;-)
     
  37. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    735
    Hi,

    Sorry for the stupid question but if i have a head model with few textures, plus a hair model, for a moving character:
    -can i atlas those textures and combine the models to create one head with hair in all one texture?
    -even if i don't use static batching i will optimise my model right?

    thanks in advance
     
  38. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    hello @eaque ,

    There are not such as stupid questions in this thread, feel free to ask anything and if you prefer just send me a PM ;-).

    Yes you should be able to atlas those textures and combine the models, STILL you need to make sure that your models share the same type of shader, else they will not be able to be combined :).

    Regarding the static batching; yes it will optimize your model and will be ran through dynamic batching but you will not gain as much optimization vs static batching. if you want you can try the light version with diffuse shaders and see if it fits your needs :).

    if you have any other questions/doubts, dont hesitate to ask; I will be more than happy to assist you :)
     
  39. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    735
    Many thanks for your kind answer!
    :)
     
  40. unity2

    unity2

    Joined:
    Jan 10, 2013
    Posts:
    23
    Does it work for per scene basis or per object basis?

    I have three different scenes having almost same meshes but differently placed for levels. Now If I combine textures using your tool for first scene, it will make atlases accordingly. How can I use the same texture atlases for other two levels so that my texture size wouldn't increase?
     
  41. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hello @unity2 sorry for the late reply I didnt got an alert from this post!.

    Regarding your question what I would do is, create a scene that contains your assets that you are going to spread around your different levels/scenes; bake them using the tool AND select the generate prefabs optio. then you have the generated baked prefabs which you can use in any scene ;-)

    Again, sorry for the delay on the answer!
     
  42. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Guys, As of Unity 5.5.1f1 there is a critical bug that messes up the textures if they are not marked as readable beforehand. In order to workaround over this for the meantime you will have to set your textures as Read/write enabled when you import them to your project

    I have created a simple repro case on this and I have sent it to the Unity guys, I'm working on this :)
     
    Last edited: Feb 16, 2017
  43. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    422
    I've copied a scene that has gameObjects that have been optimised using ProDrawCallOptimzer, however the copied scene doesn't display the meshes. The mesh filter shows as '[none]'.


    The original scene is still fine, that MeshFilter has a mesh showing (but no name, just a mesh icon in the inspector slot).
    Trying to drag and drop a mesh into the MeshFilter slot doesn't work - and I wouldn't know which mesh to use (I assume not the original?)

    I guess I should have used the 'create prefab option' (mentioned in the post above) but can I fix it in any other way? (Without breaking the original scene and its assets) i.e. without having to redo the optimisation and generating a new atlas? I want to be reusing the same mesh and atlas, between both scenes.
     
  44. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091

    hello @jeromeWork

    you need to generate prefabs from the tool itself, with that the tool will generate a mesh file in your project along the prefab, and then you can use the generated prefab in your other scenes ;-)
     
  45. unity2

    unity2

    Joined:
    Jan 10, 2013
    Posts:
    23
    In my scene, I have two sets of objects which I want to combine to two meshes. Now when I combine the second mesh it overwrite my first combined mesh I made earlier.
    Please help.
     
  46. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hello @unity2 ,

    are you using the latest version of ProDrawCall and in Unity 5.5?, could you explain me with more detail either with a video or with screenshots on what's happening?, please contact me to my email at support@pencilsquaregames.com as in Unity5.5 there are problems with the API and as of right now ProDrawCall 4.2 is in review in the asset store which fixes those errors. I will gladly provide you with ProDrawCall 4.2, send me an email ;)
     
  47. unity2

    unity2

    Joined:
    Jan 10, 2013
    Posts:
    23
    I am using Unity 5.4 with ProDrawCall 4.1.

     
  48. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Then you shouldnt have any issue, could you please send me your project so I can see what you are trying to do and how is failing?; or even better, send me a video so I can see what's happening :)
     
  49. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    It could also be that you are having UV problems; are you getting any warning after the baking process?
     
  50. Honikou

    Honikou

    Joined:
    Feb 18, 2013
    Posts:
    91
    Hi Jmunozar,

    I have a problem about the final size of my .apk (Android)

    My apk was 31.99KB , if I use your plugin , the final apk is 33.66KB.

    The scene was 14.183KB. If I use your plugin the scene go to 27.130KB. If I clear the old object wish the mesh renderer hidden, the scene go to 22.152KB.

    On settings I use, Reuse Textures, remove atlassed before bake, generate hierarchies for optimized objects and generate atlas power of 2.

    The apk size is very important for us, how can I use your plugin without increasing the final size of a scene ?

    Edit:

    I discover a better size with prefab option, but the size is still 80% more.
     
    Last edited: Mar 13, 2017