1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> 3<!-- InstanceBegin template="/Templates/default_template.dwt" codeOutsideHTMLIsLocked="false" --> 4<head> 5<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 6<meta http-equiv="Content-Style-Type" content="text/css" /> 7<!-- InstanceBeginEditable name="CSS の相対パス指定" --> 8<link href="../../../common/manual.css" rel="stylesheet" type="text/css" /> 9<!-- InstanceEndEditable --> <!-- InstanceBeginEditable name="ページのタイトル" --> 10<title>Texture combiners</title> 11<!-- InstanceEndEditable --> 12</head> 13<body> 14<div> 15 <div class="body"> <!-- InstanceBeginEditable name="本文のタイトル" --> 16 <h1>Texture combiners</h1> 17 <!-- InstanceEndEditable --> <!-- InstanceBeginEditable name="本文" --> 18 <p>This section describes texture combiners.</p> 19 <h2>What are Texture Combiners?</h2> 20 <p>The <a href="../../../glossary/index.html#texture_combiner">texture combiner</a> provides a mechanism for combining lighting, textures, constant colors and other items and determining what will ultimately be the color and alpha. Think of it like the blending of color and alpha by the TEV on the GameCube and the Wii. The texture combiner conducts processing for color (RGB) and processing for alpha (A), each independently.</p> 21 <h2>Texture Combiner Structure</h2> 22 <p>This section describes the structure of the texture combiner. The texture combiner can repeat its calculations (described below) up to six times. Each round of the calculation process is called a stage. The first round of calculations is called stage 0, and there can be up to six stages.</p> 23 <p>The following figure represents a conceptual image of the texture combiner structure.</p> 24 <img class="user_guide_chart" src="assets/combiner_composition.png" alt="Texture Combiner Configuration"/> 25 <h2>Texture Combiner Settings</h2> 26 <p>This section describes settings of the texture combiner.</p> 27 <h3>Input Sources</h3> 28 <p>The texture combiner uses three input sources when performing blending.</p> 29 <p>The table below lists ten types of input sources used by the texture combiner.</p> 30 <table> 31 <thead> 32 <tr> 33 <th>Source Types</th> 34 <th>Description</th> 35 </tr> 36 </thead> 37 <tbody> 38 <tr> 39 <th>Texture 0</th> 40 <td>The color and alpha of the texture image set for Texture 0.</td> 41 </tr> 42 <tr> 43 <th>Texture 1</th> 44 <td>The color and alpha of the texture image set for Texture 1.</td> 45 </tr> 46 <tr> 47 <th>Texture 2</th> 48 <td>The color and alpha of the texture image set for Texture 2.</td> 49 </tr> 50 <tr> 51 <th>Texture 3</th> 52 <td>The color and alpha of the texture image set for Texture 3.</td> 53 </tr> 54 <tr> 55 <th>Constant color</th> 56 <td>The color or alpha that can be set as selected for each step of the texture combiner.</td> 57 </tr> 58 <tr> 59 <th>Result output by vertex shader</th> 60 <td>The color or alpha output from the vertex shader.</td> 61 </tr> 62 <tr> 63 <th>Result output by previous stage</th> 64 <td>The color or alpha output from the previous step. This cannot be used in the first step.</td> 65 </tr> 66 <tr> 67 <th>Buffer from previous stage</th> 68 <td>The color or alpha output to the buffer from the previous step. This cannot be used in the first step.</td> 69 </tr> 70 <tr> 71 <th>Primary color</th> 72 <td>The output result of fragment lighting.</td> 73 </tr> 74 <tr> 75 <th>Secondary color</th> 76 <td>The output result of fragment lighting.</td> 77 </tr> 78 </tbody> 79 </table> 80 <p class="warning">Of the input sources used in Step 2 and beyond, at least one must be specified as <em>Constant color</em>, <em>Result output by previous stage</em>, or <em>Buffer from previous stage</em>.</p> 81 <h3>Operand</h3> 82 <!-- #BeginLibraryItem "/Library/glossary_combiner_operand.lbi" --> <!-- オペランド ( combiner_operand ) --> 83 <p><em>Operands</em> are a feature of the texture combiner used to specify the components for the blend of RGBA input sources from the various channels. In the default setting, RGB is applied to the color and A to the alpha.</p> 84 <!-- #EndLibraryItem --> 85 <p>This is a description of the operand using the texture image below.</p> 86 <table class="thumb"> 87 <thead> 88 <tr> 89 <th>Color channel.</th> 90 <th>Alpha Channel</th> 91 </tr> 92 </thead> 93 <tbody> 94 <tr> 95 <td><img class="thumb" src="assets//combiner_a.png" alt="Combiner A"/></td> 96 <td><img class="thumb" src="assets//combiner_operand_alpha.png" alt="Alpha Channel"/></td> 97 </tr> 98 </tbody> 99 </table> 100 <h4>Operands for the color in the texture combiner</h4> 101 <p>The table below lists the types of operands that can be selected for the color of the texture combiner.</p> 102 <table> 103 <thead> 104 <tr> 105 <th class="thumb">Item</th> 106 <th class="thumb">Result</th> 107 <th>Description</th> 108 </tr> 109 </thead> 110 <tbody> 111 <tr> 112 <th class="thumb">RGB</th> 113 <td class="thumb"><img class="thumb" src="assets/combiner_a.png" alt="Combiner A"/></td> 114 <td>Applies the color channel to the R, G or B channel.</td> 115 </tr> 116 <tr> 117 <th class="thumb">1 - RGB</th> 118 <td class="thumb"><img class="thumb" src="assets/combiner_operand_1_sub_rgb.png" alt="Operand 1 - RGB"/></td> 119 <td>Inverts the color channel and applies it to the R, G or B channel.</td> 120 </tr> 121 <tr> 122 <th class="thumb">A</th> 123 <td class="thumb"><img class="thumb" src="assets//combiner_operand_alpha.png" alt="Alpha Channel"/></td> 124 <td>Applies the alpha channel to the R, G or B channel.</td> 125 </tr> 126 <tr> 127 <th class="thumb">1 - A</th> 128 <td class="thumb"><img class="thumb" src="assets/combiner_operand_1_sub_alpha.png" alt="Operand 1 - A"/></td> 129 <td>Inverts the alpha channel and applies it to the R, G or B channel.</td> 130 </tr> 131 <tr> 132 <th class="thumb">R</th> 133 <td class="thumb"><img class="thumb" src="assets/combiner_operand_r.png" alt="Operand 1R"/></td> 134 <td>Applies the R channel to the R, G or B channel.</td> 135 </tr> 136 <tr> 137 <th class="thumb">G</th> 138 <td class="thumb"><img class="thumb" src="assets/combiner_operand_g.png" alt="Operand 1G"/></td> 139 <td>Applies the G channel to the R, G or B channel.</td> 140 </tr> 141 <tr> 142 <th class="thumb">B</th> 143 <td class="thumb"><img class="thumb" src="assets/combiner_operand_b.png" alt="Operand B"/></td> 144 <td>Applies the B channel to the R, G or B channel.</td> 145 </tr> 146 <tr> 147 <th class="thumb">1 - R</th> 148 <td class="thumb"><img class="thumb" src="assets/combiner_operand_1_sub_r.png" alt="Operand 1-R"/></td> 149 <td>Applies the color B channel to the R, G or B channel.</td> 150 </tr> 151 <tr> 152 <th class="thumb">1 - G</th> 153 <td class="thumb"><img class="thumb" src="assets/combiner_operand_1_sub_g.png" alt="Operand 1-G"/></td> 154 <td>Applies the color G channel to the R, G or B channel.</td> 155 </tr> 156 <tr> 157 <th class="thumb">1 - B</th> 158 <td class="thumb"><img class="thumb" src="assets/combiner_operand_1_sub_b.png" alt="Operand 1-B"/></td> 159 <td>Applies the color B channel to the R, G or B channel.</td> 160 </tr> 161 </tbody> 162 </table> 163 <h4>Operands for the alpha in the texture combiner</h4> 164 <p>The table below lists the types of operands that can be selected for the color of the texture combiner.</p> 165 <table> 166 <thead> 167 <tr> 168 <th class="thumb">Item</th> 169 <th class="thumb">Result</th> 170 <th>Description</th> 171 </tr> 172 </thead> 173 <tbody> 174 <tr> 175 <th class="thumb">A</th> 176 <td class="thumb"><img class="thumb" src="assets//combiner_operand_alpha.png" alt="Alpha Channel"/></td> 177 <td>Applies the alpha channel to the A channel</td> 178 </tr> 179 <tr> 180 <th class="thumb">1 - A</th> 181 <td class="thumb"><img class="thumb" src="assets/combiner_operand_1_sub_alpha.png" alt="Operand 1 - A"/></td> 182 <td>Inverts the alpha channel and applies it to the R, G or B channel.</td> 183 </tr> 184 <tr> 185 <th class="thumb">R</th> 186 <td class="thumb"><img class="thumb" src="assets/combiner_operand_r.png" alt="Operand 1R"/></td> 187 <td>Applies the color R channel to the A channel.</td> 188 </tr> 189 <tr> 190 <th class="thumb">G</th> 191 <td class="thumb"><img class="thumb" src="assets/combiner_operand_g.png" alt="Operand 1G"/></td> 192 <td>Applies the color G channel to the A channel.</td> 193 </tr> 194 <tr> 195 <th class="thumb">B</th> 196 <td class="thumb"><img class="thumb" src="assets/combiner_operand_b.png" alt="Operand B"/></td> 197 <td>Applies the color B channel to the A channel.</td> 198 </tr> 199 <tr> 200 <th class="thumb">1 - R</th> 201 <td class="thumb"><img class="thumb" src="assets/combiner_operand_1_sub_r.png" alt="Operand 1-R"/></td> 202 <td>Inverts the color B channel and applies it to the A channel.</td> 203 </tr> 204 <tr> 205 <th class="thumb">1 - G</th> 206 <td class="thumb"><img class="thumb" src="assets/combiner_operand_1_sub_g.png" alt="Operand 1-G"/></td> 207 <td>Inverts the color G channel and applies it to the A channel.</td> 208 </tr> 209 <tr> 210 <th class="thumb">1 - B</th> 211 <td class="thumb"><img class="thumb" src="assets/combiner_operand_1_sub_b.png" alt="Operand 1-B"/></td> 212 <td>Inverts the color B channel and applies it to the A channel.</td> 213 </tr> 214 </tbody> 215 </table> 216 <h3>Texture Combiner's Computation Expressions</h3> 217 <!-- #BeginLibraryItem "/Library/glossary_combiner_function.lbi" --> <!-- テクスチャコンバイナの計算式 ( combiner_function ) --> 218 <p><I>Texture Combiner Computational Expressions</I> are the expressions used for blending the color and alpha components as determined by the input source operand settings. There are 10 different expressions to choose from for both color and alpha.</p> 219 <!-- #EndLibraryItem --> 220 <p>The following texture images, A, B and C, represent the results for input sources 0, 1 and 2 after application of the operand.<br /> The description of the blending performed using the texture combiner function is based on this image.</p> 221 <table class="thumb"> 222 <thead> 223 <tr> 224 <th>A</th> 225 <th>B</th> 226 <th>C</th> 227 </tr> 228 </thead> 229 <tbody> 230 <tr> 231 <td><img class="thumb" src="assets//combiner_a.png" alt="Combiner A"/></td> 232 <td><img class="thumb" src="assets//combiner_b.png" alt="Combiner B"/></td> 233 <td><img class="thumb" src="assets//combiner_c.png" alt="Combiner C"/></td> 234 </tr> 235 </tbody> 236 </table> 237 <p>The table below lists the texture combiner functions that can be selected when using CreativeStudio.</p> 238 <table> 239 <thead> 240 <tr> 241 <th class="thumb">Item</th> 242 <th class="thumb">Function Name</th> 243 <th class="thumb">Result</th> 244 <th>Description</th> 245 </tr> 246 </thead> 247 <tbody> 248 <tr> 249 <th class="thumb">A</th> 250 <th class="thumb">REPLACE</th> 251 <td class="thumb"><img class="thumb" src="assets/combiner_a.png" alt="Combiner A"/></td> 252 <td>Outputs A as-is.</td> 253 </tr> 254 <tr> 255 <th class="thumb">A × B</th> 256 <th class="thumb">MODULATE</th> 257 <td class="thumb"><img class="thumb" src="assets/combiner_modulate.png" alt="MODULATE"/></td> 258 <td>Multiplies A and B.</td> 259 </tr> 260 <tr> 261 <th class="thumb">A + B</th> 262 <th class="thumb">ADD</th> 263 <td class="thumb"><img class="thumb" src="assets/combiner_add.png" alt="ADD"/></td> 264 <td>Adds A and B.</td> 265 </tr> 266 <tr> 267 <th class="thumb">A + B - 0.5</th> 268 <th class="thumb">ADD_SIGNED</th> 269 <td class="thumb"><img class="thumb" src="assets/combiner_add_signed.png" alt="ADD_SIGNED"/></td> 270 <td>Adds A and B and subtracts 0.5.</td> 271 </tr> 272 <tr> 273 <th class="thumb">A × C + B × ( 1 - C )</th> 274 <th class="thumb">INTERPOLATE</th> 275 <td class="thumb"><img class="thumb" src="assets/combiner_interpolate.png" alt="INTERPOLATEA"/></td> 276 <td>Blends A and B in the proportion given by C.<br /> For example, a change from A to B can be made smoothly by animating the color of C.</td> 277 </tr> 278 <tr> 279 <th class="thumb">A - B</th> 280 <th class="thumb">SUBTRACT</th> 281 <td class="thumb"><img class="thumb" src="assets/combiner_subtract.png" alt="SUBTRACT"/></td> 282 <td>Subtracts B from A.</td> 283 </tr> 284 <tr> 285 <th class="thumb">RGB ← Dot ( A , B )</th> 286 <th class="thumb">DOT3_RGB</th> 287 <td class="thumb"><img class="thumb" src="assets/combiner_dot3_rgb.png" alt="DOT3_RGB"/></td> 288 <td>By treating the RGB values of A and B as vectors, this algorithm is used to blend color channels separately when a normal mapped texture is specified for the type of resource. The output result is gray because the same value is inserted for each channel component.</td> 289 </tr> 290 <tr> 291 <th class="thumb">RGBA ← Dot ( A , B )</th> 292 <th class="thumb">DOT3_RGBA</th> 293 <td class="thumb"><img class="thumb" src="assets/combiner_dot3_rgb.png" alt="DOT3_RGB"/></td> 294 <td>Although the same function is used as with RGB ← Dot ( A , B ), the same value as used for color components is inserted for the alpha component.<br /> <strong>In the CreativeStudio settings you must specify RGBA←Dot ( A , B ) as the input source for both color and alpha.</strong></td> 295 </tr> 296 <tr> 297 <th class="thumb">( A + B ) × C </th> 298 <th class="thumb">ADD_MULT</th> 299 <td class="thumb"><img class="thumb" src="assets/combiner_add_mult.png" alt="ADD_MULT"/></td> 300 <td>Adds A and B and then multiplies by C.<br /> <strong>During computation, the value resulting when A and B are added does not go above 1.0.</strong></td> 301 </tr> 302 <tr> 303 <th class="thumb">( A × B ) + C </th> 304 <th class="thumb">MULT_ADD</th> 305 <td class="thumb"><img class="thumb" src="assets/combiner_mult_add.png" alt="MULT_ADD"/></td> 306 <td>Multiplies A and B and then adds C.</td> 307 </tr> 308 </tbody> 309 </table> 310 <p>Both of the functions <em>RGB ← Dot ( A , B )</em> and <em>RGBA ← Dot ( A , B )</em> take into account the fact that values will be converted to the range -1 to 1 when vectors are computed during the texel generation process for texture images stored in texture memory in the range 0 to 1.</p> 311 <p>This function works as follows.</p> 312 <p class="system">4 × ((Ar – 0.5) × (Br – 0.5) + (Ag – 0.5) × (Bg – 0.5) + (Ab – 0.5) × (Bb – 0.5))</p> 313 <!-- #BeginLibraryItem "/Library/glossary_vector.lbi" --> <!-- ベクトル ( vector ) --> 314 <p>Having both <em>magnitude</em> and <em>direction</em>, vectors are represented by arrow length and direction. With CreativeStudio, vectors are used in many different situations such as light calculations and particle speed control. They are also used when converting the color components of a texture image into XYZ vector values.</p> 315 <!-- #EndLibraryItem --> 316 <h4>Scaling calculation results</h4> 317 <p>Texture combiner calculation results can be multiplied by a scale setting. A scale can be set for each color and alpha being blended. There are three scale settings to select from: x1, x2 and x4.</p> 318 <!-- InstanceEndEditable --> </div> 319 <div class="footer" /> 320</div> 321<hr><p>CONFIDENTIAL</p></body> 322<!-- InstanceEnd --> 323</html>