• 14
• 12
• 9
• 10
• 9

# clip plane, not working on nvidia

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

## 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 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 on other sites
Quote:
 Original post by tibursHello,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=451347Thibaut.

thanks for that gl_clipVertex sorted me out :)