performance - Rasterize polygons on GPU for hit-testing -
task
perform many hit-tests on polygons. have 10,000 polygons 1,000 points each. 100,000,000 hit-tests performed against these polygons. polygons may touch each other never overlap.
solutionsimple point-in-polygon test every hit-test.
problemfar slow.
improvementrasterize polygons , check polygon pixel of hit-tests belongs to.
new problemrasterization of polygons slow. i'm using algorithm: http://alienryderflex.com/polygon_fill/
idearasterize polygons on gpu since it's optimized task , can perform in hardware.
questionwhat think thought , can give me advice start? lead high performance?
sidenotethe area sparsly covered polygons. want maintain list of pixels instead of bitmap.
this reply suggests utilize gpu if can: point in polygon aka nail test
your case seems dominated nail tests, o(1) rasterization. gpus able rasterize memory, not aware of gpu / rendering api able work list of points. also, list of points, may lose o(1) runtime nail check. may able save memory using 16 bit raster buffer (not sure if that's feasible gpu setup -- seem need 10000 colors).
performance algorithm gpu polygon raster
No comments:
Post a Comment