Basically I have a hexagonal mesh, on XY plane, upon which I draw a pseudo-randomly generated landscape.
Then to decide which face is going to be water and which land, I check for white pixels per face. If white pixels > black pixels, it's land, otherwise water.
The way I do it right now is render the buffer offscreen, and then for each pixel on the canvas, I ray cast to know which face the pixel belongs to, and then sum up all the pixels per face. Problem is... the canvas is 1000x700 pixels, and it takes AGES to raycast 700,000 pixels in JS.
So the question is... is there any faster way to know which face is located at arbitrary (x,y) pixel on the canvas, without having to raycast the entire mesh to death