EXT_clip_cull_distance WebGL working group (public_webgl 'at' khronos.org) Members of the WebGL working group XYZ Adds support for hardware clip planes and cull distances to OpenGL ES. [NoInterfaceObject] interface EXT_clip_cull_distance { const GLenum MAX_CLIP_DISTANCES_EXT = 0x0D32; const GLenum MAX_CULL_DISTANCES_EXT = 0x82F9; const GLenum MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT = 0x82FA; const GLenum CLIP_DISTANCE0_EXT = 0x3000; const GLenum CLIP_DISTANCE1_EXT = 0x3001; const GLenum CLIP_DISTANCE2_EXT = 0x3002; const GLenum CLIP_DISTANCE3_EXT = 0x3003; const GLenum CLIP_DISTANCE4_EXT = 0x3004; const GLenum CLIP_DISTANCE5_EXT = 0x3005; const GLenum CLIP_DISTANCE6_EXT = 0x3006; const GLenum CLIP_DISTANCE7_EXT = 0x3007; };
    #extension GL_EXT_clip_cull_distance : enable

    // Vertex shader
    out highp float gl_ClipDistance[2];
    out highp float gl_CullDistance[2];

    void main(){
        // Compute the clip and cull distances for this vertex
        gl_ClipDistance[0] = ...;
        gl_CullDistance[0] = ...;
        gl_ClipDistance[1] = ...;
        gl_CullDistance[1] = ...;
    }
    
Initial revision.