gSPClipRatio.3p
2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.TH gSPClipRatio 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
gSPClipRatio, gsSPClipRatio
\- specify relative size of clipping/scissoring rectangle.
.SH C SPECIFICATION
.nf
\f3#include "gbi.h"
FRUSTRATIO_1
FRUSTRATIO_2
FRUSTRATIO_3
FRUSTRATIO_4
FRUSTRATIO_5
FRUSTRATIO_6
gSPClipRatio(Gfx *gdl, r)
gsSPClipRatio(r)
\fP
.fi
.SH PARAMETERS
.TP 10
.I *gdl
graphics display list pointer.
.TP
.I r
Ratio of the clipping rectangle's size to the viewport rectangle's size.
Should be one of FRUSTRATIO_1, FRUSTRATIO_2, ..., FRUSTRATIO_6.
.SH DESCRIPTION
This command tells the RSP how to do clipping and scissoring
and can be
adjusted to increase performance.
.PP
Scissoring is performed by rasterizing the entire triangle and
then removing sections which are offscreen pixel by pixel.
Scissoring takes up time in the RDP.
.PP
Clipping is performed by turning a large triangle into one or more
smaller triangles all of which fit in the clipping rectangle which
is 1-6 times the size of the scissoring rectangle. Triangles which
are entirely inside the clipping rectangle are not clipped.
Triangles which are entirely outside the scissoring rectangle are
trivially rejected (which is very fast). Triangles which stretch from
inside the scissor rectangle to outside the clipping rectangle must be
clipped (which is very slow in the RSP). Making the clipping
rectangle much larger than the scissoring rectangle can slow down the RDP
because more pixels will be scissored. However it will speed up the
RSP because fewer triangles will be large enough to stretch all the way
from inside the scissor rectangle to outside the clipping rectangle,
so fewer triangles will be clipped (clipping slows the RSP).
When a triangle is clipped it is often turned into more than one (smaller)
triangles. Because it often takes the RDP longer to draw 2 triangles
than 1 larger one, making the clipping rectangle larger than the
scissoring rectangle can *speed up* the RDP.
.PP
Because the best ratio to use will depend on what your models are like,
the best way to use this command is to try out different values and see
which one gives the best performance.
.PP
Note: all of this assumes that your scissor rectangle is the same size as your
viewport (see
.IR gDPSetScissor(3P)
and
.IR gSPViewport(3P)
).
.SH EXAMPLE
To make the clipping rectangle 5 times larger than the scissoring rectangle:
.Ex
gSPClipRatio(glist++, FRUSTRATIO_5);
.Ee
.SH SEE ALSO
.IR gDPSetScissor (3P), gSPViewport (3P)