Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

【Optimizers】- Easy to use and functional components to optimize any other components!

Discussion in 'Assets and Asset Store' started by FimpossibleCreations, Jan 28, 2020.

  1. FcsVorfeed

    FcsVorfeed

    Joined:
    Aug 15, 2014
    Posts:
    51
    When I disable gameobject,and set FadeDuration > 0,

    why the optimizer2 will auto enabled my gameobject?

    and I don;t use DeactivateObject.

    ========================================================================
    I found this
    upload_2023-11-8_0-37-2.png
     
    Last edited: Nov 7, 2023
  2. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    549
    Hello, I can't remember why it's here, I guess some old feature required it.
    I think you can safely remove this line, just keep in mind than activate/deactivate game object tends to trigger garbage collector resulting in performance spikes if a lot of deactivation is going on (like camera view culling on/off when rotating view)
     
  3. FcsVorfeed

    FcsVorfeed

    Joined:
    Aug 15, 2014
    Posts:
    51
    Because my TOD System need to close point light in a day,But I found my setpass is still very high,So when I check the optimize found this problem, now I remove this line everything is fine
     
  4. Sarai

    Sarai

    Joined:
    Jul 20, 2014
    Posts:
    30
    Hi, I just imported Optimizers and my project got error. How to fix?
    Assets\FImpossible Creations\Shared Tools\Editor Tools\FEditor_Handles.cs(39,19): error CS0117: 'Event' does not contain a definition for 'current'

    I use Unity 2022.3.10f1

    Update: It because I have a script called "Event" too. Fixed.

    upload_2024-1-8_22-34-39.png
     
  5. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    549
    When you import optimizers package you get message about upading unity API methods for this one script file.
    You need to hit "yes" to avoid this error.
    upload_2024-1-9_13-22-20.png
     
  6. eof2007

    eof2007

    Joined:
    Apr 18, 2020
    Posts:
    7
    Hello!
    I'm trying to change the visibility range of objects on the fly during the game in the settings, I do it like this:
    Code (CSharp):
    1. EssentialOptimizer[] _essentialOptimizer = FindObjectsOfType<EssentialOptimizer>(true);
    2. foreach (EssentialOptimizer source in _essentialOptimizer) {
    3.      if (source != null) source.MaxDistance = 50f;
    4. }
    In prefabs, although the MaxDistance parameter changes, the optimizer does not seem to apply these values on the fly. I need to restart the game for this value to work.
    Perhaps there is some method that updates these values in the script or something that I missed?
     
  7. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    549
    Hello, unfortunately, you can't change distance range on the fly.
    Optimizers plugin is using Culling Groups API which requires to define static distance ranges when initializing.
    This API works best if there are multiple objects with very same distance ranges (it's generating groups of objects to optimize and each group is defined by the distance ranges), so changing it is not good for this system.
     
  8. Zeeeeelda

    Zeeeeelda

    Joined:
    Jan 26, 2022
    Posts:
    1
    @FimpossibleCreations Hello Optimizers Team,

    I have been using the Optimizers plugin for some time now and have found it to be an invaluable asset in streamlining performance within Unity. Its functionality and ease of use are commendable. However, I would like to highlight a couple of issues that I've encountered, which I believe could improve the plugin's robustness if addressed.

    1. Negative Scale Handling
      There appears to be a peculiar interaction with objects set to a negative scale: both the Max Distance and Detection Radius settings in Optimizers behave unexpectedly. Increasing the Detection Radius paradoxically reduces the Gizmos' drawn range. Moreover, negatively scaled objects remain in a "Culled" state during runtime. Given the commonality of using negative scales in scene setup, it might be beneficial to investigate how scale values are computed, perhaps considering the absolute value of the scale to rectify this discrepancy.

    2. Particle System Handling
      I’ve also encountered issues with the Optimizer's management of particle systems, specifically when a component of the particle system is removed rather than merely disabled. The Optimizer attempts to access these removed components during serialization, leading to errors. Ensuring the Optimizer verifies the presence of a component before accessing it could prevent these errors and enhance stability.
    Rectifying these points would undoubtedly elevate the user experience and utility of the Optimizers plugin. Thank you for taking the time to consider this feedback, and I look forward to any developments on these issues.
     
  9. Yaya2503

    Yaya2503

    Joined:
    Jan 13, 2023
    Posts:
    14
    hello I use an asset called voxel play which allows you to generate voxel terrains a bit like those of Minecraft, each voxel is a scriptable object, I would like to know if I can use your assets to optimize the chunks far away and improve the performance especially for Mobile devices while maintaining a large viewing distance, I would like to use your "lod" system on all distant chunks
     
  10. SAMYTHEBIGJUICY

    SAMYTHEBIGJUICY

    Joined:
    Jul 12, 2023
    Posts:
    62
    Hey mr Fimpossible. I have the optimisers tool and it works great with particle systems. I'm just trying to figure out what it actually does to a skinned mesh renderer and whether it would be more efficient for me to program something that totally disables the object. Does it totally cull the animations playing? Thanks,
     
  11. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    549
    Hello. For skinned meshes optimizers can switch bones quality by distance, turn off shadows, and when all meshes of animator are invisible, the animator is culled too (unless you have enabled "Always Animator" on the animator component), but animator will compute basic data for events etc.
    Disabling whole game object can turn out to be not efficient, since it can trigger garbage collector and when you quickly disable/enable many game objects by visibility in camera view (like camera rotation) it can result in performance cost peaks and short fps drops.
     
  12. SAMYTHEBIGJUICY

    SAMYTHEBIGJUICY

    Joined:
    Jul 12, 2023
    Posts:
    62
    OK thank you I'll keep that in mind and do some testing. Also may I ask is there any point in having 3 LODs for something like the particle systems? It's mainly just going to be on or culled right? So can I set up optimizers with just LOD0 and culled?
     
  13. SAMYTHEBIGJUICY

    SAMYTHEBIGJUICY

    Joined:
    Jul 12, 2023
    Posts:
    62
    I mainly ask because with 3LODs nothing shows for the particle system in LOD1 and 2. So not sure if I should be expecting the asset to be doing anything to set these up or if it's up to me to set up a lower intensive particle system in those LODs?
     
  14. SAMYTHEBIGJUICY

    SAMYTHEBIGJUICY

    Joined:
    Jul 12, 2023
    Posts:
    62
    also did this get pushed into an update or is it something we should all be doing?
     
  15. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    849
    I'm working on a game that switches from walking to horseback to cars and to boats.
    However, each of these have their own camera system based on the mode of travel.
    Can Optimizers work with something like this or do I need to fins another solution?

    Been using Optimizers for years but with just one camera object, so I am not sure how to make this work.

    Thanks!
     
  16. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    549
    You can lower emission rate by distance but increase particles sprites size, to make it cost less but still look almost the same from the distance, but it also depends on the kind of particle.
    upload_2024-6-10_11-44-4.png

    In the current version gameObject.setActive switch is executed only when you enable "Deactivate Object" in the last LOD setting.

    Hello, you mean you want to switch camera or display two views in the same time?
    If you just want to switch camera, then use FIMSpace.FOptimizing.OptimizersManager.SetNewMainCamera().
    Optimizers can handle only one active camera, it will not work with two camera views in the same time.
     
    dsilverthorn likes this.
  17. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    849
    This is correct- one camera at a time, just switching cameras for the different vehicles. It is single person and multi-cams are not being used.

    I'm not at my workstation right now, but where do I find "FIMSpace.FOptimizing.OptimizersManager.SetNewMainCamera()" or are you saying to add it in code or something?

    I am an artist and single dev so any help will be appreciated to help me understand how to implement.

    Thanks for your hard work- you make some wonderful assets!