WO2010069269A1 - A method of determining texture map parameters to define a footprint in a graphics processor and device thereof - Google Patents

A method of determining texture map parameters to define a footprint in a graphics processor and device thereof Download PDF

Info

Publication number
WO2010069269A1
WO2010069269A1 PCT/CN2009/075707 CN2009075707W WO2010069269A1 WO 2010069269 A1 WO2010069269 A1 WO 2010069269A1 CN 2009075707 W CN2009075707 W CN 2009075707W WO 2010069269 A1 WO2010069269 A1 WO 2010069269A1
Authority
WO
WIPO (PCT)
Prior art keywords
footprint
log
anisotropy
lut
values
Prior art date
Application number
PCT/CN2009/075707
Other languages
French (fr)
Inventor
Qinyu Chen
Ji Zhou
Original Assignee
Advanced Micro Devices (Shanghai) Co., Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Advanced Micro Devices (Shanghai) Co., Ltd. filed Critical Advanced Micro Devices (Shanghai) Co., Ltd.
Publication of WO2010069269A1 publication Critical patent/WO2010069269A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping

Definitions

  • the present invention relates to computer graphics. More particularly, the present invention relates to filtering texture map data.
  • a texture is a one-, two- or multi-dimensional array of data items used in the calculation of the color or appearance of fragments produced by rasterization of a graphics scene.
  • a texture could be image data, color or transparency data, roughness/smoothness data, reflectivity data, etc.
  • computing a textured value for a pixel involves projecting a filter from screen space (indexed by x and y coordinates) into texture space (indexed by u and v coordinates).
  • the region in texture space corresponding to a pixel is called the pixel's "footprint".
  • a pixel can be approximated with a circle in screen space.
  • the corresponding footprint in texture space can be approximated by an ellipse.
  • isotropic filtering approximates the ellipse with a circle.
  • Isotropic filtering filters equally in the two texture space dimensions u and v and yields top image quality for pixels whose footprints have major and minor texture axes that are similar in length.
  • texture stretching, oblique viewing, and perspective can cause footprints to be very elongated.
  • the circle is never a good approximation to the ellipse.
  • An ideal filter would have approximately elliptical shape.
  • anisotropic filtering uses a filter that more closely matches the elliptical shape of the ideal filter. It is well known that all ellipses have a largest diameter, which is called the major axis, and a smallest diameter, which is called the minor axis. In contrast to isotropic filtering, anisotropic filtering results in fewer aliasing artifacts for footprints with major and minor axes that are not similar in length. To provide high quality textures, accurate computation of the length of minor axis and major axis is desired.
  • FIG. IA illustrates Footprint 115 including a Minor Axis 125 that is significantly shorter than a Major Axis 130.
  • Texture samples along Major Axis 130 are read from one or more mipmap levels and are blended to produce a pixel color.
  • the levels the samples are read from are determined using a level of detail (LOD) value which is nominally the log base 2 of the length of Minor Axis 125.
  • LOD level of detail
  • FIG. IB illustrates three vectors within anisotropic Footprint 115.
  • a vector 145 and a vector 150 which are not always perpendicular are used to determine the Major Axis and Minor Axis.
  • the Major Axis is determined by the length of the vector 145 and the vector 150.
  • the longer vector 150 approximates the Major Axis and the vector 155 perpendicular to the Major Axis approximates the Minor Axis.
  • FIG. 1C illustrates four vectors within anisotropic Footprint 115.
  • a vector 145 and a vector 150 which are not always perpendicular are used to determine the Major Axis and Minor Axis.
  • vector 160 approximates the Major Axis of Footprint 115 and is computed by summing the vector 145 and the vector 150 and dividing the sum by sqrt(2).
  • the vector 165 approximates the Minor Axis of Footprint 115 and is computed by subtracting the vector 150 from the vector 145 and dividing the difference by sqrt(2).
  • the computation of the lengths of Major Axis and Minor Axis is simplified. However, the image quality is not satisfactory.
  • 3D texture (Three Dimensional Texture) is a logical extension of the traditional 2D texture.
  • a 3D texture can be thought of as a number of thin pieces of texture used to generate a three dimensional image map.
  • 3D textures are typically represented by 3 coordinates. Similar to 2D textures, the coordinates of a 3D texture range from 0 to 1 in each dimension.
  • the filtering process in a 3D texture is also controlled in the same way as in a 2D texture, that is, with the help of texture parameters.
  • one object of the present invention is to provide a method of computing texture mapping parameters and a device thereof to reduce the die area and improve, in certain circumstances, the image quality.
  • a method of determining texture map parameters to define a footprint representing a projection of a pixel onto a texture map in a graphics processor comprising computing differential value t based on a pair of specified partial derivative vectors ( U x , V x ) and (u y ,v y ); determining a range AngleRg within which the direction value of the footprint ⁇ lies, and getting reference differential value t' to which the differential value t approximates; and fetching the reference direction value of the footprint ⁇ ' in the range AngleRg from a LUT corresponding to the reference differential value t'.
  • the differential value t is based on an ellipse coefficients based on said pair of specified partial derivative vectors.
  • A Ux 1 + Vx 1
  • B 2(UxUy + VxVy)
  • C Uy 1 + Vy 1 .
  • the method of computing texture mapping parameters obtains the direction of the major axis ⁇ ', sin2 ⁇ ', and cos2 ⁇ ' via looking up a LUT to compute parameters, such as lengths of the major and minor axes and LOD values, for texture mapping.
  • said pair of specified partial derivative vectors ( x , x )and ( y , y ) are separately a partial derivative of texture map coordinates u and v with respect to x and a partial derivative of texture map coordinates with respect to y.
  • the AngleRg is (0, ⁇ /S); if 0 ⁇ A-C ⁇ B or B ⁇ A-C ⁇ 0, the AngleRg is ( ⁇ /$, ⁇ IA); if 0 ⁇ A-C ⁇ -B or -B ⁇ A-C ⁇ 0, the AngleRg is ( ⁇ /4, 3 ⁇ /8); and if A-C ⁇ -B ⁇ 0 or 0 ⁇ -B ⁇ A-C, the AngleRg is (3 ⁇ /8, ⁇ 12).
  • the step of computing the length of the major axis anisotropic texture map parameter and the length of the minor axis anisotropic texture map parameter based on A , B , C, sin2 ⁇ ' , and cos2 ⁇ ' comprises computing (A+C) + [(A-C) cos (2 ⁇ ') + B sin (2 ⁇ ')] and (A+C) - [(A-C) cos (2 ⁇ ') + B sin (2 ⁇ ') ] to produce the first length and the second length; identifying a major axis anisotropic texture map parameter as the longer of the first length and the second length and a minor axis anisotropic texture map parameter as the shorter of the first length and the second length.
  • the method further comprises the step of constructing the LUT.
  • ); if t log(
  • the LUT includes the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ for the direction of the anisotropy of the footprint ⁇ (0, ⁇ /8) with a specified interval, wherein the reference differential values t' is represented by log(
  • the method further comprises the step of computing a level of detail anisotropic texture mapping parameter.
  • the method further comprises the step of computing a logratio using the first length and the second length.
  • the step of constructing LUT comprises, for the direction of the anisotropy of the footprint ⁇ (0, ⁇ /2) with a specified interval, computing the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ ,wherein the reference differential values t' represented by log(
  • ) approximate to differential values t log(
  • the step of constructing LUT comprises, for the direction of the anisotropy of the footprint ⁇ (0, ⁇ /2) with a specified interval, computing the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ , wherein the reference differential values t' represented by log(
  • ) approximate to differential values t log ( I B
  • the step of constructing LUT comprises, for the direction of the anisotropy of the footprint ⁇ (0, ⁇ 18) with a specified interval, computing the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin ⁇ , cos ⁇ , sin2 ⁇ and cos2 ⁇ to get a LUTi, wherein the reference differential values t' is represented by log(
  • the values of sin ⁇ and cos ⁇ are included in the LUT directly, while the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ , cos2 ⁇ can be obtained from the LUT indirectly.
  • the range AngleRg is (0, ⁇ /8)
  • get reference differential value t' to which the differential value t log (
  • the range AngleRg is (0, ⁇ IA)
  • get reference differential value t' to which the differential value t log(
  • the values of sin2 ⁇ and cos2 ⁇ can be obtained from the said LUT using the trigonometric function transform formulas.
  • a binary-search is used to get reference differential value t' to which the differential value t approximates.
  • the reference differential value t' corresponds to an Index which is used to fetch the reference direction value of the anisotropy of the footprint ⁇ ' in the determined range AngleRg and corresponding sin2 ⁇ ' and cos2 ⁇ ' from the LUT.
  • the matrix of ellipse can be
  • the matrix can also be defined as
  • A Ux 2 + Vx 2 + Wx 2
  • B 2(UxUy + VxVy + WxWy)
  • C Uy 2 + Vy 2 + Wy 2 ,
  • the present invention provides a computer program product.
  • the computer program product includes, but is not limited to, a medium bearing at least one of one or more programs for executing any one of the above-mentioned methods.
  • a device for computing texture mapping parameters comprising: an ellipse coefficients computation unit configured to compute ellipse coefficients based on a pair of specified partial derivative vectors ( U x V x ) and ( u y v y ); a differential value computation unit configured to compute a differential value t based on the ellipse coefficients in log scale; a comparing unit configured to determine the range AngleRg within which the direction value of the footprint ⁇ lies; a reference differential value obtaining unit configured to get reference differential value t' to which the differential value t approximates; and a LUT search unit configured to fetch the reference direction value of the footprint ⁇ ' in the determined range AngleRg from the LUT corresponding to the reference differential value t'.
  • a differential value computation unit configured to compute the differential value t between log (
  • the parameter computation unit further comprises a length computation unit configured to compute (A+C) + [(A-C) cos (2 ⁇ ') + B sin (2 ⁇ ') ] and (A+C) - [(A-C) cos (2 ⁇ ') + Bsin (2 ⁇ ') ] to produce the first length and the second length; and an identification unit configured to identify a major axis anisotropic texture map parameter as the longer of the first length and the second length and a minor axis anisotropic texture map parameter as the shorter of the first length and the second length.
  • said anisotropic device comprises the LUT construction unit used to construct the LUT which includes the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ for the direction of the anisotropy of the footprint ⁇ e (0, ⁇ /2 ) with a specified interval.
  • said anisotropic device comprises the LUT construction unit used to construct the LUT which includes the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ for the direction of the anisotropy of the footprint ⁇ (0, ⁇ /8) with a specified interval, wherein the reference differential values t' is represented by log(
  • said parameter computation device is configured to compute a level of detail anisotropic texture mapping parameter.
  • said parameter computation device is configured to compute a logratio using the first length and the second length.
  • it provides a method of computing texture map parameters to define a footprint representing a projection of a pixel onto a texture map in a graphics processor, comprising: computing ellipse coefficients
  • A Ux 1 + Vx 2 + Wx 1
  • B 2(UxUy + VxVy + WxWy)
  • C Uy 1 + Vy 1 + Wy 1 based on a pair of specified partial derivative vectors (u x ,v x , W x ) and (u ,v , w y ); computing differential value t based on the ellipse coefficients A, B, and C; determining a range AngleRg within which the direction value of the footprint ⁇ lies, and getting reference differential value t' to which the differential value t approximates; and fetching the reference direction value of the footprint ⁇ ' in the range AngleRg from a LUT corresponding to the reference differential value t'.
  • FIG. IA illustrate a prior art application of texture samples to surface.
  • FIG. IB illustrates three vectors within anisotropic Footprint 115 used to determine the major axis and minor axis in a prior art.
  • FIG. 1C illustrates four vectors within anisotropic Footprint 115 used to determine the major axis and minor axis in a prior art.
  • FIG. 2 A illustrates texture mapping parameters mapped to adjacent pixels in accordance with aspects of the present invention.
  • FIG. 2B illustrates two vectors within an anisotropic footprint used to determine the major axis and the minor axis of anisotropy in accordance with one or more aspects of the present invention.
  • FIG.3 illustrates the method of computing texture map parameters in accordance with one or more aspects of the present invention.
  • FIG.4 shows the first embodiment of a method of computing anisotropic texture mapping parameters according to aspects of the present invention.
  • FIG.5 shows the third embodiment of a method of computing anisotropic texture mapping parameters according to aspects of the present invention.
  • FIG.6A shows the fourth embodiment of a method of computing anisotropic texture mapping parameters according to aspects of the present invention.
  • FIG.6B shows the method of constructing the LUT in the fourth embodiment.
  • FIG.7A shows the fifth embodiment of a method of computing anisotropic texture mapping parameters according to aspects of the present invention.
  • FIG.7B shows the method of constructing the LUT in the fifth embodiment.
  • FIG.8 A shows the sixth embodiment of a method of computing anisotropic texture mapping parameters according to aspects of the present invention.
  • FIG.8B shows the method of constructing the LUT in the sixth embodiment.
  • FIG. 9 shows the binary search configuration in the sixth embodiment.
  • FIGlO shows an anisotropic unit for computing anisotropic texture mapping parameters according to aspects of the present invention.
  • the major and minor axes of anisotropy determine a footprint that represents the projection of the pixel onto the texture map.
  • exact determination of the major and minor axes requires complex computations which are not cost effective to implement within the die area constraints of graphics processors.
  • the simply approximated major and minor axes used to compute parameters for texture mapping failed to meet the requirement for image quality.
  • the direction of the major axis ⁇ ', sin2 ⁇ ', and cos2 ⁇ ' can be obtained via looking up LUT (lookup Table), which will be used to compute parameters, such as lengths of the major and minor axes and LOD values, for anisotropic texture mapping.
  • the present embodiment results in improved performance compared with exact computation of the anisotropic texture mapping parameters and favorable image quality compared with simple approximation of the anisotropic texture mapping parameters.
  • FIG. 2A shows four pixels in (x, y) screen space with their corresponding texture coordinates u , v , a Pixel 200, a Pixel 201, a Pixel 202, and a Pixel 203, in accordance with one or more aspects of the present invention.
  • Texture coordinate w can be added only for mapping of three dimensional texture.
  • FIG. 2B shows the footprint of the four pixels, Pixels 200, 201, 202, and 203, in texture space.
  • Points 210, 211, and 212 are the texture coordinates of Pixels 200, 201, and 202, respectively.
  • Texture coordinates for Pixel 200, 0,0 are shown in the FIG. 2B as Point 210.
  • Texture coordinates for Pixel 201, u ⁇ , v ⁇ are shown in FIG. 2B as Point 211.
  • Texture coordinates for Pixel 202, M 25 V 2 are shown in FIG. 2B as Point 212.
  • Difference Vector 221 is the partial derivative of (u ,v) with respect to x.
  • Difference Vector 222 is the partial derivative of (u , v) with respect to y.
  • Fig.3 illustrates the method of computing texture map parameters in accordance with one or more aspects of the present invention.
  • Step 302 ellipse coefficients are computed based on a pair of specified partial derivative vectors (u x ,v x ) and
  • a differential value t is computed based on the ellipse coefficients A, B and C in log scale.
  • the differential value t can be log(
  • a range AngleRg within which the direction value of the footprint ⁇ ' lies is determined, and get reference differential value t' to which the differential value t approximates. If 0 ⁇ B ⁇ A-C or A-C ⁇ B ⁇ 0 is true, the AngleRg is (0, ⁇ /S); if not, further determining whether 0 ⁇ A-C ⁇ B or B ⁇ A-C ⁇ 0 is true, if it is true, the AngleRg is ( ⁇ /S, ⁇ IA); if it is false, further determining whether 0 ⁇ A-C ⁇ -B or -B ⁇ A-C ⁇ 0 is true, if it is true, the AngleRg is ( ⁇ IA, 7> ⁇ lS), otherwise the AngleRg is (3 ⁇ lS, ⁇ /2).
  • step 308 the reference direction value of the footprint ⁇ ' in the range AngleRg from a LUT corresponding to the reference differential value t' is fetched.
  • ) may be hardcoded to do a binary-search, while LUT may be preloaded in a ROM.
  • the LUT can include the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ for the direction of the anisotropy of the footprint ⁇ (0, ⁇ /2 )with a specified interval, wherein the reference differential values t' represented by log(
  • ) approximate to the differential values t log(
  • the LUT also can include the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ for the direction of the anisotropy of the footprint ⁇ (0, ⁇ /2 )with a specified interval, wherein the reference differential values t' represented by log(
  • ) approximate to the differential values t
  • the LUT also can include the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ for the direction of the anisotropy of the footprint ⁇ (0, ⁇ /S) with a specified interval, wherein the reference differential values t' is represented by log(
  • Fig. 4 shows the first embodiment of a method of computing texture mapping parameters according to aspects of the present invention.
  • Table 1 shows the LUT which includes the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ for the direction of the anisotropy of the footprint ⁇ (0, ⁇ /2 ) with an interval, wherein the reference differential values t' represented by log(
  • ) approximates to the differential value t log(
  • Step 406 A-C, B, and 0 are compared to determine the range AngleRg within which the reference direction value of the anisotropy of the footprint ⁇ ' lies. Comparing A-C, B, and 0, if 0 ⁇ B ⁇ A-C or A-C ⁇ B ⁇ 0, the AngleRg is (0, ⁇ /S); if 0 ⁇ A-C ⁇ B or B ⁇ A-C ⁇ 0, the AngleRg is ( ⁇ /$, ⁇ IA); if 0 ⁇ A-C ⁇ -B or -B ⁇ A-C ⁇ 0, the AngleRg is ( ⁇ /4, 3 ⁇ /S); and if A-C ⁇ -B ⁇ 0 or 0 ⁇ -B ⁇ A-C, the AngleRg is (3 ⁇ /8, ⁇ /2).
  • step 408 the reference direction value of the anisotropy of the footprint ⁇ ' in the range AngleRg, sin2 ⁇ ' and cos2 ⁇ ' are fetched from the LUT corresponding to the reference differential value t'.
  • the 24 ⁇ /60 is in the range AngleRg (3 ⁇ /8, n IT), so the reference direction value of the anisotropy of the footprint ⁇ ' equals to 24 ⁇ /60, sin2 ⁇ ' equals to 0.587785, and cos2 ⁇ ' equals to -0.809017.
  • step 410 (A+C) + [(A-C) cos (2 ⁇ ') + B sin (2 ⁇ ') ] and (A+C) - [(A-C) cos (2 ⁇ ') + B sin (2 ⁇ ') ] are computed to produce the first length and the second length.
  • step 412 a comparison between the first length and the second length is conducted, identifying the longer length and the shorter length as the length of major axis and the length of minor axis, respectively.
  • step 414 the base-two logarithm (log) of the major axis length is computed to produce a logmajor value and the base-two log of the minor axis length is computed to produce a logminor value, i.e., LOD.
  • a logratio value is computed by subtracting the logminor value from the logmajor value.
  • the logratio value is equivalent to the base-two log of the ratio value.
  • the LUT includes the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ for the direction of the anisotropy of the footprint ⁇ (0, ⁇ ll ) with an interval ⁇ /60 , wherein the reference differential values t' represented by log(
  • ) approximates to the differential value t log ( I A-C I ) - log ( I B
  • Fig. 5 shows the third embodiment of a method of computing texture mapping parameters according to the present invention.
  • Table 2 shows another LUT which includes the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ for the direction of the anisotropy of the footprint ⁇ (0, ⁇ /8) with a specified interval, wherein the reference differential values t' is represented by log(
  • the LUT also includes the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ for the direction of the anisotropy of the footprint ⁇ [ ⁇ /8 , ⁇ 14) with the specified interval, wherein the reference differential values t' represented by log(
  • Step 504 differential value t between log(
  • ) -0.17609
  • A-C, B, and 0 are compared to determine the range AngleRg within which the reference direction value of the anisotropy of the footprint ⁇ ' lies. Comparing A-C, B, and 0, if 0 ⁇ B ⁇ A-C or A-C ⁇ B ⁇ 0, the AngleRg is (0, ⁇ /S); if 0 ⁇ A-C ⁇ B or B ⁇ A-C ⁇ 0, the AngleRg is ( ⁇ /S, ⁇ IA); if 0 ⁇ A-C ⁇ -B or -B ⁇ A-C ⁇ 0, the AngleRg is ( ⁇ /4, 3 ⁇ /S); and if A-C ⁇ -B ⁇ 0 or 0 ⁇ -B ⁇ A-C, the AngleRg is (3 ⁇ /S, ⁇ /2).
  • step 508 the reference direction value of the anisotropy of the footprint ⁇ ' in the range AngleRg, sin2 ⁇ ', and cos2 ⁇ ' are fetched from the LUT corresponding to the reference differential value t'.
  • step 510 the (A+C) + [(A-C) cos (2 ⁇ ') + B sin (2 ⁇ ') ] and (A+C) - [(A-C) cos (2 ⁇ ') + B sin (2 ⁇ ') ] are computed to produce the first length and the second length.
  • step 512 a comparison between the first length and the second length is conducted, identifying the longer length and the shorter length as the length of major axis and the length of minor axis, respectively.
  • step 514 the base-two logarithm (log) of the major axis length is computed to produce a logmajor value and the base-two log of the minor axis length is computed to produce a logminor value i.e. LOD.
  • step 516 a logratio value is computed by subtracting the logminor value from the logmajor value. The logratio value is equivalent to the base-two log of the ratio value.
  • FIG.6A shows the fourth embodiment of a method of computing texture mapping parameters according to an aspect of the present invention.
  • FIG.6B shows the method of constructing LUT in the fourth embodiment.
  • Step 600 the LUT is constructed.
  • the step further comprises the following substeps:
  • Step 6001 for the direction of the anisotropy of the footprint ⁇ (0, ⁇ /2) with a specified interval, compute the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ , wherein the reference differential values t' represented by log(
  • Step 606 A-C, B, and 0 are compared to determine the range AngleRg within which the reference direction value of the anisotropy of the footprint ⁇ ' lies. Subsequently, get the reference differential value t' to which the differential value t approximates in the LUT.
  • step 608 the reference direction value of the anisotropy of the footprint ⁇ ' in the range AngleRg, sin2 ⁇ ', and cos2 ⁇ ' are fetched from the LUT corresponding to the reference differential value t'.
  • step 610 (A+C) + [(A-C) cos (2 ⁇ ') + B sin (2 ⁇ ')] and (A+C) - [(A-C) cos (2 ⁇ ') + B sin (2 ⁇ ')] are computed to produce the first length and the second length;
  • step 612 a comparison between the first length and the second length is conducted, identifying the longer length and the shorter length as the length of major axis and the length of minor axis, respectively.
  • step 614 the base-two logarithm (log) of the major axis length is computed to produce a logmajor value and the base-two log of the minor axis length is computed to produce a logminor value i.e. LOD.
  • a logratio value is computed by subtracting the logminor value from the logmajor value.
  • the logratio value is equivalent to the base-two log of the ratio value.
  • FIG.7A shows the fifth embodiment of a method of computing anisotropic texture mapping parameters according to an aspect of the present invention.
  • FIG.7B shows the method of constructing LUT in the fifth embodiment.
  • Step 700 LUT is constructed.
  • the step further comprises the following substeps:
  • Step 7001 for the direction of the anisotropy of the footprint ⁇ ( 0, ⁇ 12 ) with a specified interval, compute the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ , wherein the reference differential values t' is represented by log(
  • Step 706 A-C, B, and 0 are compared to determine the range AngleRg within which the reference direction value of the anisotropy of the footprint ⁇ ' lies. Subsequently, get the reference differential value t' to which the differential value t approximates in the LUT.
  • step 708 the reference direction value of the anisotropy of the footprint ⁇ ' in the range AngleRg, sin2 ⁇ ', and cos2 ⁇ ' are fetched from the LUT corresponding to the reference differential value t'.
  • step 710 (A+C) + [(A-C) cos (2 ⁇ ') + B sin (2 ⁇ ')] and (A+C) - [(A-C) cos (2 ⁇ ') + B sin (2 ⁇ ')] are computed to produce the first length and the second length;
  • step 712 a comparison between the first length and the second length is conducted, identifying the longer length and the shorter length as the length of major axis and the length of minor axis, respectively.
  • step 714 the base-two logarithm (log) of the major axis length is computed to produce a logmajor value and the base-two log of the minor axis length is computed to produce a logminor value i.e. LOD.
  • a logratio value is computed by subtracting the logminor value from the logmajor value.
  • the logratio value is equivalent to the base-two log of the ratio value.
  • FIG. 8A shows the sixth embodiment of a method of computing anisotropic texture mapping parameters according to aspects of the present invention.
  • FIG.8B shows the method of constructing LUT in the sixth embodiment.
  • Step 800 LUT is constructed.
  • the step further comprises the following substeps:
  • Step 8001 for the direction of the anisotropy of the footprint ⁇ (0, ⁇ /8) with a specified interval, compute the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin ⁇ , cos ⁇ , sin2 ⁇ , and cos2 ⁇ to get LUTi, wherein the reference differential values t' is represented by log(
  • Step 8002 for the direction of the anisotropy of the footprint ⁇ ( ⁇ /8, ⁇ IA ) with the specified interval, compute the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin ⁇ , cos ⁇ , sin2 ⁇ , and cos2 ⁇ to get LUT 2 , wherein the reference differential values t' is represented by log(
  • Step 8003 combine the tables LUTi with LUT 2 , and delete the redundant columns of sin2 ⁇ and cos2 ⁇ to get LUT;
  • Table 3 shows the LUTi in the sixth embodiment.
  • Table 4 shows the LUT 2 in the sixth embodiment.
  • Table 5 shows the LUT obtained by combining LUTi with LUT 2 .
  • the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ , cos2 ⁇ are included in the LUT indirectly, while the values of sin ⁇ and cos ⁇ are included in the LUT directly.
  • Step 804 differential value t between log(
  • ) log22-log23
  • Step 806 A-C, B, and 0 are compared to determine the range AngleRg within which the reference direction value of the anisotropy of the footprint ⁇ ' lies. Comparing A-C, B, and 0, if 0 ⁇ B ⁇ A-C or A-C ⁇ B ⁇ 0, the AngleRg is (0, ⁇ /S); if 0 ⁇ A-C ⁇ B or B ⁇ A-C ⁇ 0, the AngleRg is ( ⁇ /S, ⁇ IA); if 0 ⁇ A-C ⁇ -B or -B ⁇ A-C ⁇ 0, the AngleRg is ( ⁇ /4, 3 ⁇ /S); and if A-C ⁇ -B ⁇ 0 or 0 ⁇ -B ⁇ A-C, the AngleRg is (3 ⁇ /S, ⁇ /2).
  • the reference differential values correspond with indexes which are integers. Therefore, the index corresponding to the reference differential value t' can be obtained.
  • step 808 the reference direction value of the anisotropy of the footprint ⁇ ' in the range AngleRg, sin2 ⁇ ', and cos2 ⁇ ' are fetched from the LUT corresponding to the Index.
  • the Index 6 is used to look up the LUT according to the relationship between the Index and the position of the reference direction value of the anisotropy of the footprint ⁇ ' in the range AngleRg, sin2 ⁇ ', and cos2 ⁇ '.
  • ⁇ ' 9 ⁇ /60
  • sin2 ⁇ ' 0.809017
  • cos2 ⁇ ' 0.587785.
  • step 810 (A+C) + [(A-C) cos (2 ⁇ ') + B sin (2 ⁇ ') ] and (A+C) - [(A-C) cos (2 ⁇ ') + B sin (2 ⁇ ') ] are computed to produce the first length and the second length.
  • step 812 a comparison between the first length and the second length is conducted, identifying the longer length and the shorter length as the length of major axis and the length of minor axis, respectively.
  • step 814 the base-two logarithm (log) of the major axis length is computed to produce a logmajor value and the base-two log of the minor axis length is computed to produce a logminor value i.e. LOD.
  • a logratio value is computed by subtracting the logminor value from the logmajor value.
  • the logratio value is equivalent to the base-two log of the ratio value.
  • Fig.10 shows a device for computing texture mapping parameters according to one aspect of the present invention.
  • the device comprises:
  • an ellipse coefficients computation unit 1001 configured to compute the ellipse coefficients based on a pair of specified partial derivative vectors ( U x V x ) and
  • a differential value computation unit 1003 configured to compute the differential value t based on the ellipse coefficients in log scale
  • comparing unit 1005 configured to determine a range AngleRg within which the direction value of the footprint ⁇ ' lies
  • reference differential value obtaining unit 1007 configured to get reference differential value t' to which the differential value t approximates, wherein the differential value t comes from a differential value computation unit 1003;
  • a LUT search unit 1009 configured to fetch the reference direction value of the footprint ⁇ ' in a determined range AngleRg from a LUT corresponding to the reference differential value t';
  • the parameter computation unit 1011 configured to compute texture parameters.
  • the parameter computation unit 1011 comprises length computation unit configured to computing (A+C) + [(A-C) cos (2 ⁇ ') + B sin (2 ⁇ ') ] and (A+C) - [(A-C) cos (2 ⁇ ') + Bsin (2 ⁇ ') ] to produce the first length and the second length; and an identification unit configured to identify a major axis anisotropic texture map parameter as the longer of the first length and the second length and a minor axis anisotropic texture map parameter as the shorter of the first length and the second length.
  • the device for computing texture mapping parameters further comprises a LUT construction unit used to construct the LUT which includes the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ , and cos2 ⁇ for the direction of the anisotropy of the footprint ⁇ e (0, ⁇ /2 ) with a specified interval.
  • the device for computing texture mapping parameters further comprises a LUT construction unit used to construct the LUT which includes the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ for the direction of the anisotropy of the footprint ⁇ (0, ⁇ /8) with a specified interval, wherein the reference differential values t' represented by log(
  • a LUT construction unit used to construct the LUT which includes the values of every direction of the anisotropy of the footprint ⁇ and corresponding sin2 ⁇ and cos2 ⁇ for the direction of the anisotropy of the footprint
  • a parameter computation unit 1011 is configured to compute a level of detail anisotropic texture mapping parameter.
  • a parameter computation unit 1011 is configured to compute a logratio using the first length and the second length.
  • the present invention can be applied to both anisotropic and isotropic filtering.
  • anisotropic filtering needs the length of minor axis/ratio/direction, while only the length of major axis is needed for isotropic filtering. It is apparent to those skilled in the art that if the ellipse matrix is defined as
  • ASIC application-specific integrated circuit
  • programmable logic device discrete gate or transistor logic
  • discrete hardware components such as, e.g., registers and FIFO
  • processor executing a set of firmware instructions any conventional programmable software and a processor, or any combination thereof.
  • hardware components may be manufactured based on hardware description language (HDL) instructions stored on a computer readable medium.
  • HDL hardware description language
  • HDL instructions may be used for mask works and the like and ultimately configure a manufacturing process so as to manufacture a hardware device (such as a processor, for example) capable of operating in accordance with aspects of the invention.
  • the processor may advantageously be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine.
  • the software could reside in RAM memory, flash memory, ROM memory, registers, hard disk, a removable disk, or any other form of storage medium known in the art.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The present invention discloses a method of determining texture map parameters to define a footprint representing a projection of a pixel onto a texture map in a graphics processor. The method comprises computing ellipse coefficients based on a pair of specified partial derivative vectors ( U x , V x ) and ( u y , v y ); computing differential value t based on the ellipse coefficients in log scale; determine a range AngleRg within which the direction value of the footprint a lies, and getting reference differential value t' to which the differential value t approximates; and fetching the reference direction value of the footprint a' in the range AngleRg from a LUT corresponding to the reference differential value t'. The present invention results in improved performance compared with exact computation of the texture mapping parameters and favorable image quality compared with simple approximation of the texture mapping parameters.

Description

A METHOD OF DETERMINING TEXTURE MAP
PARAMETERS TO DEFINE A FOOTPRINT IN A GRAPHICS
PROCESSORAND DEVICE THEREOF
TECHNICAL FIELD
The present invention relates to computer graphics. More particularly, the present invention relates to filtering texture map data.
BACKGROUND ART
A texture is a one-, two- or multi-dimensional array of data items used in the calculation of the color or appearance of fragments produced by rasterization of a graphics scene. A texture could be image data, color or transparency data, roughness/smoothness data, reflectivity data, etc. Generally, computing a textured value for a pixel involves projecting a filter from screen space (indexed by x and y coordinates) into texture space (indexed by u and v coordinates). The region in texture space corresponding to a pixel is called the pixel's "footprint". A pixel can be approximated with a circle in screen space. For texture mapping of 2-dimensional pixels, the corresponding footprint in texture space can be approximated by an ellipse.
For low hardware cost and speed, isotropic filtering approximates the ellipse with a circle. Isotropic filtering filters equally in the two texture space dimensions u and v and yields top image quality for pixels whose footprints have major and minor texture axes that are similar in length. However, texture stretching, oblique viewing, and perspective can cause footprints to be very elongated. In such cases, the circle is never a good approximation to the ellipse. An ideal filter would have approximately elliptical shape.
To correct the problem, as mentioned, anisotropic filtering uses a filter that more closely matches the elliptical shape of the ideal filter. It is well known that all ellipses have a largest diameter, which is called the major axis, and a smallest diameter, which is called the minor axis. In contrast to isotropic filtering, anisotropic filtering results in fewer aliasing artifacts for footprints with major and minor axes that are not similar in length. To provide high quality textures, accurate computation of the length of minor axis and major axis is desired.
FIG. IA illustrates Footprint 115 including a Minor Axis 125 that is significantly shorter than a Major Axis 130. Texture samples along Major Axis 130 are read from one or more mipmap levels and are blended to produce a pixel color. The levels the samples are read from are determined using a level of detail (LOD) value which is nominally the log base 2 of the length of Minor Axis 125. An exact computation of the lengths of Major Axis 130 and Minor Axis 125 has proved to be complex and expensive in terms of performance and/or die area.
In order to simplify the computation, several different approaches have been generated to approximate the Major Axis and the Minor Axis. FIG. IB illustrates three vectors within anisotropic Footprint 115. A vector 145 and a vector 150 which are not always perpendicular are used to determine the Major Axis and Minor Axis. According to one of the prior art, the Major Axis is determined by the length of the vector 145 and the vector 150. The longer vector 150 approximates the Major Axis and the vector 155 perpendicular to the Major Axis approximates the Minor Axis. FIG. 1C illustrates four vectors within anisotropic Footprint 115. A vector 145 and a vector 150 which are not always perpendicular are used to determine the Major Axis and Minor Axis. According to another prior art, vector 160 approximates the Major Axis of Footprint 115 and is computed by summing the vector 145 and the vector 150 and dividing the sum by sqrt(2). Likewise, the vector 165 approximates the Minor Axis of Footprint 115 and is computed by subtracting the vector 150 from the vector 145 and dividing the difference by sqrt(2). The computation of the lengths of Major Axis and Minor Axis is simplified. However, the image quality is not satisfactory.
3D texture (Three Dimensional Texture) is a logical extension of the traditional 2D texture. A 3D texture can be thought of as a number of thin pieces of texture used to generate a three dimensional image map. 3D textures are typically represented by 3 coordinates. Similar to 2D textures, the coordinates of a 3D texture range from 0 to 1 in each dimension. The filtering process in a 3D texture is also controlled in the same way as in a 2D texture, that is, with the help of texture parameters.
Currently, the algorithm to apply derivative correction in DX 10/11 is very complicated, involving many division, multiplier, square, and log operations, etc. In the case of 3D texture, more computation operations are included, which is nearly unacceptable. And as a result, it is extremely difficult to implement the algorithm on hardware.
Accordingly, there is a need for a simplified algorithm to save logic area and keep a good balance between the accuracy of computing anisotropic texture mapping parameters and the size of the die area.
SUMMARY OF THE INVENTION
To resolve the existing problems in the prior technology, one object of the present invention is to provide a method of computing texture mapping parameters and a device thereof to reduce the die area and improve, in certain circumstances, the image quality.
In one aspect of the present invention, it provides a method of determining texture map parameters to define a footprint representing a projection of a pixel onto a texture map in a graphics processor, comprising computing differential value t based on a pair of specified partial derivative vectors ( Ux , Vx ) and (uy ,vy); determining a range AngleRg within which the direction value of the footprint α lies, and getting reference differential value t' to which the differential value t approximates; and fetching the reference direction value of the footprint α' in the range AngleRg from a LUT corresponding to the reference differential value t'.
Preferably, the differential value t is based on an ellipse coefficients based on said pair of specified partial derivative vectors. The ellipse coefficients can be defined as A=
Figure imgf000004_0001
+ uy 2 , B= 2(uxvx + u yvy) , and C= vx 2 + vy 2 or
A = Ux1 + Vx1, B = 2(UxUy + VxVy), C = Uy1 + Vy1. The method of computing texture mapping parameters obtains the direction of the major axis α', sin2α', and cos2α' via looking up a LUT to compute parameters, such as lengths of the major and minor axes and LOD values, for texture mapping.
Specifically, it can be a method of computing anisotropic texture map parameters to define an anisotropic footprint representing a projection of a pixel onto a texture map in a graphics processor, comprising: computing ellipse coefficients A=ux 2 +u2
B= 2(uxvx + uyvy) , and C= vx 2 + vy 2 based on a pair of specified partial derivative
vectors (ux ,vx ) and (uy ,vy); computing differential value t between log ( I A-C I ) and log ( I B | ) based on the ellipse coefficients A, B, and C; comparing A-C, B, and 0 to determine the range AngleRg within which the reference direction value of the anisotropy of the footprint α' lies, and getting reference differential value t' to which the differential value t approximates; fetching the reference direction value of the anisotropy of the footprint α' in a range AngleRg and corresponding sin2q' and cos2α' from a LUT corresponding to the reference differential value t'; computing the length of the major axis anisotropic texture map parameter and the length of the minor axis anisotropic texture map parameter based on A , B , C, sin2α' , and cos2α'.
Preferably, said pair of specified partial derivative vectors ( x , x )and ( y , y ) are separately a partial derivative of texture map coordinates u and v with respect to x and a partial derivative of texture map coordinates with respect to y.
Preferably, if 0<B<A-C or A-C<B<0, the AngleRg is (0, π /S); if 0< A-C <B or B<A-C<0, the AngleRg is (π/$, π IA); if 0< A-C <-B or -B<A-C<0, the AngleRg is ( π /4, 3 π /8); and if A-C <-B<0 or 0<-B<A-C, the AngleRg is (3 ΛΓ /8, π 12).
Preferably, the step of computing the length of the major axis anisotropic texture map parameter and the length of the minor axis anisotropic texture map parameter based on A , B , C, sin2α' , and cos2α' comprises computing (A+C) + [(A-C) cos (2α') + B sin (2α')] and (A+C) - [(A-C) cos (2α') + B sin (2α') ] to produce the first length and the second length; identifying a major axis anisotropic texture map parameter as the longer of the first length and the second length and a minor axis anisotropic texture map parameter as the shorter of the first length and the second length. Preferably, the method further comprises the step of constructing the LUT.
Preferably, the LUT includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α, cos2α, and reference differential values t' for the direction of the anisotropy of the footprint α<≡ (0, π/2 ) with a specified interval, wherein the reference differential values t' approximates to the differential values t. More preferably, if t=log(|A-C|) - log(|B|), t' is represented by log(|cot(2α)|); if t =log(|B|) - log(|A-C|), t' is represented by log(|tan(2α)|)
Preferably, the LUT includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α<≡ (0, π/8) with a specified interval, wherein the reference differential values t' is represented by log(|tan(2α)|); and includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint ae [π/8, π /4) with the specified interval, wherein the reference differential values t' is represented by log(|cot(2α)|).
Preferably, the method further comprises the step of computing a level of detail anisotropic texture mapping parameter.
Preferably, the method further comprises the step of computing a logratio using the first length and the second length.
Preferably, the step of constructing LUT comprises, for the direction of the anisotropy of the footprint α<≡ (0, π/2) with a specified interval, computing the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α,wherein the reference differential values t' represented by log(|cot(2α)|) approximate to differential values t=log(|A-C|)- log(|B|); and organizing the computed values of every direction of the anisotropy of the footprint α and corresponding sin2α, cos2α and reference differential values to generate the LUT.
Preferably, the step of constructing LUT comprises, for the direction of the anisotropy of the footprint α<≡ (0, π/2) with a specified interval, computing the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α, wherein the reference differential values t' represented by log(|tan(2α)|) approximate to differential values t=log ( I B | ) - log ( I A-C I ) ; and organizing the computed values of every direction of the anisotropy of the footprint α and corresponding sin2α, cos2α and reference differential values to generate the LUT.
Preferably, the step of constructing LUT comprises, for the direction of the anisotropy of the footprint α<≡ (0, π 18) with a specified interval, computing the values of every direction of the anisotropy of the footprint α and corresponding sinα, cosα, sin2α and cos2α to get a LUTi, wherein the reference differential values t' is represented by log(|tan(2α)|); for the direction of the anisotropy of the footprint α<≡ ( π/8, π IA ) with the specified interval, computing the values of every direction of the anisotropy of the footprint α and corresponding sinα, cosα, sin2α and cos2α to get a LUT2 wherein the reference differential values t' is represented by log(|cot(2α)|); and combining the two tables LUTi and LUT2 , and deleting the redundant columns of sin2α and cos2α to get a LUT3.
Preferably, the values of sinα and cosα are included in the LUT directly, while the values of every direction of the anisotropy of the footprint α and corresponding sin2α, cos2α can be obtained from the LUT indirectly.
Preferably, if the range AngleRg is (0, π/8), get reference differential value t' to which the differential value t= log (|B|) - log (|A-C|) approximates; if the range AngleRg is (0, π IA), get reference differential value t' to which the differential value t= log(|A-C|) - log (|B|) approximates.
Preferably, for the direction of the anisotropy of the footprint a<≡(π IA, π 12), the values of sin2α and cos2α can be obtained from the said LUT using the trigonometric function transform formulas.
Preferably, a binary-search is used to get reference differential value t' to which the differential value t approximates.
Preferably, the reference differential value t' corresponds to an Index which is used to fetch the reference direction value of the anisotropy of the footprint α' in the determined range AngleRg and corresponding sin2α' and cos2α' from the LUT.
The matrix of ellipse can be
~Ux Uy ~Ux Vx Ux2 + Uy2 UxVx + UyVy A BI2
M = T * T=
Vx Vy_ Uy Vy_ UxVx + UyVy Vx2 + Vy2 B/2 C On the other hand, the matrix can also be defined as
Ux2 + Vx2 UxUy + VxVy
M = r*τ = , that is, wherein the ellipse coefficients
UxUv + VxVv Uy2 + Vy
can be defined as A = Ux2 + Vx2, B = 2(UxUy + Vx Vy), C = Uy2 + Vy2. By adding a third item W and set
A = Ux2 + Vx2 + Wx2, B = 2(UxUy + VxVy + WxWy), C = Uy2 + Vy2 + Wy2 ,
the above method can also be applied to 3D texture.
In another aspect of the present invention, it provides a computer program product. In one implementation, the computer program product includes, but is not limited to, a medium bearing at least one of one or more programs for executing any one of the above-mentioned methods.
In another aspect of the present invention, it provides a device for computing texture mapping parameters, comprising: an ellipse coefficients computation unit configured to compute ellipse coefficients based on a pair of specified partial derivative vectors ( Ux Vx ) and ( uy vy ); a differential value computation unit configured to compute a differential value t based on the ellipse coefficients in log scale; a comparing unit configured to determine the range AngleRg within which the direction value of the footprint α lies; a reference differential value obtaining unit configured to get reference differential value t' to which the differential value t approximates; and a LUT search unit configured to fetch the reference direction value of the footprint α' in the determined range AngleRg from the LUT corresponding to the reference differential value t'.
Specifically, the present device can be used for computing anisotropic texture mapping parameters by comprising: an ellipse coefficients computation unit configured to compute the ellipse coefficients A=ux 2 +uy 2 , B=2(uxvx +uyvy) , and C=
v x + vl based on a pair of specified partial derivative vectors (ux Vx ) and (uy vy); a differential value computation unit configured to compute the differential value t between log (|A-C|) and log(|B|); comparing unit configured to compare A-C, B, and 0 to determine the range AngleRg within which the reference direction value of the anisotropy of the footprint α' lies; reference differential value obtaining unit configured to get reference differential value t' to which the differential value t approximates; a LUT search unit configured to fetch the reference direction value of the anisotropy of the footprint α' in a determined range AngleRg, sin2α', and cos2α' from a LUT corresponding to the reference differential value t'; a parameter computation unit configured to compute the length of the major axis anisotropic texture map parameter and the length of the minor axis anisotropic texture map parameter based on A , B , C, sin2α' , and cos2α'.
Preferably, the parameter computation unit further comprises a length computation unit configured to compute (A+C) + [(A-C) cos (2α') + B sin (2α') ] and (A+C) - [(A-C) cos (2α') + Bsin (2α') ] to produce the first length and the second length; and an identification unit configured to identify a major axis anisotropic texture map parameter as the longer of the first length and the second length and a minor axis anisotropic texture map parameter as the shorter of the first length and the second length.
Preferably, said anisotropic device comprises the LUT construction unit used to construct the LUT which includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α e (0, π/2 ) with a specified interval.
Preferably, said anisotropic device comprises the LUT construction unit used to construct the LUT which includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α<≡ (0, π/8) with a specified interval, wherein the reference differential values t' is represented by log(|tan(2α)|); and also includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α<≡ [;z78, π/4) with the specified interval, wherein the reference differential values t' is represented by log(|cot(2α)|).
Preferably, said parameter computation device is configured to compute a level of detail anisotropic texture mapping parameter.
Preferably, said parameter computation device is configured to compute a logratio using the first length and the second length.
In another aspect of the present invention, it provides a method of computing texture map parameters to define a footprint representing a projection of a pixel onto a texture map in a graphics processor, comprising: computing ellipse coefficients
A = Ux1 + Vx2 + Wx1, B = 2(UxUy + VxVy + WxWy),C = Uy1 + Vy1 + Wy1 based on a pair of specified partial derivative vectors (ux ,vx , Wx) and (u ,v , wy); computing differential value t based on the ellipse coefficients A, B, and C; determining a range AngleRg within which the direction value of the footprint α lies, and getting reference differential value t' to which the differential value t approximates; and fetching the reference direction value of the footprint α' in the range AngleRg from a LUT corresponding to the reference differential value t'.
It should be understood that the general description above and the detailed description below are all illustrative and descriptive, intended for further describing the present invention.
Other features and advantages of the present invention are given in the following description, partially seen from the description or the implementation of the present invention. Objects and other advantages of the present invention can be learned and obtained from the description, claims and accompanying drawings.
BRIEF DESCRIPTION OF THE DRAWINGS
The present invention can be understood more easily through the accompanying drawings constituting a part of this specification, which illustrate embodiments of the present invention and serve to explain various principles of embodiments of the present invention together with the description.
FIG. IA illustrate a prior art application of texture samples to surface.
FIG. IB illustrates three vectors within anisotropic Footprint 115 used to determine the major axis and minor axis in a prior art.
FIG. 1C illustrates four vectors within anisotropic Footprint 115 used to determine the major axis and minor axis in a prior art.
FIG. 2 A illustrates texture mapping parameters mapped to adjacent pixels in accordance with aspects of the present invention. FIG. 2B illustrates two vectors within an anisotropic footprint used to determine the major axis and the minor axis of anisotropy in accordance with one or more aspects of the present invention.
FIG.3 illustrates the method of computing texture map parameters in accordance with one or more aspects of the present invention.
FIG.4 shows the first embodiment of a method of computing anisotropic texture mapping parameters according to aspects of the present invention.
FIG.5 shows the third embodiment of a method of computing anisotropic texture mapping parameters according to aspects of the present invention.
FIG.6A shows the fourth embodiment of a method of computing anisotropic texture mapping parameters according to aspects of the present invention.
FIG.6B shows the method of constructing the LUT in the fourth embodiment.
FIG.7A shows the fifth embodiment of a method of computing anisotropic texture mapping parameters according to aspects of the present invention.
FIG.7B shows the method of constructing the LUT in the fifth embodiment.
FIG.8 A shows the sixth embodiment of a method of computing anisotropic texture mapping parameters according to aspects of the present invention.
FIG.8B shows the method of constructing the LUT in the sixth embodiment.
FIG. 9 shows the binary search configuration in the sixth embodiment.
FIGlO shows an anisotropic unit for computing anisotropic texture mapping parameters according to aspects of the present invention.
DESCRIPTION OF PREFERRED EMBODIMENTS
In the following description, numerous specific details are set forth to provide a more thorough understanding of aspects of the present invention. However, it will be apparent to one of skill in the art that the present invention may be practiced without one or more of these specific details. In other instances, well-known features have not been described in order to avoid obscuring the present invention.
The major and minor axes of anisotropy determine a footprint that represents the projection of the pixel onto the texture map. In the prior art, exact determination of the major and minor axes requires complex computations which are not cost effective to implement within the die area constraints of graphics processors. In the prior art, the simply approximated major and minor axes used to compute parameters for texture mapping failed to meet the requirement for image quality. In the present embodiment of the invention, the direction of the major axis α', sin2α', and cos2α' can be obtained via looking up LUT (lookup Table), which will be used to compute parameters, such as lengths of the major and minor axes and LOD values, for anisotropic texture mapping. Furthermore, the present embodiment results in improved performance compared with exact computation of the anisotropic texture mapping parameters and favorable image quality compared with simple approximation of the anisotropic texture mapping parameters.
FIG. 2A shows four pixels in (x, y) screen space with their corresponding texture coordinates u , v , a Pixel 200, a Pixel 201, a Pixel 202, and a Pixel 203, in accordance with one or more aspects of the present invention. Texture coordinate w can be added only for mapping of three dimensional texture.
FIG. 2B shows the footprint of the four pixels, Pixels 200, 201, 202, and 203, in texture space. Points 210, 211, and 212 are the texture coordinates of Pixels 200, 201, and 202, respectively. Texture coordinates for Pixel 200, 0,0 are shown in the FIG. 2B as Point 210. Texture coordinates for Pixel 201, u \, v \ are shown in FIG. 2B as Point 211. Texture coordinates for Pixel 202, M 25V2 are shown in FIG. 2B as Point 212. Difference Vector 221 is the partial derivative of (u ,v) with respect to x. Difference Vector 222 is the partial derivative of (u , v) with respect to y.
Fig.3 illustrates the method of computing texture map parameters in accordance with one or more aspects of the present invention. In Step 302, ellipse coefficients are computed based on a pair of specified partial derivative vectors (ux ,vx) and
In Step 304, a differential value t is computed based on the ellipse coefficients A, B and C in log scale. The differential value t can be log(|A-C|)- log(|B|)or log(|B|)-log(|A-C|).
In step 306, a range AngleRg within which the direction value of the footprint α' lies is determined, and get reference differential value t' to which the differential value t approximates. If 0<B<A-C or A-C<B<0 is true, the AngleRg is (0, π/S); if not, further determining whether 0< A-C <B or B<A-C<0 is true, if it is true, the AngleRg is (π/S, π IA); if it is false, further determining whether 0< A-C <-B or -B<A-C<0 is true, if it is true, the AngleRg is (π IA, 7> πlS), otherwise the AngleRg is (3 πlS, π/2).
In step 308, the reference direction value of the footprint α' in the range AngleRg from a LUT corresponding to the reference differential value t' is fetched.
The value log(|cot(2a)|) or log(|tan(2a)|) may be hardcoded to do a binary-search, while LUT may be preloaded in a ROM.
The LUT can include the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α<≡ (0, π/2 )with a specified interval, wherein the reference differential values t' represented by log(|cot(2α)|) approximate to the differential values t=log(|A-C|) - log (|B|).
The LUT also can include the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α<≡ (0, π/2 )with a specified interval, wherein the reference differential values t' represented by log(|tan(2α)|) approximate to the differential values t=
Figure imgf000013_0001
The LUT also can include the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α<≡ (0, π/S) with a specified interval, wherein the reference differential values t' is represented by log(|tan(2α)|); and include the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint αe [^/8, π IA) with the specified interval, wherein the reference differential values t' is represented by log(|cot(2α)|). First embodiment
Fig. 4 shows the first embodiment of a method of computing texture mapping parameters according to aspects of the present invention.
Table 1 shows the LUT which includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α<≡ (0, π/2 ) with an interval, wherein the reference differential values t' represented by log(|cot(2α)|) approximates to the differential value t=log(|A-C|) - log (|B|).
As shown in Fig. 4, in Step 402, ellipse coefficients A=ux 2 + uy 2 , B=2(uxvx +uyvy) ,
and C= vx + vy 2 are computed based on a pair of specified partial derivative vectors
(MX , vx) and (uy ,vy ).
Table 1
Figure imgf000014_0001
Figure imgf000015_0001
In Step 404, a differential value t= log(|A-C|)-log(|B|) is computed based on the ellipse coefficients A, B, and C. Suppose A=4, B=-2, and C=I are obtained in step402, then the differential value t= Iog(|4-l|)-log((-2|)=log3-log2=0.17609.
In Step 406, A-C, B, and 0 are compared to determine the range AngleRg within which the reference direction value of the anisotropy of the footprint α' lies. Comparing A-C, B, and 0, if 0<B<A-C or A-C<B<0, the AngleRg is (0, π /S); if 0< A-C <B or B<A-C<0, the AngleRg is (π/$, π IA); if 0< A-C <-B or -B<A-C<0, the AngleRg is (π/4, 3 π/S); and if A-C <-B<0 or 0<-B<A-C, the AngleRg is (3 π/8, π/2). For A=4, B=-2, and C=I, 0<-B<A-C, so the range AngleRg within which the reference direction value of the anisotropy of the footprint α' lies is (3 π /8, π/2). That is to say, the reference direction value of the anisotropy of the footprint α' φ π/8, π/2).
Subsequently, get the reference differential value t' to which the differential value t approximate, wherein the reference differential values t' is represented by log(|cot(2α)|). For the differential value t=0.17609, comparing 0.17609 with the values in the log(|cot(2α)|) column to obtain the most approximate reference differential value t'=0.138738.
In step 408, the reference direction value of the anisotropy of the footprint α' in the range AngleRg, sin2α' and cos2α' are fetched from the LUT corresponding to the reference differential value t'. The reference differential value t'=0.138738 corresponds to two different groups of α, sin2α, and cos2α in the LUT. One group is that α=6 ;r /60, sin2α=0.587785, and cos2α=0.809017, and the other group is α=24;r/60, sin2α=0.587785, and cos2α— 0.809017. The 24π/60 is in the range AngleRg (3 π/8, n IT), so the reference direction value of the anisotropy of the footprint α' equals to 24 π /60, sin2α' equals to 0.587785, and cos2α' equals to -0.809017.
In step 410, (A+C) + [(A-C) cos (2α') + B sin (2α') ] and (A+C) - [(A-C) cos (2α') + B sin (2α') ] are computed to produce the first length and the second length.
In step 412, a comparison between the first length and the second length is conducted, identifying the longer length and the shorter length as the length of major axis and the length of minor axis, respectively.
In step 414, the base-two logarithm (log) of the major axis length is computed to produce a logmajor value and the base-two log of the minor axis length is computed to produce a logminor value, i.e., LOD.
In step 416, a logratio value is computed by subtracting the logminor value from the logmajor value. The logratio value is equivalent to the base-two log of the ratio value.
Second embodiment
In the embodiment of the present invention, the LUT includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α<≡ (0, πll ) with an interval π /60 , wherein the reference differential values t' represented by log(|tan(2α)|) approximates to the differential value t=log ( I A-C I ) - log ( I B | ). The only difference compared with the first embodiment is that in Step 404 a differential value t= log( I B I ) -log( I A-C I ) is computed.
Third embodiment
Fig. 5 shows the third embodiment of a method of computing texture mapping parameters according to the present invention.
Table 2 shows another LUT which includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α<≡ (0, π /8) with a specified interval, wherein the reference differential values t' is represented by log(|tan(2α)|). The LUT also includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α<≡ [ π /8 , π 14) with the specified interval, wherein the reference differential values t' represented by log(|cot(2α)|) approximate to differential values t.
As shown in Fig. 5, in Step 502, ellipse coefficients A=ux 2 + uy 2 , B=2(uxvx +uyvy) ,
and C= vx 2 + v2 are computed based on a pair of specified partial derivative vectors
("x >O and (uy ,vy ).
In Step 504 differential value t between log(|A-C|) and log(|B|) are computed based on the ellipse coefficients A, B, and C. Suppose A=4, B=2, and C=I are computed in step 502, the differential value t= log(|4-l|)-log(|2|)=log3-log2 =0.17609, or the differential value t= log(|2|) -log(|4-l|) =-0.17609
In Step 506, A-C, B, and 0 are compared to determine the range AngleRg within which the reference direction value of the anisotropy of the footprint α' lies. Comparing A-C, B, and 0, if 0<B<A-C or A-C<B<0, the AngleRg is (0, π/S); if 0< A-C <B or B<A-C<0, the AngleRg is (π/S, π IA); if 0< A-C <-B or -B<A-C<0, the AngleRg is (π/4, 3 π/S); and if A-C <-B<0 or 0<-B<A-C, the AngleRg is (3 π/S, π/2). For A=4, B=2, and C=I, 0<B<A-C, so the range AngleRg within which the reference direction value of the anisotropy of the footprint α' lies is (0, π/S). That is to say, the reference direction value of the anisotropy of the footprint α' <≡ (0, π/S).
Table 2
Figure imgf000017_0001
Figure imgf000018_0001
Subsequently, get the reference differential value t' to which the differential value t approximates. For the differential value t=0.17609, comparing 0.17609 with the reference differential values to obtain the reference differential value t'=0.138738. For the differential value t— 0.17609, comparing -0.17609 with the reference differential values to obtain the reference differential value t'=-0.138738.
In step 508 the reference direction value of the anisotropy of the footprint α' in the range AngleRg, sin2α', and cos2α' are fetched from the LUT corresponding to the reference differential value t'. The reference differential value t'=0.138738 corresponds to one group of α, sin2α, and cos2α in the LUT. The group is that α=9π/60, sin2α=0.809017, and cos2α=0.587785.
The reference differential value t'=-0.138738 corresponds to one group of α, sin2α, and cos2α in the LUT. The group is that α=6;r/60, sin2α=0.587785, and cos2α=0.809017.
Only 6π 160 is in the range AngleRg (0, π/8), so the reference direction value of the anisotropy of the footprint α' =6 π /60, sin2α=0.587785, and cos2α=0.809017.
In step 510, the (A+C) + [(A-C) cos (2α') + B sin (2α') ] and (A+C) - [(A-C) cos (2α') + B sin (2α') ] are computed to produce the first length and the second length.
In step 512, a comparison between the first length and the second length is conducted, identifying the longer length and the shorter length as the length of major axis and the length of minor axis, respectively.
In step 514 the base-two logarithm (log) of the major axis length is computed to produce a logmajor value and the base-two log of the minor axis length is computed to produce a logminor value i.e. LOD. In step 516 a logratio value is computed by subtracting the logminor value from the logmajor value. The logratio value is equivalent to the base-two log of the ratio value.
Fourth embodiment
FIG.6A shows the fourth embodiment of a method of computing texture mapping parameters according to an aspect of the present invention. FIG.6B shows the method of constructing LUT in the fourth embodiment.
As shown in FIG.6A, in Step 600 the LUT is constructed. As shown in FIG.6B, the step further comprises the following substeps:
Step 6001: for the direction of the anisotropy of the footprint α<≡ (0, π/2) with a specified interval, compute the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α, wherein the reference differential values t' represented by log(|cot(2α)|) approximates to differential values;
Step 6003: organize the computed values of every direction of the anisotropy of the footprint α and corresponding sin2α, cos2α and reference differential values to generate the LUT, wherein the reference differential value t' approximates to the differential value t=log (|A-C|) - log (|B|).
In Step 602, ellipse coefficients
Figure imgf000019_0002
+uyvy) , and C=
Figure imgf000019_0001
+ vy 2 are
computed based on a pair of specified partial derivative vectors (ux , vx) and (« , v ).
In Step 604, a differential value t= log( I A-C I )-log( I B | ) is computed based on the ellipse coefficients A, B, and C.
In Step 606, A-C, B, and 0 are compared to determine the range AngleRg within which the reference direction value of the anisotropy of the footprint α' lies. Subsequently, get the reference differential value t' to which the differential value t approximates in the LUT.
In step 608, the reference direction value of the anisotropy of the footprint α' in the range AngleRg, sin2α', and cos2α' are fetched from the LUT corresponding to the reference differential value t'. In step 610, (A+C) + [(A-C) cos (2α') + B sin (2α')] and (A+C) - [(A-C) cos (2α') + B sin (2α')] are computed to produce the first length and the second length;
In step 612, a comparison between the first length and the second length is conducted, identifying the longer length and the shorter length as the length of major axis and the length of minor axis, respectively.
In step 614, the base-two logarithm (log) of the major axis length is computed to produce a logmajor value and the base-two log of the minor axis length is computed to produce a logminor value i.e. LOD.
In step 616, a logratio value is computed by subtracting the logminor value from the logmajor value. The logratio value is equivalent to the base-two log of the ratio value.
Fifth embodiment
FIG.7A shows the fifth embodiment of a method of computing anisotropic texture mapping parameters according to an aspect of the present invention. FIG.7B shows the method of constructing LUT in the fifth embodiment.
As shown in FIG.7A, in Step 700, LUT is constructed. As shown in FIG.7B, the step further comprises the following substeps:
Step 7001 : for the direction of the anisotropy of the footprint α<≡ ( 0, π 12 ) with a specified interval, compute the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α, wherein the reference differential values t' is represented by log(|tan(2α)|)approximate to differential values t;
Step 7003: organize the computed values of every direction of the anisotropy of the footprint α and corresponding sin2α, cos2α, and reference differential values to generate the LUT, wherein the reference differential value t' approximates to the differential value t=log ( I B | ) - log ( I A-C I ).
In Step 702, ellipse coefficients
Figure imgf000020_0001
+uyvy) , and C= vx 2 + vy 2 are
computed based on a pair of specified partial derivative vectors (ux , vx ) and (u v ). In Step 704, a differential value t= log ( I B | ) - log ( I A-C I ) is computed based on the ellipse coefficients A, B, and C.
In Step 706, A-C, B, and 0 are compared to determine the range AngleRg within which the reference direction value of the anisotropy of the footprint α' lies. Subsequently, get the reference differential value t' to which the differential value t approximates in the LUT.
In step 708 the reference direction value of the anisotropy of the footprint α' in the range AngleRg, sin2α', and cos2α' are fetched from the LUT corresponding to the reference differential value t'.
In step 710, (A+C) + [(A-C) cos (2α') + B sin (2α')] and (A+C) - [(A-C) cos (2α') + B sin (2α')] are computed to produce the first length and the second length;
In step 712, a comparison between the first length and the second length is conducted, identifying the longer length and the shorter length as the length of major axis and the length of minor axis, respectively.
In step 714 the base-two logarithm (log) of the major axis length is computed to produce a logmajor value and the base-two log of the minor axis length is computed to produce a logminor value i.e. LOD.
In step 716 a logratio value is computed by subtracting the logminor value from the logmajor value. The logratio value is equivalent to the base-two log of the ratio value.
Sixth embodiment
Fig. 8A shows the sixth embodiment of a method of computing anisotropic texture mapping parameters according to aspects of the present invention. FIG.8B shows the method of constructing LUT in the sixth embodiment.
As shown in FIG.8 A, in Step 800 LUT is constructed. As shown in FIG.8B, the step further comprises the following substeps:
Step 8001: for the direction of the anisotropy of the footprint α<≡ (0, π /8) with a specified interval, compute the values of every direction of the anisotropy of the footprint α and corresponding sinα, cosα, sin2α, and cos2α to get LUTi, wherein the reference differential values t' is represented by log(|tan(2α)|);
Step 8002: for the direction of the anisotropy of the footprint α<≡ ( π/8, π IA ) with the specified interval, compute the values of every direction of the anisotropy of the footprint α and corresponding sinα, cosα, sin2α, and cos2αto get LUT2, wherein the reference differential values t' is represented by log(|cot(2α)|);
Step 8003: combine the tables LUTi with LUT2, and delete the redundant columns of sin2α and cos2α to get LUT;
Table 3 shows the LUTi in the sixth embodiment. Table 4 shows the LUT2 in the sixth embodiment. Table 5 shows the LUT obtained by combining LUTi with LUT2. The values of every direction of the anisotropy of the footprint α and corresponding sin2α, cos2α are included in the LUT indirectly, while the values of sinα and cosα are included in the LUT directly.
Table 3 LUTi (α e (0, π/S))
Figure imgf000022_0001
Table 4 LUT2 (α e C π/S, π/4))
Figure imgf000023_0001
Table5 LUT Combination of LUTiand LUT2
Figure imgf000023_0002
In Step 802 ellipse coefficients
Figure imgf000024_0001
C= + vy 2 are
computed based on a pair of specified partial derivative vectors (ux , vx) and (uy ,vy ).
In Step 804 differential value t between log(|A-C|) and log(|B|) are computed based on the ellipse coefficients A, B, and C. Suppose A=4, B=3, and C=2 are computed in step 802, then the differential value t= Iog2(|4-2|)-log2(|3|) =log22-log23
=-0.477121
In Step 806, A-C, B, and 0 are compared to determine the range AngleRg within which the reference direction value of the anisotropy of the footprint α' lies. Comparing A-C, B, and 0, if 0<B<A-C or A-C<B<0, the AngleRg is (0, π/S); if 0< A-C <B or B<A-C<0, the AngleRg is (π/S, π IA); if 0< A-C <-B or -B<A-C<0, the AngleRg is (π/4, 3 π/S); and if A-C <-B<0 or 0<-B<A-C, the AngleRg is (3 π/S, π/2). For A=4, B=3, and C=2, 0< A-C <B, so the range AngleRg within which the reference direction value of the anisotropy of the footprint α' lies is (π/S, π/4). That is to say, the reference direction value of the anisotropy of the footprint α' e(π/8, π/4).
Subsequently, get the reference differential value t' to which the differential value t approximates in the LUT. The reference differential values correspond with indexes which are integers. Therefore, the index corresponding to the reference differential value t' can be obtained.
For the differential value t=-0.477121, via binary search, the reference differential value t' and the corresponding Index can be obtained. FIG.9 shows the binary search configuration. The binary search is implemented according to FIG.9. In the embodiment, the midpoints between the fitting nodes are separating points to achieve rounding effect. Totally three comparisons can determine an index. The reference differential values t=-4.60881 corresponds to the Index 6.
In step 808 the reference direction value of the anisotropy of the footprint α' in the range AngleRg, sin2α', and cos2α' are fetched from the LUT corresponding to the Index. The Index 6 is used to look up the LUT according to the relationship between the Index and the position of the reference direction value of the anisotropy of the footprint α' in the range AngleRg, sin2α', and cos2α'. In the embodiment, α'=9^/60, sin2α'=0.809017, and cos2α'=0.587785. In step 810 (A+C) + [(A-C) cos (2α') + B sin (2α') ] and (A+C) - [(A-C) cos (2α') + B sin (2α') ] are computed to produce the first length and the second length.
In step 812, a comparison between the first length and the second length is conducted, identifying the longer length and the shorter length as the length of major axis and the length of minor axis, respectively.
In step 814, the base-two logarithm (log) of the major axis length is computed to produce a logmajor value and the base-two log of the minor axis length is computed to produce a logminor value i.e. LOD.
In step 816, a logratio value is computed by subtracting the logminor value from the logmajor value. The logratio value is equivalent to the base-two log of the ratio value.
Fig.10 shows a device for computing texture mapping parameters according to one aspect of the present invention. The device comprises:
an ellipse coefficients computation unit 1001 configured to compute the ellipse coefficients based on a pair of specified partial derivative vectors ( Ux Vx ) and
a differential value computation unit 1003 configured to compute the differential value t based on the ellipse coefficients in log scale;
comparing unit 1005 configured to determine a range AngleRg within which the direction value of the footprint α' lies;
reference differential value obtaining unit 1007 configured to get reference differential value t' to which the differential value t approximates, wherein the differential value t comes from a differential value computation unit 1003;
a LUT search unit 1009 configured to fetch the reference direction value of the footprint α' in a determined range AngleRg from a LUT corresponding to the reference differential value t';
a parameter computation unit 1011 configured to compute texture parameters. In another embodiment of the present invention, the parameter computation unit 1011 comprises length computation unit configured to computing (A+C) + [(A-C) cos (2α') + B sin (2α') ] and (A+C) - [(A-C) cos (2α') + Bsin (2α') ] to produce the first length and the second length; and an identification unit configured to identify a major axis anisotropic texture map parameter as the longer of the first length and the second length and a minor axis anisotropic texture map parameter as the shorter of the first length and the second length.
In another embodiment of the present invention, the device for computing texture mapping parameters further comprises a LUT construction unit used to construct the LUT which includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α, and cos2α for the direction of the anisotropy of the footprint α e (0, π/2 ) with a specified interval.
In another embodiment of the present invention, the device for computing texture mapping parameters further comprises a LUT construction unit used to construct the LUT which includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α<≡ (0, π /8) with a specified interval, wherein the reference differential values t' represented by log(|tan(2α)|) approximate to differential values t; and includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α, and cos2α for the direction of the anisotropy of the footprint αe[^/8, π IA) with the specified interval, wherein the reference differential values t' represented by log(|cot(2α)|) approximate to differential values t.
In another embodiment of the present invention, a parameter computation unit 1011 is configured to compute a level of detail anisotropic texture mapping parameter.
In another embodiment of the present invention, a parameter computation unit 1011 is configured to compute a logratio using the first length and the second length.
Obviously, the present invention can be applied to both anisotropic and isotropic filtering. The difference is that anisotropic filtering needs the length of minor axis/ratio/direction, while only the length of major axis is needed for isotropic filtering. It is apparent to those skilled in the art that if the ellipse matrix is defined as
Ux2 + Vx2 UxUy + VxVy
M = T'*T = , that is, wherein the ellipse coefficients is
UxUy + VxVy Uy1 + Vf
defined as A = Ux2 + Vx2, B = 2(UxUy + VxVy), C = Uy2 + Vy2. By adding a third item
W and set A = Ux2 + Vx2 + Wx2, B = 2(UxUy + VxVy + WxWy), C = Uy2 + Vy2 + Wy2 ,
the above methods can also be applied to 3D texture.
In addition, the various illustrative logical blocks, flowcharts, windows, and steps described in connection with the embodiments disclosed herein may be implemented or performed in hardware or software with an application-specific integrated circuit (ASIC), a programmable logic device, discrete gate or transistor logic, discrete hardware components, such as, e.g., registers and FIFO, a processor executing a set of firmware instructions, any conventional programmable software and a processor, or any combination thereof. Such hardware components may be manufactured based on hardware description language (HDL) instructions stored on a computer readable medium. Such HDL instructions may be used for mask works and the like and ultimately configure a manufacturing process so as to manufacture a hardware device (such as a processor, for example) capable of operating in accordance with aspects of the invention. The processor may advantageously be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The software could reside in RAM memory, flash memory, ROM memory, registers, hard disk, a removable disk, or any other form of storage medium known in the art.
Described above are only the preferred embodiments of the present invention which do not limit the present invention. Rather, as for those skilled in the art, the present invention may have various changes and alternations. All such modifications, substitutions, improvements etc. within the spirit and principle of the present invention should be all covered in the scope of the affixed claims of the present invention.

Claims

1. A method of determining texture map parameters to define a footprint representing a projection of a pixel onto a texture map in a graphics processor, comprising: computing differential value t based on a pair of specified partial derivative vectors (ux ,vx ) and (uy ,vy );
determining a range AngleRg within which the direction value of the footprint α lies, and getting reference differential value t' to which the differential value t approximates; and fetching the reference direction value of the footprint α' in the range AngleRg from a LUT corresponding to the reference differential value t'.
2. The method of claim 1, wherein the differential value is based on an ellipse coefficients based on said pair of specified partial derivative vectors.
3. The method of Claim 2, wherein
the ellipse coefficients are defined as A=ux 2 + uy 2 , B= 2(uxvx +uyvy) , and C=
4. The method of Claim 2, wherein the ellipse coefficients are defined as
A = Ux1 + Vx1, B = 2(UxUy + VxVy), C = Uy1 + Vy1.
5. The method of Claims 3 or 4, wherein the value t is the difference between log (|A-C|) and log(|B|); and the range AngleRg is determined by comparing A-C, B, and 0.
6. The method of Claim 5, further comprising: computing the length of a major axis anisotropic texture map parameter and the length of a minor axis anisotropic texture map parameter based on A , B , C, sin2α' and cos2α'.
7. The method of Claim 6, wherein the pair of specified partial derivative vectors ( Ux , Vx ) and ( uy , vy ) are separately a partial derivative of texture map coordinates u and v with respect to x and a partial derivative of texture map coordinates with respect to y.
8. The method of Claim 6, wherein if 0<B<A-C or A-C<B<0, the AngleRg is (0, π/S); if 0< A-C <B or B<A-C<0, the AngleRg is (π/S, π IA); if 0< A-C <-B or -B<A-C<0, the AngleRg is (π IA, 3 π IS); and if A-C <-B<0 or 0<-B<A-C, the AngleRg is (3 π /8, π 12).
9. The method of Claim 6, wherein computing the length of the major axis anisotropic texture map parameter and the length of the minor axis anisotropic texture map parameter based on A , B , C, sin2α' and cos2α', comprising, computing (A+C) + [(A-C) cos (2α') + B sin (2α')] and (A+C) - [(A-C) cos (2α') + B sin (2α') ] to produce the first length and the second length; identifying a major axis anisotropic texture map parameter as the longer of the first length and the second length and a minor axis anisotropic texture map parameter as the shorter of the first length and the second length.
10. The method of Claim 6, further comprising the step of constructing the LUT.
11. The method of any one of Claims 6-10, wherein the LUT includes the values of every reference direction of the anisotropy of the footprint α and corresponding sin2α, cos2α, and reference differential value t' for the direction of the anisotropy of the footprint α e (0, π/2 ) with a specified interval, wherein reference differential value t' are reference differential values which approximate to the differential values t.
12. The method of Claim 11, wherein if t=log(|A-C|) - log(|B|), t' represents log(|cot(2α)|); if t =log(|B|) - log(|A-C|), t' represents log(|tan(2α)|).
13. The method of any one of Claims 6-10, wherein the LUT includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α e (0, π/8) with a specified interval, wherein the reference differential values t' is represented by log(|tan(2α)|); and includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α<≡ [ π/8 , π/4)] with the specified interval, wherein the reference differential values t' is represented by log(|cot(2α)|).
14. The method of any one of Claims 6-10, further comprising the step of computing a level of detail anisotropic texture mapping parameter.
15. The method of any one of Claims 6-10, further comprising the step of computing a logratio using the first length and the second length.
16. The method of Claim 10, wherein the step of constructing the LUT comprises: for the direction of the anisotropy of the footprint α<≡ (0, π/2) with a specified interval, computing the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α, wherein the reference differential values t' represented by log(|cot(2α)|) approximate to differential values t=log (|A-C|) - log (|B|); organizing the computed values of every direction of the anisotropy of the footprint α and corresponding sin2α, cos2α and reference differential values t' to generate the LUT.
17. The method of Claim 10, wherein the step of constructing the LUT comprises: for the direction of the anisotropy of the footprint α<≡ (0, π/2) with a specified interval, computing the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α, wherein the reference differential values t' represented by log(|tan(2α)|) approximate to differential values t=log (|B|) - log ( A-C|); and organizing the computed values of every direction of the anisotropy of the footprint α and corresponding sin2α, cos2α and reference differential values t' to generate the LUT.
18. The method of Claim 10, wherein the step of constructing the LUT comprises: for the direction of the anisotropy of the footprint α<≡ (0, π 18) with a specified interval, computing the values of every direction of the anisotropy of the footprint α and corresponding sinα, cosα, sin2α, and cos2α to get LUTi, wherein the reference differential values t' is represented by log(|tan(2α)|); for the direction of the anisotropy of the footprint α<≡ ( π/8, π IA ) with the specified interval, computing the values of every direction of the anisotropy of the footprint α and corresponding sinα, cosα, sin2α, and cos2α to get LUT2, wherein the reference differential values t' is represented by log(|cot(2α)|); combining LUTi with LUT2 , and deleting the redundant columns of sin2α and cos2α to get LUT.
19. The method of Claim 13, wherein the values of sinα and cosα are included in the LUT directly, while the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α can be obtained from the LUT indirectly.
20. The method of Claim 13, wherein if the range AngleRg is (0, π 18), get reference differential value t' to which the differential value t= log (|B|) - log (|A-C|) approximates; if the range AngleRg is (π/8 > π IA), get reference differential value t' to which the differential value t= log (|A-C|) - log (|B|) approximates.
21. The method of Claim 13, wherein for the direction of the anisotropy of the footprint αe(π/4, π 12), the values of sin2α and cos2α can be found from the said LUT using the trigonometric function transform formulas.
22. The method of Claim 20, wherein a binary-search is used to get reference differential value t' to which the differential value t approximates in the LUT.
23. The method of Claim 22, wherein the reference differential value t' corresponds to an Index which is used to fetch the reference direction value of the anisotropy of the footprint α' in a determined range AngleRg and corresponding sin2α' and cos2α' from the LUT.
24. A computer program product, comprising:
computer program for executing the methods according to any one of Claims 1-23.
25. The computer program product of claim 24, wherein the computer program is based on hardware description language instructions.
26. A device for determining texture map parameters to define a footprint, comprising: an ellipse coefficients computation unit configured to compute ellipse coefficients based on a pair of specified partial derivative vectors (ux Vx ) and (uy vy);
a differential value computation unit configured to compute a differential value t based on the ellipse coefficients; a comparing unit configured to determine the range AngleRg within which the direction value of the footprint α lies; a reference differential value obtaining unit configured to get reference differential value t' to which the differential value t approximates; and a LUT search unit configured to fetch the reference direction value of the footprint α' in the determined range AngleRg from a LUT corresponding to the reference differential value t'.
27. The device of Claim 26, wherein the ellipse coefficients are defined as A=ux 2 + uy 2 , B= 2(uxvx +uyvy) , and C=
28. The device of Claim 26, wherein the ellipse coefficients are defined as
A = Ux1 + Vx1, B = 2(UxUy + VxVy), C = Uy1 + Vy1 .
29. The device of Claims 27 or 28, wherein : the value t is the difference between log (|A-C|) and log(|B|); and the range AngleRg is determined by comparing A-C, B, and 0.
30. The device of Claim 29, further comprising: a parameter computation unit configured to compute the length of the major axis texture map parameter and the length of the minor axis anisotropic texture map parameter based on A , B , C, sin2α', and cos2α'.
31. The device of Claim 30, further comprising the LUT construction unit used to construct the LUT which includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α e (0, π 12) with a specified interval.
32. The device of Claim 30, further comprising the LUT construction unit used to construct the LUT which includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint α<≡ (0, π/8) with a specified interval, wherein the reference differential values t' is represented by log(|tan(2α)|); and includes the values of every direction of the anisotropy of the footprint α and corresponding sin2α and cos2α for the direction of the anisotropy of the footprint αe[^/8, π /4) with the specified interval, wherein the reference differential values t' is represented by log(|cot(2α)|).
33. The device of Claim 30, wherein the parameter computation unit comprises: a length computation unit configured to compute (A+C) + [(A-C) cos (2α') + B sin (2α') ] and (A+C) - [(A-C) cos (2α') + Bsin (2α') ] to produce the first length and the second length; and an identification unit configured to identify a major axis texture map parameter as the longer of the first length and the second length and a minor axis texture map parameter as the shorter of the first length and the second length.
34. The device of Claim 30, wherein the parameter computation unit is configured to compute a level of detail texture mapping parameter.
35. The device of Claim 34, wherein the parameter computation unit is configured to compute a logratio using the first length and the second length.
36. A method of determining texture map parameters to define a footprint representing a projection of a pixel onto a texture map in a graphics processor, comprising:
computing ellipse coefficients A = Ux1 + Vx2 + Wx1, B = 2(UxUy + VxVy + WxWy),C = Uy1 + Vy1 + Wy1 based on a pair of specified partial derivative vectors (ux ,vx , Wx) and (uy ,vy , wy);
computing differential value t based on the ellipse coefficients A, B, and C; determining a range AngleRg within which the direction value of the footprint α lies, and getting reference differential value t' to which the differential value t approximates; and
fetching the reference direction value of the footprint α' in the range AngleRg from a LUT corresponding to the reference differential value t'.
PCT/CN2009/075707 2008-12-18 2009-12-18 A method of determining texture map parameters to define a footprint in a graphics processor and device thereof WO2010069269A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200810207277.6 2008-12-18
CN200810207277.6A CN101751687B (en) 2008-12-18 2008-12-18 Method and device for determining texture mapping parameters to define and represent pixel projection footprints

Publications (1)

Publication Number Publication Date
WO2010069269A1 true WO2010069269A1 (en) 2010-06-24

Family

ID=42268334

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/075707 WO2010069269A1 (en) 2008-12-18 2009-12-18 A method of determining texture map parameters to define a footprint in a graphics processor and device thereof

Country Status (2)

Country Link
CN (1) CN101751687B (en)
WO (1) WO2010069269A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2610373A (en) * 2021-01-06 2023-03-08 Advanced Risc Mach Ltd Graphics texture mapping

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116168138A (en) * 2023-02-21 2023-05-26 格兰菲智能科技有限公司 Level of detail determination method, device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1467687A (en) * 2002-06-20 2004-01-14 Systems and methods for providing controllable texture sampling
US7339594B1 (en) * 2005-03-01 2008-03-04 Nvidia Corporation Optimized anisotropic texture sampling
US7369136B1 (en) * 2004-12-17 2008-05-06 Nvidia Corporation Computing anisotropic texture mapping parameters

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2216781C2 (en) * 2001-06-29 2003-11-20 Самсунг Электроникс Ко., Лтд Image-based method for presenting and visualizing three-dimensional object and method for presenting and visualizing animated object
JP4594892B2 (en) * 2006-03-29 2010-12-08 株式会社東芝 Texture mapping apparatus, method and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1467687A (en) * 2002-06-20 2004-01-14 Systems and methods for providing controllable texture sampling
US7369136B1 (en) * 2004-12-17 2008-05-06 Nvidia Corporation Computing anisotropic texture mapping parameters
US7339594B1 (en) * 2005-03-01 2008-03-04 Nvidia Corporation Optimized anisotropic texture sampling

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2610373A (en) * 2021-01-06 2023-03-08 Advanced Risc Mach Ltd Graphics texture mapping
GB2610373B (en) * 2021-01-06 2023-09-06 Advanced Risc Mach Ltd Graphics texture mapping

Also Published As

Publication number Publication date
CN101751687A (en) 2010-06-23
CN101751687B (en) 2014-03-05

Similar Documents

Publication Publication Date Title
CN106910242B (en) Method and system for carrying out indoor complete scene three-dimensional reconstruction based on depth camera
Ernst et al. Mutual information based semi-global stereo matching on the GPU
Yoon et al. Adaptive support-weight approach for correspondence search
KR101281258B1 (en) Graphics processing unit with deferred vertex shading
JP5163981B2 (en) Apparatus and method for texture detail level calculation
US11494970B2 (en) Importance sampling for determining a light map
Ttofis et al. Edge-directed hardware architecture for real-time disparity map computation
US20140355899A1 (en) Video enhancement using related content
US8330767B2 (en) Method and apparatus for angular invariant texture level of detail generation
US20100027911A1 (en) Multilevel thresholding for mutual information based registration and image registration using a gpu
US20090309877A1 (en) Soft shadow rendering
US10559085B2 (en) Devices, systems, and methods for reconstructing the three-dimensional shapes of objects
CN114595221A (en) Tile-based sparsity-aware dataflow optimization for sparse data
Lawrence et al. Adaptive Numerical Cumulative Distribution Functions for Efficient Importance Sampling.
Viola et al. GPU-based frequency domain volume rendering
US20090213144A1 (en) Apparatus and method to calculate raster data
US7154504B2 (en) System and method for fast, smooth rendering of lit, textured spheres
WO2010069269A1 (en) A method of determining texture map parameters to define a footprint in a graphics processor and device thereof
CN111369435B (en) Color image depth up-sampling method and system based on self-adaptive stable model
US7369136B1 (en) Computing anisotropic texture mapping parameters
US20060110048A1 (en) System and method for characterizing 2-dimensional shapes by compactness measurements
Atapour-Abarghouei et al. Extended patch prioritization for depth filling within constrained exemplar-based RGB-D image completion
US7619635B1 (en) Anisotropic texture sampling for odd ratios
Liu et al. Adaptive cluster rendering via regression analysis
Nair et al. Scalable multi-view stereo using CMA-ES and distance transform-based depth map refinement

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 09832951

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09832951

Country of ref document: EP

Kind code of ref document: A1