Search Unity

ProDrawcallOptimizer, reduce the number of drawcalls drastically on your project

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

  1. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    hey @SoloChristian, thats pretty weird, are you positive all your materials are diffuse?, could you send me your file I try it out quickly here? :)
     
  2. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    hey @SoloChristian, I just noticed its a small bug!, pretty easy to fix, I'm fixing it right now actually quick solution, just create another object (a cube) and bake them both.

    if you want mail me and I'll send you right away the fix ;)
     
  3. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hey @SoloChristian problem has been fixed. I'm now updating it to the asset store. If you want, mail me and I'll send you the fixed version right away :)

    Again. Thanks for notifying :)
     
  4. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    Wow that was quick. :) I messaged you my email.
     
  5. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    indeed, replied!, cheers ;)
     
  6. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    226
    The Tool does not seem to reuse Textures within "Multiple materials" marked Renderer. Therefore my atlases looked like this:
    Atlas Standard-Opaque-Mai0.jpg
    Is there a way to get around this?

    EDIT: Okay I just saw the same problem a few posts ago. Do you plan to change the behaviour of the Optimizer in the future? Otherwise this asset sadly is useless to me :(.
     
    Last edited: May 29, 2015
  7. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hello Pojoih,

    Yeah unfortunately for the time being when you have multiple materials is not an easy fix; this is because each multiple material object is used as an unique object with its materials.

    A workaround I can suggest you is to get your object, combine it, and use it across (the combined object). with this the tool will reuse those textures.

    I'll try and see what can I do to enhance this workflow and reuse textures in multiple material objects tho. but cant promise anything.

    Cheers :)
     
  8. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    226
    This should be something your script automates, recognising at least the a renderer uses the same (multiple textures).
    Eg I have 30+ objects which uses the same mesh with the same 2 materials in the same row.

    This should be easy to keep track of as it can behave like just one material, don't you think?

    Anyway thanks for answering and I hope you can update the program in the future with this kind of function. In the meantime it seems I have to put some effort and reduce all my models into using just one texture.
     
  9. jmunozar

    jmunozar

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

    I agree, but as I said each object is processed as an Unique object, hence I dont have access to "What has already been atlassed" as the processes run appart (combining materials on multiple material objects and combining objects).

    I'm checking what can be done to keep track for the textures on multiple material objects. :)
     
  10. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    226
    Ah okay I understand now. Thanks a lot.
     
  11. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    no problem :) Cheers ;)
     
  12. chloridrik

    chloridrik

    Joined:
    Sep 9, 2013
    Posts:
    14
    Hi, your tool is very good, for the moment I use the free version, but soon I'l need the full version.
    But for the moment, I have a problem, I have dynamic object with physic (mesh collider and rigid body)
    When your tool duplicate this object, I have a new object at the same position with mesh collider and rigid body, but the original object keep his mesh collider and rigid body. Is it possible to disable all components of the original game object ?

    thx
     
  13. jmunozar

    jmunozar

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

    Is not possible to disable all the components on the original game object; its done like this by design because several times I have happened to use some optimization tools and they deleted my original objects and left me with only the optimized objects and sometimes I needed the original objects's scripts. So this is why I decided to not have an "Invasive" approach when the tool has to touch your objects.

    Being said that: its just a matter of selecting the old objects and deleting them.

    If this is a hassle (because there are too much objects) if you want I can modify just for you the app so when it finishes it disables your game objects completely. :)

    Hope this explains everything :)
     
  14. fales

    fales

    Joined:
    Jun 10, 2015
    Posts:
    8
    Hi @jmunozar ,
    I noticed that the "trial" version on the asset store is still at version 1.7.1 which does not support Unity5 standard shader, is there no way to try your very interesting tool before buying it blindly?
     
  15. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    hey @fales :).

    The light version works with the "Legacy/Diffuse" and "legacy/Bumped Diffuse" shaders, if you want you can try it out with those shaders, it will work exactly the same with the standard shader.

    On a side note, that the light version is at 1.7 doesnt mean its not up to date, I mean: it contains all the latest fixes and its supported on Unity5 with the shaders I just said :).

    Cheers ;)
     
  16. fales

    fales

    Joined:
    Jun 10, 2015
    Posts:
    8
    Wow, thanks for the very fast reply, I'll try it out right away :)
     
  17. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Sure man :), if you have any issue just mail me I'll try to help you out ;)
     
  18. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    226
    small one but annoying. The interface look like this in Pro Skin:
    Screenshot 2015-06-13 13.52.44.png
     
  19. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    226
    Okay so I found a few problems with the standard Shader:

    - It looks like you're not differentiate between textureless Emission Values and Colors in the Standard Shader. All my red gree blue yello emission materials got batched together and the values are lost. Maybe handling the Emission Values and Colors like the albedo ones is a good idea.
    - Different Tiling settings got ignored as well
    - In the newest version I only got albedo textures, bumps and speculars just don't get generated. Version 3.3.1 works fine. No exceptions of other logs.

    Everyone who wants to buy this asset: Apart for some bugs this is still the best Texture Atlaser/Mesh Baker I've found so far!
     
    Last edited: Jun 13, 2015
  20. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    oh, good point!, I'll fix this for the next version; if you want it quicker just send me a pm with the purchase number and I'll send it to you :).
     
  21. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    hey @pojoh, thanks for the kind words :),

    -The tool doesnt support tinting, if that's what you where referring to, this is because the tinting gets calculated in the shader and I don't have a way to know the calculations for the end texture for your specific shader :-(.

    - Yes, this is an issue that happens if you reuse textures, BUT, this can be fixed if you just uncheck the "reuse textures" in the options menu :)

    - Auch, could you send me a video / a small scene where I can test this behaviour?, it shouldnt happen and seems is a regression :S. (when I get home im going to check it out :by myself regardless)

    Again, thanks a lot and I'm glad the tool works for you :).
     
    Last edited: Jun 13, 2015
  22. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hey Pojoih! :)

    I *think* I might have found the issue. in the examples included in the tool, inside the "Dream" example; there is a shader, called "Standard" please remove it! its overriding the standard shader that comes originally with Unity5.1 :).

    Let me know if this solves your issue, I'm still checking on more stuff
     
  23. jmunozar

    jmunozar

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

    Fixed! :), I'll be updating it in the next version, if you want mail me I'll send you a link for downloading it right now ;) Screen Shot 2015-06-13 at 14.37.39.png

    I'm still working on checking out what happened with the standard shader ;)
     
  24. KB73

    KB73

    Joined:
    Feb 7, 2013
    Posts:
    234
    Hi, any reason why you don't support fusing of meshes with this? thnx
     
  25. jmunozar

    jmunozar

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


    The tool does combine meshes since 3.3.2 :), it will not combine meshes with skinnned mesh renderers (yet) tho.

    I will have to update that in the Asset Store docs!, thanks a lot :)
     
  26. KB73

    KB73

    Joined:
    Feb 7, 2013
    Posts:
    234
    k thnx! :)
     
  27. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Sure @KB73 :), no problem ;)
     
  28. KB73

    KB73

    Joined:
    Feb 7, 2013
    Posts:
    234
    Hi, another problem right now, we're on 5.1.1 - the optimization in progress never finishes even one some small examples. any idea? we just downloaded the full version today on the asset store.

    One other question, do you deal with lightmap UV's that are out of bounds?

    thanks
     
  29. KB73

    KB73

    Joined:
    Feb 7, 2013
    Posts:
    234
    * not lightmap UV's, i mean normal mesh UV's that exceed 0->1 range, thanks
     
  30. jmunozar

    jmunozar

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

    mmm that's actually pretty weird; if you are generating prefabs its normal that it takes long time :).
    Also, if you are building for other platform besides StandAlone (iOS, Xbox, Android) it will definitely take waaay more time; this is because the tool has to change formats and reimport in order to analyze and read pixels from your textures. Besides that it should bake normally. Try out the examples that come with the tool and re-bake them so you can see that the tool finishes :).

    Regarding the UV's outside [0,0 - 1,1], the tool doesnt handle that, actually if its outside the 0-1 interval then the tool will tell you that some meshes are malformed. BUT, if you dont have textures and you are only coloring then the tool will remap all your UVs to 0.5, 0.5 (as they are colors).

    Hope this answers ;)
     
  31. KB73

    KB73

    Joined:
    Feb 7, 2013
    Posts:
    234
    k thnx - would recommend attempting to fix the UV out of range, artist in maya like to work with UV range way outside of 0-1 as it is much much easier to visualize and import :)
     
  32. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    I have been thinking on ways to solve this but is pretty complicated because the atlas that the tool generates makes the UV fit for each texture :(, I also tried compressing the texture to fit the portion in the atlas but it looks _bad_ and you will lose a lot of quality so its a no-go :/
     
    Last edited: Jun 23, 2015
  33. Phantomx

    Phantomx

    Joined:
    Oct 30, 2012
    Posts:
    202
    Where is the custom shader tab? we purchased this especially because of that tab and it's not there.... we have custom shaders that have some textures that should not be altased but the script does atlas them...
     
  34. jmunozar

    jmunozar

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

    you dont need that anymore, the tool automagically recognizes any type of shader now :).

    Now if you have certain textures inside the shader that you dont want to atlas then its a matter of just atlassing the whole shader and then just delete the atlassed textures that you dont need.

    I removed the manual custom shaders tab because it was cumbersome and prone to error. and if you dont want to atlas some shader-defines then its just a matter of deleting the texture after baking :).
     
  35. Phantomx

    Phantomx

    Joined:
    Oct 30, 2012
    Posts:
    202
    ho yeah, I didn't think of that... stupid me... thanks!
     
  36. jmunozar

    jmunozar

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

    Actually thanks for pointing that out, I'm deleting the "custom shaders" video as its outdated! :) thanks to you! ;)
     
  37. Kmartin_ECS

    Kmartin_ECS

    Joined:
    Apr 15, 2015
    Posts:
    16
    Hi, I recently updated to the Pro Version and I'm having an issue. I'm using the Unity 5 standard shader, and when I bake my atlases, normal maps aren't generated and carried over to the combined material. Has anyone else experienced this?

    I am getting one warning message "Couldn't know if atlas 'File path\Atlas Standard-Opague-Mai-Bum1.png' was a normal map, if it was, please set it as a normal map; textures might look weird.

    I found that texture (I'm assuming this is the bump/normal map), and tried flagging it as a normal map but it looks very incorrect.

    I'm also getting "Resizing texture: from 32x32 to 1024x512 in order to make it fit in the atlas', and it is putting a texture in the Occlusion box when neither object has a texture plugged into its occlusion channel.
     
    Last edited: Jul 7, 2015
  38. jmunozar

    jmunozar

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

    That warning message appears sometimes when the tool cant determine if one of your textures was a normal map or not. By the name of the shader I can tell that you are using a Standard Shader with 2 textures (one main and one bumped).

    So if the tool cant determine that (having a bumped texture) its just a matter of doing what you did :).

    NOW, if it looks reaaally bumpy!, what you need to do is to reduce the "Bumpiness" in the generated texture.

    Do this:
    "Select your texture in the project view".
    --> Click on "Generate alpha from grayscale"
    ------> Adjust the bumpiness accordingly :)

    let me know if you have any issue ;)


    Hey M
     
  39. Kmartin_ECS

    Kmartin_ECS

    Joined:
    Apr 15, 2015
    Posts:
    16
    Hey jmunozar,

    Thanks for the quick response. I've been doing some testing all morning and haven't been able to resolve the issue. The bump atlas it is creating is actually just a flat texture, it isn't carrying over the same information, so generating from grayscale doesn't fix the problem. Its also plugging it into the occlusion box by default so I don't think its generating that map from the old normals. I did come up with a workaround, If I switch the shader used to the legacy bumped diffuse and then bake, the normal map is atlased and carried over just fine, and then I can switch it back to the standard shader, but obviously I'd prefer to figure out what is going on.
     
  40. jmunozar

    jmunozar

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

    thats pretty strange, did you tried out baking the Standard shader sample scene? it has some bumped textures in it.

    Do you have a small case you can send me over? like a small scene with 2 objects that replicates the issue

    So I can analyze it and tell you whats going on :)

    cheers
     
  41. Kmartin_ECS

    Kmartin_ECS

    Joined:
    Apr 15, 2015
    Posts:
    16
    Completely baffled right now. I switched all my objects back to using the standard shader and put together a scene to send to you, but then noticed it was baking fine. I then reverted my project back to before I switched them to use the legacy shaders, and it was back to not working again.

    The only thing I can think is that there was something in the metadata for the materials that was confusing it at first, and was refreshed when I switched the material type to legacy and later back to standard. Either way, for now it seems to be working, and if it happens again I'll try manually clearing out the metadata to confirm that was the issue.
     
  42. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    AAHHH that's actually an issue with the standard shader that sometimes doesn't update correctly on the scene view!, been there! haha :).

    Happened to me when using transparent shaders once in the rendering mode :(.
    I sent a bug report to Unity since the early Beta of Unity5 and haven't heard anything from them :S.

    Still, I'm glad you managed to solve it, if you have any other issue just post it here I'll try to help you out ASAP ;)

    Cheers :)
     
  43. Dbailey2012

    Dbailey2012

    Joined:
    Jul 8, 2015
    Posts:
    2
    Hi there, having a few issues with getting this to work, been doing some testing and having some weird stuff happening using the Unity 5 Standard Shader.

    All Objects are using the same maps. Alb, Metalness, Normal and AO. Ill attach images of the results before and after below. The normal doesn't seem to work properly after bake, and the AO does something like banding across the model.

    Before

    before.png


    After

    after.png
    Any ideas?
     
  44. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091

    Hey @Dbailey2012!,

    There can be 2 issues:

    1. If you are using different tiled materials with the same texture across the meshes then you will have to turn off the "reuse textures" property in the advanced checkbox, this is because when you have a different tiled materials across the different meshes but with the same textures the tool recognizes it at the same texture as it uses an MD5 to recognize unique textures with the path (but as is the same with different tiled properties it will fail.)

    2. It could also seem you are having an UV problem with your AO checkout this video:
    on how to solve this issue.

    Let me know if you manage / dont manage to solve it :)
     
  45. jmunozar

    jmunozar

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

    did you manage to solve your issue? just checking on you.
     
  46. Dbailey2012

    Dbailey2012

    Joined:
    Jul 8, 2015
    Posts:
    2
    Sadly not, it seems to have different results each time I press bake. All UVS are within 0,1 per mesh, as they are all unique normals / AO maps too. Some have overlapping / shared texture space to maximize texture space. Does your package have an issue with this?
     
  47. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Not that I know of, could you send me a simple scene that resembles your issue so I can check it out? its 2am here, just mail me your sample scene and when I wake up I'll check it out and come back to you ASAP ;)
     
  48. jmunozar

    jmunozar

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

    As discussed, the issue was that you where having different texture sizes across the same model so the tool got confused when combining textures, it was solved by not combining textures :).
     
  49. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    527
    Just wanted to give a heads-up that the asset needs some adaptation for unity 5.2b2 as there are 2 script errors:

    Assets/ProDrawCallOptimizer/Scripts/Editor/Core/Atlasser.cs(127,33): error CS1501: No overload for method `SetPlatformTextureSettings' takes `3' arguments

    line 33 & 37
     
  50. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    hey @10FingerArmy , yup, indeed I have already reported it, its an issue with Unity, checkout:
    http://forum.unity3d.com/threads/te...-requiring-a-boolean-as-4th-parameter.340970/

    STILL: The good news for you is that I managed to fix it :), just go to Atlasser.cs and do these 2 changes:

    delete Line 127 and change it to this:
    texImporter.SetPlatformTextureSettings(texturePlatforms, maxTexturesSizes, TextureImporterFormat.ARGB32, true);//set to a readabale format

    delete Line 215 and change it to this:
    textureImporter.SetPlatformTextureSettings(texturePlatforms, maxTexturesSizes, textureImporterFormats, true);


    Bare that the Version 5.2 is still in beta so there are lots of API changes before the final release. For example in our case the function requires a 4th param which is a boolean (which is not even documented in the 5.2 docs of what it is for.) so maybe in 5.2b3 will change again. for the time being you can solve the issue with that :)
     
    ImpossibleRobert likes this.