raycast with distance
#1
Hi

is there a way to raycast within a certain distance from an object?

i can raycast and cull after , but would that not waste computing time?
i am working on a BIG scene with lots of objects, hence why i would like to raycast within a radius so to speak


cheers

Harv
  Reply
#2
I don't really understand what you're asking to do. Which operator are you trying to raycast with and why?
  Reply
#3
(10-11-2021, 04:31 AM)tyFlow Wrote: I don't really understand what you're asking to do. Which operator are you trying to raycast with and why?

 i want to raycast from a sphere which is emitting into a large scene,  the sphere is moving around the scene.  Essentially faking a lidar type of look.
As the sphere emits and moves through the scene , the points are raycast to scene objects, and the "scan" builds up.

Everything works as expected , its just that when the sphere is high up it raycasts out to scene objects that are further away than I want it to raycast too .

I can delete these with a outside surface operator no problem , but I thought it maybe a little quicker computing wise if there was a way to raycast with a "max radius"  setting ,so to speak. Rather than raycasting to far away objects first  , then deleting.

hope that makes sense?
 Smile

cheers
Harv


Attached Files Thumbnail(s)
   
  Reply
#4
Oh, you mean with the Position Raycast operator? Raycasting itself is pretty cheap...the longest time is usually spent building the acceleration structures, especially if your input meshes are deforming.

Are you working in a scene where Position Raycast is prohibitively slow?
  Reply
#5
(10-11-2021, 02:13 PM)tyFlow Wrote: Oh, you mean with the Position Raycast operator? Raycasting itself is pretty cheap...the longest time is usually spent building the acceleration structures, especially if your input meshes are deforming.

Are you working in a scene where Position Raycast is prohibitively slow?

Sorry , yes the position raycast.
 no its not slow at all Smile
 but was just thinking that it "may" slow things down, seemed a tiny bit of a waste raycasting and then deleting, that's all really Smile


thanks Tyson

Smile
  Reply
#6
I see, yea I wouldn't sweat it....the performance boost you'd gain by culling the initial casts if they don't hit something within a certain range wouldn't be that big. Perhaps at some point I will add an option from the operator to delete particles that don't hit anything within a certain distance, just to skip the middleman.
  Reply
#7
cheers Tyson
  Reply
#8
I'd love to see raycasting have a distance feature - it's the first one I've seen not to have it and definitely would be useful to be able to say "if within range of surface, test true or project the hit" rather than it be infinite. If it's possible to put on the roadmap, that would be killer

Thanks guys!

AM
  Reply
#9
Yea, I can add that.
  Reply


Forum Jump: