Sign in to follow this  
Darkn1o

Higher precision depth textures on ATI

Recommended Posts

I'm developing an application on an X1900 that requires higher precision depth textures. I know that this card supports 24-bit depth textures, however the precision in the depth texture thats created always seems to be limited to 16 bits. Even when glGetTexLevelParameter claims that the depth texture is 32 bits, my precision only seems to be at around 16. My initialization code is below. I am also using Catalyst drivers 6.2. On a 6800GT, I've tested this code and it works as expected, so I'm not sure if theres something wrong with the code or with the card.
	glGenTextures(1,&depth);
	glBindTexture(GL_TEXTURE_2D,depth);
	glTexImage2D(GL_TEXTURE_2D,0,GL_DEPTH_COMPONENT24_ARB,TEXSIZE,TEXSIZE,0,GL_DEPTH_COMPONENT,GL_FLOAT,0);
	
	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE_ARB);
	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC_ARB, GL_NONE);
	glGetTexLevelParameteriv(GL_TEXTURE_2D,0, GL_TEXTURE_DEPTH_SIZE_ARB, &test);

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this