Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Spatial queries
#2
(25-10-2023, 07:12 AM)CosmosST Wrote: Hi,

I have two emitters parented by the same solver on the scene. Their particle systems are turned as I don't need it.  And I want to apply spatial queries to both of the emitters fluid particles. 

What is the best way for an efficient query on the both actors at the same time ? 
The obvious method is setting a for-loop on an actors solverIndices and make the query and open another for-loop for going through the results. But what is the better way if I would like to combine a query on both emitters ? Running a for-loop on each actor separately ?

Hi,

All spatial queries are performed on a per-solver basis, all actors in the solver are queried in parallel. No need to use a for loop over individual actors. It's also possible to perform multiple queries in parallel, so you can for instance issue 10 raycasts against all actors in the solver in a single call. See:
http://obi.virtualmethodstudio.com/manua...eries.html



(25-10-2023, 07:12 AM)CosmosST Wrote: Another question is; I see a a significant framerate drop when running a spatial query. Would it be an idea to use a compute shader for running a similar process ? 

The cost of bringing back query results from the GPU would quickly exceed the cost of performing the query on the CPU, as if you want query results on the same frame you've requested them this will stall the GPU and force it to flush the entire pipeline.

This said, Obi 7 (released later this year) has a full compute-shader based physics backend. Queries in that backend can be performed, but have a few frames of latency which means you get the results asynchronously a few frames after requesting the query.

kind regards,
Reply


Messages In This Thread
Spatial queries - by CosmosST - 25-10-2023, 07:12 AM
RE: Spatial queries - by josemendez - 25-10-2023, 07:19 AM
RE: Spatial queries - by CosmosST - 30-10-2023, 08:00 AM