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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Poly Few | Mesh Simplifier and Automatic LOD Generator

Discussion in 'Assets and Asset Store' started by Brain-_-Fail, Jan 18, 2020.

  1. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    Unfortunately that won't be possible. PolyFew isn't an HLOD system.
     
  2. ronripsyche

    ronripsyche

    Joined:
    May 29, 2018
    Posts:
    4
    Just wanted to say thank you for this amazing asset! It really saves indie devs a lot of trouble optimizing assets. The only thing that's really missing is URP support.

    Is it something being worked on? Since Universal is the go-to pipeline for optimization (quality, performance, DOTS), adding support for it would turn Poly Few into a god-tier asset.
     
    hhoffren and pixelR like this.
  3. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    URP and the others scriptable pipelines are still not mature. Unity is continuously altering the shader code for fixing stuff, adding new features and a lot of other things. BatchFew combines materials based on Texture Arrays which requires rewrite of Unity shaders for each Render pipeline. Thus the current instability/Shader modification of URP and HDRP doesn't make it feasible for me to add support for it. This is also the reason why long term projects are still sticking with the older render pipeline.
     
    Last edited: Aug 8, 2020
    Ali-Nagori likes this.
  4. HASSANHR

    HASSANHR

    Joined:
    Feb 23, 2018
    Posts:
    18
    Thanks for your response , Yes generating Lightmap uv's (UV2) for new combined meshes is a must if your planing to bake the lighting in your project, and i think it's easily accessible Via unity Api
    thank you
     
  5. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    When combining meshes it does ask you whether you want to generate lightmap UVs or not. When generating LODs it won't ask you this, because it preserves lightmap UVs data if present in the original meshes.
     
    HASSANHR likes this.
  6. VincentAbert

    VincentAbert

    Joined:
    May 2, 2020
    Posts:
    120
    Hello ! I've just started using it but the add-on is great ! I do have a problem however, generating LOD completely messed up my lightmap and I don't really know what to do...

    Edit : Those were Unity-generated lightmaps if that's important
     
    Last edited: Aug 6, 2020
  7. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    Hi, sorry for the inconvenience caused. Can you please contact me @kbawar555@gmail.com so that we can get this resolved?. I don't want to clutter the forums.

    Thank you for the patience

    EDIT: Below is a link to a video that I've made. It might help you solve the problem. If it doesn't then please contact me @kbawar555@gmail.com

    https://drive.google.com/file/d/1dusJj0LZmktDfFgo9gkCbCGNuSbWePyA/view?usp=sharing
     
    Last edited: Aug 7, 2020
  8. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,866
    Hi there!
    Batch few seems really great and I think texture arrays is the way to go instead of atlases :)
    I have some doubts though:
    When using texture compression, texture arrays must be generated per build target.
    In example, when you switch a project from iOS to Android, consoles or desktop, you have to use different compression formats for each one of them.
    Since Unity doesn't have any editor texture importer dialog for texture arrays, the recompression must be done by script.
    Does Batch Few have any way to rebuild the texture array assets when changing the build target?

    (more details on the other thread: https://forum.unity.com/threads/batch-few-mesh-combiner-and-material-merger.954456/#post-6296971 )
     
    Last edited: Sep 12, 2020
    friuns3 and eaque like this.
  9. Quantumstorey

    Quantumstorey

    Joined:
    Jun 1, 2017
    Posts:
    9
    I'm getting this error on Installation and am unable to compile

    Assets\PolyFew\ThirdParty\AsImpL\Scripts\Dataset\ObjectBuilder.cs(568,36): error CS0117: 'RendererExtensions' does not contain a definition for 'UpdateGIMaterials'

    Unity 2019.3.15f1
    Android
     
  10. Quantumstorey

    Quantumstorey

    Joined:
    Jun 1, 2017
    Posts:
    9

    Ok, I found the issue. Not your code. It was a badly formatted extension method in a custom plugin. So please Ignore.
     
  11. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    233
    Hi, I wonder whats the best practice is when combining meshes. I have a few different materials but most objects share the same material. The textures though, vary a lot in size. So should I combine everything or is it better to only combine objects that have similar texture size?
     
  12. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,866
    Batch Few will make all your textures the same size when you combine them in a Texture Array.
    That means you can set the Texture Array size to the size of your largest texture and all textures that are not that size will be resized to this global size, which will preserve the quality of all your textures but will make them eat more video memory.
    If video memory is not an issue, you can combine them this way.
    However, if video memory is an issue (because you have tons and tons of little textures that would weight too much if resized to, say 4096x4096) then you should combine your materials by texture size (all materials with small textures together)
     
  13. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    233
  14. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    245
    I noticed recently that the Combine materials tool didn't seem to like combining materials using colour only (without textures). It would have been grand if it baked the colours to a texture map in this scenario. I suppose this is due to Texture array support but give it some thought as its really helpful for low poly modelling.
     
  15. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    Thank you for the suggestion. I'll add this feature in the next update.

    EDIT: Version 5.1 adds the requested feature
     
    Last edited: Oct 16, 2020
    shyamarama and atomicjoe like this.
  16. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    329
    I am having an issue with the assets in my scene. I used poly few on a lot of them to generate LODs and now the shadows are acting strangely:

    Do you have any idea what might be causing something like this?
     
  17. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    Hi, I'm sorry for the late response. Seems quite strange to me as well. Are you using baked lighting in your scene?. It might happen with baked lighting. You have to re-bake the lighting after generating LODs. More info here: https://docs.unity3d.com/Manual/LODForBakedGI.html

    If I can get my hands on the scene then I will be able to investigate this further. You can contact me directly @kbawar555@gmail.com
     
  18. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @Brain-_-Fail , Hi - just wondering if I could use this asset to reduce a high poly asset to a low poly asset with a true 'low poly look'?
     
  19. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    If you're talking about "low poly stylized looks" then the asset is not specifically designed for this purpose. You'll definitely get a low poly look if you reduce a 3d model below a specific threshold but there is no guarantee on how equally the low poly look is distributed across the model.
     
    Duffer123 likes this.
  20. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
  21. Jmonroe

    Jmonroe

    Joined:
    Jul 7, 2012
    Posts:
    118
    UPDATE: see below... all is working now.

    Original post:
    Hi,
    I just purchased PolyFew and like the product. However my poly reduced character with blendshapes is doing funky things with the skin normals when animated. I believe it has something to do with the blendshapes. Here's before hitting Play and then after hitting Play. Any suggestion?
    Before "Play"
    normalsgood.PNG
    After "Play"
    normalsMessedUp.PNG

    UPDATE: Bawar received my model and updated his asset in less than a day to solve the issue. Much appreciated! All is working now.
     
    Last edited: Oct 26, 2020
  22. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    Are you using a character creation system ?. Is the character using custom shaders ?. Which version of Unity are you using and which version of Asset Import Pipeline is selected. Honestly speaking this is the first time I have heard of such an issue so I need more detail on this. In order to diagnose and solve the problem I'll have to reproduce this at my end. To not clutter this thread please contact me @kbawar555@gmail.com

    Thank you

    EDIT: Update 5.2 solved this issue.
     
    Last edited: Oct 28, 2020
  23. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    161
    Does every object need a poly few script attached to it? For instance UI objects and empty game object still have a poly few script attached. Does this degrade performance by having them attached?
     
  24. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    The "PolyFewHost" component that gets added to a GameObject when you select it is simply a placeholder script that allows PolyFew's window to appear in the inspector. This component only gets added when you select a feasible GameObject on which PolyFew can work and then gets deleted from the same object automatically when it looses focus. So don't worry about it because at the end of the day there won't be any PolyFewHosts on any GameObjects in your scene and also the PolyFewHost does nothing at all, you can even open the script and look at it's source code. You'll see that it is just an empty class with no code in it. Even if it attaches itself permanently to all of your scene GameObjects (Which is impossible as stated previously) it won't cause even a single frame drop.

    Anyways if you want to change the default behavior of automatic popping of PolyFew's UI (and attaching of PolyFewHost component) in the inspector for every selected GameObject and want to go back to the manual way of attaching and removing components. You can modify this from the menus toolbar by going to "Window > Brainfail Product > Poly Few > Disable Auto UI Attaching".
     
    Duffer123 likes this.
  25. songjiekun

    songjiekun

    Joined:
    Jan 21, 2017
    Posts:
    29
    hi @Brain-_-Fail
    i find a issue. when i generate lod, the lightmap uv (uv2) became different then the original one. i use uv2 for my decal texture. so the decal will be different on different lod
     
  26. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    Hi @songjiekun

    It's not possible to keep the exact same UVs when a mesh is simplified which is what happens when you generate LODs. The reason being that when you simplify a mesh you delete appropriate vertices from the original mesh which reduces the vertex count. The other mesh data like normals, tangents, UVs etc that are associated with the deleted vertices must as well be discarded or remapped in some way. If you have 10 vertices then you must have 10 UV coordinates (UV1 and UV2 ...) now if the vertex count reduces to 5 you must have 5 UV coordinates for the new mesh now. Please note that this is not a limitation with PolyFew but something that's impossible to do. This process would be the same in every mesh simplification tool on the planet whether it's free or super expensive whether it's a plugin for a game engine or a simplification tool in a dedicated industry standard 3d modeling software.

    I hope you understand :)
     
  27. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    638
    Hello Do Your asset support creating LODS using Unity build in Lod groups?
     
  28. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    Hi @Jakub_Machowski.
    Yes, PolyFew uses unity's built in LODGroup component when it creates LODs
     
  29. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    638
    @Brain-_-Fail So basically I could Save generated LOD to Mesh file or aset file and I could create prefav from it? Earlierwe used Automatic LOD, but asset become buggy and abandoned this is Why we are looking something with similar workflow but also batch process :)
     
  30. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    638
    P.S I'm just asking if creating "Unity LOD group" is automatic process I see nothing about it on Aset store webpage or on any screenshot.
     
  31. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    It's as easy as clicking a button and adjusting a few settings to meet your needs. PolyFew is fast, simple and easy to use and the process is automatic with minimal user input, and yes the simplified meshes are saved as mesh files which means you can create prefabs.

    These two videos might help you:

    Poly Few | Mesh Simplifier and Automatic LOD Generator - YouTube
    How to generate LODs for multiple objects at once - YouTube
     
  32. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    PS: Try it out and if something goes wrong or you find a bug I'll offer you a refund.
     
  33. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    638
    Ok thanks for Info I see now Lod group, but someone in reviews mentioned That Poly Few Host Component stay on every object of prefab and cant be deleted. Is that true? We have the same Problem With Automatic LOD it left it scripts on object and When We are using tousand of Objects there was a problem of cpu overhead. :) Could it be removed in actual version?

    Also I saw that AFter creating prefab with LOD group We cant preview result first, or is there option to preview results before. Also is there option to generate LODS in Prefab Preview mode (From unity 2018.4 and above) ?
     
  34. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    PolyFew Host component is required by PolyFew to render its interface, without it you won't be able to see PolyFew, hence it's an essential part of it. This component only gets added when you select a feasible GameObject or multiple GameObjects and then gets deleted from the same object(s) automatically when it loses focus. So don't worry about it because at the end of the day there won't be any PolyFewHosts on any GameObjects in your scene whatsoever.
    This allows PolyFew to automatically show up for feasible GameObjects and you won't have to worry about adding Polyfewhost components on different gameobjects manually and forgetting to delete them later on as Polyfew would automatically remove the component when a GameObject will loose focus and also there is absolutely 0 overhead of PolyFewHost as it does nothing at all, you can even open the script and look at it's source code., it is just an empty class with no code in it.

    I don't know what you mean by prefab preview mode but you can definitely visualize the changes before actually applying them with PolyFew. You can see this in the intro video as well without hitting the "Reduce" or "Generate LODs" button the changes don't actually get applied. Also in fact If you still accidentally apply any changes and want to revert back you can easily do that as well with a click of a simple button.

    Anyways as previously said you can try out PolyFew and If you face any issues I'll offer you a refund. I don't know what to say more on this :)
     
  35. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    638
    Hello After tying Yout asset I see few Things that I'm not sure or not happy with but maybe I'm doing something wrong

    1. Most important is WHen Using automatic LOD I can't or dont know how to preview al LODS, It just generate it, and ask me to save scene don have idea why it reload scene? Cause if I wont save it it also wont save Poly Few Host on object so I have to re-add it. (also there is some Uv2 generation question all the time that I dont understand what it exactly means, but it should be also option to set it up dont ask every time. If I'm doing it wrong let me know but I dont see option to regerate. Also I though I will be able to preview automatic LOD in Realtime some way.

    2. The BIGGEST MINUS is that I had to set so many setting Per every LOD Level of mesh. (in Automatic LOD) I cant use here any preset or use some global settings. What If we have over 300 LODs? It will be a small nightmare to set the same settings every time I work with next mesh. WHats more If after Lod generation I also lose my poly Few settings cause its removed from object. (Or because scene didnt saved dont saved)

    That 2 minuses are most important If there are option to work with that or improve by some settings let me know. Other case I cant imagine to work with so many LODS

    There are also few smaller problem but still add a lot ofclicking

    1. Lower Lod Levels dont get static tags, and layer settigns from Main mesh LOd, What means I have to set up that manually too (I think there should be option to do that)

    2. I dont Why hierarchy of Lods is so complicated and have unneded parents, With working with huge scenes that additiional empty objects are unncessary, And I would need to re-create that. (also why there is DONT delete model even if I already created asset)
    upload_2020-11-30_18-47-25.png
    There would be enough To have Level01 / Level02/ Level 03 Objects. Not all that Poly Few

    3. I dont know why manual say I have to save scene after generating Lod, Cause if I will save asset and make a prefab what is a base workflow in unity Why manual say I will lose LOD if dont save prefab?

    P.S I of course on start of testing disabled "Automatic add Poly Few UI" in settings, cause I dot exactly understand why it adds it by defeault, but good that there is that option.

    Dont get me wrong overall Asset is great, but basiacally preview of LOD is unusable if working with automatic LOD, and for Work with Many Mehses The elements I described will make that work will take long long days Instead 1-2 days for us.
     
    Last edited: Nov 30, 2020
  36. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    I'm sorry for the inconvenience caused to you.

    I think you'll need some time for understanding the tool. You asked that you can't preview LODs. Well generating LOD simply simplifies meshes and you can already see how your model will look if for example it is simplified with (Reduction Strength = 50% - Preserve Borders = true). You have to use the Reduction Strength slider for this purpose. Also as I already did mention in my previous comments If you still accidentally apply any changes and want to revert back you can easily do that as well with a click of a simple button. In case of LODs just press the "Destroy LODs" button and then simply regenerate the LODs with the new settings as required.

    About the generate UV2 button if you don't understand it just leave it at default which is "No".

    To answer point 2. I don't know why is this happening with you but the settings remain intact once you set them even if PolyFewHost is removed when you re-add it all the settings are there (It doesn't matter if you save the scene or not). Also you said that if there are 300 objects then what. Consider the case of Automatic attaching of PolyFewHost in this case which saves you tons of time which otherwise you would have had to manually add PolyFewHost to each one of the 300 objects.

    The hierarchy is not so complicated if you understand what it means then you'll thank me later on. Of course you have to work hard if you create something pressing a mouse button once or twice doesn't make much difference. Patience is the key to success at least in Game development.

    There is absolutely no where stated in the manual that you'll loose prefab if you don't save the scene. I don't know where did you see this. When generating LODs PolyFew simply asks you to save the scene and it says if you don't save the scene before exiting the Unity editor the changes might get lost. This is the default behavior with unity in fact this is the default behavior with almost every software on the planet. In plain English it means that PolyFew doesn't force you to save the scene if simply warns you. You can save the scene whenever you want to but do make sure to save it before exiting the unity editor.

    Only one of your point seems legit to me and a good suggestion as well i-e There should be an option to automatically set "static" flag on the generated LODs.

    Can you please contact me @kbawar555@gmail.com? I don't want to clutter this thread with useless information.

    EDIT: Update to v5.5 which adds all these features and more.
     
    Last edited: Dec 10, 2020
  37. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    638


    Thanks for reply, In my opinion as developer with over 10 years experience every additional click is a pain as well as too many unnecessary empty object in hierarchy for organization and cpu calculations. :) I still think that asking about UV every time when generating object should not be there it should be just in Automatic LOD setting as everything else. Whats more I think that setting preset is also must have as well as static/layer flag copy, so If you will be able to improve that It would be great. Ok I will contact You on e-mail, but I think this is not useless information, but something that everybody could check out before buy (For example that static flag improvement will be improved)

    P.S I understand I could preview LOD on top. But then I need to again setup everything in Automatic lod exactly the same (for example some copy settings from Actual preview would be helpfull)

    Regards :)
     
  38. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118

    Actually a lot of what you see in PolyFew has been added over time on the request of many users. The problem is that I have to make sure that majority is satisfied. If I make a change so that it satisfies a single individual and it's hard for other users to cope with then I am the one in trouble :).

    Btw your post is not useless, I was actually referring to my recurring responses to your posts that might clutter the thread. The suggestions (Static flags one and the copy template one) that you gave will definitely be added in the next update which would not be far away I promise.

    So thanks for the great ideas :)

    PS: Forgot to mention that if you want to generate LODs for let's say 300 objects you can do that at once by selecting multiple objects and specifying the same LOD generation settings to be used by them and clicking the "Generate LODs" button. So I don't think that you would have to adjust the settings individually for each object, which although is the correct and preferred way of doing things as the process of mesh simplification is such that not every object would work best with the same set of settings, so tuning the settings for individual objects and then generating LODs is the way to go.
     
    Last edited: Dec 2, 2020
  39. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    638
    Thats a game changer! I didnt know that such as automatization with many object at once is possible :)
     
    Last edited: Dec 2, 2020
  40. Tymianek

    Tymianek

    Joined:
    May 16, 2015
    Posts:
    94
    Why does the polyfew window appear on every GameObject. It's super annoying. I want to add polyfew where I need it not on every freking thing in the project. How do I change that behavior?
    Also do you have any support discord?
    Even an empty GameObject has polyfew component that can't be deleted.
    upload_2020-12-2_16-51-0.png
     
  41. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    638
    I was annoyed but that too, but you could turn off that behaviour if I remember well in Tools unity window
     
  42. Tymianek

    Tymianek

    Joined:
    May 16, 2015
    Posts:
    94
    This shouldn't be enabled by default. Also, it isn't stored in project so if someone new downloads the repo they will have the option enabled even if I disable it.
    upload_2020-12-2_18-39-40.png
     
  43. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    638
    I agree
     
  44. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    Well you can disable this behavior if you are annoyed by this it is very simple to do so and takes less than 10 seconds and would save the settings on your UnityEditor so that you don't have to modify them again and again for every new project you create. Also it doesn't make any sense to store these personalization settings on your project, as these are user specific. If these settings were stored in your project, then anyone downloading the project from the repository will be forced to use your settings, even if they didn't want to. Also disabling "auto UI attaching" is not meant to be the default workflow with PolyFew. A lot of users are used to this new way of doing things and actually they appreciate this. I believe you have gotten used to the old school way of doing things manually by attaching stuff and then forgetting to delete them and mess up with a lot of settings. BTW you can click on the "POLY FEW" label in the inspector a little bit right to the cat icon and it would appear collapsed like this:

    new.PNG

    Unfortunately no, I don't have a discord channel. You can contact me @kbawar555@gmail.com though
     
    Last edited: Dec 31, 2020
  45. Tymianek

    Tymianek

    Joined:
    May 16, 2015
    Posts:
    94
    I just don't want to see a script on objects that don't and shouldn't use poly few.
    I don't want this on for example a GameManager, it doesn't make any sense to have it there.
     
  46. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    707
    Hello im having an issue with all the skinned mesh renders going crazy with animations like the wrong vertices are being attached to the wrong bones. Unity 2019.4 , Any ideas of what im doing wrong ?
    Image is a model before and after using Polyfew to reduce polycount.
    PolyfewIssue.PNG
     
  47. Jmonroe

    Jmonroe

    Joined:
    Jul 7, 2012
    Posts:
    118
    I remember having that issue when I checked “optimize game object” of the rig tab of importer. Did you check optimize game object?
     
  48. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118

    Seems very strange to me and never have seen or heard about this before. Did you try what @Jmonroe suggested ?.
    If it doesn't fix the issue, please email me with the model file or the unity package with the scene having the model so that I can reproduce this at my end and resolve this.

    Thank you
     
    JBR-games likes this.
  49. arie1994

    arie1994

    Joined:
    Jun 30, 2016
    Posts:
    85
  50. Brain-_-Fail

    Brain-_-Fail

    Joined:
    Jan 21, 2017
    Posts:
    118
    Hi Arie, PolyFew cannot convert normal/non-skinned meshes to skinned meshes but it can combine meshes and convert skinned meshes to non-skinned meshes, both at runtime and from the editor UI.