Shadow map performance with ATI Catalyst 6.11

Hi,

i found out that my OGL application gets really slow once i enable shadow mapping.

The shadow map generation does not cost much performance(120->100fps), but once i sample the shadow map in my fragment shader it drops to below 30 fps.

After some testing i found out that this behaviour is hardware/driver dependant:

  • 8800 GTS: very fast with current drivers
  • X800: >50fps with Cat 5.8, 6.10, 6.11, 7.8
  • X1900: ~100fps with CAT6.10, <30fps with Cat6.11, 7.3, 7.8
  • X2900: below 30fps with cat 7.8
    Visuals are correct on all configs.

My guess is that the GL driver implementation changed after 6.10 for the newer chips… but what can i do to make it fast again with current drivers?

Thats my shadow map texture setup:

  
glBindTexture(GL_TEXTURE_2D,m_shadowTexName); CHECKGLERROR;
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); CHECKGLERROR;
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); CHECKGLERROR;
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER_ARB); CHECKGLERROR;
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER_ARB); CHECKGLERROR;
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE_ARB); CHECKGLERROR;
	// content is initially undefined(0 pointer for data)
	glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, shadowX, shadowY, 0, GL_DEPTH_COMPONENT, GL_BYTE, 0); CHECKGLERROR;

Tried GL_DEPTH_COMPONENT16/24, GL_CLAMP/GL_REPEAT =>no effect.

The shadow sampling code:

  
"!!ARBfp1.0 OPTION ARB_fragment_program_shadow;  

"
(...)
"TEX s0, centerSample, texture[2], SHADOW2D;   
" 

Tried TXP instead of TEX=>no effect
Tried 2D(instead SHADOW2D) and disabling GL_COMPARE_R_TO_TEXTURE_ARB => no effect.
Commenting out the TEX gives the high performance, but without shadows of course.

Any idea what else to try? Did someone experience similar problems?

Best regards,
Martin

PS: I also tried to sign up with AMD support, but i only got the autoreply “Your request to open a new customer account has been received” a week ago.

->glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, shadowX, shadowY, 0, GL_DEPTH_COMPONENT, GL_BYTE, 0); CHECKGLERROR;

i believe ati only supports 24 bit depth
the GL_BYTE seems a bit suss

GL_BYTE is the external format, he’s passing a null buffer anyway so it’s royally ignored.

GL_DEPTH_COMPONENT as internal format will get converted by the driver to one of the GL_DEPTH_COMPONENT_16, _24 or _32, so it’s unlikely to be the problem.