Help with texture averaging
This feels like it should be a relatively simple problem, but I'm also not great with the opengl api. I'd like to get the average color of a texture WITHIN some triangle/rect/polygon. My first (and only idea) was to utilize the fragment shader for this, drawing the shape's pixels as invisible and accumulating the colors for each rendered texel. But that would probably introduce unwanted syncing and I don't know how I would store the accumulated value.
Googling has brought be to an endless sea of questions about averaging the whole texture, which isn't what I'm doing.