soconne
11-02-2003, 04:58 AM
I'm trying to do projective shadowing and I'm getting the following issue. http://cs.selu.edu/~soconnell/projshadow.JPG
I don't understand why I'm seeing those black boxes then semi-black boxes on the screen. I set the bodercolor of the texture to white but they're still there, and I have clamping on also. Here's my code for updating the shadow texture:
glBindTexture(GL_TEXTURE_2D, depthtexture);
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, TSIZE, TSIZE, 0);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
float bcolor[]={1,1,1,1};
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, bcolor);
Would the problem perhaps be somewhere in this code?
I don't understand why I'm seeing those black boxes then semi-black boxes on the screen. I set the bodercolor of the texture to white but they're still there, and I have clamping on also. Here's my code for updating the shadow texture:
glBindTexture(GL_TEXTURE_2D, depthtexture);
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, TSIZE, TSIZE, 0);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
float bcolor[]={1,1,1,1};
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, bcolor);
Would the problem perhaps be somewhere in this code?