I want to create a simple radar sensor by using ray-traycing.
The reson to use ray-tracing is that I need tha path information with multiple reflections.
I used SingleLineTraceByChannel. But it did not reflect.
So, I thought that I should use the ray-traycing.
I want to implement the function by C++ codes.
Could you give me some advice about which functions and variables should I use, etc… ?
The linetrace functions defined in UWorld don’t include bouncing, they’re straight-forward collision checks between two points using different methods. What you could do is process the FHitResult param populated in the function call - specifically use FHitResult’s ImpactNormal to calculate the bounce/outgoing vector (the angle between the ingoing vector and the impact normal is the same as the angle between the outgoing vector and the normal). You will manually have to keep track of how many times to bounce the rays.
On a side note, in general the geometry and traces in game dev are absolute/theoretical and probably won’t simulate reality very well unless you have very high resolution meshes, but I’m not quite sure what you’re trying to do.
Hi, staticvoidlol .
I appreciate your great comments.
My radar model casts a lot of rays (for example above 10000), and receives the rays which are reflected by objects.
If I use LineTraceByChannel, it will take a lot of time to simulate with CPU.
I thought that if I could utilize ray-tracing infomation with GPU, the simulation speed became fast.
But, after a lot of google searches, I could not find how to get infomation from ray tracing.
I know the issue about mesh size which you said.
But in this case, the mesh size is not going to be problem.
Thank you !
Makes sense - all I can suggest is trying to find the ray-tracing rendering code in the engine source to see if you can utilize that. I haven’t ever looked at that so unfortunately I won’t be much help further. Good luck.
I’m glad to hear advice.
I’m going to keep trying to solve it!
Did you find a way to access the GPU raytracing API?
I’m also interested in this in order to create a LIDAR sensor using GPU raytracing, but cannot find any documentation or API at all for “manual” raycasts.