Quantcast
Channel: AMD Developer Forums: Message List - OpenGL & Vulkan
Viewing all articles
Browse latest Browse all 631

Re: why the gl_ClipDistance[] doesn't work?

$
0
0

Sorry for the late reply. Here's how I'm setting clip planes in the vert shader and it's working fine for me on AMD, NVidia and Intel:

 

#if defined(VERT_SHADER) 

outfloat gl_ClipDistance[MAX_CLIP_PLANES]; 


void setClipPlanes(in vec4 worldSpaceVertex){

#   if MAX_CLIP_PLANES > 0

    gl_ClipDistance[0]= dot(worldSpaceVertex, dvd_clip_plane[0]);

#  endif

#   if MAX_CLIP_PLANES > 1

    gl_ClipDistance[1]= dot(worldSpaceVertex, dvd_clip_plane[1]);

#  endif

.........

}

#endif


Viewing all articles
Browse latest Browse all 631

Trending Articles