15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci NV_shadow_samplers_array 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_NV_shadow_samplers_array 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContributors 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Mathias Heyer, NVIDIA 125bd8deadSopenharmony_ci Greg Roth, NVIDIA 135bd8deadSopenharmony_ci 145bd8deadSopenharmony_ciContacts 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ci Greg Roth, NVIDIA (groth 'at' nvidia 'dot' com) 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciStatus 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Complete 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciVersion 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci Date: Aug 30, 2012 255bd8deadSopenharmony_ci Revision: 4 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciNumber 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci OpenGL ES Extension #146 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ciDependencies 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ci Requires OpenGL ES 2.0. 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ci Written based on the wording of the OpenGL ES 2.0.25 Specification. 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci Written based on the wording of The OpenGL ES Shading Language 385bd8deadSopenharmony_ci 1.00.14 Specification. 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ci Requires NV_texture_array and EXT_shadow_samplers. 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ciOverview 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ci This extension expands the shadow map capability described in 455bd8deadSopenharmony_ci EXT_shadow_samplers to include support for shadow samplers of 2D 465bd8deadSopenharmony_ci array textures. 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ciNew Procedures and Functions 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ci None 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ciNew Tokens 535bd8deadSopenharmony_ci 545bd8deadSopenharmony_ci Returned in <type> by glGetActiveUniform: 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ci GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ciNew GLSL defines 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci #define GL_NV_shadow_samplers_array 1 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ciNew GLSL sampler types 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ci sampler2DArrayShadowNV 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ciNew GLSL functions 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci float shadow2DArrayNV(sampler2DArrayShadowNV sampler, vec4 coord); 695bd8deadSopenharmony_ci 705bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL ES 2.0.25 Specification (OpenGL ES 715bd8deadSopenharmony_ciOperation) 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ci Modify Section 2.10.4 (Shader Variables) 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ci In the final sentence on p. 36 add "SAMPLER_2D_ARRAY_SHADOW_NV" to 765bd8deadSopenharmony_ci the list of types that can be returned in the <type> parameter of 775bd8deadSopenharmony_ci GetActiveUniform. 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ciAdditions to OpenGL ES Shading Language 1.00.14 Specification 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ci Modify Section 4.1, (Basic Types): 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci Append the following row to the unnamed table in section 4.1 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci Type Meaning 865bd8deadSopenharmony_ci --------------- --------------------------------------------------------- 875bd8deadSopenharmony_ci sampler2DArrayShadowNV a handle for accessing a 2D array depth texture with comparison 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ci Modify section 4.5.3 (Default Precision Qualifiers): 905bd8deadSopenharmony_ci 915bd8deadSopenharmony_ci Add to the list of predeclared globally scoped default precision 925bd8deadSopenharmony_ci statements: 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci "precision lowp sampler2DArrayShadowNV;" 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ci Modify section 8.7 (Texture Lookup Functions): 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci Add the following new texture lookup function: 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci The built-in texture lookup function shadow2DArrayNV is optional, 1015bd8deadSopenharmony_ci and must be enabled by 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci #extension GL_NV_shadow_samplers_array : enable 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ci before being used. 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci Syntax: 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ci float shadow2DArrayNV(sampler2DArrayShadowNV sampler, vec4 coord) 1105bd8deadSopenharmony_ci 1115bd8deadSopenharmony_ci Description: 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci Use texture coordinate (coord.s, coord.t) to do a depth comparison 1145bd8deadSopenharmony_ci lookup on an array layer of the depth texture bound to sampler, as 1155bd8deadSopenharmony_ci described in section 3.7.14.1. The layer to access is indicated by 1165bd8deadSopenharmony_ci the third coordinate (coord.p) and is computed by layer = max (0, 1175bd8deadSopenharmony_ci min(d - 1, floor (coord.p + 0.5)) where 'd' is the depth of the 1185bd8deadSopenharmony_ci texture array. The fourth component of coord (coord.q) is used as 1195bd8deadSopenharmony_ci the R value. The texture bound to sampler must be a depth texture, 1205bd8deadSopenharmony_ci or results are undefined. 1215bd8deadSopenharmony_ci 1225bd8deadSopenharmony_ciIssues 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci (1) Should the result of the texture comparison be interpreted as 1255bd8deadSopenharmony_ci a LUMINANCE, INTENSITY or ALPHA texel? 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ci RESOLVED: A scalar value is returned from the shadow lookup built-in 1285bd8deadSopenharmony_ci function in the fragment shader, so it can be interpreted however 1295bd8deadSopenharmony_ci desired. 1305bd8deadSopenharmony_ci 1315bd8deadSopenharmony_ciRevision History 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci Rev. Date Author Changes 1345bd8deadSopenharmony_ci ---- ------------- --------- ---------------------------------------- 1355bd8deadSopenharmony_ci 4 30 Aug 2012 groth Added missing NV suffixes. Corrected a dependency 1365bd8deadSopenharmony_ci 3 28 Aug 2012 groth Minor copy edits 1375bd8deadSopenharmony_ci 2 19 Aug 2012 groth Correct dependency and GLSL enable 1385bd8deadSopenharmony_ci 1 12 Aug 2012 groth Initial GLES2 version from EXT_gpu_shader4. 139