Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

[RELEASED] Impostors - Runtime Optimization

Discussion in 'Assets and Asset Store' started by MUGIK, Oct 11, 2019.

?

What dependencies you are ok with using in your project?

  1. Unity 2019.4+

    28 vote(s)
    84.8%
  2. Jobs (+ Collection and Mathematics)

    28 vote(s)
    84.8%
  3. Burst (+ Mathematics)

    27 vote(s)
    81.8%
Multiple votes are allowed.
  1. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    292
    Actually, I found a workaround for static batching. Now I'm curious if it will work with static batch utility)
    Most likely next update will fix issues with static batching.

    UPD
    StaticBatchingUtility works fine with Impostors. You can call Combine() at any point(Awake, Start, Update)
     
    Last edited: Jun 7, 2021
  2. NullyStudio

    NullyStudio

    Joined:
    May 10, 2019
    Posts:
    5
    Hello Do you know if this will work with Poly Few | Mesh Simplifier and Auto LOD Generator ?
     
  3. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    292
    There is no built-in integration with any asset.
    This asset expands Level Of Details technique with one more level - an impostor. So it should work perfectly with any LODs generators as long as you are using the LODGroup component(it is required for Impostors package to work)
     
  4. NullyStudio

    NullyStudio

    Joined:
    May 10, 2019
    Posts:
    5
    Hello , after i added the rederer feature to the forwardRenderer it does not getr added
    imposter1.PNG imposter 2.PNG
     
  5. NullyStudio

    NullyStudio

    Joined:
    May 10, 2019
    Posts:
    5
    Sorry I was being dumb i did not save the scene after
     
    MUGIK likes this.
  6. mikeohc

    mikeohc

    Joined:
    Jul 1, 2020
    Posts:
    63
    Hi, I've read other posts regarding this, but I'm wondering what will happen if I have a static house with dynamic interiors, and I want to create an imposter for the house. Would the house appear in front of all the dynamic interior objects since it's just a quad now? I'd need to disable/cull the interior gameobjects before the house turns into an imposter?

    Another scenario: house with no roof, with dynamic interior. The player is standing on a cliff looking towards many houses to see if there are items there before going towards it. Would all the items need to be imposters then? How would the houses render behind those objects while having a few walls overlap some items?
     
  7. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    292
    Yes

    That sounds logical. You could cull the interior with LODGroup component because you anyways have to use this component to work with Impostors.

    I think the better solution would be to include interior into impostor. Impostors package doesn't require your objects to be marked with a static gameObject flag, you can move objects but these changes won't apply to impostor texture until you explicitly say ImpostorLODGroup to recalculate rendering instructions. This might be confusing to implement, so if you will have any question feel free to ask me here or in DM.

    If the house and interior objects are all have their own impostors then house's impostor will overlap all the interior impostors. Impostors can't do ZTest because it's just a flat quad.
     
    mikeohc likes this.
  8. mikeohc

    mikeohc

    Joined:
    Jul 1, 2020
    Posts:
    63
    Thank you so much for answering all the questions. :)
    I'm going to purchase the asset and run a few tests.
     
    MUGIK likes this.
  9. mikeohc

    mikeohc

    Joined:
    Jul 1, 2020
    Posts:
    63
    So I've ran a few tests, and just came back to say this asset is fantastic! The example regarding an open roof interior is achievable by following what Mugik suggested above for anyone wondering.

    Regarding updating (adding/removing) renderers in the LOD Group, I realized I need to remove the imposters and set it up again. Is there a way to update imposters with updated renderer list in the editor?

    I tried this and am curious how you'd do this when a dynamic object has been moved, and requires update the next time imposter is called. Thanks
     
    hopeful likes this.
  10. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    292
    You need to do this:
    Code (CSharp):
    1. _impostorLODGroup.SetLODsAndCache(lods);
    2. _impostorLODGroup.RequestImpostorTextureUpdate();
    Please, let me know if it helped

    There are context menu commands you could use
    upload_2021-6-19_10-49-13.png
     
    Last edited: Jun 19, 2021 at 8:49 AM
    mikeohc likes this.
  11. mikeohc

    mikeohc

    Joined:
    Jul 1, 2020
    Posts:
    63
    It seems I'm missing Request Impostor Texture Update?
    Couldn't locate it inside script either...
    Screenshot (219).png
     
  12. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    292
    Oh gosh, I'm so sorry! That's the not-released feature yet. I just need to publish it on the asset store... Gonna make this as soon as possible.
    If you'd like you can contact me through email and I will send you the new version bypassing the asset store.
     
    hopeful and mikeohc like this.
unityunity