tyFlow Forum
raycast with distance - Printable Version

+- tyFlow Forum (https://forum.tyflow.com)
+-- Forum: tyFlow Discussion (https://forum.tyflow.com/forum-1.html)
+--- Forum: General Discussion (https://forum.tyflow.com/forum-2.html)
+--- Thread: raycast with distance (/thread-2695.html)



raycast with distance - dr_ron69 - 10-08-2021

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


RE: raycast with distance - tyFlow - 10-11-2021

I don't really understand what you're asking to do. Which operator are you trying to raycast with and why?


RE: raycast with distance - dr_ron69 - 10-11-2021

(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


RE: raycast with distance - tyFlow - 10-11-2021

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?


RE: raycast with distance - dr_ron69 - 10-11-2021

(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


RE: raycast with distance - tyFlow - 10-11-2021

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.


RE: raycast with distance - dr_ron69 - 10-11-2021

cheers Tyson


RE: raycast with distance - amckay - 11-13-2022

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


RE: raycast with distance - tyFlow - 11-16-2022

Yea, I can add that.