Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

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:
    477
    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:
    477
    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:
    577
    @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:
    743
    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,079
    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:
    4,960
    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,079
    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:
    4,960
    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:
    577
    @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:
    246
    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:
      391
  15. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    274
    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:
    96
    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:
    14
    Is this still active or supported?
     
  18. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,785
    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:
    296
    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:
    4,960
    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
    JBR-games likes this.
  22. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    296

    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