1Name 2 3 NV_shadow_samplers_array 4 5Name Strings 6 7 GL_NV_shadow_samplers_array 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 #146 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 NV_texture_array 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 2D 46 array textures. 47 48New Procedures and Functions 49 50 None 51 52New Tokens 53 54 Returned in <type> by glGetActiveUniform: 55 56 GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 57 58New GLSL defines 59 60 #define GL_NV_shadow_samplers_array 1 61 62New GLSL sampler types 63 64 sampler2DArrayShadowNV 65 66New GLSL functions 67 68 float shadow2DArrayNV(sampler2DArrayShadowNV 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_2D_ARRAY_SHADOW_NV" to 76 the 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 sampler2DArrayShadowNV a handle for accessing a 2D array depth texture with comparison 88 89 Modify section 4.5.3 (Default Precision Qualifiers): 90 91 Add to the list of predeclared globally scoped default precision 92 statements: 93 94 "precision lowp sampler2DArrayShadowNV;" 95 96 Modify section 8.7 (Texture Lookup Functions): 97 98 Add the following new texture lookup function: 99 100 The built-in texture lookup function shadow2DArrayNV is optional, 101 and must be enabled by 102 103 #extension GL_NV_shadow_samplers_array : enable 104 105 before being used. 106 107 Syntax: 108 109 float shadow2DArrayNV(sampler2DArrayShadowNV sampler, vec4 coord) 110 111 Description: 112 113 Use texture coordinate (coord.s, coord.t) to do a depth comparison 114 lookup on an array layer of the depth texture bound to sampler, as 115 described in section 3.7.14.1. The layer to access is indicated by 116 the third coordinate (coord.p) and is computed by layer = max (0, 117 min(d - 1, floor (coord.p + 0.5)) where 'd' is the depth of the 118 texture array. The fourth component of coord (coord.q) is used as 119 the R value. The texture bound to sampler must be a depth texture, 120 or results are undefined. 121 122Issues 123 124 (1) Should the result of the texture comparison be interpreted as 125 a LUMINANCE, INTENSITY or ALPHA texel? 126 127 RESOLVED: A scalar value is returned from the shadow lookup built-in 128 function in the fragment shader, so it can be interpreted however 129 desired. 130 131Revision History 132 133 Rev. Date Author Changes 134 ---- ------------- --------- ---------------------------------------- 135 4 30 Aug 2012 groth Added missing NV suffixes. Corrected a dependency 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