smarc-project / SMARCUnityAssets

Contains the assorted models, scripts and utils used by all SMARC Unity projects. Standard and HDRP.
1 stars 8 forks source link

Parallelize sonar hit processing #46

Open KKalem opened 1 month ago

KKalem commented 1 month ago

Sonars are raycasting in parallel, but the processing of the results is a simple for loop over thousands of rays. Parallelizing that part would make it even more capable of large number of casts.

https://github.com/smarc-project/SMARCUnityAssets/blob/4277e8ed75acac8b76bae8d5fee7a5729676041c/Runtime/Scripts/VehicleComponents/Sensors/Sonar.cs#L337

martkartasev commented 1 month ago

https://discussions.unity.com/t/completing-raycast-commands-before-processing-them/834372

I think it is possible to combine RayCast Jobs with other types of Jobs https://docs.unity3d.com/ScriptReference/Unity.Jobs.JobHandle.html