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

Discussion Corgi Async Raycasts - Move your raycasts off of the main thread! [Released!]

Discussion in 'Assets and Asset Store' started by funkyCoty, Dec 17, 2023.

  1. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    740
    Corgi Async Raycasts allow you to easily leverage Unity's built in Jobified raycasts system. It provides an extremely simple to use API for moving your raycasts off of the main thread.

    ~Documentation~
    ~Asset Store~
    ~Discord~

    upload_2023-12-16_16-55-15.png

    Features:
    * Simple to setup and easy to use. Drop in a prefab and the API is ready to use!
    * VERY fast and provides an alternative API which is a bit slower but even easier to use.
    * Works on all platforms Unity supports!
    * Includes a simple demo scene to explain the API!
    * Includes full source code!
     
    Last edited: Feb 24, 2024
    adamgolden likes this.
  2. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    740
    It's finally live!
     
  3. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    740
    First update is live.

     
    iddqd likes this.
  4. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    503
    Hey @funkyCoty

    Once again a great asset!

    Do you have any idea why I'm not seeing a difference in performance?
    I'm using 50000 cubes and am getting around 5-7fps with all three methods.

    I added:
    Code (CSharp):
    1.        
    2. private void OnRaycastHit(RaycastHit hitInfo)
    3. {
    4.             return;
    5. ...
    6.  
    in DemoCubeRaycastGround.cs - so the cube doesn't actually move and I also remove the Rotation of the whole Circle.

    It would be interesting to have a pure benchmark Scene to see the actual performance difference.

    Thanks
     
  5. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    740
    Can you post profiler results? getting 5 fps with 50,000 cubes.. you might just be bottlenecked by cube rendering lol. Also, as the documentation suggests you should avoid that API in particular, use the one that gives tickets and it'll be faster overall
     
  6. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    740
    small update just pushed