WebGL
Khronos
 

WebGL EXT_clip_cull_distance Extension Proposed Specification

DO NOT IMPLEMENT!!!

Name

EXT_clip_cull_distance

Contact

WebGL working group (public_webgl 'at' khronos.org)

Contributors

Members of the WebGL working group

Version

Last modified date: August 22, 2016
Revision: 1

Number

WebGL extension #XYZ

Dependencies

Written against the WebGL API 2.0 specification.

Overview

This extension exposes the EXT_clip_cull_distance functionality to WebGL.

There are no WebGL-specific behavioral changes.

Consult the above extension for documentation, issues and new functions and enumerants.

When this extension is enabled:

IDL

    [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;
    };
  

Sample Code

    #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] = ...;
    }
    

Revision History

Revision 1, 2016/08/22