Ive been trying to implement instant radiosity with OpenGL. I wont go through details but what ive been trying to do is :
We have many lightsources and we want to get illumination of a scene with them. Ive been using accumulation buffer ( cos in opengl there is max 8 lights in one go ) and gl spot lights.
Problem was that with glLightfv( Lightn, GL_DIFFUSE, LightIntensity); LightIntensity values are clumped to 1.0 and radiosity can be much bigger then one. Ive tried to do the trick LightIntensity /= 1000 and then with for every call of glAccum do glAccum( GL_ACCUM, 1000 ); unfortunetely that isnt possible without extension i believe.
So in order to make it possible ive started using ARB_color_buffer_float extension with glew.
Ive initialised glew and check if extension was available
GLenum err = glewInit();
if (GLEW_OK != err)
/* Problem: glewInit failed, something is seriously wrong. */
fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
if( glewIsSupported("GL_ARB_color_buffer_float") )
It was working fine.
Then before rendering ive used
Program is compiling and works but unfortunetely results are still or
black screen or completly white ( depending on parameters )
Ive tried to simulate basic equation of global illumination with spotlights .Something like this :
glLightfv( OpenGlLights[iLightIndeks], GL_DIFFUSE, LightDiffusse);
glLightfv( OpenGlLights[iLightIndeks], GL_POSITION, LightSpotPosition);
glLightfv( OpenGlLights[iLightIndeks], GL_SPOT_DIRECTION, LightSpotNormal );
glLightf( OpenGlLights[iLightIndeks], GL_SPOT_CUTOFF , light0SpotCutoff);
glLightf( OpenGlLights[iLightIndeks], GL_QUADRATIC_ATTENUATION, 1);
I think that something is wrong with colors clamping.
Any ideas ? How can i check it out(debug and stuff )? (besides basic
knowledge of open gl i dont have experience with extension and more advanced stuff.
Any help will be apprecieted.