nsdev
02-14-2011, 09:33 AM
Hello everybody,
We are developing an application that applies filters to images and we extensively use the GPU via OpenGL and GLSL shaders for that. We currently experience a strange anomaly in the application: the result of one of our most complex shaders is sometimes darker than it should be or even completely black. "Sometimes" means like out of 50 processed images 3-4 will contain the anomaly (never the same images). If we process again the "faulty" images they will most likely come out OK.
Now for a quick description of how we use OpenGL to filter:
- bind the result texture to a FBO;
- compile/link/set the GLSL shaders to be used (vertex shader and fragment shader, GLSL v1.1);
- bind the needed texture units (11 texture units for the case of the shader exposing the anomaly);
- set the uniforms used by the shader;
- finally render to the FBO;
- none of the textures used are bigger than 1024x1024 (neither the textures used as input or the texture bound to the FBO); the anomaly when present it affects the whole output texture in the same way (meaning that is either completely black or completely darker than it should normally be)
- we check for OpenGL errors at quite all used functions;
All of the shader uniforms and input textures were checked both for the "darker" or black results and for the successful case and they were correct. Only the output texture differs.
The anomaly seems to be independent of GPU (happens both on NVidia and ATI) and also OS independent (Win Vista, Win7 and MacOS 10.5 and 10.6).
Anybody has any idea of what we may deal with here? Some ideas of how we could nail this problem? We kind of ran out of ideas so any help would be very appreciated.
Best regards to everyone!
We are developing an application that applies filters to images and we extensively use the GPU via OpenGL and GLSL shaders for that. We currently experience a strange anomaly in the application: the result of one of our most complex shaders is sometimes darker than it should be or even completely black. "Sometimes" means like out of 50 processed images 3-4 will contain the anomaly (never the same images). If we process again the "faulty" images they will most likely come out OK.
Now for a quick description of how we use OpenGL to filter:
- bind the result texture to a FBO;
- compile/link/set the GLSL shaders to be used (vertex shader and fragment shader, GLSL v1.1);
- bind the needed texture units (11 texture units for the case of the shader exposing the anomaly);
- set the uniforms used by the shader;
- finally render to the FBO;
- none of the textures used are bigger than 1024x1024 (neither the textures used as input or the texture bound to the FBO); the anomaly when present it affects the whole output texture in the same way (meaning that is either completely black or completely darker than it should normally be)
- we check for OpenGL errors at quite all used functions;
All of the shader uniforms and input textures were checked both for the "darker" or black results and for the successful case and they were correct. Only the output texture differs.
The anomaly seems to be independent of GPU (happens both on NVidia and ATI) and also OS independent (Win Vista, Win7 and MacOS 10.5 and 10.6).
Anybody has any idea of what we may deal with here? Some ideas of how we could nail this problem? We kind of ran out of ideas so any help would be very appreciated.
Best regards to everyone!