In the Gouraud shading table, specify RGB change data of 4 points (2 lines) of the part. Data interpolated between 4 points for each RGB is added to the original color of the part.
* Each RGB value takes a value between 00H and 1FH, so add the complemented RGB data minus 10H to the original color of the part. For example, if the RGB value is 10H, keep the original color, if it is 00H, it will be -10H, if it is 1FH, it will be + 0FH. If the value after operation is less than 00H, it will be 00H, and if it will be greater than 1FH, it will be 1FH.
The relationship between Gouraud shading table setting values and correction values is shown below.
Table 5.3 Relationship between Gouraud Shading Table Settings and Correction Values
table setting value | correction value for original data TD> table Setting value | correction value for original data TD>
00H | −10H | 10H | 0 |
01H | −0FH | 11H | + 01H |
02H | −0EH | 12H | + 02H |
03H | −0DH | 13H | + 03H |
04H | −0CH | 14H | + 04H |
05H | −0BH | 15H | + 05H |
06H | −0AH | 16H | + 06H |
07H | −09H | 17H | + 07H |
08H | −08H | 18H | + 08H |
09H | −07H | 19H | + 09H |
0AH | −06H | 1AH | + 0AH |
0BH | −05H | 1BH | + 0BH |
0CH | −04H | 1CH | + 0CH |
0DH | −03H | 1DH | + 0DH |
0EH | −02H | 1EH | + 0EH |
0FH | −01H | 1FH | + 0FH |
| |
¡Real Gouraud shading only changes the brightness, but this method changes the RGB, so the hue changes depending on the case.
∙ To prevent the hue from changing, define each position for each point of RGB defined in the Gouraud shading table to the same value. This will apply a white goo.
∙ Lines, polylines, and polygons are processed for non-textured colors, and sprites are processed for characters referenced in the character pattern data or color lookup table.