1 2Name 3 4 SGIX_pixel_texture_bits 5 6Name Strings 7 8 GL_SGIX_pixel_texture_bits 9 10Version 11 12 $Date: 1998/10/01 23:30:18 $ $Revision: 1.11 $ 13 14Number 15 16 127 17 18Dependencies 19 20 GL_SGIS_pixel_texture 21 can be implemented in parallel with SGIX_pixel_texture_lod 22 23Overview 24 25 The pixel_texture extension causes the "convert to fragment" 26 stage of the pixel pipeline to derive the fragment's texture 27 coordinates from the pixel group's color components. 28 At this stage in the pixel pipeline, the color components have 29 been converted into the framebuffer format. These 30 framebuffer format values are used to produce texture coordinates 31 of exactly the same value. The internal representation of 32 texture coordinates is intentionally left vague in the spec 33 so implementations can choose whatever they like. 34 35 This works well when the frame buffer format for 36 a color component is a fixed point value in the range [0,1]. 37 However, if SGIX_color_range is supported, the framebuffer 38 format can be floating point, and the values are not 39 a linear ramp. This means that the texture must be 40 large and sparsely populated in order to ensure that 41 each texture coordinate value reaches a unique texel. 42 43 This extension allows the application to specify that 44 the color component be treated like an unsigned integer 45 with the same number of bits as are in the framebuffer format, 46 which makes each texel in the texture accessible through 47 the texture lookup equations with a texture whose size 48 is 2^n in each dimension, where n is the number of bits in 49 the framebuffer format. 50 51 The application must know the exact frambuffer format 52 in order to define the texture correctly. 53 54 For example, this approach allows the implementation of 55 a bit-preserving 1D lookup table for the s10e5 bali pixel format. 56 It specifies a mapping of the s10e5 pixel format to a texture 57 coordinate index in a manner that allows one texel to be 58 mapped to each of the 64K bit patterns possible in the 59 s10e5 format. 60 61 The motivation is to allow the shader toolkit to implement 62 functions, e.g., cos(x), with a copy pixels 63 and pixel texture enabled in a way that preserves as 64 much accuracy as possible. 65 66IP Status 67 68 Silicon Graphics has filed for patent protection for some of the 69 techniques described in this extension document. 70 71Issues 72 73 * Could we define a separate scale factor so that we don't 74 necessarily have to specify that we convert to the framebuffer 75 format? 76 77 There isn't much need to mention the framebuffer format 78 here; we just need to specify how we're going to interpret 79 the bits. However, the application must use a texture 80 that corresponds to the framebuffer format. 81 82 * To get to the exact center of a texel, we need to add 83 0.5 to the calculation after the conversion to unsigned 84 int and before the divide by 2^m-1. 85 86 This is not necessary because the equations for calculating 87 the 2x2 square of texels when TEXTURE_MIN_FILTER is LINEAR 88 do it. (Section 3.8 in the spec.) 89 90New Procedures and Functions 91 92 None 93 94New Tokens 95 96 Accepted by the <pname> parameter of PixelTexGenParameteriSGIX and 97 PixelTexGenParameterivSGIX: 98 99 COLOR_TO_TEXTURE_COORD_SGIX 100 101 Accepted by the <param> parameter of PixelTexGenParameteriSGIX and 102 PixelTexGenParameterivSGIX: 103 104 COLOR_BIT_PATTERN_SGIX 105 COLOR_VALUE_SGIX 106 107Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation) 108 109 None 110 111Additions to Chapter 3 of the 1.0 Specification (Rasterization) 112 113 This extension, similar to the pixel_texture.spec modifies the 114 "Conversion to Fragments" subsection of section 3.6.3 (Rasterization 115 of Pixel Rectangles) of the GL Specification. Immediately following 116 the text added by the pixel_texture.spec, insert the following: 117 118 If the PixelTexGenParameterSGIX param COLOR_TO_TEXTURE_COORD_SGIX 119 is set to COLOR_BIT_PATTERN_SGIX, the mapping from r,g,b,a 120 to s,t,r,q is altered. 121 122 At this stage, final color processing has been performed and the 123 r,g,b,a values are in the form that matches the framebuffer. 124 To map the red color value to the s texture coordinate the 125 m bits of red, interpreted as an integer in the range [0,2^m-1], are 126 divided by 2^m-1 to obtain an s coordinate in the range [0,1]. 127 Green and Blue are mapped similarly. The q texture coordinate 128 is set to one if a divide by q is in effect. If TEXTURE_4D_SGIS 129 is enabled, Alpha is mapped to q in the same way Red is 130 mapped to s. 131 132 If the PixelTexGenParameterSGIX param COLOR_TO_TEXTURE_COORD_SGIX 133 is set to COLOR_VALUE_SGIX, the r,g,b,a values are used 134 to produce floating point values for s,t,r,q. 135 136Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations 137and the Frame Buffer) 138 139 None 140 141 142Additions to Chapter 5 of the 1.0 Specification (Special Functions) 143 144 None 145 146Additions to Chapter 6 of the 1.0 Specification (State and State Requests) 147 148 None 149 150Additions to the GLX Specification 151 152 XXX 153 154Errors 155 156New State 157 158 The following is added to Table 6.16. Pixels. 159 160 Get Value Get Command Type Initial Value Attrib 161 --------- ----------- ---- ------------- ------ 162 COLOR_TO_TEXTURE_COORD_SGIX GetPixelTexGenParameterivSGIS Z2 COLOR_VALUE_SGIX pixel 163 164New Implementation Dependent State 165 166 None 167