1Name 2 3 NV_shadow_samplers_cube 4 5Name Strings 6 7 GL_NV_shadow_samplers_cube 8 9Contributors 10 11 Mathias Heyer, NVIDIA 12 Greg Roth, NVIDIA 13 14Contacts 15 16 Greg Roth, NVIDIA (groth 'at' nvidia 'dot' com) 17 18Status 19 20 Complete 21 22Version 23 24 Date: Aug 30, 2012 25 Revision: 4 26 27Number 28 29 OpenGL ES Extension #147 30 31Dependencies 32 33 Requires OpenGL ES 2.0. 34 35 Written based on the wording of the OpenGL ES 2.0.25 Specification. 36 37 Written based on the wording of The OpenGL ES Shading Language 38 1.00.14 Specification. 39 40 Requires OES_depth_texture_cube_map and EXT_shadow_samplers. 41 42Overview 43 44 This extension expands the shadow map capability described in 45 EXT_shadow_samplers to include support for shadow samplers of cube 46 map textures. 47 48New Procedures and Functions 49 50 None 51 52New Tokens 53 54 Returned in <type> by glGetActiveUniform: 55 56 GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5 57 58New GLSL defines 59 60 #define GL_NV_shadow_samplers_cube 1 61 62New GLSL sampler types 63 64 samplerCubeShadowNV 65 66New GLSL functions 67 68 float shadowCubeNV(samplerCubeShadowNV sampler, vec4 coord); 69 70Additions to Chapter 2 of the OpenGL ES 2.0.25 Specification (OpenGL ES 71Operation) 72 73 Modify Section 2.10.4 (Shader Variables) 74 75 In the final sentence on p. 36 add "SAMPLER_CUBE_SHADOW_NV" to the 76 list of types that can be returned in the <type> parameter of 77 GetActiveUniform. 78 79Additions to OpenGL ES Shading Language 1.00.14 Specification 80 81 Modify Section 4.1, (Basic Types): 82 83 Append the following row to the unnamed table in section 4.1 84 85 Type Meaning 86 --------------- --------------------------------------------------------- 87 samplerCubeShadowNV a handle for accessing a Cube depth texture with comparison 88 89 90 Modify section 4.5.3 (Default Precision Qualifiers): 91 92 Add to the list of predeclared globally scoped default precision 93 statements: 94 95 "precision lowp samplerCubeShadowNV;" 96 97 Modify section 8.7 (Texture Lookup Functions): 98 99 Add the following new texture lookup function: 100 101 The built-in texture lookup function shadowCubeNV is optional, 102 and must be enabled by 103 104 #extension GL_NV_shadow_samplers_cube : enable 105 106 before being used. 107 108 Syntax: 109 110 float shadowCubeNV(samplerCubeShadowNV sampler, vec4 coord) 111 112 Description: 113 114 Use texture coordinate (coord.s, coord.t, coord.p) to do a depth 115 comparison lookup on the depth cubemap bound to sampler, as 116 described in section 3.7.14.1. The direction of the vector (coord.s, 117 coord.t, coord.p) is used to select which face to do a two- 118 dimensional texture lookup in, as described in section 3.7.5 of the 119 OpenGL ES 2.0 specification. The fourth component of coord (coord.q) 120 is used as the R value. The texture bound to sampler must be a depth 121 cubemap, otherwise results are undefined. 122 123Issues 124 125 (1) Should the result of the texture comparison be interpreted as 126 a LUMINANCE, INTENSITY or ALPHA texel? 127 128 RESOLVED: A scalar value is returned from the shadow lookup built-in 129 function in the fragment shader, so it can be interpreted however desired. 130 131Revision History 132 133 Rev. Date Author Changes 134 ---- ------------- --------- ---------------------------------------- 135 4 30 Aug 2012 groth Added missing NV suffixes 136 3 28 Aug 2012 groth Minor copy edits 137 2 19 Aug 2012 groth Correct dependency and GLSL enable 138 1 12 Aug 2012 groth Initial GLES2 version from EXT_gpu_shader4. 139