1Name 2 3 SGI_complex 4 5Name Strings 6 7 GL_SGI_complex 8 9Version 10 11 $Date: 1996/10/01 21:31:49 $ $Revision: 1.4 $ 12 13Number 14 15 87 16 17Dependencies 18 19 EXT_abgr affects the definition of this extension 20 EXT_texture3D affects the definition of this extension 21 EXT_subtexture affects the definition of this extension 22 EXT_histogram affects the definition of this extension 23 EXT_convolution affects the definition of this extension 24 SGI_color_table affects the definition of this extension 25 SGIS_texture4D affects the definition of this extension 26 EXT_cmyka affects the definition of this extension 27 EXT_blend_minmax affects the definition of this extension 28 EXT_blend_logicop affects the definition of this extension 29 EXT_blend_subtract affects the definition of this extension 30 31 32Overview 33 34 This extension extends the notion of color values to include 35 complex color consisting of a real and imaginary parts or subcomponents 36 for each color component. This extension defines the extended semantics 37 for all operations that currently apply to color values. 38 39 The purpose of this extension is to provide the foundation for complex 40 color processing. With this foundation in place further 41 extensions can be added to define complex input formats, complex 42 storage formats, and additional complex processing operations. 43 44Issues 45 46 * is there a better way? 47 48 * all multiplies of color*color become complex multiplies 49 (texture environment, blending); is this overkill? 50 51 * scalar multiplies for fog and antialiasing coverage scale the 52 real and imaginary components equally. is this okay? 53 54 55New Procedures and Functions 56 57 None 58 59New Tokens 60 61 None 62 63Additions to Chapter 2 of the GL Specification (OpenGL Operation) 64 65 To Section 2.7 Vertex Specification 66 67 Paragraph 3: 68 69 Finally, there are several ways to set the current color. The GL stores 70 both a current single-valued color index, and a current 4-valued complex 71 RGBA color. One or the other of these is significant depending as the GL is 72 in color index mode or RGBA mode. The mode selection is made when the GL is 73 initialized. In RGBA mode state is maintained for both the real and 74 imaginary parts of each component, but only the real part may be set. 75 76 Paragraph 5: 77 78 ... The initial RGBA color is (R, G, B, A) = ({1,0},{1,0},{1,0},{1,0}). 79 80 81 Section 2.12 Colors and Coloring 82 83 Paragraph 1: 84 85 Paragraph 2: 86 87 ... After lighting, both real and imaginary parts of RGBA colors are 88 clamped to the range [0, 1]. 89 90 Section 2.12.1 Lighting 91 92 [ All colors expanded to complex ] 93 94 Section 2.12.6 Clamping or Masking 95 96 Paragraph 1: 97 98 ... After lighting, real and imaginary parts of RGBA colors are clamped 99 to [0, 1]. ... 100 101 Section 2.12.8 Color and Texture Coordinate Clipping 102 103 [ are real and imaginary parts clipped independently? ] 104 105 106 Section 2.12.9 Final Color Processing 107 108 [ indicate the both real & imaginary components are converted and 109 stored as appropriate for the framebuffer ] 110 111 112Additions to Chapter 3 of the GL Specification (Rasterization) 113 114 Section 3.2 Antialiasing 115 116 Paragraph 2: 117 118 In RGBA mode, the R, G, and B values of the rasterized fragment are 119 left unaffected, but the A value is multiplied by a floating-point real 120 value in the range [0, 1] that describes a fragment's screen coverage. 121 ... 122 123 Section 3.6.3 Rasterization of Pixel Rectangles 124 125 Conversion to Complex (follows Conversion to floating point) 126 127 This step applies only to groups of components. It is no performed on 128 indices. Each element in a group is converted to a complex value by 129 setting the real part to the floating-point value computed in the 130 previous step and setting the imaginary part to zero. 131 132 RGBA to RGBA Lookup 133 134 ... First, each component is converted to a real value by discarding 135 the imaginary component and the real value is clamped to the range [0, 1]. 136 There is a table associated with each of the R, G, B, and A component 137 elements: PIXEL_MAP_R_TO_R for R, PIXEL_MAP_G_TO_G for G, PIXEL_MAP_B_TO_B 138 for B, and PIXEL_MAP_A_TO_A for A. Each element is multiplied by an integer 139 on less thanthe size of the corresponding table, and, for each element, 140 and address is found by rounding this value to the nearest integer. For 141 each element, the addressed value in the correspoding table replaces the 142 element. The real value is then converted to a complex value by assigning 143 zero to the imaginary part. 144 145 Section 3.8 Texturing 146 147 Paragraph 2 148 149 ... The arguments width, height, format, type, and data correspond precisely 150 to the corresponding arguments to DrawPixels (refer to section 3.6.3); they 151 specify the image's width and height., a format of the image data, the type 152 of those data, and a pointer to the image data in memory. The image is taken 153 from memory exactly as if these arguments were passed to DrawPixels, but 154 the process stops just before final conversion. Both the real and imaginary 155 part of the complex R, G, B, and A value so extracted is clamped to [0, 1]. 156 ... 157 158 Section 3.8.3 Texture Environments and Texture Functions 159 160 Paragraph 1. 161 162 ... TEXTURE_ENV_COLOR is set to a RGBA color by providing four 163 single-precision floating-point values in the range [0, 1]. (values 164 outside this range are clamped to it). The four values are assigned to 165 the real parts of the complex color; the imaginary parts are unchanged 166 from the default value of zero. If intergers are proivide for 167 TEXTURE_ENV_COLOR, then they are converted to floating-point as specified 168 in Table 2.4 for signed integers. 169 170 Table 3.9 171 172 [ modify to show complex equations ] 173 174 Paragraph 3. 175 176 The state required for the current texture environment consists of the 177 three-valued integer indicating the texture function and four complex 178 floating-point TEXTURE_ENV_COLOR values. In the initial state, the 179 texture function is given by MODULATE and TEXTURE_ENV_COLOR is 180 ({0,0},{0,0},{0,0},{0,0}). 181 182 Section 3.9 183 184 Paragraph 5. 185 186 ... The R, G, B, and A values of C sub f are specified by calling Fog 187 with <pname> equal to FOG_COLOR; in this case params points to four values 188 comprising the real part of C sub f. ... 189 190 Paragraph 7. 191 192 The state required for fog consists of a three valued integer to select 193 the fog equation, three floating-point values d, e, and s, and RGBA fog 194 color a fog color index, and a single bit to indicate whether or not fog 195 is enabled. In the initial state, fog is disabled, FOG_MODE is EXP, d = 196 1.0, e = 1.0, and s = 0.0; C sub f = ({0,0},{0,0},{0,0},{0,0}) and i sub 197 f = 0. 198 199 200Additions to Chapter 4 of the GL Specification (Per-Fragment Operations 201and the Framebuffer) 202 203 Paragraph 3. 204 205 Color buffers consist of either unsigned integer color indices or R, G, 206 B, and optionally A unsigned integer values storing the real parts of 207 pixel colors. 208 209 210 Section 4.1.3 Alpha test 211 212 This step applies only in RGBA mode. In color index mode, proceed to the 213 next step. The alpha test discards a fragment conditional on the outcome 214 of a comparison between the incoming fragments's alpha real-part value 215 and a constant value. ... 216 217 218 Section 4.1.6 Blending 219 220 [complex blending equations. the destination color imaginary subcomponent 221 is zero so the equations degenerate to the real equations, 222 GL_ONE is interpreted as {1,0} and GL_ZERO as {0,0} ] 223 224 Section 4.3.2 Reading Pixels 225 226 Conversion of RGBA values 227 228 Paragraph 2. 229 230 The R, G, and B (and possibly A) values form a group of elements. Each 231 element is taken to be a fixed-point value in [0,1] wiht m bits, where 232 m is the number of bits in the corresponding color component of the 233 selected buffer (see section 2.12.9). The corresponding color value 234 is assigned to the real-part of the resulting color. The imaginary 235 part is set to zero. 236 237 Convolution 238 239 [???] 240 241 Color Tables 242 243 [???] 244 245 Histogram 246 247 [???] 248 249 Final Conversion 250 251 For an index, if the type is not FLOAT, final conversion consists of 252 masking the index with the value given Table 4.6; if the type is FLOAT, 253 then the integer index is converted to a GL float data value. For a 254 component, each the real and imaginary parts are first clamped to [0,1] 255 Then the appropriate conversion formula from Table 4.7 is applied to the 256 both the real and imaginary parts of each component. 257 258 259Additions to Chapter 5 of the GL Specification (Special Functions) 260 261 Section 5.1 Evaluators 262 263 [ color maps evaluate to complex colors, by setting imaginary component to 264 zero ] 265 266 Section 5.3 Feedback 267 268 [ only real colors are returned. define new COLOR formats to get complex 269 colors ] 270 271Additions to Chapter 6 of the GL Specification (State and State Requests) 272 273 [ add GetComplexFloatv(enum value, float *data); redefined state tables ] 274 275Additions to the GLX Specification 276 277 None 278 279GLX Protocol 280 281Errors 282 283 None 284 285New State 286 287 [ lots ? ] 288 289New Implementation Dependent State 290 291 None 292