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

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~

9533812--1345696--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!
1 Like

It’s finally live!

First update is live.

1 Like

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:

private void OnRaycastHit(RaycastHit hitInfo)
{
            return;
...

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

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

small update just pushed

It’s neat but I’m not getting performance increase (at least in editor).
Seems like overhead for scheduling gives worse performance.
10000 raycasts
default unity ~55ms main thread 17fps
raycast tickets ~65ms main thread 15fps
async callbacks ~80ms main thread 12fps

Nonetheless, I wanted to try jobified raycasts, and this is a good performance test.

Would you mind repeating your test in a build? I’ve been using this plugin in real projects and have only had gains from it. Profiling within the editor is often misleading.