UsmanJafri / LiDAR-GTA-V

A plugin for Grand Theft Auto V that generates a labeled LiDAR point cloud from the game environment.
MIT License
156 stars 31 forks source link

A way to accelerate point cloud sampling #2

Closed gdpinchina closed 6 years ago

gdpinchina commented 6 years ago

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);
PurnaKoteswaraRaoMallepaddi commented 6 years ago

So where exactly do we need to put this code

gdpinchina commented 6 years ago

After each calling of WORLDPROBE::_CAST_RAY_POINT_TO_POINT

UsmanJafri commented 6 years ago

@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.

UsmanJafri commented 6 years ago

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