TVP4020
Programmers Reference Manual
Graphics Programming
77
lbReadFormat.DepthWidth = 3 // 15 bit
lbReadFormat.StencilWidth = 3 // 1 bit
LBReadFormat(lbReadFormat) // Load read format
LBWriteFormat(lbReadFormat) // Write is same as read
// Set the localbuffer write mode
LBWriteMode(PERMEDIA_ENABLE)
// Set the localbuffer read mode
// Partial products for 800 : 512 + 256 + 32
lbReadMode.PP0 = 5 // 512 (<< 9)
lbReadMode.PP1 = 4 // 256 (<< 8)
lbReadMode.PP2 = 1 // 32 (<< 5)
lbReadMode.ReadSource = PERMEDIA_DISABLE
lbReadMode.ReadDestination = PERMEDIA_ENABLE
lbReadMode.DataType = PERMEDIA_LBDEFAULT
lbReadMode.WindowOrigin =
as appropriate
lbReadMode.PatchMode = PERMEDIA_DISABLE
LBReadMode(lbReadMode)
// Now ready to render with localbuffer read and write
// suitable for stencil and depth buffering operations.
5.6
Stencil/Depth Test Unit
The stencil test conditionally rejects fragments based on the outcome of
a comparison between the value in the stencil buffer and a reference
value. The stencil buffer is updated according to the current stencil
update mode which depends on the result of the stencil test and the
depth test. Stencil testing can be used in many different ways, e.g.
hidden line removal, decals, masking areas of the screen, stippling.
The depth (Z) test, if enabled, compares a fragment's depth against the
corresponding depth in the depth buffer. If the test fails, the fragment will
be rejected.
5.6.1
Stencil Test
This test only occurs if all the preceding tests (bitmask, scissor, stipple)
have passed. The stencil test is controlled by the
stencil function and the
stencil operation. The stencil function controls the test between the
reference stencil value and the value held in the stencil buffer. If the test
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 ...