Claims
- 1. In a computer graphics system wherein objects are represented by one or more primitives each defined by a plurality of vertices, and wherein said objects are rendered to generate a two dimensional image for display during which coordinates of each vertex of said primitives are subjected to a perspective transformation which yields a perspectively transformed depth coordinate associated with the vertex, a method for mapping a texture function to pixels covered by at least one of said primitives comprising the steps of:
- associating at least one texture parameter to each vertex of said at least one of said primitives;
- for each vertex of said at least one of said primitives,
- determining a perspective factor associated with the given vertex based upon the perspectively transformed depth coordinate associated with the given vertex,
- applying said perspective factor associated with the given vertex to each texture parameter associated with the given vertex to generate a perspectively transformed texture parameter associated with the given vertex;
- for each pixel covered by said at least one primitive,
- for each texture parameter associated with each vertex of said at least one primitive, determining a perspectively transformed texture parameter associated with the given pixel according to perspectively transformed texture parameters associated with each vertex of said at least one of said primitives,
- determining a perspective factor associated with the given pixel according to said perspective factor associated with each vertex of said at least one of said primitives,
- generating an approximation of M over said perspective factor associated with the given pixel according to data stored in a look up table, and
- for each perspectively transformed texture parameter associated with the given pixel, performing an operation on said perspectively transformed texture parameter, said perspective factor and said approximation associated with the given pixel to determine a perspectively correct value of said texture parameter associated with the given pixel.
- 2. The method of claim 1,
- wherein the step of applying said perspective factor to each texture parameter associated with the given vertex includes the step of dividing each texture parameter by the projected z coordinate of the given vertex.
- 3. The method of claim 1,
- wherein each perspectively transformed texture parameter associated with the given pixel is determined according to plane equations associated with said at least one of said primitives, and
- wherein said perspective factor associated with the given pixel is determined according to plane equations associated with said at least one of said primitives.
- 4. The method of claim 1, wherein said look up table stores a value of K/q for a range of q.
- 5. The method of claim 4, wherein if said perspective factor associated with a given pixel lies within said-range of q, then
- reading out from said look up table a value of K/q coinciding with said perspective factor, and
- determining said approximation of M over said perspective factor associated with the given pixel according to said value of K/q read out from said look up table.
- 6. The method of claim 4, wherein if said perspective factor associated with the given pixel does not lie within said range of q, then
- applying a normalization function to said perspective factor associated with the given pixel to generate a normalized q that is within said range of q,
- reading out from said look up table a value coinciding with K over said normalized q,
- applying a denormalization function to said value read out from said look up table to generate said approximation of M over said perspective factor associated with the given pixel.
- 7. The method of claim 6, wherein said range of q is defined by the interval (q.sub.min, q.sub.max) and wherein, if said perspective factor assocaited with the given pixel is less than q.sub.min, then
- said normalized function that generates said normalized q (q.sub.NORM) is defined by the following equations:
- q=perspective factor associated with the given pixel
- nbits.sub.L =log.sub.2 (q.sub.min)
- nbits.sub.q =[1+-log.sub.2 (q)]
- kbits=nbits.sub.L +1-nbits.sub.q
- q.sub.NORM =q*2.sup.kbits
- and said denormalization function is defined by the following equation:
- M/q=(K/q.sub.NORM)*2.sup.kbits *M/K.
- 8.
- 8. The method of claim 6, wherein said range of q is defined by the interval (q.sub.min, q.sub.max), further comprising the step of:
- if said perspective factor associated with the given pixel is greater than q.sub.max, then reading out from said look up table a value coinciding with K over said normalized q incremented by 1.
- 9. The method of claim 6, wherein, if said perspective factor associated with the given pixel is greater than q.sub.max, then
- said normalized function that generates said normalized q (q.sub.NORM) is defined by the following equations:
- q=perspective factor associated with the given pixel
- nbits.sub.L =log.sub.2 (q.sub.min)
- nbits.sub.q =[1+log.sub.2 (q)]
- kbits=nbits.sub.q -nbits.sub.L -1
- q.sub.NORM =q*2.sup.kbits
- and said denormalization function is defined by the following equations:
- .delta.=(q-q.sub.NORM)*2.sup.kbits
- f.sub.1 =K/q.sub.NORM
- f.sub.2 =K/(q.sub.NORM +1) ##EQU8##10.
- 10. The method of claim 4, wherein said look up table comprises 32 entries each storing a value of K/q, and wherein each entry comprises 24 bits.
- 11. The method of claim 4, wherein said look up table comprises 64 entries each storing a value of K/q, and wherein each entry comprises 25 bits.
- 12. In a computer graphics system wherein objects are represented by one or more primitives each defined by a plurality of vertices, and wherein said objects are rendered to generate a two dimensional image for display during which coordinates of vertices of said primitives are subjected to a perspective transformation which yields a perspectively transformed depth coordinate associated with the vertex, an apparatus for mapping a texture function to pixels covered by at least one of said primitives comprising: means for associating at least one texture parameter to each vertex of said at least one of said primitives;
- for each vertex of said at least one of said primitives,
- means for determining a perspective factor associated with the given vertex based upon the perspectively transformed depth coordinate associated with the given vertex,
- means for applying said perspective factor associated with the given vertex to each texture parameter associated with the given vertex to generate a perspectively transformed texture parameter associated with the given vertex;
- for each pixel covered by said at least one primitive,
- for each texture parameter associated with each vertex of said at least one primitive, means for determining a perspectively transformed texture parameter associated with the given pixel according to perspectively transformed texture parameters associated with each vertex of said at least one of said primitives,
- means for determining a perspective factor associated with the given pixel according to said perspective factor associated with each vertex of said at least one of said primitives,
- means for generating an approximation of M over said perspective factor associated with the given pixel according to data stored in a look up table, and
- for each perspectively transformed texture parameter associated with the given pixel, means for performing an operation on said perspectively transformed texture parameter, said perspective factor and said approximation associated with the given pixel to determine a perspectively correct value of said texture parameter associated with the given pixel.
- 13. The apparatus of claim 12,
- wherein said means for applying said perspective factor to each texture parameter associated with the given vertex comprises means for dividing each texture parameter by the projected z coordinate of the given vertex.
- 14. The apparatus of claim 12,
- wherein each perspectively transformed texture parameter associated with the given pixel is determined according to plane equations associated with said at least one of said primitives, and
- wherein said perspective factor associated with the given pixel is determined according to plane equations associated with said at least one of said primitives.
- 15. The apparatus of claim 12, wherein said look up table stores a value of K/q for a range of q.
- 16. The apparatus of claim 15, further comprising:
- means for reading out from said look up table a value of K/q coinciding with said perspective factor associated with the given pixel if said perspective factor associated with the given pixel lies within said range of q, and
- means for determining said approximation of K over said perspective factor associated with the given pixel according to said value of K/q read out from said look up table.
- 17. The apparatus of claim 15, further comprising:
- means for applying a normalization function to said perspective factor associated with the given pixel to generate a normalized q that is within said range of q if said perspective factor associated with the given pixel does not lie within said range of q,
- means for reading out from said look up table a value coinciding with K over said normalized q, and
- means for applying a denormalization function to said value read out from said look up table to generate said approximation of K over said perspective factor associated with the given pixel.
- 18. The apparatus of claim 17, wherein said range of q is defined by the interval (q.sub.min, q.sub.max), and wherein, if said perspective factor associated with the given pixel is less than q.sub.min, then
- said normalized function that generates said normalized q (q.sub.NORM) is defined by the following equations:
- q=perspective factor associated with the given pixel
- nbits.sub.L =log.sub.2 (q.sub.min)
- nbits.sub.q =[1+log.sub.2 (q)]
- kbits=nbits.sub.L +1-nbits.sub.q
- q.sub.NORM =q*2.sup.kbits
- and said denormalization function is defined by the following equation:
- M/q=(K/q.sub.NORM)*2.sup.kbits *M/K
- 19. The apparatus of claim 17, wherein said range of q is defined by the interval (q.sub.min, q.sub.max), further comprising:
- means for reading out from said look up table a value coinciding with K over said normalized q incremented by 1 if said perspective factor associated with said given pixel is greater than q.sub.max.
- 20. The apparatus of claim 19, wherein, if said perspective factor associated with the given pixel is greater than q.sub.max, then
- said normalized function that generates said normalized q (q.sub.NORM) is defined by the following equations:
- q=perspective factor associated with the given pixel
- nbits.sub.L =log.sub.2 (q.sub.min)
- nbits.sub.q =[1+log.sub.2 (q)]
- kbits=nbits.sub.q -nbits.sub.L -1
- q.sub.NORM =q*2.sup.kbits
- and said denormalization function is defined by the following equations:
- .delta.=(q-q.sub.NORM)*2.sup.kbits
- f.sub.1 =K/q.sub.NORM
- f.sub.2 =K/(q.sub.NORM +1) ##EQU9##
- 21. The apparatus of claim 15, wherein said look up table comprises 32 entries each storing a value of K/q, and wherein each entry comprises 24 bits.
- 22. The apparatus of claim 15, wherein said look up table comprises 64 entries each storing a value of K/q, and wherein each entry comprises 25 bits.
- 23. The method of claim 4, wherein K is a power of 2.
- 24. The method of claim 1, wherein M is a power of 2.
- 25. The apparatus of claim 15, wherein K is a power of 2.
- 26. The apparatus of claim 12, wherein M is a power of 2.
CROSS-REFERENCE TO RELATED APPLICATIONS
The present application claims priority to co-pending U.S. Provisional Application Ser. No. 60/005,064 filed Oct. 6, 1995. This application is also a continuation of U.S. application Ser. No. 08/586,266, filed Jan. 16, 1996, herein incorporated by reference in its entirety.
US Referenced Citations (5)
Foreign Referenced Citations (1)
Number |
Date |
Country |
0 637 813 A2 |
Feb 1995 |
EPX |
Non-Patent Literature Citations (3)
Entry |
"Survey of Texture Mapping", P.S. Heckbert, IEEE CG&A, 1986. |
"Interpolation for Polygon Texture Mapping and Shading", P.S. Heckbert and H.P. Moreton, Dept. of Electrical Eng. and Computer Sciences, Univ. of Calif., Berkeley, CA 94720, Jul. 15, 1990. |
"A Trip Down the Graphics Pipeline: The Homogeneous Perspective Transform", J.F. Blinn, IEEE Computer Graphics & Applications, May 1993. |
Continuation in Parts (1)
|
Number |
Date |
Country |
Parent |
586266 |
Jan 1996 |
|