High precision texture wrapping method and device
First Claim
1. In a computer graphics system, a method for generating texture coordinates for a selected pixel within a triangle for a texture wrapping operation, the triangle having a plurality of vertices, the selected pixel being defined within the triangle by a plurality of barycentric coordinates, the method comprising:
- receiving a set of texture coordinates for each of the vertices of the triangle;
receiving a plurality of barycentric coordinates associated with the selected pixel;
determining a plurality of barycentric coefficients for the selected pixel from the texture coordinates of the vertices of the triangle, the barycentric coefficients being optimized to obtain a specified degree of precision, the specified degree of precision being adapted to distinguish between neighboring texture coordinates; and
computing the texture coordinates based on the barycentric coefficients and the barycentric coordinates, wherein the texture coordinates are substantially distinct from neighboring texture coordinates.
4 Assignments
0 Petitions
Accused Products
Abstract
The present invention provides a method and a device for generating texture coordinates for a selected pixel within a triangle for a texture wrapping operation. The selected pixel is defined within the triangle by a plurality of barycentric coordinates. The method includes receiving a set of texture coordinates for each of the vertices of the triangle and receiving a plurality of barycentric coordinates associated with the selected pixel. The method further includes determining a plurality of barycentric coefficients for the selected pixel from the texture coordinates of the vertices of the triangle. The barycentric coefficients are optimized to obtain a specified degree of precision, which is adapted to distinguish between neighboring texture coordinates. In addition, the method includes computing the texture coordinates based on the barycentric coefficients and the barycentric coordinates, wherein the texture coordinates are substantially distinct from neighboring texture coordinates.
-
Citations
25 Claims
-
1. In a computer graphics system, a method for generating texture coordinates for a selected pixel within a triangle for a texture wrapping operation, the triangle having a plurality of vertices, the selected pixel being defined within the triangle by a plurality of barycentric coordinates, the method comprising:
-
receiving a set of texture coordinates for each of the vertices of the triangle;
receiving a plurality of barycentric coordinates associated with the selected pixel;
determining a plurality of barycentric coefficients for the selected pixel from the texture coordinates of the vertices of the triangle, the barycentric coefficients being optimized to obtain a specified degree of precision, the specified degree of precision being adapted to distinguish between neighboring texture coordinates; and
computing the texture coordinates based on the barycentric coefficients and the barycentric coordinates, wherein the texture coordinates are substantially distinct from neighboring texture coordinates. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15)
translating the texture coordinates of the vertices of the triangle into revised texture coordinates such that the texture coordinates fit within a specified number range.
-
-
3. The method as recited in claim 1, wherein the operation of determining the barycentric coefficients comprises:
-
determining a minimum texture coordinate value from the texture coordinates of the vertices of the triangle; and
computing the barycentric coefficients.
-
-
4. The method as recited in claim 3, wherein the operation of determining the minimum texture coordinate value comprises:
-
selecting a minimum texture coordinate from the texture coordinates of the vertices of the triangle; and
determining the minimum texture coordinate value by computing a largest integer value that is equal to or less than the selected minimum texture coordinate.
-
-
5. The method as recited in claim 4, wherein the texture coordinates for the vertices of the triangle include C0in, C1in, and C2in, and wherein the operation of computing the barycentric coefficients comprises:
-
determining a first barycentric coefficient by computing (C0in-C2in);
determining a second barycentric coefficient by computing (C1in-C2in); and
determining a third barycentric coefficient by computing C2in minus the minimum texture coordinate value.
-
-
6. The method as recited in claim 5, wherein the barycentric coordinates include A and B, where A and B correspond to areas of sub-triangles defined by the selected pixel and the vertices of the triangle in a screen space.
-
7. The method as recited in claim 1, wherein the texture coordinates are computed by interpolation based on the barycentric coefficients and the barycentric coordinates.
-
8. The method as recited in claim 1, wherein the texture coordinates are computed in accordance with a barycentric equation.
-
9. The method as recited in claim 1, wherein each of the vertices and the selected pixel are associated with texture coordinates (s, t, r) and wherein the barycentric coefficients are determined for each of the texture coordinates (s, t, r) of the selected pixel.
-
10. The method as recited in claim 1, wherein the method selects a set of selected pixels within the triangle, wherein the method determines the barycentric coefficients and the texture coordinates of each of the selected set of pixels in parallel.
-
12. The device as recited in claim 1, wherein the means for determining the barycentric coefficients comprises:
means for translating the texture coordinates of the vertices of the triangle into revised texture coordinates such that the texture coordinates fit within a specified number range.
-
13. The device as recited in claim 1, wherein the means for determining the barycentric coefficients comprises:
-
a minimum value generator for determining a minimum texture coordinate value from the texture coordinates of the vertices of the triangle; and
means for computing the barycentric coefficients.
-
-
14. The device as recited in claim 13, wherein the means for determining the minimum texture coordinate value comprises:
-
means for selecting a minimum texture coordinate from the texture coordinates of the vertices of the triangle; and
means for determining the minimum texture coordinate value by computing a largest integer value that is equal to or less than the selected minimum texture coordinate.
-
-
15. The device as recited in claim 14, wherein the texture coordinates for the vertices of the triangle include C0in, C1in, and C2in, and wherein the means for computing the barycentric coefficients comprises:
-
means for determining a first barycentric coefficient by computing (C0in-C2in);
means for determining a second barycentric coefficient by computing (C1in-C2in); and
means for determining a third barycentric coefficient by computing C2in minus the minimum texture coordinate value.
-
-
11. A device for generating texture coordinates for a selected pixel within a triangle for a texture wrapping operation, the triangle having a plurality of vertices, the selected pixel being defined within the triangle by a plurality of barycentric coordinates, the device comprising:
-
means for receiving a set of texture coordinates for each of the vertices of the triangle;
means for receiving a plurality of barycentric coordinates associated with the selected pixel;
means for determining a plurality of barycentric coefficients for the selected pixel from the texture coordinates of the vertices of the triangle, the barycentric coefficients being optimized to obtain a specified degree of precision, the specified degree of precision being adapted to distinguish between neighboring texture coordinates; and
means for computing the texture coordinates based on the barycentric coefficients and the barycentric coordinates such that the texture coordinates are substantially distinct from neighboring texture coordinates.
-
-
16. A device for generating texture coordinates for a selected pixel within a triangle for a texture wrapping operation, the triangle having a plurality of vertices, the selected pixel being defined within the triangle by a plurality of barycentric coordinates, the device comprising:
-
vertex buffer circuitry adapted to receive a set of texture coordinates for each of the vertices of the triangle, the vertex buffer circuitry being configured to determine a plurality of barycentric coefficients for the selected pixel from the texture coordinates of the vertices of the triangle, the barycentric coefficients being optimized to obtain a specified degree of precision, the specified degree of precision being adapted to distinguish between neighboring texture coordinates; and
a barycentric evaluator coupled to receive the barycentric coefficients from the vertex buffer circuitry, the barycentric evaluator receiving a plurality of barycentric coordinates associated with the selected pixel, and the barycentric evaluator being configured to compute the texture coordinates based on the barycentric coefficients and the barycentric coordinates, wherein the texture coordinates are substantially distinct from neighboring texture coordinates. - View Dependent Claims (17, 18, 19, 20, 21, 22, 23, 24, 25)
a minimum texture coordinate generator arranged to receive the texture coordinates of the vertices of the triangle, the minimum texture coordinate generator being configured to generate a minimum texture coordinate value from the texture coordinates of the vertices of the triangle; and
a plurality of subtractors arranged to receive the texture coordinates of the vertices and the minimum texture coordinate value for generating the barycentric coefficients.
-
-
19. The device as recited in claim 18, wherein the minimum texture coordinate generator determines the minimum texture coordinate value by selecting a minimum texture coordinate from the texture coordinates of the vertices of the triangle and determining the minimum texture coordinate value by computing a largest integer value that is equal to or less than the selected minimum texture coordinate.
-
20. The device as recited in claim 19, wherein the texture coordinates for the vertices of the triangle include C0in, C1in, and C2in, and wherein the barycentric coefficients are (C0in-C2in), (C1in-C2in), and C2in minus the minimum texture coordinate value.
-
21. The device as recited in claim 20, wherein the barycentric coefficients include A and B, where A and B correspond to areas of sub-triangles defined by the selected pixel and the vertices of the triangle.
-
22. The device as recited in claim 16, wherein the barycentric evaluator includes an interpolator to interpolate the texture coordinates of the selected pixel based on the barycentric coefficients and the barycentric coordinates.
-
23. The device as recited in claim 16, wherein the barycentric evaluator computes the texture coordinates of the selected pixel in accordance with a barycentric equation.
-
24. The method as recited in claim 16, wherein each of the vertices and the selected pixel are associated with texture coordinates (s, t, r) and wherein the vertex buffer circuitry determines the barycentric coefficients for each of the texture coordinates (s, t, r) of the selected pixel.
-
25. The device as recited in claim 16, wherein the device selects a set of selected pixels within the triangle, wherein the device determines the barycentric coefficients and the texture coordinates of the selected set of pixels in parallel.
Specification