15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci NV_shadow_samplers_cube 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_NV_shadow_samplers_cube 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 #147 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 OES_depth_texture_cube_map 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 cube 465bd8deadSopenharmony_ci map 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_CUBE_SHADOW_NV 0x8DC5 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ciNew GLSL defines 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci #define GL_NV_shadow_samplers_cube 1 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ciNew GLSL sampler types 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ci samplerCubeShadowNV 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ciNew GLSL functions 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci float shadowCubeNV(samplerCubeShadowNV 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_CUBE_SHADOW_NV" to the 765bd8deadSopenharmony_ci 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 samplerCubeShadowNV a handle for accessing a Cube depth texture with comparison 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ci Modify section 4.5.3 (Default Precision Qualifiers): 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci Add to the list of predeclared globally scoped default precision 935bd8deadSopenharmony_ci statements: 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci "precision lowp samplerCubeShadowNV;" 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci Modify section 8.7 (Texture Lookup Functions): 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci Add the following new texture lookup function: 1005bd8deadSopenharmony_ci 1015bd8deadSopenharmony_ci The built-in texture lookup function shadowCubeNV is optional, 1025bd8deadSopenharmony_ci and must be enabled by 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ci #extension GL_NV_shadow_samplers_cube : enable 1055bd8deadSopenharmony_ci 1065bd8deadSopenharmony_ci before being used. 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci Syntax: 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci float shadowCubeNV(samplerCubeShadowNV sampler, vec4 coord) 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci Description: 1135bd8deadSopenharmony_ci 1145bd8deadSopenharmony_ci Use texture coordinate (coord.s, coord.t, coord.p) to do a depth 1155bd8deadSopenharmony_ci comparison lookup on the depth cubemap bound to sampler, as 1165bd8deadSopenharmony_ci described in section 3.7.14.1. The direction of the vector (coord.s, 1175bd8deadSopenharmony_ci coord.t, coord.p) is used to select which face to do a two- 1185bd8deadSopenharmony_ci dimensional texture lookup in, as described in section 3.7.5 of the 1195bd8deadSopenharmony_ci OpenGL ES 2.0 specification. The fourth component of coord (coord.q) 1205bd8deadSopenharmony_ci is used as the R value. The texture bound to sampler must be a depth 1215bd8deadSopenharmony_ci cubemap, otherwise results are undefined. 1225bd8deadSopenharmony_ci 1235bd8deadSopenharmony_ciIssues 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci (1) Should the result of the texture comparison be interpreted as 1265bd8deadSopenharmony_ci a LUMINANCE, INTENSITY or ALPHA texel? 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci RESOLVED: A scalar value is returned from the shadow lookup built-in 1295bd8deadSopenharmony_ci function in the fragment shader, so it can be interpreted however 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 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