15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci AMD_depth_clamp_separate 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_AMD_depth_clamp_separate 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Pierre Boudier (pierre.boudier 'at' amd.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContributors 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Pierre Boudier, AMD 165bd8deadSopenharmony_ci Graham Sellers, AMD 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciStatus 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci In Progress 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciVersion 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci Last Modified Date: 09/15/2010 255bd8deadSopenharmony_ci Author Revision: 2 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciNumber 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci 401 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ciDependencies 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ci The extension is written against the OpenGL 4.1 (Core) Specification. 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ciOverview 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci The extension ARB_depth_clamp introduced the ability to control 385bd8deadSopenharmony_ci the clamping of the depth value for both the near and far plane. 395bd8deadSopenharmony_ci One limitation is that the control was for both planes at the 405bd8deadSopenharmony_ci same time; some applications can benefit from having clamping 415bd8deadSopenharmony_ci enabled for only one of the two planes, in order to save 425bd8deadSopenharmony_ci fillrate for the other plane by clipping the geometry. 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ci This extension provides exactly such functionality. 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ciNew Procedures and Functions 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci None 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ciNew Tokens 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, 535bd8deadSopenharmony_ci and by the <pname> parameter of GetBooleanv, GetIntegerv, 545bd8deadSopenharmony_ci GetFloatv, and GetDoublev: 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ci DEPTH_CLAMP_NEAR_AMD 0x901E 575bd8deadSopenharmony_ci DEPTH_CLAMP_FAR_AMD 0x901F 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 4.1 (Core) Specification (OpenGL Operation) 605bd8deadSopenharmony_ci 615bd8deadSopenharmony_ci Section 2.20 "Primitive Clipping" 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci Add to the end of the 3rd paragraph: 645bd8deadSopenharmony_ci 655bd8deadSopenharmony_ci "Depth clamping is enabled with the generic Enable command and 665bd8deadSopenharmony_ci disabled with the Disable command. The value of the argument to 675bd8deadSopenharmony_ci either command may be DEPTH_CLAMP_NEAR_AMD or DEPTH_CLAMP_FAR_AMD to enable 685bd8deadSopenharmony_ci or disable depth clamping at the near and far planes, respectively. If near 695bd8deadSopenharmony_ci depth clamping is enabled, the "-w_c <= z_c" plane equation is ignored by 705bd8deadSopenharmony_ci view volume clipping. Effectively, there is no near plane. Likewise, if far 715bd8deadSopenharmony_ci clamping is enabled, the "z_c <= w_c" plane equation is ignored by view 725bd8deadSopenharmony_ci volume clipping, effectively removing the near plane." 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci "In addition to DEPTH_CLAMP_NEAR_AMD and DEPTH_CLAMP_FAR_AMD, the token 755bd8deadSopenharmony_ci DEPTH_CLAMP may be used to simultaneously enable or disable depth clamping 765bd8deadSopenharmony_ci at both the near and far planes." 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 4.1 (Core) Specification (Rasterization) 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci None. 815bd8deadSopenharmony_ci 825bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 4.1 (Core) Specification (Per-Fragment 835bd8deadSopenharmony_ciOperations and the Frame Buffer) 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci -- Section 4.1.5 "Depth buffer test" 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci Add to the end of the 2nd paragraph: 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ci "If depth clamping (see section 2.20) is enabled, before the incoming 905bd8deadSopenharmony_ci fragment's z_w is compared z_w is clamped to the range [min(n,f),0] if 915bd8deadSopenharmony_ci clamping at the near plane is enabled, [0, max(n,f)] if clamping at the 925bd8deadSopenharmony_ci far plane is enabled, and [min(n,f), max(n,f)] if clamping is enabled at 935bd8deadSopenharmony_ci both the near and far planes, where n and f are the current near and far 945bd8deadSopenharmony_ci depth range values (see section 2.12.1)." 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 4.1 (Core) Specification (Special Functions) 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci None. 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 4.1 (Core) Specification (State and 1015bd8deadSopenharmony_ciState Requests) 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci None. 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 4.1 (Core) Specification (Invariance) 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci None. 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications 1105bd8deadSopenharmony_ci 1115bd8deadSopenharmony_ci None. 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ciErrors 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci None. 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ciNew State 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ciAdd to table 6.9, Transformation State - p.350 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci +----------------------+---------+---------------+---------------+-------------------------+-------+ 1225bd8deadSopenharmony_ci | Get Value | Type | Get Command | Initial Value | Description | Sec | 1235bd8deadSopenharmony_ci +----------------------+---------+---------------+---------------+-------------------------+-------+ 1245bd8deadSopenharmony_ci | DEPTH_CLAMP_NEAR_AMD | B | IsEnabled | FALSE | Depth clamping enabled | 2.20 | 1255bd8deadSopenharmony_ci | | | | | at the near plane | | 1265bd8deadSopenharmony_ci | DEPTH_CLAMP_FAR_AMD | B | IsEnabled | FALSE | Depth clamping enabled | 2.20 | 1275bd8deadSopenharmony_ci | | | | | at the far plane | | 1285bd8deadSopenharmony_ci +----------------------+---------+---------------+---------------+-------------------------+-------+ 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci * Note that DEPTH_CLAMP still exists. However, enabling it enables depth clamping for both 1315bd8deadSopenharmony_ci the near and the far plane. Querying DEPTH_CLAMP will return TRUE if DEPTH_CLAMP_NEAR_AMD _or_ 1325bd8deadSopenharmony_ci DEPTH_CLAMP_FAR_AMD is enabled. 1335bd8deadSopenharmony_ci 1345bd8deadSopenharmony_ciNew Implementation Dependent State 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ci None 1375bd8deadSopenharmony_ci 1385bd8deadSopenharmony_ciIssues 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci 1) What should happen to GL_DEPTH_CLAMP? What happens if depth clamping is 1415bd8deadSopenharmony_ci enabled at one plane, but not the other - what does glIsEnabled(GL_DEPTH_CLAMP) 1425bd8deadSopenharmony_ci return? 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci DISCUSSION: Right now, glIsEnabled(GL_DEPTH_CLAMP) returns GL_TRUE if clamping 1455bd8deadSopenharmony_ci is enabled at either plane. Other options are to return GL_TRUE only if clamping 1465bd8deadSopenharmony_ci is enabled at both planes, or to maintain traditional depth clamping as 1475bd8deadSopenharmony_ci separate state, and have yet another enable to control separate clamping. 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ciRevision History 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci Rev. Date Author Changes 1525bd8deadSopenharmony_ci ---- -------- -------- ----------------------------------------- 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ci 2 09/15/2010 gsellers Update to stand against OpenGL 4.1 1555bd8deadSopenharmony_ci Add token values. 1565bd8deadSopenharmony_ci Minor cleanup. 1575bd8deadSopenharmony_ci Some clarifications. 1585bd8deadSopenharmony_ci Add issue 1. 1595bd8deadSopenharmony_ci 1 11/19/2009 pboudier Initial draft based on ARB_depth_clamp 160