![background image](http://html.mh-extra.com/html/texas-instruments/tvp4020-permedia-2/tvp4020-permedia-2_reference-manual_1097169117.webp)
Graphics Programming
TVP4020
Programmers Reference Manual
108
5.11.5
Flat Shading Example
A flat shaded primitive:
// Set DDA to flat shade mode
colorDDAMode.UnitEnable = PERMEDIA_ENABLE
colorDDAMode.Shade = PERMEDIA_FLAT_SHADE_MODE
ColorDDAMode(colorDDAMode)
ConstantColor(0xFFFFFFFF)
// Load the flat color
5.11.6
Gouraud Shaded Trapezoid Example
See Appendix D for details of how to calculate delta values.
// Enable unit in Gouraud shading mode
colorDDAMode.UnitEnable = PERMEDIA_ENABLE
colorDDAMode.Shade = PERMEDIA_GOURAUD_SHADE_MODE
ColorDDAMode(colorDDAMode)
// Load the color start values and deltas for dominant edge
// and the body of the trapezoid
RStart()
// Set-up the red component start value
dRdx()
// Set-up the red component increments
dRdyDom()
GStart()
// Set-up the green component start value
dGdx()
// Set-up the green component increments
dGdyDom()
BStart()
// Set-up the blue component start value
dBdx ()
// Set-up the blue component increments
dBdyDom ()
5.11.7
Gouraud Shaded Line Example
Summary of Contents for TVP4020 PERMEDIA 2
Page 1: ...Texas Instruments TVP4020 PERMEDIA 2 Programmer s Reference Manual Issue 4 ...
Page 284: ...TVP4020 Programmers Reference Manual A Gouraud Shaded Triangle 275 ...
Page 292: ...TVP4020 Programmers Reference Manual Register Tables 283 ...
Page 314: ...TVP4020 Programmers Reference Manual Index 305 ...
Page 315: ...Index TVP4020 Programmers Reference Manual 306 Index ...
Page 323: ...Index TVP4020 Programmers Reference Manual 314 ...