Search Unity

InstantOC - dynamic occlusion culling + LOD

Discussion in 'Assets and Asset Store' started by frenchfaso, Jan 18, 2013.

?

Should I strip out the integrated LOD stuf from InstantOC to make the code more maintainable?

Poll closed Mar 4, 2017.
  1. Yes, I never used it anyway

    50.0%
  2. Yes, I've used it in the past but will only use InstantOC for oc in the future

    50.0%
  3. No, I like it better than the Unity LOD

    0 vote(s)
    0.0%
  1. khanhhh89

    khanhhh89

    Joined:
    Nov 14, 2013
    Posts:
    1
    We purchased the asset a few days ago, and it works well on our game. However, the asset takes too much time per frame's time. Most of time spent in firing rays from pixels. I am investigating why does it happen and I see that the method CullingGroup.QueryIndices(...) always return 0. It means that CullingGroup with sphere doesn't work. However, when I use CullingGroup.OnStateChanged, it still notify me when a sphere is in or out of Frustum View. Could you help me explain what's the purpose of CullingGroup.QUeryIndices(), does it affect our performance when it always return 0, and why it returns 0?
     
  2. smonz3

    smonz3

    Joined:
    Jan 9, 2017
    Posts:
    18
    Hi, I just purchased this asset and checked out the demo scene in unity 5.6.. I am having a lot of issues with it. The objects seem to flicker a lot, they don't seem to occlude each other, even when occludee is ticked, and the performance in the demo is far far worse with IOC on then with IOC off??? For example, with 4000 objects in the demo scene with IOC off the FPS is 200, with IOC on the FPS is 110? If there is an issue with 5.6? If so how can it be fixed? If not, am I able to request a refund?
     
  3. frenchfaso

    frenchfaso

    Joined:
    Aug 12, 2008
    Posts:
    479
    Hello,
    thank you for your purchase!
    This is probably only a setup issue, if we can't figure this out, I'll offer you a refund.
    Please try the following:
    Create a new blank project, load InstantOC and open the demo scene.
    Locate the "Logo" prefab and in the IOClod component of the Logo prefab uncheck "occludee".
    Press play, check if there are reported errors in the console.
     
  4. frenchfaso

    frenchfaso

    Joined:
    Aug 12, 2008
    Posts:
    479
    Hello!
    In InstantOC you can mark small/distant/sparse objects as static (in the IOClod script), it's an optimization to reduce flickering of small/distant/sparse objects.
    The function call you are mentioning deals with this IOClod static objects, if there aren't objects marked as static (in IOClod) it returns 0.
    What values do you use? (Sample rays, etc..)
     
    Last edited: Jul 11, 2017
  5. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @frenchfaso about your poll. I haven't yet used your LOD function of InstantOC yet but I probably would if it would greatly optimise performance but I wonder maybe it would help you maintain both better if it were a plugin that you could modify the code easier as a separate system.
     
  6. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    What the object structure is needed for IOC to work?
    My gameobjects are heavily structures due to my game design, and their colliders are not the parents of their models(I have to manipulate multiple colliders at the same time in runtime). Can IOC deal with gameobjects like this?
     
  7. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hello! Why buy this and not use Unitys standard? ...I see alot of performance and bug complaints....
     
  8. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    You would use this for dynamic scenes, like if you were using a randomly generated "dungeon" for your play area, you could use IOC to eliminate drawing of meshes in rooms that can't be seen.

    On the other hand, while this worked fine in a project I set up about two months ago, I just tried to set it up in another one and I'm not able to get it working. So I'm not sure if there's a Unity version bug, or if I somehow set it up wrong (it's easy to set up), or what.
     
  9. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Thanl you for a good answer! Then I dont think this is something for me.. I have a big terrain made with gaia and alot of trees and forest stuff and houses spawnded with gena and using advanced foliage shader 5 with all foliage.. Im using lod... but I think Unitys OC would work just fine.. :)
     
  10. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    You are probably right. Devs who are baking generally don't need dynamic OC, and all the billboarding of trees should help you a ton.
     
    JBR-games and mattis89 like this.
  11. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @frenchfaso @Wright Having an issue in Voxeland, as soon as I installed InstantOC and hit play the Character in the Voxeland Demo slowly started flying up and in one straight direction!! All player controls don't effect it. This happens even without InstantOC scripts added to the scene. Using Unity 5.6.4p1

    Update: I had set it up wrong - I haven't touched IOC in a while.. just to show everyone it works well, I've doubled my frame rate with Voxeland, people might now be able to use Voxeland in their Mobile games
     
    Last edited: Dec 30, 2017
    hopeful likes this.
  12. Jasmin1347

    Jasmin1347

    Joined:
    Jan 24, 2018
    Posts:
    2
    Recently i was use InstantOC,in this package "IOCcam" Script take a long time to execute.
    is there any way to decrease time to load the scene ?
     
  13. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    im torn between this & VRDOC - Dynamic Occlusion Culling... for my VR projects..
     
  14. ZbigniewCebula

    ZbigniewCebula

    Joined:
    Apr 3, 2015
    Posts:
    1
    Hey, frenchfaso. I've bought InstantOC because my whole game is based on procedural generation. Unfortunately I have problems from the begin, I build world using cubes but I've got this:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. IOClod.HideAll () (at Assets/InstantOC/IOClod.cs:532)
    3. IOClod.Initialize () (at Assets/InstantOC/IOClod.cs:134)
    4. IOClod.Start () (at Assets/InstantOC/IOClod.cs:128)
    5.  
    then
    Code (CSharp):
    1. IndexOutOfRangeException: Index was outside the bounds of the array.
    2. IOCcam.AddBoundingSphere (UnityEngine.BoundingSphere sphere) (at Assets/InstantOC/IOCcam.cs:64)
    3. IOClod.Start () (at Assets/InstantOC/IOClod.cs:100)
    4.  
    and more:
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. IOClod.ShowLod (System.Single d) (at Assets/InstantOC/IOClod.cs:378)
    3. IOClod.UnHide (UnityEngine.RaycastHit h) (at Assets/InstantOC/IOClod.cs:315)
    4. IOCcam.Unhide (UnityEngine.Transform t, UnityEngine.RaycastHit hit) (at Assets/InstantOC/IOCcam.cs:150)
    5. IOCcam.Update () (at Assets/InstantOC/IOCcam.cs:140)
    6.  
    Settings in attachement.
     

    Attached Files:

    • cap.PNG
      cap.PNG
      File size:
      207 KB
      Views:
      890
  15. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    Hi -- I'm interested in this but it looks like your demo links are broken. Is there a current demo I could try?

    The links to the user manual and FAQ and stuff are broken too, says your blog is only open to invited readers.
     
  16. Steviebops

    Steviebops

    Joined:
    Apr 9, 2013
    Posts:
    132
    Im having some trouble, when the camera pans over an occluded object, it is unhidden as it enters the view, as it should be.

    But it never gets hidden again as the camera moves away, no matter what I set the Hide Delay to.

    Im using Unity version 2.018.1.6f.
     
  17. mrPRAZ

    mrPRAZ

    Joined:
    Oct 10, 2013
    Posts:
    23
    Is this still active or supported?
     
  18. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Last post "July" ,last year.... @KatoSet
     
  19. zisaboy

    zisaboy

    Joined:
    Jun 30, 2014
    Posts:
    6
    frenchfaso, Jul 11, 2017Report

    version 3.0.0 (current) released May 17, 2018
     
  20. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    I'm about to buy this to use it with Dungeon Architect (randomly generated dungeons) and MapMagic (procedural world). anyone has experience with any of these? Also, unity version is 2018.3.0f2, does InstantOC works with it?
     
  21. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    I don't have any experience using the various occlusion plugins with DA - and I don't have recent experience using InstantOC, specifically, either - but IIRC the developer of DA was thinking about adding some automatic mesh combining ...? Something like that. I may not be remembering correctly. But keep in mind that mesh combining and occlusion culling can fight each other, and it can take some thought to get them to work appropriately.

    I'd say that - in general - if you're using DA to generate internal dungeons, where the camera only sees something like one room at a time, then occlusion culling like InstantOC is going to win the day, because even though all of the rest of the dungeon has been generated and exists, only the room seen by the camera will be rendered. For that type of scenario you generally want to avoid mesh combining, and you probably don't even need LOD. However, if in your game the camera is elevated and showing building exteriors, streets, and terrain where broad vistas are visible ... then maybe a mesh combining / LOD / instancing solution is going to get you the most performance.
     
    Last edited: Dec 21, 2018
    biogicfps and JBR-games like this.
  22. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349

    Thanks for the reply, my game is First Person so I guess that would fit InstantOC, I ll wait an answer from the developer here regarding unity versions supported an any other hint before purchasing tho
     
  23. jawasjnsdjn

    jawasjnsdjn

    Joined:
    Mar 7, 2013
    Posts:
    37
    I must implore you to opensource this tool now that it has gone free for the good of the userbase.
     
  24. frenchfaso

    frenchfaso

    Joined:
    Aug 12, 2008
    Posts:
    479
    Hy @jawasjnsdjn that's the plan indeed ;-)
    I have to check with the Assetstore team if there are licensing issues opensourcing a former paid package, if not, InstantOC's new home will be Github.
    Feels like the right thing to do since I haven't updated it in a long time.
     
  25. frenchfaso

    frenchfaso

    Joined:
    Aug 12, 2008
    Posts:
    479
    Hello everyone,
    finally got a response from the Assetstore team, and it turns out I can opensource InstantOC!
    It will need a permissive license like MIT, BSD 3-clause or Apache, other than that, there are no limitations.
    I'll polish it a bit (the demo scene doesn't work anymore on the latest Unity LTS release) and publish it on github hopefully in the next couple of weeks.
    Stay tuned!
     
    URPian, JBR-games and Lars-Steenhoff like this.
  26. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    I'm not an expert, but I think MIT is the preferred one.
     
  27. Kennosuke

    Kennosuke

    Joined:
    Jun 29, 2018
    Posts:
    16
    Hello @frenchfaso are you still offering support for this asset? Upon implementing it into my game that has a procedurally generated dungeon maze, my FPS dropped significantly. I used to get around 90-120fps, but now it's around 10-20fps. I would prefer not having to write my own occlusion culling system if I can get yours to work efficiently.

    I read through some of the reviews, and saw one or two other users running into similar problems. You replied to them that it could be a setup issue. Could you explain the most common cause of FPS loss when using your IOC tool?

    *Edit 1* : Nevermind, I am just writing my own OC, so it's all good.
     
    Last edited: Feb 5, 2020
  28. neomarian

    neomarian

    Joined:
    May 11, 2012
    Posts:
    43
    Hello guys, any new on this? It was added git?
     
  29. r137

    r137

    Joined:
    Mar 12, 2018
    Posts:
    47
    Is this project still active? I couldn't find it on github?
     
  30. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109
    @frenchfaso

    Hi I didn't set LODs and I will randomly start getting spammed with this error, i have the trees being spawned in a removed by world streamer but i have attached your script to my trees to help with lag, it works great until this error bogs me down

    upload_2020-5-19_22-51-56.png

    The Trees have their own LOD system, am I supposed to attach the script to each LOD or just the parent?
     
    Last edited: May 20, 2020