I need to calculate how many pixels in my scene are of white color. For this purpose i use a call to glReadPixels function, with the following parameters:
float colors[3*600*600];
glReadPixels(0,0,600,600,GL_RGB,GL_FLOAT,colors);
But all i get - is memory overlfow or or somthing like that - the computer reboots...
When i use
float colors[3*600*600];
glReadPixels(0,0,1,1,GL_RGB,GL_FLOAT,colors);
that is when i read a single pixel - everything goes ok...
So, i wonder, where is the whoel memory going? is the scene too big? (0,0,600,600 - in windows coordinates) or do i have to pass some other parameters to glReadPixels()?
Thanks in Advance :)
edit: formatting...