Line stylization through graphics processor unit (GPU) textures
AssigneeAutodesk, Inc.
InventorsSean P. James, David Timothy Rudolf, Ravinder Patnam Krishnaswamy
Life of this patent
Estimating the term…
Abstract
A method, apparatus, system, and computer program product provide the ability to render a line having line stylization/linetype pattern via texture mapping of a graphics processing unit (GPU). Linetype information for a pattern of a linetype for the line is acquired. The pattern is stored in a texture by encoding a type of element of the pattern and a texel center location. The GPU renders the line by computing a distance between a pixel of the line and the texel center location, determining if the distance exceeds a threshold, and rendering the pixel if the distance is within the threshold.
Claims22
A computer-implemented method for rendering a line, comprising:
- acquiring, using a central processing unit (CPU), linetype information for a pattern of a linetype for the line, wherein the pattern comprises a sequence of one or more elements, and wherein each of the one or more elements has an element type, and wherein each element type comprises a dot, a dash, or a space;
- selecting, using the CPU, a texture size width for a texture;
- scaling the pattern to fit the texture size width;
- storing, using the CPU, the pattern in the texture by encoding for each of the one or more elements:
- (i) the element type for the element;
- and (ii) a texel center location for a texel in the texture that includes the element;
- passing, from the CPU to a graphics processing unit (GPU), the texture and one or more geometry segments that define the line to be rendered, wherein the one or more geometry segments include a composite length;
- the GPU rendering the line by:
- computing an offset based on the composite length and the texel center location;
- and
- rendering the line utilizing the offset to determine a beginning point of the pattern, wherein a value of a pixel is determined by the element type at the offset.
A system for rendering a line in a computer system comprising:
- (a) a computer having a central processing unit (CPU) and a graphics processing unit (GPU);
- (b) the CPU:
- (1) acquiring linetype information for a pattern of a line type for the line, wherein the pattern comprises a sequence of one or more elements, and wherein each of the one or more elements has an element type, and wherein each element type comprises a dot, a dash, or a space;
- (2) selecting a texture size width for a texture;
- (3) scaling the pattern to fit the texture size width;
- (4) storing the pattern in the texture by encoding for each of the one or more elements:
- (i) the element type for the element;
- and (ii) a texel center location for a texel in the texture that includes the element;
- (5) passing, to the GPU, the texture and one or more geometry segments that define the line to be rendered, wherein the one or more geometry segments include a composite length;
- (c) the GPU rendering the line by:
- (1) computing an offset based on the composite length and the texel center location;
- and
- (2) rendering the line utilizing the offset to determine a beginning point of the pattern, wherein a value of a pixel is determined by the element type at the offset.
Dependencies are inferred from the claim text.