UsmanJafri/LiDAR-GTA-V

A way to accelerate point cloud sampling

gdpinchina opened this issue · 4 comments

I have done a same work in my repo. May I point out? There is a way to accelerate point cloud sampling.
Drawing a box on each sampling dot may accelerate the sampling process. I dont know why, but it just works. I think it maybe reduce the time cost in each calling of API "WORLDPROBE::_CAST_RAY_POINT_TO_POINT". I got about 25 frames per second with GTX1080Ti, and each frame I sampled 1000 points.

//I dont kown why, activate these seem to be more fluently
	if (_isVisual) {
		GRAPHICS::DRAW_BOX(endCoord.x - 0.05f, endCoord.y - 0.05f, endCoord.z - 0.05f, endCoord.x + 0.05f, endCoord.y + 0.05f, endCoord.z + 0.05f, (short)0, (short)255, (short)0, (short)255);
	}
GRAPHICS::DRAW_BOX(endCoord.x - 0.05f, endCoord.y - 0.05f, endCoord.z - 0.05f, endCoord.x + 0.05f, endCoord.y + 0.05f, endCoord.z + 0.05f, (short)0, (short)255, (short)0, (short)0);

So where exactly do we need to put this code

After each calling of WORLDPROBE::_CAST_RAY_POINT_TO_POINT

@gdpinchina Thank you for your suggestion! Could you please explain why this would help because the idea of drawing an extra box at every point results in a speed up seems illogical. But nonetheless, I tried this but it always resulted in a game crash. I was testing at 230,400 points.

Deleted @jainrahul1 's comment as the exact same comment was posted elsewhere.