Method and device for rendering areas bounded by curves using a GPU
AssigneeBlackBerry Limited
InventorRonald Friedrich Pfeifle
Life of this patent
Estimating the term…
Abstract
A method is provided for rendering pixels based on a certain type of Bézier curve, called a simple Bézier arch. The method uses an implicit function to determine whether each pixel in a domain triangle containing the arch is on the arch, on one side of the arch, or on the other side. The function's parameters can be linearly interpolated to allow efficient rendering of the triangle by a GPU. A method is also provided for applying the aforementioned method to render pixels, based on a non-linear Bézier curve having at most four control points, by subdividing the curve into simple Bézier arches as necessary. A computing device for performing these methods is also provided.
Claims18
A method of rendering pixels, comprising:
- retrieving, from a memory of a computing device, a graphics model, the graphics model comprising parameters of Bézier curves having at most four control points, a simple Bézier arch obtainable using the parameters;
- when a Bézier curve of the graphics model is not a simple Bézier arch, subdividing the Bézier curve into simple Bézier arches;
- for each simple Bézier arch defined by a control sequence consisting of (a) an initial endpoint E1, followed by (b) either (i) a single attraction point Co or (ii) a first attraction point C1 followed by a second attraction point C2, followed by (c) a terminal endpoint E2, at least one attraction point being non-co-linear with the endpoints:
- determining, using a pre-processing program executable by a central processing unit of the computing device, a domain triangle containing the arch and having as vertices E1, E2, and an intersection point I of rays emanating from the endpoints and passing through respective attraction points associated with the endpoints;
- and
- for each pixel in the domain triangle:
- computing, using a shader program executable by a graphics processing unit of the computing device, a value of a function f(τ0, τ1, τ2, d1, d2)=τ0τ2d1+τ12d2, wherein τ0, τ1, τ2 are barycentric co-ordinates of that pixel, based on E1, and E2, respectively;
- wherein d1 and d2 are each linear functions of τ0, τ1, and τ2;
- and wherein the function evaluates to zero if that pixel is on the arch;
- and
- rendering, using the graphics processing unit in communication with the central processing unit, that pixel based on the computed value, the graphics processing unit being directed by the shader program;
- wherein rendering that pixel comprises rendering to one or more of:
- a display device, a file in the memory and a peripheral device.
Dependencies are inferred from the claim text.