Patent ID: 8654146

Claim:
A method for rendering a computer-generated image using a stencil buffer, comprising: receiving a complex arbitrary polygon comprising multiple closed polygonal contours, the multiple closed polygonal contours comprising at least an outer contour and one or more inner contours; separating the complex arbitrary polygon into its constituent closed polygonal contours; dividing each constituent closed polygonal contour into primitives, each primitive being a polygon having at least 3 and at most P vertices where 2<P<N, where N is the number of vertices of the closed polygonal contour; wherein dividing comprises: (i) storing data representative of a partial contour from the closed polygonal contour; (ii) outputting a first level primitive using the stored data, the first level primitive corresponding to contiguous vertices of the closed polygonal contour; (iii) updating the stored data; (iv) whilst the stored data represents higher level primitives outputting a higher level primitive using the stored data, an (i+1)th higher level primitive corresponding to the end vertices of consecutive ith level primitives, and updating the stored data; (v) whilst the stored data represents a further first level primitive outputting the further first level primitive and updating the stored data; (vi) repeating steps (i) to (v) until the closed polygonal contour has been divided into primitives or the remaining partial contour has substantially zero area; concatenating the resulting primitives with primitives resulting from dividing one or more of the other constituent closed contours; and using a stencil buffer to render the concatenated primitives to produce a computer generated image.