1Name 2 3 INTEL_texture_scissor 4 5Name Strings 6 7 GL_INTEL_texture_scissor 8 9Version 10 11 $Date: 1997/05/09 02:42:17 $ $Revision: 1.1 $ 12 13Number 14 15 135 16 17Dependencies 18 19 EXT_texture3D is affected by the definition of this extension 20 EXT_texture is required 21 22Overview 23 24This extension enables one to render with clipping based on texture 25coordinates. The only way to clip a primitive while rendering in GL 1.1 is 26to define a Clipping Plane. Clipping of the primitive is then effected 27based on the spatial coordinates of the primitive with reference to the user 28defined clipping plane. This extension adds a new dimension to the clipping 29of primitives, namely-clipping based on texture coordinates as opposed 30to spatial coordinates. 31 32One of the advantages of clipping planes, is that for a given viewing volume 33all the primitives that make up the models in the current scene may be 34clipped against a set of clipping planes that are defined once at the start 35for the current viewing volume. Two issues that are worth mentioning in 36this case are : 37 381. The cost of defining clipping planes is amortized over all primitives in 39the scene 402. The job of determining the equation of clipping planes that enclose a 41convex region defining the current viewing volume is fairly straightforward. 42 43Both the above factors that make clip planes so profitable in 3D graphics 44rendering, do not necessarily hold true when dealing with 3D texture mapped 45based volume rendering of large volume datasets. This is specifically 46true when one uses 3D texture mapping hardware to do volumetric morphing of 47large volumes. Three factors require the ability to clip based on texture 48coordinates 49 50First, most texture memory in machines are never large enough to fit the 51entire volumetric dataset. Hence, to use 3D texture mapping to render 52volumes, one has to partition the volume into blocks large enough to fit in 53the available texture memory. This requires one to clip the primitives the 54straddle texture block boundaries, for oblique viewing angles. In 55straightforward volume rendering, this clipping may be easily done through 56the definition of clip planes in GL, because there is a linear correspondence 57between the texture coordinate 'w' and the spatial coordinate 'z' of each 58point in the volume. 59 60Second, when one morphs a source volume to obtain the target volume, the 61linear correspondence between the texture coordinate 'w' and the spatial 62coordinate 'z' of each point in the volume is lost. Because morphs are 63inherently non-linear different points in the original volume (identified 64by a unique 'z' and an unique 'w') are mapped to different locations in the 65target and in the process lose their linear relationship. Thus no one set 66of clipping planes can be defined for all the primitives that result when 67rendering morphed volumes. 68 69Third, even if one were to try and define clip planes for each of the 70resulting primitives when rendering morphed volumes, the equations are not 71easy to determine - both in terms of speed and ease of implementation! 72One has to first determine the intersection points where the texture 73coordinate goes out of bounds, i.e. below 0.0 or above 1.0, and then define 74a planes that would encapsulte those parts of the primitive that have 75texture coordinates in the correct range. 76 77Finally, the fact that all this has to be done in software slows down the 78process tremendously. 79 80An easier solution would be to enable, a simple test in hardware that checks 81to see if a fragments texel coordinates are within a user defined range. If 82it passes this test the fragment is rendered, if not it is discarded. 83 84Besides the immediate advantage in performance, this solution would also 85enable one to simplify application code considerably. 86 87An added benefit of this extension is that it provides one with the facility 88of tiling 2D textures in 1D, 2D or 3D. 89 90New Procedures and Functions 91 92void TexScissorINTEL(GLenum target, 93 GLclampf tlow, 94 GLclampf thigh); 95void TexScissorFuncINTEL(GLenum target, Glenum lfunc, Glenum hfunc) 96 97New Tokens 98 99Accepted by the <cap> parameter of Enable, Disable, IsEnabled : 100 101TEXTURE_SCISSOR_INTEL 102 103Accepted by the <pname> parameter of parameter of GetBooleanv, GetIntegerv, 104GetFloatv, and GetDoublev 105 106TEXTURE_SCISSOR_S_INTEL [ returns two values : low and high ] 107TEXTURE_SCISSOR_T_INTEL [ returns two values : low and high ] 108TEXTURE_SCISSOR_R_INTEL [ returns two values : low and high ] 109 110by the <target> parameter of glTexScissorINTEL and glTexScissorFuncINTEL 111 112 GL_S 113 GL_T 114 GL_R 115 116Additions to Chapter 2 of the GL 1.1 Specification 117 118None 119 120 121Additions to Chapter 3 of the GL 1.1 Specification (Rasterization) 122 123None 124 125Additions to Chapter 4 of the GL 1.1 Specification (Per Fragment Operations 126and the Framebuffer) 127 128The INTEL_texturescissor conditionally discards a fragment based on the 129outcome of a comparison between the texture coordinate value of the incoming 130fragment and the texture bounds set by the TexScissorINTEL() function. The 131test is controlled with 132 133void TexScissorINTEL(GLenum target, GLclampf tlow, GLclampf thigh) 134 135The texture scissor test is controlled by the texture function set by 136TexScissorFuncINTEL() : 137 138 void TexScissorFuncINTEL(GLenum target, GLenum lfunc, Glenum hfunc) 139 140lfunc can be any of GL_GREATER, GL_GEQUAL, or GL_EQUAL while lfunc can be 141any of GL_LESS, GL_LEQUAL or GL_EQUAL. These values enable one to handle 142boundary cases that involve adjacent regions overlapping. 143 144Thus, for lfunc set to GL_GEQUAL and hfunc set to GL_LEQUAL, if the target 145texture coordinate (s, t, or r) is greater than or equal to tlow and less 146than or equal to thigh (i.e. tlow <= s, t, r <= thigh), the texture test 147passes. Otherwise, the test fails and the fragment is discarded. The test 148is enabled or disabled with the Enable and Disable commands, using the 149symbolic constant TEXTURE_SCISSOR_INTEL. When disabled, the texture scissor 150test is not performed and it is as if the texture scissor test always passes. 151 152'tlow' and 'thigh' are two floating point values in the range <0.0, 1.0> 153(tlow is always less than or equal to thigh). The default values are 0.0 for 154tlow and 1.0 for thigh. Initially, the texture scissor test is disabled by 155default. 156 157Additions to Chapter 5 of the GL 1.1 Specification (Special Functions) 158 159None 160 161Additions to Chapter 6 of the GL 1.1 Specification (State and State Requests) 162 163None 164 165Additions to GLX Specification 166 167None 168 169GLX Protocol 170 171None 172 173Dependencies on EXT_texture3D 174 175If EXT_texture3D is not supported, references to texture target GL_R are 176invalid and should be ignored. 177 178Errors 179 180INVALID_VALUE is generated if glTexScissorINTEL() is called with tlow > thigh. 181 182INVALID_VALUE is generated if glTexScissorINTEL() is called with tlow < 0.0 183or tlow > 1.0 184 185INVALID_VALUE is generated if glTexScissorINTEL() is called with thigh < 0.0 186or thigh > 1.0 187 188INVALID_VALUE is generated if glTexScissorFuncINTEL() is called with lfunc or 189hfunc set to any other value other than [GL_GREATER, GL_GEQUAL, or GL_EQUAL] 190and [GL_LESS, GL_LEQUAL or GL_EQUAL] respectively. 191 192 193New State 194 195None 196 197New Implementation Dependent State 198 199 200Get Value Get Command Type Initial Value Attribute 201TEXTURE_SCISSOR_INTEL IsEnabled B False texture / enable 202TEXTURE_SCISSOR_S_INTEL GetFloatv R 0.0, 1.0 texture / enable 203TEXTURE_SCISSOR_T_INTEL GetFloatv R 0.0, 1.0 texture / enable 204TEXTURE_SCISSOR_R_INTEL GetFloatv R 0.0, 1.0 texture / enable 205TEXTURE_SCISSOR_FUNC_INTEL GetIntegerv Z6 GL_GEQUAL, GL_LESS texture / enable 206 207 208