Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Assets GPU Occlusion Culling without baking and raycasting

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:
    299


    Meanwhile, new demo with VR Single Pass support is available!
    Check out #news on Discord: https://discord.gg/GhKTEXy

    UPD
    Fixed a bug which caused shadows to be always visible if the scale of the Directional Light wasn't 1;1;1.
    The bug was spotted with Time of Day, now it correctly works with this asset.
     
    Last edited: Mar 10, 2019
    Slaghton likes this.
  2. ohbado

    ohbado

    Joined:
    Aug 13, 2014
    Posts:
    30
    Hello.
    This asset looks really cool!
    I expect support of console (PS4). When do you support PS4?
     
  3. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    No ETA yet
     
  4. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    Next in the roadmap: LWRP/HDRP support, then Vegetation Studio integration
     
    Last edited: Mar 11, 2019
    julianr likes this.
  5. dirkjacobasch

    dirkjacobasch

    Joined:
    Apr 24, 2018
    Posts:
    266
    I hope multiple camera support is comming soon, because I have a first person, third person and freelook cameras. ;)
     
  6. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    Hm, so only 1 camera is active at any moment, right?
     
  7. dirkjacobasch

    dirkjacobasch

    Joined:
    Apr 24, 2018
    Posts:
    266
    Yes, and when I switch to another camera the GDOC script is disabled with the following error.

    Code (CSharp):
    1. NullReferenceException: buffer is null
    2. UnityEngine.Camera.RemoveCommandBuffer (UnityEngine.Rendering.CameraEvent evt, UnityEngine.Rendering.CommandBuffer buffer) (at C:/buildslave/unity/build/Runtime/Export/Camera.bindings.cs:296)
    3. GDOC.GDOC.RemoveBuffers () (at Assets/Imports/Bearroll/GDOC/Scripts/GDOC/GDOC_PluginInterface.cs:98)
    4. GDOC.GDOC.OnDisable () (at Assets/Imports/Bearroll/GDOC/Scripts/GDOC/GDOC.cs:232)
    5. UnityEngine.Behaviour:set_enabled()
    6. GDOC.GDOC:OnEnable() (at Assets/Imports/Bearroll/GDOC/Scripts/GDOC/GDOC.cs:182)
    7. UnityEngine.GameObject:SetActive()
    8. PilotCharacterController:SetThirdPersonCameraActive() (at Assets/Scripts/Character/PilotCharacterController.cs:662)
    9. PilotCharacterController:Update() (at Assets/Scripts/Character/PilotCharacterController.cs:247)
     
  8. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    Okay, it's not what I thought you wanted (I thought something like split screen with multiple cameras rendering simultaneously). It's easier so will be fixed soon

    BTW I'm working on LWRP/HDRP support, new demo will be posted on discord today or tomorrow
     
    Last edited: Mar 11, 2019
  9. dirkjacobasch

    dirkjacobasch

    Joined:
    Apr 24, 2018
    Posts:
    266
    Cool.
    No, currently only one camera is active at a time. Multiple cameras at a time maybe later but not yet.

    Thanks.
     
  10. ohbado

    ohbado

    Joined:
    Aug 13, 2014
    Posts:
    30
    OK.
    But I think you understand that the CPU of console is very very poor.This asset is suitable to improve a performance of a console equipped with poor CPU.
    I bought this asset.I hope that you will accelerate development.
     
  11. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    New demo posted on Discord: https://discord.gg/GhKTEXy

    VR support improved, many bugs fixed, performance optimized.

    To enable experimental LWRP support:
    Project Settings → Player → Other settings → Scripting Define Symbols → Add GDOC_LWRP
    Also you'll need to convert the materials used in the demo. You can simply change their shader to LWRP/Lit.

    Please post bugs in #bug-reports or PM me
     
    dirkjacobasch likes this.
  12. dirkjacobasch

    dirkjacobasch

    Joined:
    Apr 24, 2018
    Posts:
    266
    Awesome work.
     
  13. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    133
    @drcrck do dynamic versus static meshes make a difference with how this asset handles culling? i.e.) are both culled regardless of how they are set in Unity?
     
  14. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    if you mean static/dynamic batching then no, there is no difference
     
  15. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    133
    More so when you enable an object with a mesh to be static from the inspector, as sometimes you cannot do certain things with static objects versus dynamic objects.
     
  16. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    No, it's not an issue
     
    local306 likes this.
  17. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,024
    Nice, look forward to this.
     
  18. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299


    Version 1.1 will be available on the Asset Store soon!

    — Many bugs fixed
    — Performance optimized
    — Now supports LWRP
    — Now supports VR Single Pass (non-instanced)
    — Now supports Unity 5.6.6 (as well as any 2017 or 2018 version)

    If you already have it purchased, PM me your invoice number on Discord to download it right now.
    https://discord.gg/GhKTEXy
     
  19. therewillbebrad

    therewillbebrad

    Joined:
    Mar 2, 2018
    Posts:
    145
    Can't seem to find the single pass vr demo.
     
  20. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
  21. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    290
    This looks very promising, nice work! Really interested in the fact that it culls the shadows as well, this could really help VR developers increase FPS! Looking forward to testing this weekend!!

    // WildStyle
     
  22. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    A friendly reminder for customers:
    If you purchased GDOC, you can PM me your invoice number on Discord (or this forum) to download the latest 1.1 version, which is not available on the Asset Store yet.
    https://discord.gg/GhKTEXy
     
  23. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
  24. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    153
    This looks like it should be directly shipped with Unity itself.
    I'm subscribing to this thread to know when multipass VR is supported for my day work, and Mac/Linux release for my night work.
     
  25. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    GDOC 1.2-rc1 free demo is posted on Discord
    Join now to download: https://discord.gg/GhKTEXy

    Multi pass is almost ready, will be available in the next version
    No ETA for mac/linux
     
    TanselAltinel likes this.
  26. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,024
    Hi, I am interested in your asset, I see there are other assets (will omit name) that seem to do something very similar (No baking OC on GPU) , is cheaper, can I ask what the differences are between yours and others, what advantages does yours have? I am just considering which one to buy.
     
  27. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    I've seen only one ($9.99) but it looks abandoned. Also according to "package preview" it has only 10 files (only 1 script related to OC and 1 shader) which is definitely not enough to do this task properly

    Others do it on CPU with raycasts
     
  28. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,024
    Thanks for the info, ah so your asset differs mostly by doing the work on the GPU, if I understand correctly.
     
  29. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    Compared to the ones using raycasts? The main difference is that they need colliders on every object, and to avoid false positive occlusion, they better be MeshColliders.
     
    khos likes this.
  30. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    GDOC demo 1.2-rc2

    — Fixed a bug caused groups to work incorrectly with "without shadows" management mode
    — Changed the way LOD Groups are scanned: now only the renderers of the original LODGroup are put into the GDOC_Occludee, while other children of the group are managed separately.
    — Added experimental VR Multi Pass support (can be enabled in the GDOC settings when VR is on).

    Demo is available for free on Discord: https://discord.gg/GhKTEXy

    @TanselAltinel check it out!
     
    TanselAltinel likes this.
  31. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    318
    What setup is needed for it to work?
     
  32. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    153

    Just purchased this.
    Will update here with my impressions (though I don't think I need to say as much :) )
     
    drcrck likes this.
  33. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    Last edited: Mar 22, 2019
  34. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    Check out "best practices" in the first post
     
  35. Firlefanz73

    Firlefanz73

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

    with the update I get a error message:

    ArgumentNullException: Value cannot be null.
    Parameter name: shader
    UnityEngine.Material..ctor (UnityEngine.Shader shader) (at C:/buildslave/unity/build/Runtime/Export/Shader.bindings.cs:105)
    Bearroll.GDOC.OnEnable () (at Assets/GDOC/Scripts/GDOC/GDOC.cs:272)
    Bearroll.GDOC.Awake () (at Assets/GDOC/Scripts/GDOC/GDOC.cs:189)

    Where do I have to set a shader?

    Thanks :)
     
  36. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    It must be in the Bearroll/GDOC/Resources folder
    I just imported the package uploaded to the asset store into an empty project and the shader is there
    Make sure you restarted Unity and deleted the previous version (especially if it was 1.0)
     
    Last edited: Mar 23, 2019
  37. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,831
    Does this work with meshes rendered via DrawMesh/DrawMeshInstanced/DrawMeshInstancedIndirect?
     
  38. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    It doesn't
    In future versions there will be API that will allow you to define occlusion shapes ("virtual", not bound to scene objects) and use them in your code
    Unfortunately, there is no way to do it automatically
     
  39. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    GDOC 1.2.1
    — Fixed a bug caused GDOC_DemoScene to overwrite scenes inherited from the default sample scene.

    In case you're not sure how you created your scenes, please don't use old versions to avoid data loss.

    1.2.1 will be available on the asset store approx tomorrow
    Also it's posted on Discord: https://discord.gg/GhKTEXy
    (Pm me your invoice number to get access to the private section)
     
  40. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    353
    I need 2 cameras . How is the set up of this? Is it just add a componet to every object? Or is there a wizard, or just slap it on the camera and off to the races?
     
  41. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,182
    Hi drcrck,

    does your asset also deactivate child meshes that are (child) parts of a (skinned) mesh? I have a Skeleton that should have a sword, but it sometimes does not have. I am not sure why, maybe also a problem of my own code.... :)

    Thanks :)
     
  42. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    if you need to switch cameras, you simply add GDOC to both and then enable/disable cameras when needed (though it will cause a rescan. it will be improved in future versions)
    if you need 2 cameras with different matrices rendering simultaneously with OC, it's not supported yet

    You need to mark these objects as Dynamic or exclude them from OC (by layer or by adding GDOC_Occludee/GDOC_Group)
     
  43. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,182
    Using Enviro at night the GDoc component has a warning on it:

    Light error: lightisnotfromabove

    Don't know if that's a Problem, everything seems to work fine :)
     
    GorkaChampion likes this.
  44. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    Last edited: Apr 3, 2019
  45. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    Small update released, already available on the asset store
    GDOC 1.2.2
    — Fixed minor bugs
    — Now game objects with Animator component and all their children are processed as dynamic occludees by default (by automatically adding GDOC_Group so it has higher priority than layer rules. Can be disabled in settings).

    Download demo package to test it in your project:
    https://drive.google.com/file/d/1dehcHM6Yxdb-MzKLVbxbzQIJSYKWM-WJ

    Purchase it on the Asset Store:
    https://assetstore.unity.com/packages/tools/utilities/gdoc-dynamic-gpu-occlusion-culling-139079
     
  46. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,127
    I noticed this too, when increasing GDoc accuracy to 100
     
  47. Ecocide

    Ecocide

    Joined:
    Aug 4, 2011
    Posts:
    292
    I am very interested as we are pretty much CPU bound all the time and there is a lot of free calculation time left on most GPUs. However, we need a setup so it works with multiple cameras (for example a triple screen setup). Do you plan to add this anytime soon?
     
  48. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    299
    no eta for multiple cameras yet.
    most likely, in the 2.0 version that won't depend on native dll

    Meanwhile, GDOC 1.3-rc1 is available

    upload_2019-4-6_2-46-44.png

    — Shadowmap based shadow blocking testing is removed (it wasn't enabled by default in latest versions you won't notice any difference).
    — Teleport detection now also enables objects within Minimum Distance.
    — Camera Depth Texture is no longer required in Forward.
    — Experimental VR Single Pass Instanced support added

    Please restart Unity, then delete previous version before importing

    Demo (and full package for customers, PM me your invoice ID on discord) are available on Discord: https://discord.gg/GhKTEXy
     
  49. HeXiaomMin

    HeXiaomMin

    Joined:
    Mar 17, 2015
    Posts:
    4
    Is it possible to run it on mobile phones in the future?
     
  50. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    811
    Hi, this asset looks very promising!
    I just bought it without any hesitate.
    I see that the culling for dynamic renderers are much slower than static ones, which is very reasonable, but I want to know if there can be any chance for me to change the status of my renderers between static and dynamic.
    I'll have many items generated by player's progress in my game, and upon generation they will need physics. But after they got stationary, I'll lock their rigidbody to save performance, but upon pickup by player or other AI agents, the item will be set to dynamic inorder to move in the scene.
    In my case, I want to know if the occluding system can let me mark all the locked items into the static occluding queue, and move them into dynamic when moved or picked up?
     
unityunity