WebGL Generator for Summed triangle area maps

Generator for building precomputed summed triangle maps by offloading the generation to the GPU. A summed triangle map is the summed area for each possible line on the texture (2 coords) with the zero coordinate, forming a triangle for each line.

This can be used at run-time to determine the area under a triangle on the map by adding and subtracting the sums of the triangles from the lines that make up the triangle, based on the direction of the triangle (cross product)

Approach:

Todo: optimsation - as the two points on a line can be flipped and produce the same area, we only need to sample the second point where it appears above the line to the first point. This will allows us to double the resolution of samples for the same image size.

Time taken: Generating, please wait...