US2013093766A1PendingUtilityA1
Interpolation of vertex attributes in a graphics processor
Est. expiryAug 7, 2027(~1 yrs left)· nominal 20-yr term from priority
G06T 15/20G06T 15/005
51
PatentIndex Score
0
Cited by
0
References
0
Claims
Abstract
Vertex data can be accessed for a graphics primitive. The vertex data includes homogeneous coordinates for each vertex of the primitive. The homogeneous coordinates can be used to determine perspective-correct barycentric coordinates that are normalized by the area of the primitive. The normalized perspective-correct barycentric coordinates can be used to determine an interpolated value of an attribute for the pixel. These operations can be performed using adders and multipliers implemented in hardware.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method of rendering a pixel according to an interpolated value of an attribute for the pixel, the method comprising:
accessing, using a graphics processing unit (GPU) executing a graphics pipeline, vertex data for a graphics primitive, the vertex data comprising homogeneous coordinates for vertices of the primitive; accessing, using said GPU, a first plurality of barycentric coordinates for a first pixel associated with the primitive; determining, in said graphics pipeline, a first plurality of normalized perspective-correct barycentric coordinates; and determining, in said graphics pipeline, an interpolated value of an attribute for the first pixel using the first plurality of normalized perspective-correct barycentric coordinates.
2 . The method of claim 1 wherein the first plurality of normalized perspective-correct barycentric coordinates are normalized by an area associated with the primitive.
3 . The method of claim 1 wherein the homogeneous coordinates comprise a first coordinate x, a second coordinate y, and a third coordinate w, and wherein the first plurality of normalized perspective-correct barycentric coordinates are determined using a first plurality of ratios comprising a respective value of the barycentric coordinates divided by a respective value of the third coordinate.
4 . The method of claim 3 further comprising:
determining a reciprocal of a sum of the ratios; and
determining the normalized perspective-correct barycentric coordinates by multiplying the reciprocal and selected values of the ratios.
5 . The method of claim 3 further comprising:
incrementing the first plurality of ratios to determine a second plurality of ratios for a second pixel that is adjacent the first pixel;
using the second plurality of ratios, determining a second plurality of normalized perspective-correct barycentric coordinates that are normalized by an area associated with the primitive; and
using the second plurality of normalized perspective-correct barycentric coordinates, determining an interpolated value of an attribute for the second pixel.
6 . The method of claim 3 wherein the primitive comprises three vertices and further comprising:
placing the first plurality of ratios in first, second and third registers, respectively;
placing a reciprocal of a sum of data in the first, second and third registers in a fourth register;
multiplying data in the first and fourth registers to determine a first normalized perspective-correct barycentric coordinate; and
multiplying data in the second and fourth registers to determine a second normalized perspective-correct barycentric coordinate.
7 . A system comprising:
a memory; a central processing unit (CPU) coupled to the memory; and a graphics processor unit (GPU) coupled to the CPU, wherein the GPU executes a graphics pipeline operable for rendering a first pixel according to an interpolated value of an attribute for the first pixel, the graphics pipeline operable for using a first plurality of normalized perspective-correct barycentric coordinates to determine the interpolated value, the normalized perspective-correct barycentric coordinates based on homogeneous coordinates associated with vertices of a primitive that covers the first pixel.
8 . The system of claim 7 wherein the normalized perspective-correct barycentric coordinates normalized by an area associated with the primitive.
9 . The system of claim 7 wherein the first plurality of normalized perspective-correct barycentric coordinates are based on a first plurality of ratios, and wherein the first plurality of ratios are based on homogeneous coordinates associated with each vertex of the primitive, the homogeneous coordinates comprising a first coordinate x, a second coordinate y and a third coordinate w, wherein the ratios are determined by dividing a respective value of the barycentric coordinates by a respective value of the third coordinate.
10 . The system of claim 9 wherein the normalized perspective-correct barycentric coordinates are based on a product of: i) a reciprocal of a sum of the ratios and ii) selected values of the ratios.
11 . The system of claim 9 wherein the GPU is further operable for using a second plurality of normalized perspective-correct barycentric coordinates to determine an interpolated value of an attribute for a second pixel that is adjacent the first pixel, the second plurality of normalized perspective-correct barycentric coordinates normalized by the area, wherein the second plurality of normalized perspective-correct barycentric coordinates are based on a second plurality of ratios, and wherein the second plurality of ratios are determined by incrementing the first plurality of ratios.
12 . The system of claim 9 wherein the primitive comprises a triangle, wherein the pipeline comprises:
a first register, a second register and a third register for holding the first plurality of ratios;
an adder for computing a sum of data in the first, second and third registers;
a fourth register for holding a reciprocal of the sum; and
multipliers for multiplying data in the first and fourth registers to determine a first normalized perspective-correct barycentric coordinate and for multiplying data in the second and fourth registers to determine a second normalized perspective-correct barycentric coordinate.
13 . The system of claim 12 wherein the interpolated value of the attribute is determined by: i) multiplying the first normalized perspective-correct barycentric coordinate by the difference between a first value for the attribute at a first vertex of the primitive and a second value for the attribute at a second vertex of the primitive to produce a first result; ii) multiplying the second normalized perspective-correct barycentric coordinate by the difference between a third value for the attribute at a third vertex of the primitive and the second value to produce a second result; and iii) adding the first result, the second result and the second value to determine the interpolated value of the attribute.
14 . The system of claim 12 wherein the interpolated value of the attribute is determined by: i) first multiplying data in the third and fourth registers to determine a third normalized perspective-correct barycentric coordinate; ii) second multiplying the first, second and third normalized perspective-correct barycentric coordinates by, respectively, a first value for the attribute at a first vertex of the primitive, a second value for the attribute at a second vertex of the primitive, and a third value for the attribute at a third vertex of the primitive; and iii) summing results of the first multiplying and the second multiplying.
15 . A method of interpolating a value of an attribute of a first pixel, the interpolated value useful for rending the first pixel, the method comprising:
accessing, in a graphics pipeline executed by a processing unit, a first plurality of ratios comprising first, second and third ratios for a first pixel covered by a graphics primitive having an area associated therewith, wherein the ratios are determined by dividing a respective value of a barycentric coordinate associated with the primitive by a respective value of a coordinate associated with a vertex of the primitive; determining, in said graphics pipeline, a reciprocal of a sum of the first, second and third ratios; multiplying, in said graphics pipeline, the reciprocal and the first ratio to determine a first normalized perspective-correct barycentric coordinate that is normalized by the area of the primitive; and determining, in said graphics pipeline, an interpolated value of an attribute for the first pixel using the first normalized perspective-correct barycentric coordinate.
16 . The method of claim 15 further comprising:
accessing vertex data for the primitive, the vertex data comprising homogeneous coordinates for each vertex of the primitive; and
using the homogeneous coordinates, determining the first, second and third ratios.
17 . The method of claim 15 further comprising:
multiplying the reciprocal and the second ratio to determine a second normalized perspective-correct barycentric coordinate that is normalized by the area of the primitive;
determining the interpolated value of the attribute for the first pixel using the first and second normalized perspective-correct barycentric coordinates;
registering the first, second and third ratios in first, second and third registers, respectively;
registering the reciprocal in a fourth register;
multiplying data in the first and fourth registers to determine the first normalized perspective-correct barycentric coordinate; and
multiplying data in the second and fourth registers to determine the second normalized perspective-correct barycentric coordinate.
18 . The method of claim 17 further comprising:
multiplying the first normalized perspective-correct barycentric coordinate by the difference between a first value for the attribute at a first vertex of the primitive and a second value for the attribute at a second vertex of the primitive to produce a first result;
multiplying the second normalized perspective-correct barycentric coordinate by the difference between a third value for the attribute at a third vertex of the primitive and the second value to produce a second result; and
adding the first result, the second result and the second value to determine the interpolated value of the attribute.
19 . The method of claim 17 further comprising:
first multiplying data in the third and fourth registers to determine a third normalized perspective-correct barycentric coordinate;
second multiplying the first, second and third normalized perspective correct barycentric coordinates by, respectively, a first value for the attribute at a first vertex of the primitive, a second value for the attribute at a second vertex of the primitive, and a third value for the attribute at a third vertex of the primitive; and
summing results of the first multiplying and the second multiplying to determine the interpolated value of the attribute.
20 . The method of claim 15 further comprising:
incrementing the first plurality of ratios to determine a second plurality of ratios for a second pixel that is adjacent the first pixel;
using the second plurality of ratios to determine a second plurality of normalized perspective-correct barycentric coordinates that are normalized by the area of the primitive; and
using the second plurality of normalized perspective-correct barycentric coordinates to determine an interpolated value of an attribute for the second pixel.Join the waitlist — get patent alerts
Track US2013093766A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.