Original Post
Hello again !
Let me start from the fact I've tried searching for almost 5 days now to find a solution how to project the shadow map by using a CubeShadow in the shaders, and guess what - couldn't find anything.. really.
Here's the deal - i am trying to implement a omnidirectional shadowmap with cubemaps.
i generate a Cube texture 512x512:
And bind it to my Framebuffer with GL_DEPTH_ATTACHMENT.
I render from light position to all 6 faces of Cube starting GL_TEXTURE_CUBE_MAP_POSITIVE_X and iterating 6 times.
Of course i :
And render the geometry, results stored in cube depth map:
EDITOR SHOT, SO YOU CAN SEE THE LIGHT POSITION

NORMAL RENDERING WITHOUT SHADOWS APPLIED

GDEBUGGER - SHOWING CONTENTS OF CUBE TEXTURE

Now, time to 'project' that as a shadow in the shader..
I pass my cube texture to the fragment shader with:
How do i project that as a shadowmap in the shader?
Can i ask you please to help me out with that?
i couldn't find anything related to samplerCubeShadow on the net...
Let me start from the fact I've tried searching for almost 5 days now to find a solution how to project the shadow map by using a CubeShadow in the shaders, and guess what - couldn't find anything.. really.
Here's the deal - i am trying to implement a omnidirectional shadowmap with cubemaps.
i generate a Cube texture 512x512:
glGenTextures(1, &tDepthCubeMap);
glBindTexture(GL_TEXTURE_CUBE_MAP, tDepthCubeMap);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE );
glTexParameterf( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
for (int face = 0; face < 6; face++)
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, GL_DEPTH_COMPONENT32F , 512, 512, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
And bind it to my Framebuffer with GL_DEPTH_ATTACHMENT.
I render from light position to all 6 faces of Cube starting GL_TEXTURE_CUBE_MAP_POSITIVE_X and iterating 6 times.
Of course i :
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);
//
Switch fov to 90
gluPerspective(90, 512/512,1,200);
And render the geometry, results stored in cube depth map:
EDITOR SHOT, SO YOU CAN SEE THE LIGHT POSITION

NORMAL RENDERING WITHOUT SHADOWS APPLIED

GDEBUGGER - SHOWING CONTENTS OF CUBE TEXTURE

Now, time to 'project' that as a shadow in the shader..
I pass my cube texture to the fragment shader with:
uniform samplerCubeShadow shadowMap;How do i project that as a shadowmap in the shader?
Can i ask you please to help me out with that?
i couldn't find anything related to samplerCubeShadow on the net...

: