Original Post
Hi all, I am trying to implement GPU based histogram generation. I want to use the method given here but there are some steps that I m not able to grasp. From my reading, the following is how this is done. The algorithm renders point primitive for each pixel. There are two steps 1) Calcualtion of the histogram bin index In the vertex shader, the bin index is calculated, this is easily done using the following vertex shader code assuming that the color attribute is assigned with each point. After the bin location is calculated, it is converted to an output location that maps into the 1D bin texture. Now this is something I m not able to understand. Does it mean that I use the index and output a specific position something like this, this will output position from [0---1,0] in clipspace. So how does it relate to the histogram texture? Do I render my histogram texture at exactly the same position using a seperate render target? 2)Accumalation of the histogram bins This is achieved by setting the blend mode as follows Now the thing that i dont get is what will the geometry that i will be rendering on this rendertarget? If anyone can give pointers to any detailed docs or perhaps someone who has implemented this before, please help. Thanks, Mobeen
half3 channel=half3(0.299, 0.587, 0.114);
half index = dot(IN.Color, channel);
OUT.position = half4(index,0,0,1);
glBlendMode(GL_ONE, GL_ONE);