I am very new to the WebGL subject. What I want to do is to calculate the average color of 6 different framebuffers like the ones below in the picture. Now I am wondering what the best way to go about it would be? I tried to do
gl.readPixels(0, 0, 256, 256, gl.RGBA, gl.UNSIGNED_BYTE, pixelValues);
but that seems to be very slow... Is there a way that this can happen on the graphics card?
this is how the FBO is set up - I have this from a tutorial:
...
You have two options
Off the top of my head
I think the shader would look something like this
--fragment shader--