Black scenes issue on nvidia cards

Hi,

I just did some kind of opengl / glsl demo and i noticed that some of the scenes appeared simply black or seemed to have some components clampled between 0.8 and 1 instead of 0 to 1.

Seems like the GLSL shaders compile everywhere; they are also validated on the 3DLabs tool. On all ATI cards, the demo looks correct. On all GeforceFX and up cards, the issue above appears.

It is interresting to note that most scenes use the same shader, and most scenes are rendered correctly on the nvidia cards. The only “fancy” thing is maybe using not really standard blending modes.

I wondered if anyone had this issue before me, and if so, how to overpass it…
have a nice day…

  • gamma settings ?
  • antialising ?
  • uninitialized values ?
  • can you describe in detail your “not really standard blending modes” ?

If you suspect blending issues, compare the pixelformats you got on either board for the number of destination alpha bits.
glGetIntegerv(GL_ALPHA_BITS, &alphaBits)
Maybe you got alpha bits on one and not on the other.
If you use GLUT the pixelformat selection needs to contain GLUT_ALPHA.

so,

  • gamma settings: none i think.
  • multisampling 4x is activated.
  • blending modes are random combinaisions of standard opengl blending enumerants, no extensions were used.

download link for the demo

about uninitialized variables, that’s a very good question actually… what has to be initialized to defaults? :slight_smile:

thanks for the quick answers…

right, seems like there might be an issue with the pixel format:

		// FSAA pixel format attributes.
		int pFSAAattribs1[] = 
		{ 
			WGL_SUPPORT_OPENGL_ARB, true,
			WGL_DRAW_TO_WINDOW_ARB, true,
			WGL_DOUBLE_BUFFER_ARB, true,
			WGL_COLOR_BITS_ARB, config->colorbuffer, 
			WGL_DEPTH_BITS_ARB, config->zbuffer, 
			WGL_STENCIL_BITS_ARB, config->stencilbuffer,
			WGL_SAMPLE_BUFFERS_ARB, true,
			WGL_SAMPLES_ARB, config->multisampling,
			0
		};
		static PIXELFORMATDESCRIPTOR pfd =
		{
			sizeof(PIXELFORMATDESCRIPTOR),
				1,
				PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,
				PFD_TYPE_RGBA,
				(unsigned char) config->colorbuffer,
				0,0,0,0,0,0,0,0,0,0,0,0,
				config->zbuffer,
				config->stencilbuffer, 0 ,
				PFD_MAIN_PLANE,
				0,0,0,0 
		};