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"><!-- InstanceBegin template="/Templates/default_template.dwt" codeOutsideHTMLIsLocked="false" -->
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5<meta http-equiv="Content-Style-Type" content="text/css" />
6<!-- InstanceBeginEditable name="CSS の相対パス指定" -->
7<link href="../../../common/manual.css" rel="stylesheet" type="text/css" />
8<!-- InstanceEndEditable --> <!-- InstanceBeginEditable name="ページのタイトル" -->
9<title>Write to Framebuffer</title>
10<!-- InstanceEndEditable -->
11</head>
12<body>
13<div>
14  <div class="body"> <!-- InstanceBeginEditable name="本文のタイトル" -->
15  <h1>Write to Framebuffer</h1>
16  <!-- InstanceEndEditable --> <!-- InstanceBeginEditable name="本文" -->
17  <p>This section describes the process by which fragments that passed the write test are written to the framebuffer.</p>
18  <p>CreativeStudio offers four options for the <em>blend mode</em> when writing to the frame buffer.<br /> The table below lists the options that can be selected for the blend mode.</p>
19
20    <table>
21    <thead>
22      <tr>
23        <th>Item</th>
24        <th>Description</th>
25      </tr>
26    </thead>
27    <tbody>
28      <tr>
29        <th>Unused</th>
30        <td>Does not perform blending. Results in an opaque expression.</td>
31      </tr>
32      <tr>
33        <th>Blending</th>
34        <td>Applies a scale to the fragment color and alpha and framebuffer color and alpha, and then performs blending using a blending formula.</td>
35      </tr>
36      <tr>
37        <th>Separate<br />Blending</th>
38        <td>Applies a scale to each color component and alpha value, and then blends the fragment color and alpha and framebuffer color and alpha using a blending formula.</td>
39      </tr>
40      <tr>
41        <th>Logical operations</th>
42        <td>Blends the fragment color and alpha and framebuffer color and alpha using logical operations.</td>
43      </tr>
44    </tbody>
45  </table>
46
47  <h2>Blending</h2>
48  <p>This section describes the per-fragment mixing process called <I>blending</I>.</p>
49  <!-- #BeginLibraryItem "/Library/glossary_blending.lbi" --> <!-- ブレンド処理 ( blending ) -->
50  <p><I>Blending</I> is the process by which the color and alpha values for fragments that have passed the write test (the <I>source color</I> and <I>source alpha</I>) are blended with the color and alpha values at the same locations in the framebuffer being written to (the <I>destination color</I> and <I>destination alpha</I>). The source and destination are multiplied by coefficients (i.e., scaled)  and the results of the blending equation are written back to the framebuffer.</p>
51  <!-- #EndLibraryItem -->
52  <p>The figure below shows the blending flow.</p>
53  <img class="user_guide_chart" src="assets/write_frame_buffer_blending.png" alt="Blending flow"/>
54  <h3>Blend Source Coefficient and Destination Coefficient</h3>
55  <!-- #BeginLibraryItem "/Library/glossary_blending_coefficient.lbi" --> <!-- ブレンド処理の係数 ( blending_coefficient ) -->
56  <p><I>Blend source coefficient</I> refers to the coefficient that the source color and source alpha are multiplied by. The results are then used as source elements.<br /> <I>Blend destination coefficient</I> refers to the coefficient that the destination color and destination alpha are multiplied by. The results are then used as destination elements.<br /> In CreativeStudio, you can configure separate coefficients for the color and alpha.</p>
57  <!-- #EndLibraryItem -->
58  <h4>Blend color</h4>
59  <!-- #BeginLibraryItem "/Library/glossary_blend_color.lbi" --> <!-- ブレンドカラー ( blend_color ) -->
60  <p><I>Blend color</I> refers to the fixed color and alpha values that can be used with the blend source and destination coefficients.</p>
61  <p class="warning">The constant color setting is different from the one for the texture combiner.</p>
62  <!-- #EndLibraryItem -->
63  <p>The figure below lists the types of coefficients.</p>
64  <img class="user_guide_chart" src="assets/write_frame_buffer_blending_coefficient.png" alt="Blending Coefficients"/>
65  <p class="hint">The coefficients that comprise a color or alpha value subtracted from 1 have their signs flipped.</p>
66  <h3>Blending Equation</h3>
67  <!-- ブレンディング方程式 ( blending_equation ) -->
68  <p>The <I>blending equation</I> is a calculation that combines the source elements (results of multiplying by the blend source coefficients) and destination elements (results of multiplying by the blend destination coefficients). In CreativeStudio, you can configure separate blending equations for the color and alpha.</p>
69  <p>The figure below shows color blending using a blending equation.</p>
70  <img class="user_guide_chart" src="assets/write_frame_buffer_blending_equation.png" alt="Blending Equation"/>
71  <p>Below, we describe using blending equations to combine the following blend source coefficient and blend destination coefficient color images.</p>
72  <table class="thumb">
73    <thead>
74      <tr>
75        <th>Blend Source Coefficient</th>
76        <th>Blend Destination Coefficient</th>
77      </tr>
78    </thead>
79    <tbody>
80      <tr>
81        <td><img class="thumb" src="assets//write_frame_buffer_blending_coefficient_source.png" alt="Blend Source Coefficient"/></td>
82        <td><img class="thumb" src="assets//write_frame_buffer_blending_coefficient_target.png" alt="Blend Destination Coefficient"/></td>
83      </tr>
84    </tbody>
85  </table>
86  <p>The table below lists the types of blending equations.</p>
87  <table>
88    <thead>
89      <tr>
90        <th class="thumb">Item</th>
91        <th class="thumb">Operator</th>
92        <th class="thumb">Result</th>
93        <th>Description</th>
94      </tr>
95    </thead>
96    <tbody>
97      <tr>
98        <th class="thumb">Add source and destination.</th>
99        <th class="thumb">ADD</th>
100        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_add.png" alt="Blending ADD"/></td>
101        <td>Blend source coefficient + Blend destination coefficient.</td>
102      </tr>
103      <tr>
104        <th class="thumb">Subtract destination from source.</th>
105        <th class="thumb">SUBTRACT</th>
106        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_sub.png" alt="Blending SUBTRACT"/></td>
107        <td>Blend source coefficient - Blend destination coefficient.</td>
108      </tr>
109      <tr>
110        <th class="thumb">Subtract source from destination.</th>
111        <th class="thumb">REVERSE_SUBTRACT</th>
112        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_reverse_sub.png" alt="Blending REVERSE_SUBTRACT"/></td>
113        <td>Blend destination coefficient - Blend source coefficient.</td>
114      </tr>
115      <tr>
116        <th class="thumb">Smaller value of either the source or destination.</th>
117        <th class="thumb">MIN</th>
118        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_min.png" alt="Blending MIN"/></td>
119        <td>Compares the blend source coefficient and blend destination coefficient and uses the smaller of the two values.</td>
120      </tr>
121      <tr>
122        <th class="thumb">Larger value of either the source or destination.</th>
123        <th class="thumb">MAX</th>
124        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_max.png" alt="Blending MAX"/></td>
125        <td>Compares the blend source coefficient and blend destination coefficient and uses the larger of the two values.</td>
126      </tr>
127    </tbody>
128  </table>
129  <h2>Separate blending</h2>
130
131  <p><I>Separate blending</I> is the process by which the fragment color and alpha that will be used because they have passed the write test (the <I>source color</I> and <I>source alpha</I>) are blended with the color and alpha at the same location in the framebuffer being written (the <I>destination color</I> and <I>destination alpha</I>).</p>
132  <p>The source and destination color components and alpha values are multiplied by coefficients, and the results of the blending equations are written back to the framebuffer.</p>
133
134
135
136  <h2>Logical operations</h2>
137  <p><I>Logical operations</I> in this case refers to processes that are performed on the fragment color that will be used because it has passed the write test (the <I>source color</I>) and the color at the same location in the framebuffer being written to (the <I>destination color</I>).</p>
138  <p>A logical operation is performed on the two possible input values for source and destination color of 1 (TRUE) or 0 (FALSE) to output a single value, which is then written back to the framebuffer.</p>
139
140
141
142
143
144  <p>The figure below shows the logical operation flow.</p>
145  <img class="user_guide_chart" src="assets/write_frame_buffer_logical_operations.png" alt="Logical Operation Flow"/>
146  <p>Below, we describe using logical operations to combine the following source color (A) and destination color (B) image inputs. This example uses monochrome images for purposes of simplicity. White regions are treated as 1, and black regions as 0.</p>
147  <p>&nbsp; </p>
148  <table class="thumb">
149    <thead>
150      <tr>
151        <th>Source Color</th>
152        <th>Destination Color</th>
153      </tr>
154    </thead>
155    <tbody>
156      <tr>
157        <td><img class="thumb" src="assets//write_frame_buffer_source_color.png" alt="Blend Source Coefficient"/></td>
158        <td><img class="thumb" src="assets//write_frame_buffer_destination_color.png" alt="Blend Destination Coefficient"/></td>
159      </tr>
160    </tbody>
161  </table>
162  <p>The figure below lists the types of logical operations. In CreativeStudio, you can select these from <B>Calculation methods</B>.</p>
163  <table>
164    <thead>
165      <tr>
166        <th class="thumb">Item</th>
167        <th class="thumb">Operator</th>
168        <th class="thumb">Result</th>
169        <th>Description</th>
170      </tr>
171    </thead>
172    <tbody>
173      <tr>
174        <th class="thumb">All bit values are 0</th>
175        <th class="thumb">CLEAR</th>
176        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_clear.png" alt="Logical operation CLEAR"/></td>
177        <td>Writes 0 to RGBA.</td>
178      </tr>
179      <tr>
180        <th class="thumb">Source color bit value</th>
181        <th class="thumb">COPY</th>
182        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_copy.png" alt="Logical operation COPY"/></td>
183        <td>Writes the source value as-is.</td>
184      </tr>
185      <tr>
186        <th class="thumb">Destination color bit value</th>
187        <th class="thumb">NOOP</th>
188        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_noop.png" alt="Logical operation NOOP"/></td>
189        <td>Does not write anything. Uses the existing framebuffer value.</td>
190      </tr>
191      <tr>
192        <th class="thumb">All bit values are 1</th>
193        <th class="thumb">SET</th>
194        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_set.png" alt="Logical operation SET"/></td>
195        <td>Writes 1 to RGBA.</td>
196      </tr>
197      <tr>
198        <th class="thumb">Source color bit value, inverted</th>
199        <th class="thumb">COPY_INVERTED</th>
200        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_copy_inverted.png" alt="Logical operation INVERTED"/></td>
201        <td>Inverts the source value.</td>
202      </tr>
203      <tr>
204        <th class="thumb">Destination color bit value, inverted</th>
205        <th class="thumb">INVERT</th>
206        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_invert.png" alt="Logical operation INVERT"/></td>
207        <td>Inverts the destination value.</td>
208      </tr>
209      <tr>
210        <th class="thumb">Bitwise AND of the source color and the inverted destination color.</th>
211        <th class="thumb">AND_REVERSE</th>
212        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_and_reverse.png" alt="Logical operation AND_REVERSE"/></td>
213        <td>Bitwise AND of the source value and the inverted destination value. Outputs 1 for those areas where A and inverted B are both 1.</td>
214      </tr>
215      <tr>
216        <th class="thumb">Bitwise OR of the source color and the inverted destination color.</th>
217        <th class="thumb">OR_REVERSE</th>
218        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_or_reverse.png" alt="Logical operation OR_REVERSE"/></td>
219        <td>Bitwise OR of the source value and the inverted destination value. <em>Logical sum</em> outputs 1 for areas where either A or B are 1, and outputs 0 otherwise.</td>
220      </tr>
221      <tr>
222        <th class="thumb">Bitwise AND of the source color and the destination color.</th>
223        <th class="thumb">AND</th>
224        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_and.png" alt="Logical operation AND"/></td>
225        <td>Bitwise AND of the source value and the destination value. Outputs 1 for those areas where A and B are both 1.</td>
226      </tr>
227      <tr>
228        <th class="thumb">Bitwise OR of the source color and the destination color.</th>
229        <th class="thumb">OR</th>
230        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_or.png" alt="Logical operation OR"/></td>
231        <td>Bitwise OR of the source value and the destination value.<br /></td>
232      </tr>
233      <tr>
234        <th class="thumb">Inversion of the bitwise AND of the source color and the destination color.</th>
235        <th class="thumb">NAND</th>
236        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_nand.png" alt="Logical operation NAND"/></td>
237        <td>Inversion of the bitwise AND of the source value and the destination value. Also called <I>Not_And</I>. Outputs <CODE>0</CODE> when all input values are <CODE>1</CODE>, and otherwise outputs <CODE>1</CODE>.</td>
238      </tr>
239      <tr>
240        <th class="thumb">Inversion of the bitwise OR of the source color and the destination color.</th>
241        <th class="thumb">NOR</th>
242        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_nor.png" alt="Logical operation NOR"/></td>
243        <td>Inversion of the bitwise OR of the source value and the destination value. Also called <I>Not_Or</I>. Outputs 1 when all input values are 0, and outputs 1 otherwise.</td>
244      </tr>
245      <tr>
246        <th class="thumb">Bitwise exclusive OR of the source color and the destination color.</th>
247        <th class="thumb">XOR</th>
248        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_xor.png" alt="Logical operation XOR"/></td>
249        <td>Exclusive bitwise OR of the source value and the destination value. Outputs 1 where input values differ, and outputs 0 where they are the same.</td>
250      </tr>
251      <tr>
252        <th class="thumb">Inversion of the exclusive bitwise OR of the source color and the destination color.</th>
253        <th class="thumb">EQUTV</th>
254        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_equtv.png" alt="Logical operation EQUTV"/></td>
255        <td>Inversion of the exclusive bitwise OR of the source value and the destination value.</td>
256      </tr>
257      <tr>
258        <th class="thumb">Bitwise AND of the inverted source color and the destination color.</th>
259        <th class="thumb">AND_INVERTED</th>
260        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_and_inverted.png" alt="Logical operation AND_INVERTED"/></td>
261        <td>Bitwise AND of the inverted source value and the destination value.</td>
262      <tr>
263        <th class="thumb">Bitwise OR of the inverted source color and the destination color.</th>
264        <th class="thumb">OR_INVERTED</th>
265        <td class="thumb"><img class="thumb" src="assets/write_frame_buffer_logical_or_inverted.png" alt="Logical operation OR_INVERTED"/></td>
266        <td>Bitwise OR of the inverted source value and the destination value.</td>
267      </tr>
268    </tbody>
269  </table>
270  <!-- InstanceEndEditable --> </div>
271  <div class="footer" />
272</div>
273<hr><p>CONFIDENTIAL</p></body>
274<!-- InstanceEnd --></html>