Sign in to follow this  
BlackSeeds

clip plane, not working on nvidia

Recommended Posts

Hi, I have just finished a water shader for a map editor i'm working on. All works fine..well did work fine on my PC (Ati x1950). When i run the program on the computers on the PC's at university (NVIDIA) the clipping plane to clip the reflected geometry which goes above the water plane does not work and hence my reflections don't look right. If you get you eye right down to the water level the reflections become at some point correct, its definitely the clip plane problem because if I disable clip planes on my PC then i get the same results as NVIDIA machines. I have had some issues with NVIDIA vs ATI before where shadow mapping didnt work on nvidia (well the alpha of the texture) and it was because I only used RGBA pixel type and didn't give myself an explicit alpha channel. Is it possible the problem is something like this? ie do i need to give my self some stencil bits in the PFD or something? Any help would be much appreciated, having an ATI machine at home makes it difficult to debug this issue.

Share this post


Link to post
Share on other sites
Hello,

As far as I remember, you have to write a special shader output named gl_ClipVertex. It seems to be the eye space coordinate of the vertex.

Give a look at this thread :
http://www.gamedev.net/community/forums/topic.asp?topic_id=451347

EDIT:

The good way to do it without switching to software with your Ati seems to be :


// fix of the clipping bug for both Nvidia and ATi
#ifdef __GLSL_CG_DATA_TYPES
gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;
#endif



Thibaut.

Share this post


Link to post
Share on other sites
Quote:
Original post by tiburs
Hello,

As far as I remember, you have to write a special shader output named gl_ClipVertex. It seems to be the eye space coordinate of the vertex.

Give a look at this thread :
http://www.gamedev.net/community/forums/topic.asp?topic_id=451347

Thibaut.


thanks for that gl_clipVertex sorted me out :)



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