• Advertisement
Sign in to follow this  

clip planes - shadow mapping

This topic is 4831 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im trying to set up clipping planes around my shadow map light, as to eliminate any artifacts.... now the problem im having is getting the planes in to eye space. i currently to project my depth map in to the scene i do: bias matrix * perspective matrix * light transform * inverse camera transform for the clip planes, i know i have to loeave out the bias matrix, and am wondering how to get the planes to eye space? to generate the planes im wanting to extract the planes from the matrix at some stage. hopefully this is clear :-/ so i need my clip planes in eye space which is the problem.... which matrix to extract from eg. perpsective * light trans. then somehow transform them to eye space? or is persp. * light trans. * inv. camera trans in eye space so all i would have to do is extract planes form this matrix?

Share this post


Link to post
Share on other sites
Advertisement
why do u need clipplanes? to eliminate the backwards projection perhaps?
i dont think clipplanes are the way to go

Share this post


Link to post
Share on other sites
Don't forget clipping planes are not hardware accelerated on NVidia cards - i'd consider switching to another solution (ie. doing the culling in a fragment shader with texkill, or with the alpha test and the fixed function pipeline).

Y.

Share this post


Link to post
Share on other sites
to eliminate back projections and projections/glithes out the sides.....

[Edited by - supagu on October 24, 2004 6:04:57 AM]

Share this post


Link to post
Share on other sites
>>to eliminate back projections and projections/glithes out the sides...<<

sorry didnt see your post, the side projections are easily solved by supplying a clear edge to your texture, preferably with GL_CLAMP_TO_BORDER (not in hardware on gf2 and under) or using GL_CLAMP_TO_EDGE/CLAMP and not drawing in the outside 1x1 pixels u can use glScissor to restrict this.

the back projection can be solved like Ysaneya suggested, i personally disacrd them in the fragment program

Share this post


Link to post
Share on other sites
ah that worked greatr clamp to border, i was using clamp to edge which wasnt nice.

still i need a back clip plane because im not using shaders....

so far i have set up the GL_MODEL_MATRIX to have the cameras transform so when i set up my clip planes its set up for camera (so i only need my clip planes in world space

ive tried:
light perspective matrix * light world transform

but this doesnt work :-/ i also tried light perspective * light view transform.

[Edited by - supagu on October 30, 2004 4:43:54 AM]

Share this post


Link to post
Share on other sites
so u want to use a clipplane?
the 4 numbers in the equation are just the ABCD of a planes quation ie the first 3 are the direction vector + the fourth is the distance along this vector.
thus set the first three to point in the opposite direction of the lighting (normalize the vector first) and then stick in the planes distance from the origin in the fourth number, else u can leave that at zero, and just translate to the lights position and then enable the clipplane

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement