shadow mapping

hello,
i tried to implement shadow mapping using this tutorial
http://www.paulsprojects.net/tutorials/smt/smt.html

but it seems that nothing is drawn to the shadow-map-texture.
is there anything jogl-specific regarding to reading out the depth buffer using
gl.glCopyTexSubImage2D(GL.GL_TEXTURE_2D, 0, 0, 0, 0, 0, shadowMapSize, shadowMapSize);

will i maybe have to use a jogl-PBuffer?

Are you sure nothing is drawn ? I followed the same tutorial and at first I thought nothing was drawn but it’s possible that all the z-values are very close together.

Koen

thanks, you are right, i had the near and far clipping distances wrong…

Hi.

I know I’m digging up an old thread here. I’m just trying to get this working myself here and I’m having trouble understanding how matrices work in jogl and how they’re manipulated. I’ve used the gleem library to convert my float arrays to Mat4f to multiply them. Can anyone tell me if the following look correct?

tm, bm, lvm, lpm are Mat4f of transformMatrix, biasMatrix, lightViewMatrix and lightProjectionMatrix ( all float[16] )

//Calculate texture matrix for projection
		//This matrix takes us from eye space to the light's clip space
		//It is postmultiplied by the inverse of the current view matrix when specifying texgen
		int j=0,k=0;
		for(int i = 0; i < 16; i++) {
			bm.set(j,k,biasMatrix[i]);
			lpm.set(j,k,lightProjectionMatrix[i]); 
			lvm.set(j,k,lightViewMatrix[i]);
			j++; if(j>3) j=0;
			if(j==0) k++;
		}
		
		tm = bm.mul(lpm.mul(lvm));  //equivalent to MATRIX4X4 textureMatrix=biasMatrix*lightProjectionMatrix*lightViewMatrix; ?

I’ve done a lot of googling and searching this forum…

Basically, if anyone has any code they’d be willing to share to help me understand the matrix operations going on in the above tutorial, I would be very, very grateful!!

Thanks in advance…