Search Unity

Assets GPU Occlusion Culling without baking and raycasting — free demo package is available!

Discussion in 'Works In Progress' started by drcrck, Jan 25, 2019.

?

Price?

Poll closed Feb 22, 2019.
  1. 10

    17 vote(s)
    29.8%
  2. 20

    12 vote(s)
    21.1%
  3. 30

    17 vote(s)
    29.8%
  4. 40

    3 vote(s)
    5.3%
  5. 50

    8 vote(s)
    14.0%
  1. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    283
    No, the current version is Windows Standalone PC only
     
    jbb1979 likes this.
  2. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    176
    Do you know this work ?
    https://diglib.eg.org/handle/10.2312/pgs.20141246.019-024

    Integrating Occlusion Culling into LOD on GPU


    Real-time rendering of complex 3D models is still a very challenging task. Recently, GPU-based level-of-detail (LOD) approaches have been proposed to fast decrease the complexity of a 3D model, but applying only LOD approaches is usually not sufficient to achieve highly interactive rendering rate for the complex model that contains hundreds of millions of triangles. Visibility culling, especially occlusion culling, needs to be introduced to further reduce the amount of triangles being rendered at each frame. In this paper, we present a novel rendering approach that seamlessly integrates occlusion culling with the LOD approach in a unified scheme towards the GPU architecture. The result shows that the integration significantly reduces the complexity of the 3D model and satisfies the demands of both memory efficiency and performance.
     
    jbb1979 and Flurgle like this.
  3. Renea

    Renea

    Joined:
    Nov 12, 2017
    Posts:
    2
    Couple of Questions:
    1. Does this work with Weather maker?
    2. Does this work with multiple directional lights? i.e. one light set up for day(Sun) and one light set for night(Moon)
    3. Will there be support for additive scenes? I have a project where scenes are separated into sub scenes (main, Sound, VFX). I downloaded the demo project, I couldn't assign the directional light. I am assuming this is because the script was on the camera in the main sub scene, but the directional light is in the vfx sub scene.
     
    jbb1979 likes this.
  4. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    283
    I'll check it out, thanks

    1. Never used it, does it do something unusual that can prevent GDOC from working? It works with EnviroSky and should support any similar system.
    2. It supports only with 1 directional light at a time, but you can switch them with GDOC.SetDirectionalLight
    3. It will be auto assigned automatically when you load the second scene. If not, do it manually with GDOC.SetDirectionalLight
     
    jbb1979 likes this.
  5. Justin_Wingfall

    Justin_Wingfall

    Joined:
    May 15, 2014
    Posts:
    95
    buying once it hits hdrp.

    oh yea and multi cameras, I doing a fix camera game. Once either one is added, I'm buying asap, if I don't find anything else that fits my needs by that time, of coarse. :)
     
    jbb1979 likes this.
  6. SquallLiu

    SquallLiu

    Joined:
    Jun 19, 2017
    Posts:
    24
    It's really a good asset to use for reducing batches!
    Thanks for sharing GDOC.

    However it seems GDOC causes memory leaks.
    Our game keeps loading different scenes and we call GDOC.Disable()/GDOC.Enable() to scan scene objects every round.
    And we measure the memory utility, GDOC causes memory leaks.

    Is there any suggestions about lifetime control of GDOC?
    Should we only enable/disable GDOC only once instead of every round?

    Thanks.
     
    jbb1979 likes this.
  7. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    283
    Both will be supported in 1-2 weeks! :)
    You don't need to call Disable/Enable if "scan new scenes" is checked. Or it doesn't work for you?
    Also, do you mean managed or unmanaged memory?
    Anyway, new version will be released soon and these issues might already be fixed
     
    jbb1979 likes this.
  8. SquallLiu

    SquallLiu

    Joined:
    Jun 19, 2017
    Posts:
    24
    Since we use LoadSceneMode.Additive and move scenes(race track combination) after it finishes scanning.
    The moved scene seems to have wrong position and would be culled incorrectly.
    Manually call Disable()/Enable() fits our need :) (we can do scanning after track combination).

    I think the memory leak comes from unmanaged memory (when calling Enable()).
    Managed memory should be fine since garbage collection.

    Thanks!
     
    jbb1979 likes this.
  9. Black_Raptor

    Black_Raptor

    Joined:
    Nov 3, 2014
    Posts:
    108
    Hi !
    I noticed you mention he work on Vulkan and VR, do you think he could work on mobile hardware like the Snapdragon 835 of the Oculus Quest ?
     
    jbb1979 likes this.
  10. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    283
    Hi, Vulkan is not supported yet
     
    jbb1979 likes this.
  11. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    2,103
    Hi, just purchased GDOC.

    The asset itself is promising, dropped batch count by at least same amount as OC for me, no need to waste hours on baking.

    Warning, major critique ahead:
    But the initial scan is painfully slow. Just by looking through the source I can tell where the problem lies - in the component creation / attachment, null checks, allocations via GetComponents that do not have list buffer send to them.

    Perhaps using GetComponentsInChildren<T>(true, List<T> buffer) would be much faster when dealing with large hierarchies, rather than manually fetching components via GetComponent<T>.

    (https://docs.unity3d.com/ScriptReference/GameObject.GetComponentsInChildren.html
    -> public void GetComponentsInChildren(bool includeInactive, List<T> results))

    (I guess I can disable auto-detection and hook up GDOC_Occludee to each prefab / renderer?)

    If you're interesting in improving initial scan time, move the whole attachment process to the editor.
    I've done similar component attachment on static objects in editor time, so it shouldn't be that hard to implement (albeit it can be tricky when handling prefabs).

    This will reduce scan time to about zero, you'd just need to hook the GDOC_Occludee components to the GDOC in OnEnable / OnDisable.

    Also, please don't do:
    Code (CSharp):
    1. component.transform.position = ...
    2. component.transform.rotation = ...
    Do it like so
    Code (CSharp):
    1. Transform cTrm = component.transform;
    2. cTrm.SetPositionAndRotation(...);
    3. cTrm. ... = ...
    4. cTrm. ... = ...
    Transform is native call, which by its own is not a lot, but when it comes to thousands of calls, its not nice.

    Also,
    Code (CSharp):
    1. Vector3.one * e.range * 2
    is slower than:
    Code (CSharp):
    1. e.range * 2 * Vector3.one
    Result is the same. Order maters.

    TL;DR: C# source would love to have a couple of refactoring passes done to it.

    I don't want to sound like an asshole, and at the same time I don't want to sit a couple of nights refactoring purchased assets' code.

    Hope to see some improvements in this area in the future.
     
    Last edited: Jun 29, 2019
    jbb1979 likes this.
  12. churi24

    churi24

    Joined:
    Sep 17, 2013
    Posts:
    78
    Hi, I have a game on Steam, and I think this asset could help us with our performance problem, but before buying I need some information.
    Our case:
    1) Our game has a part of the scenario that is generated randomly.
    2) Except for some very specific materials, we use only standard materials.
    3) We are using volumetric lights.
    4) We are not using Directional Lights, only Spot and Point light.
    5) Our shadows are Realtime.
    6) We have only one camera active (we are using Cinemachine)

    Question: 1- How this asset works?, just to understand what you do in the GPU. I read the posts, and it makes a scan at the beginning. 2- Do you trigger some event when this process ends?
    3- Do you have plans to support PS4 & xbox? I know this asset took a lot of research and work, the questions are simply to orientate me :)
     
    jbb1979 likes this.
  13. Murkawski

    Murkawski

    Joined:
    Nov 30, 2014
    Posts:
    48
    Hey, I sent you a message on Discord about trying out the asset before we buy it for our project. We really want to try it out to make sure it fits our game. You mentioned on the asset store that we can contact you on Discord for some kind of demo version that we could try out.
     
    jbb1979 likes this.
  14. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    283
    @xVergilx thanks for the comments, the upcoming version has many improvements in both C++ and C# parts

    1. It disables components/gameobjects (depends on settings) that are not seen by any camera (note in the current version it supports only 1 camera, but it will be unlimited in the next one)
    2. Scanning will be improved in the next version and yes, I can add an even if you need it
    3. I do, but there's still a lot to do so no eta

    Hi, just answered
    The demo is posted on the #news channel on discord
     
  15. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,120
    Hello drcrck,

    will there be a GDoc update soon with improvements? Is this working with Unity 2019.2 already?

    I am planning to update my project to Unity 2019.2 soon :)

    Thanks
     
    jbb1979 likes this.
  16. flow-

    flow-

    Joined:
    Apr 19, 2015
    Posts:
    151
    Can it cull Terrains?
    If not is there an API where we can make a custom rule for culling the terrain?
    We have Terrain Chunks generated with Map Magic at runtime, what we could do is to make the chunks smaller like maybe 10x10 or 100x100 and cull it because these terrains slow down our game too much.
     
    jbb1979 likes this.
  17. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    176
    A better approach is using world streaming.
     
    flow-, jbb1979 and xVergilx like this.
  18. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    2,103
    If its rendered via default Mesh Renderer it will.

    Otherwise - probably not.
     
    flow- and jbb1979 like this.
  19. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,120
    Latest release seems to work well with Unity 2019.2.
     
    jbb1979 likes this.
  20. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,794
    Has this been integrated with Vegetation Studios Pro yet? Thanks.
     
    jbb1979 likes this.
  21. jbb1979

    jbb1979

    Joined:
    Aug 6, 2019
    Posts:
    320
    This is an amazing Tech and, increasing frame-rates ten times is crazy-wonderful ! !

    You have revolutionized video-games, if every-one did this we'd have much finer games ! !
     
  22. flow-

    flow-

    Joined:
    Apr 19, 2015
    Posts:
    151
    Okay, thank you for the info
     
  23. R0man

    R0man

    Joined:
    Jul 10, 2011
    Posts:
    61
    How easy would this be to use for someone interested in drawing a lot of instanced models using
    Graphics.DrawMeshInstancedIndirect
    . Would it be possible to create a custom made instanced shader, that would use the GPU culling data?

    Yeah, very broad question. I was mostly interested in the authors thoughts on this.
     
  24. RodneyGD

    RodneyGD

    Joined:
    Jun 3, 2019
    Posts:
    5
    Hello there!
    Is there a way to build GDOC with IL2CPP scripting backend? It only seems to work with Mono in our project.
     
  25. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    2,103
    Just noticed something weird. Like a race condition between GDOC and the camera.

    If the camera is rotated too fast (e.g. via user input) objects stay invisible for about 1~2 frames. Have anyone else encountered that? Any ideas how to fix that?
     
  26. AlteredPlanet

    AlteredPlanet

    Joined:
    Aug 12, 2013
    Posts:
    451
    Keep up the good work, I hope you get multi-cam and console support before the year is over with.
     
  27. Manufacture43

    Manufacture43

    Joined:
    Apr 21, 2017
    Posts:
    134
    Is the Switch supported? How is performance?
     
  28. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    2,103
    Okay, so I've somehow managed to hang Unity Editor with this plugin. I've added another layer and different culling mask setup for the lights, and its now hanging constantly after scan completes.

    If I disable scanning everything works just fine.

    Not sure what's causing this though. Need to investigate.
     
  29. toads

    toads

    Joined:
    Sep 6, 2019
    Posts:
    1
    When using LWRP with GDOC, there is no UnityEngine.Experimental.Rendering in the 5.16.1 version of LWRP.
    How should I handle it?
     
  30. Dturk34

    Dturk34

    Joined:
    Nov 13, 2014
    Posts:
    12
    It's a very good asset but It's still not working in HDRP, the developer does not answer for almost 5 months.
     
  31. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    485
    Hello. We plan to integrate GDOC deeper in our BuildIn RP scenario.
    Do you plan to further support the Asset.

    Latest version was released
    Version1.2.2(current)
    Released: Apr 3, 2019

    Do you plan to further support it.
    An Roadmap would be great.
     
  32. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    283
    Hey everyone, I'm back. New version is coming soon!
    I'll answer to your questions and post more details later this/next week.
     
  33. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    283
    The upcoming version will support the latest LWRP (currently testing with 6.9.2) and even HDRP (because unity finally fixed its extension API).

    Not yet, and the upcoming version will still be Windows-only
    But I'm also working on GDOC 2.0 that will work without the currently used native dll
    It will require Unity 2019.1+ (older versions don't support all the required functions) and will support most modern platforms except mobile.
     
  34. AlteredPlanet

    AlteredPlanet

    Joined:
    Aug 12, 2013
    Posts:
    451
    is multi-cam supported in the upcoming version?
     
  35. manpower13

    manpower13

    Joined:
    Dec 22, 2013
    Posts:
    108
    Also curious about this! Looks very cool =)
     
    Teila likes this.
unityunity