Graphical texture mapping

CN114782608BActive Publication Date: 2026-09-29ARM LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210007714.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-07-30
Filing Date
2022-01-05
Publication Date
2026-09-29
Estimated Expiration
2042-01-05

AI Technical Summary

Benefits of technology

[0190]本发明可实施在任何合适的系统中,诸如实施在合适配置的基于微处理器的系统中。在一个实施方案中,本文所述的技术在基于计算机和/或微处理器的系统中实现。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114782608B_ABST
    Figure CN114782608B_ABST
Patent Text Reader

Abstract

When anisotropic filtering is performed in sampling a texture to provide output sample texture values used in rendering output in a graphics processing system, the anisotropic direction in the texture along which samples are to be taken is determined by: determining an X vector component and a Y vector component of an arbitrary length vector corresponding to a direction of a major axis of a hypothetical elliptical projection of a sample point at which the texture is sampled onto a surface to which the texture is applied; and then normalizing the determined X vector component and the determined Y vector component to provide an X component and a Y component of a unit vector corresponding to the direction of the major axis of the elliptical footprint of the sample point to be used as the anisotropic direction in the texture along which samples are to be taken.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method and apparatus for performing texture mapping in a graphics processing system. Background Technology

[0002] In graphics processing systems, it is common to generate colors (and other data) for sampling locations in the rendered output (e.g., an image to be displayed) by applying so-called textures or texture data to the surface to be drawn.

[0003] Computer graphics textures are typically configured as arrays of texture data elements (texels), each with a corresponding texture dataset (such as values ​​for color, brightness, and / or light / shadow) stored for it. The sampling locations where the texture will be applied in the rendered output are then mapped to the corresponding locations in the texture and the texture sampled at those locations using an appropriate filtering process (such as bilinear filtering) to determine the texture data to be used for the sampling locations in the rendered output.

[0004] The problem with texture mapping in graphics processing arises when the sampled texture is applied to a surface that is tilted relative to the viewpoint (camera). In this case, the "projection" from the sampling position seen from the viewpoint onto the surface (and therefore the sampled texture) (assuming the projected sampling point is circular) will not be circular (which would be the result if the surface were perpendicular to the view direction), but rather elliptical (where the size of the ellipse is determined by the angle of the surface relative to the view direction).

[0005] Figure 1 This is illustrated, and an exemplary render output 1 is shown, which corresponds to a plane of the screen where the rendered image is to be displayed and includes multiple sampling locations (pixels) 2 (assuming a circle). For example, corresponding texture samples of these multiple sampling locations will need to be obtained in order to render the pixels appropriately. Figure 1 This is a simplified representation of a small portion of pixel 2 in render output 1. It should be understood that the entire area of ​​render output 1 will include the appropriate pixel array.

[0006] Figure 1 Also shown is a "camera" 3 corresponding to the viewpoint from which the rendering output is rendered.

[0007] like Figure 1 As shown, for an exemplary pixel 4 of a 3D surface 5 that is sampled at an angle to the view direction from camera 3, the effective projection of the (circular) pixel 4 from camera position 3 through the rendering output (screen) 1 to the view "cone" 6 on the 3D surface 5 at an angle to the view direction will be an ellipse 7.

[0008] In this case, simply taking a “circular” bilinear sample from the texture to be applied to the surface will result in errors, such as blurring and / or aliasing in terms of the reproduced texture on the surface.

[0009] To address this issue, a texture sampling technique known as "anisotropic filtering" is used. This involves acquiring multiple (e.g., bilinear) samples along a line in the texture (often referred to as the anisotropic direction) designed to correspond to the major axis of an "ellipse" (the area occupied by an ellipse), which corresponds to the projection of the sampling point onto the surface to which the texture is to be applied. These multiple samples acquired along the line (anisotropic direction) are centered at the texture coordinates to be sampled (which will be the center of the ellipse).

[0010] Then, for example, using a weighted average, such as based on the distance of multiple (e.g., bilinear) samples along the anisotropic direction from the center of the projected “ellipse” (from the sampled texture coordinates), these multiple samples are appropriately combined to provide an overall output sampled texture value that is returned and used to texture the sampled points in question.

[0011] Graphical textures are known to be stored and used in the form of "mipmaps" (i.e., as a sequence (chain) of progressively lower resolution (less detailed) versions of a texture, where each mipmap level is, for example, half the resolution (half the detail) of the previous mipmap level).

[0012] Mipmaps are designed to increase rendering speed and reduce aliasing artifacts. Higher resolution mipmaps will be used for high-density samples, such as objects close to the viewpoint (camera), while lower resolution mipmaps will be used for objects further away.

[0013] When using mipmaps, the desired level of detail (LOD) of the sampled texture is typically defined (e.g., based on the distance of the surface to which the texture is to be applied from the viewpoint (camera)). The texture sampling operation then samples either the mipmap closest to that LOD, or two mipmap levels located on either side of the desired LOD, and then appropriately combines the samples from these two mipmap levels (e.g., based on their relative "distance" from the desired actual LOD). The latter can be accomplished using a trilinear sampling process, where bilinear filtering is used to obtain samples from each mipmap level, and then the two samples (one sample per mipmap level) are appropriately combined (e.g., using a weighted average based on the difference between the mipmap's LOD and the actual LOD to be sampled) to provide the output sampled texture value.

[0014] For example, when using textures for an image with a resolution of 40×40 sampling locations, where the mipmap is 128×128, 64×64, and 32×32 texels, interpolation of 64×64 and 32×32 mipmaps (with trilinear interpolation) can be used.

[0015] When performing anisotropic filtering using mipmaps, an appropriate number of trilinear samples are acquired along the anisotropic direction (and then appropriately combined to provide the output sampled texture values ​​to be used). Therefore, in this case, bilinear samples are acquired at each mipmap level along the anisotropic direction, and then the bilinear samples from each mipmap level are combined to provide appropriate trilinear sample values, which are then appropriately combined to provide the overall output sampled texture values.

[0016] Figure 2 This is illustrated by showing the acquisition of multiple (in this case, six) texture samples 20 along the anisotropic direction 21 corresponding to the major axis of an "ellipse" 22 in an appropriate pair of mipmap levels (including a more detailed mipmap level 23 and a less detailed mipmap level 24), which corresponds to the projection of the sampling location onto the surface (as described above). The samples from each mipmap level are then appropriately combined in pairs to effectively provide a set of multiple trilinear samples along the anisotropic direction, and these trilinear samples are then appropriately combined accordingly to give the final output sampled texture value.

[0017] When performing anisotropic filtering using mipmaps, it is necessary to determine the mipmap level of detail (LOD) for the trilinear samples, the anisotropic direction (line) to be taken along in the mipmap, and the number of samples to be taken along the anisotropic direction.

[0018] When performing anisotropic filtering, these parameters are typically determined by finding an ellipse that approximates the shape of the sampling location when projected onto the surface to which the texture is to be applied. The minor axis of the projected ellipse is then used to find the level of detail of the sampled texture, the major axis (direction) of the ellipse indicates the direction (anisotropic direction) of the line within the texture to be sampled, and the ratio of the major to minor axis of the projected ellipse is used to determine the number of samples to be acquired along the line (anisotropic direction) in the texture.

[0019] While it's possible to determine the projected ellipse and its corresponding ellipse parameters to achieve high accuracy in anisotropic filtering, this is relatively expensive to implement in hardware. Generally, methods for performing anisotropic filtering tend to use approximations when determining the ellipse parameters, such as attempting to find the best match with a set of reference anisotropic directions for a given anisotropic filtering operation, rather than determining the actual anisotropic directions themselves. However, the applicant has recognized that using such approximations for anisotropic filtering can lead to visual artifacts, and specifically, may give incorrect angular results regarding the major axis of the ellipse. Furthermore, these errors may exhibit an angular dependence (i.e., being larger for some angles compared to others).

[0020] Therefore, the applicant believes that there is still room for improvement in techniques for performing anisotropic filtering when performing graphics texture mapping. Summary of the Invention

[0021] According to a first aspect of the invention, a method is provided for performing anisotropic filtering when sampling a texture to provide output sampled texture values ​​used when rendering output in a graphics processing system, the method comprising: When using anisotropic filtering to sample textures, output sample texture values ​​are provided for positions x and y in the text: Determine the number of locations for sampling the texture along the anisotropic direction, along which the samples will be processed in the texture by the following operations: Determine if it has the form Ax 2 +Bxy+Cy 2 The coefficients A, B, and C of the ellipse = F correspond to the projection of the sampling points, the texture is sampled onto the surface onto which the texture is to be applied, where x and y are the coordinates of the position in the texture that provides the output sampled texture value; and Using only the determined coefficients A, B, and C of the elliptic coefficients A, B, C, and F, determine the number of positions where the sample should be photographed along the anisotropic direction in the texture.

[0022] The method further includes: Based on the determined number of locations, samples or specimens are photographed along the anisotropic directions in the texture; and The sample or sample taken along the anisotropic direction in the texture is used to provide an output sampled texture value for the sampled location in the texture.

[0023] According to a second aspect of the invention, an apparatus is provided for performing anisotropic filtering when sampling a texture to provide output sampled texture values ​​for use when rendering output in a graphics processing system, the apparatus comprising: The sample determination circuit is configured to sample the texture using anisotropic filtering to provide output sampled texture values ​​at positions x and y in the text. Determine the number of locations for sampling the texture along the anisotropic direction, and sample the texture along the anisotropic direction: Determine if it has the form Ax 2 +Bxy+Cy 2 The coefficients A, B, and C of the ellipse = F correspond to the projection of the sampling points, the texture is sampled onto the surface onto which the texture is to be applied, where x and y are the coordinates of the position in the texture to provide the output sampled texture values; and Using only the determined coefficients A, B, and C of the elliptic coefficients A, B, C, and F, determine the number of positions where the sample should be taken along the anisotropic direction in the text; The device further includes: A texture sampling circuit, configured to capture samples or samples along anisotropic directions in the texture based on the determined number of locations; and A sample combination circuit configured to use the sample or sample taken along the anisotropic direction in the texture to provide an output sampled texture value for the sampled location in the texture.

[0024] In these aspects, the present invention relates to determining the number of locations of samples in a texture (i.e., determining the degree of anisotropy) when performing anisotropic filtering.

[0025] In these aspects of the invention, coefficients A, B, C from an elliptic function are used (and only used) to determine the number of sample locations (anisotropy) in the texture, the elliptic function defining an ellipse which is a projection of the sampling locations, wherein texture values ​​will be applied to the surface on which the texture is being applied.

[0026] As will be discussed further below, this simplifies the calculations required to determine the number of locations for the samples (anisotropy), thus making the operation more efficient and effective in hardware. In particular, the applicant has recognized that the anisotropy can be determined when performing anisotropic filtering without using the elliptic coefficients F of the process, and specifically, without performing any scaling operations using the elliptic coefficients F. This then allows for simpler and more efficient anisotropy determination in hardware.

[0027] In this invention, the sampled texture can be any suitable and desired texture that can be used for graphics processing and for graphics processing, and can represent and store any suitable and desired data that the texture can be used to represent in graphics processing and graphics processing systems. Thus, a texture can represent, for example, appropriate color values ​​(e.g., rGBα values) (and in one embodiment, for example, an image), but can also represent other graphics processing parameters and data that can be represented using a texture, such as brightness values, light / shadow values, depth values, etc. This invention applies regardless of the actual data on which the texture is sampled.

[0028] Correspondingly, the texture being sampled should and preferably comprises an appropriate (e.g., 2D) array of texture data elements (text), each texture data element having an associated data (e.g., color) value. The texture values ​​of the desired sample will be indicated accordingly by indicating the appropriate location or position within the texture (texture coordinates) of the texture to be sampled, to provide the output sampled texture values ​​required for the graphics processing texturing operation in question.

[0029] The sampled texture is preferably provided as multiple mipmaps (mipmap levels), where each mipmap level is progressively less detailed than the previous level. The set of mipmaps for the texture may include only two mipmap levels, but preferably more than two, for example, extending from the most detailed mipmap level through progressively less detailed mipmap levels to at least a detailed mipmap level, such as including a single texel. Typically, the mipmap levels of the texture can be arranged and configured as needed, for example, and preferably according to how the texture is organized and configured as the mipmap levels of the graphics processor and graphics processing system and / or the application requiring graphics processing.

[0030] This invention relates to the case of anisotropically sampled textures. In this case, as described above, (multiple) samples are taken along the anisotropic direction and appropriately used (combined) to provide the sampled texture values ​​for output.

[0031] In these aspects, the present invention determines the number of sample locations (using multiple samples) by assuming that the sampling locations (points) using texture values ​​will be projected as ellipses onto the surface on which the texture is being applied.

[0032] Therefore, the anisotropic filtering process is configured and operates to sample based on an estimated elliptical coverage area within the texture, the estimated elliptical coverage area being designed to correspond to the projection of the sampling point onto the surface on which the texture is being applied.

[0033] To facilitate this, the invention includes (and the texture sampling device includes) one or more parameters configured to determine one or more parameters of an ellipse, the ellipse being estimated and intended to correspond to a projection of the texture being sampled onto the surface at the sampling location (point), and specifically, appropriate parameters of the ellipse can be used to appropriately control the anisotropic filtering process.

[0034] More specifically, in these aspects, the invention assumes that the projection of the sampling position onto the surface will be an ellipse of the form: Ax 2 +Bxy+Cy 2 =F Where A, B, C, and F are elliptic coefficients, and x and y are the texture coordinates (in texture space) of the location in the texture that is "sampled".

[0035] The present invention then determines, in particular, the elliptic coefficients A, B, and C, and uses those coefficients to determine the number of locations in the texture to be sampled when performing anisotropic filtering.

[0036] The elliptic coefficients A, B, and C can be determined in any suitable and desirable manner. In a particularly preferred embodiment, they are determined by derivatives of the texture coordinates in the X and Y directions in which the rendered output is generated. These derivatives are preferably expressed according to texture coordinate space such that they indicate the difference between the texture coordinates (texture number) at a sampling location in screen space and the texture coordinates at the next sampling location in screen space in the X and Y directions, respectively.

[0037] Therefore, in a preferred embodiment, the derivatives dTdx of the “X” texture coordinates and dtd of the “Y” texture coordinates are determined, and then used to determine the elliptic coefficients A, B, and C (and the device includes circuitry or circuitry configured to determine these derivatives).

[0038] The derivatives of the texture coordinates in the X and Y directions in screen space can be determined in any suitable and desirable manner. This is preferably accomplished by determining the derivatives of the texture coordinates of adjacent sampling positions in the X and Y directions in screen space, respectively.

[0039] The texture coordinate derivatives can be used to determine the elliptic coefficients A, B, and C in any suitable and desired manner. In a preferred embodiment, the elliptic coefficients A, B, and C are determined from the texture coordinate derivatives as follows: A = dTdx.y 2 + dTdy.y 2 B = -2 (dTdx.x dTdx.y + dTdy.x dTdy.y C = dTdx.x 2 + dTdy.x 2 Where x and y are the positions in the texture where the sampled texture values ​​need to be output.

[0040] In a particularly preferred embodiment, each of the elliptic coefficients A, B, and C may have been constrained by a value, for example, and preferably, such that there are one or more values ​​that the elliptic coefficients are not allowed to have, wherein if the value determined according to the derivative of the texture coordinates is a “non-allowed” value, the correspondingly determined elliptic coefficient is set (e.g., clamped) to the corresponding “allowed” value.

[0041] In this regard, the applicant has found that, for certain values ​​of texture coordinate derivatives, operation in the manner described in this invention may not be sufficiently numerically stable, thus necessitating, in principle, the use of undesirable high precision to provide sufficiently accurate determinations in those cases. This could potentially require an undesirable large amount of hardware area and energy cost (in use) to achieve this.

[0042] The applicant has discovered that this can alternatively avoid (those cases requiring undesirable high-precision determination) without affecting the visual output, in fact, by clamping the determined values ​​of A, B, and C to the preferred, preferably predefined "allowed" values ​​in those cases. Specifically, the applicant has discovered that the values ​​of the texture coordinate derivatives that trigger this behavior are only generated for very eccentric ellipses, such that clamping the elliptic coefficients in these cases should not significantly affect the visual results of texture sampling (compared to cases where "full" precision determination is achieved).

[0043] In a particularly preferred embodiment, a specific, preferably selected, preferably predefined minimum value is set for each of the elliptic coefficients A and C, and if the corresponding determined elliptic coefficient is less than the minimum value, it is set (clamped) to its corresponding minimum value. Therefore, if the determined value of coefficient A (e.g., from the texture coordinate derivative) is less than the minimum allowable value (and correspondingly for coefficient C), then the minimum allowable value of coefficient A will preferably be used, and coefficient A will be clamped (set).

[0044] The fixture is preferably configured such that multiplying a and C together does not reduce the range of the digital representation used (e.g., a 32-bit floating-point range) and yields a result of 0.0, and thus still allows for a sufficiently small negative LOD value so that the maximum permissible positive LOD bias may still result in a "final sampled LOD" greater than 0.0.

[0045] In a particularly preferred embodiment, at least when using 32-bit floating-point representation, the elliptic coefficients A and C are "clamped" on this basis as follows: If (A < 2^-63) A = 2^-63 If (C < 2^-63) C = 2^-63 In a particularly preferred embodiment, in addition to ensuring that the elliptic coefficients a and C are at least equal to a predefined minimum, it is also ensured that the difference between those coefficients is not greater than a specific, preferably selected, preferably predetermined maximum difference (one or two coefficients are then set (clamped) to a value that is equal to the predetermined maximum permissible difference if the difference between the values ​​determined as from the texture coordinate derivative exceeds the maximum permissible difference).

[0046] In this context, the maximum permissible difference between the elliptic coefficients A and C can be determined in any suitable and desirable manner. In a particularly preferred embodiment, the supported graphics processor texture mapping circuitry (hardware) (allowed for sampling) is determined based on the maximum anisotropy (i.e., the maximum number of locations that can be sampled along the anisotropic direction when anisotropic filtering is performed).

[0047] In a particularly preferred embodiment, the maximum permissible ratio between the values ​​of the elliptic coefficients A and C is set to be equal to the square of the maximum supported anisotropy, i.e., (max_supported_aniso). 2 .

[0048] Preferably, based on the maximum anisotropy supported by the hardware, the values ​​of coefficients A and C are further restricted as follows: If (A < C) ((1 / max_supported_aniso)^2) ) A = C ((1 / max_supported_aniso)^2) If (C < A) ((1 / max_supported_aniso)^2) ) C = A ((1 / max_supported_aniso)^2) Where max_supported_aniso is the maximum supported anisotropy.

[0049] The maximum anisotropy supported in this respect can be set and selected in any suitable and desired manner and with any suitable and desired element or component of the system. It will typically be set (fixed) along with the hardware of the processor in question (because it will be determined by the maximum precision that the hardware is capable of handling for the computation in question, which will be fixed for the hardware). An exemplary suitable maximum supported anisotropy is 16. Of course, other arrangements will be possible.

[0050] For the ellipticity coefficient B, in a preferred embodiment, a specific, preferably selected, preferably predetermined maximum value is set for the square of this coefficient (i.e., for B). 2 ) and B 2 The value is determined from the derivative of the texture coordinates and is preferably set (clamped) to a maximum value if it exceeds the maximum value.

[0051] In this case, B 2 The maximum value is again preferably based on (intended to be supported) the maximum anisotropy. Most preferably, B 2 The clamping value is set as follows: BB=B B If (BB > 4) A C (1 - (1 / max_supported_aniso)) ) BB = 4 A C (1- (1 / max_supported_aniso)) Elliptic coefficients A, B, and C can be used to determine the number of locations (anisotropy) of a sample in any suitable and desired manner. As mentioned above, this should and preferably is done without using the elliptic coefficient F as part of the determination, and preferably (at least) without performing any partitioning (scaling) using the elliptic coefficient F. (That is, using the determined coefficients A, B, and C to determine the number of locations in the texture where the sample should be photographed along the anisotropic direction, without using the elliptic coefficient F as part of the determination.)

[0052] In a particularly preferred embodiment, the ellipticity coefficients A, B, and C are used to determine the number of sample locations (anisotropy) as follows: root = sqrt((AC)^2B^2) aniso_degree=sqrt((A+C+root) / (A+C-root)) Where A, B, and C are the elliptic coefficients of the ellipse, which is the projection of the screen-space sampling position onto the surface to which the texture is to be applied (as described above); and Anisotropy is the anisotropy degree (i.e., the number of specific locations in the sampled texture).

[0053] The applicant has discovered, in particular, that the anisotropy degree can be correctly determined from the elliptic coefficients A, B, and C in this manner, and this provides a more efficient mechanism and process for determining the anisotropy degree based on its implementation in hardware.

[0054] In a preferred embodiment, if, for any reason, the determined anisotropy degree is not a significant number, then the anisotropy degree is preferably set (clamped) to "1". Therefore, in a preferred embodiment: if (isnan(aniso_degree)) aniso_degree = 1 Furthermore, in a particularly preferred embodiment, a specific, preferably selected, preferably predetermined maximum value is set for the anisotropy degree (sample size), and the anisotropy degree determined according to the ellipticity coefficients A, B, and C is set (clamped) to the set maximum value. If it exceeds the maximum value, i.e.: if (aniso_degree > max_aniso ) aniso_degree = max_aniso The maximum anisotropy is set by max_aniso.

[0055] The determined anisotropy is restricted to no more than the set maximum anisotropy set. In effect, the number of sampling locations is capped when sampling the texture, and thus sampling is performed on the capped texture sampling cost when performing anisotropic filtering.

[0056] The maximum number of allowed locations that can be sampled when performing anisotropic filtering can be set for this purpose in any suitable and desired manner and by any suitable and desired element or component of the system.

[0057] For example, this can simply be the maximum supported anisotropy, as described above (and in a preferred embodiment, the maximum supported anisotropy is used as the default maximum allowed number of samples that can be taken when performing anisotropic filtering, and the maximum anisotropy can be taken at any location where a smaller maximum allowed number of samples can be sampled when performing anisotropic filtering).

[0058] In a particularly preferred embodiment, or alternatively, it may also be possible to specify the location of the maximum permissible number of samples that can be sampled when performing anisotropic filtering, which differs from the maximum anisotropy supported (intended to be set).

[0059] In a preferred embodiment of this type, applications requiring graphics processing (and therefore, in particular, texture mapping) are able to set the maximum anisotropy to be used (for this purpose). Alternatively, a maximum anisotropy setting may also be available for the graphics processor driver. For example, a default maximum value may exist, for instance, set by the driver, but applications can set lower or higher maximum values ​​for the anisotropy in use (but not higher than the maximum supported anisotropy) if needed.

[0060] In a particularly preferred embodiment, the determination of the number of samples (degree of anisotropy) is further configured to ensure that at least one sample will be taken; that is, if the determined number of samples (determined degree of anisotropy) is less than 1, the determined degree of anisotropy will be set to 1. if (aniso_degree is <1.0) aniso_degree = 1.0.

[0061] Once the number of locations (anisotropy) for the sample texture has been determined, samples should be taken along the anisotropic direction in the texture based on the determined number of locations, and preferably along the anisotropic direction. As will be discussed further below, this may include taking samples along the determined number of locations in the texture along the anisotropic direction (and in a preferred embodiment, in this case, it may include taking samples along the anisotropic direction in the texture, where the locations are different from the determined number of locations), but based on the determined number of locations (e.g., determined using the determined number of locations) (and in other embodiments, this is the case).

[0062] There may be only a single "version" of the texture to be sampled (e.g., at the mipmap level) for anisotropic filtering operations. In this case, the number of positions in the texture (mipmap) based on a determined number of positions (e.g., and preferably equal to the determined number of positions) should be sampled in an appropriate manner.

[0063] However, in a particularly preferred embodiment, the sampled texture is provided as two or more mipmaps, and the sampling of the texture includes sampling the appropriate mipmaps or mipmaps of the texture (depending on the determined number of locations to be sampled).

[0064] Therefore, in a particularly preferred embodiment, the sampled texture is provided as two or more mipmaps, and the method includes: A pair of mipmap levels are determined, including a first more detailed mipmap level and a second more detailed mipmap level, wherein the second more detailed mipmap level acquires samples from the simulation map level and the less detailed mipmap level from the pair of mipmap levels to provide the sampled texture values ​​of the output (and preferably, samples are acquired along the anisotropic direction in the more detailed mipmap level, and the samples taken along the anisotropic direction are combined in the more detailed mipmap level and in the more detailed mipmap level to provide the output sampled texture values ​​for use).

[0065] Correspondingly, the device of the present invention preferably includes: The mipmap level selection circuit is configured to, when using anisotropic filtering to sample to provide textures of two or more mipmaps, determine a pair of mipmap levels, including a first more detailed mipmap level and a second more detailed mipmap level, to obtain samples to provide output sampled texture values. Furthermore, the texture sampling circuitry is configured to sample one or more (preferably more) locations along the anisotropic direction at a more detailed mipmap level, and at a more detailed mipmap level. Furthermore, the sample combination circuit is configured to combine the samples captured along the anisotropic direction at a more detailed mipmap level and a less detailed mipmap level to provide output sample texture values ​​for use.

[0066] In these embodiments of the invention, when anisotropic filtering is performed, two texture mipmap levels are sampled. One mipmap level is more detailed (i.e., includes a higher resolution (more detailed) version of the texture in question), and the other mipmap level of the two includes a less detailed (lower resolution) version of the sampled texture. Any two mipmap levels can be selected for sampling.

[0067] In a preferred embodiment, the two mipmap levels for acquiring texture samples include adjacent levels in the mipmap hierarchy.

[0068] The two mipmap levels from the sample can be selected and determined according to any suitable and desired criteria and conditions. In a preferred embodiment, they are determined based on the level of detail (LOD) of the texture to be sampled.

[0069] Preferably, mipmap levels from either side of the desired level of detail are selected and sampled from. Therefore, it is preferable to select a more detailed mipmap level, i.e., a mipmap level that is closest to the desired level of detail (but more detailed than the desired level of detail), and preferably to select a slightly more detailed mipmap level that is closest to the desired level of detail (but less detailed than the desired level of detail) as the sample mipmap level.

[0070] The level of detail of the texture to be sampled can be determined accordingly in any suitable and desired manner. In a preferred embodiment, the texture applied to the surface is determined at least based on the projected ellipse of the sampling location on the surface.

[0071] The level of detail can be determined at least in part based on a defined length of the minor axis of the projected ellipse of the sampling point in question. The length of the minor axis of the projected ellipse of the sampling point in question can be determined in any suitable and desirable manner. In a particularly preferred embodiment, the defined length of the minor axis of the projected ellipse of the sampling point indicates the radius of the minor axis of the projected ellipse of the sampling point, and most preferably, it is the radius of the minor axis of the projected ellipse of the sampling point. Therefore, in a preferred embodiment, the level of detail is determined at least in part based on a defined radius of the minor axis of the projected ellipse of the sampling point in question.

[0072] However, in a particularly preferred embodiment, the length of the minor axis (e.g., its radius) of the projected ellipse of the sampling point in question is determined at a level of detail without specifically determining (and it is not necessary to specifically determine) it.

[0073] Most preferably, the level of detail is determined as log2 of the length of the minor axis of the projected ellipse of the sampling point in question, and preferably as log2 of the minor axis of the projected ellipse in question, and preferably by a logical 2 operation on one or more of the ellipse coefficients, and preferably a complex number.

[0074] In a particularly preferred embodiment of this type, the level of detail to be used is determined to be: lod = 0.5 (log2( 2F ) - log2( A + C + root)) in: LOD is a defined level of detail; A and C are ellipticity coefficients, which are preferably determined as described above; F is the elliptic coefficient F as defined above; and root is the parameter "root" as defined above (i.e., root = sqrt( (A - C)^2 + B^2 )).

[0075] In this regard, the applicant has recognized that the level of detail will not (and does not need to) be very high precision, and therefore can be satisfactorily determined using a basis-2 logarithm as described above. Furthermore, this form of log2 operation can be implemented relatively inexpensively in hardware (e.g., compared to a partitioning operation). Therefore, using multiple log2 operations to determine the level of detail makes it possible to determine the level of detail relatively inexpensively in hardware.

[0076] Therefore, the applicant believes that determining the level of detail at which the texture is sampled when performing anisotropic filtering (and thus selecting the mipmap level to be used when sampling the texture) can be novel and the invention itself can be novel and inventive, and not only in determining the number of locations of samples in the texture in the manner discussed above.

[0077] Therefore, according to a third aspect of the invention, a method is provided for performing anisotropic filtering when sampling a texture to provide output sampled texture values ​​for use when rendering output in a graphics processing system, the method comprising: When the samples are provided as textures of two or more mipmaps, anisotropic filtering is used to provide the output sampled texture values ​​at positions x and y in the text: The level of detail for sampling the texture is determined in the following way: Determine if it has the form Ax 2 +Bxy+Cy 2 The coefficients A, B, C, and F of the ellipse = F correspond to the projection of the sampling point, the texture being sampled onto the surface onto which the texture is to be applied, where x and y are the coordinates of the position in the texture to provide the output sampled texture value; and Using one or more log2 operations, and preferably on one or more of the determined elliptic coefficients A, B, C, F, to determine one or more of the determined elliptic coefficients A, B, C, F, to determine the level of detail for sampling the texture (and preferably by determining the level of detail of the texture as: lod=0.5 (log2(2f)-log2(A+C+root) in: LOD is a specific level of detail; and root = sqrt( (A - C)^2 + B^2 ) ) The method further includes: The determined level of detail is used to select one or more of the mipmap levels of the texture, thereby obtaining samples to provide sampled texture values ​​for the output; Sample or sample at one or more locations along an anisotropic direction in the texture at one or more selected mipmap levels; and The samples or samples taken along the anisotropic directions in the one or more mipmap levels are used to provide output sampled texture values ​​for the locations sampled in the texture.

[0078] According to a fourth aspect of the invention, there is provided an apparatus for performing anisotropic filtering when sampling a texture to provide output sampled texture values ​​for use when rendering output in a graphics processing system, the apparatus comprising: The details determine the level of the circuit, which is configured to sample a texture provided as two or more mipmaps using anisotropic filtering to provide output sampled texture values ​​at positions x and y in the text: The level of detail for sampling the texture is determined in the following way: Determine if it has the form Ax 2 +Bxy+Cy 2 The coefficients A, B, C, and F of the ellipse = F correspond to the projection of the sampling point, the texture being sampled onto the surface onto which the texture is to be applied, where x and y are the coordinates of the position in the texture to provide the output sampled texture value; and Using one or more log2 operations, and preferably on one or more of the determined elliptic coefficients A, B, C, F, to determine one or more of the determined elliptic coefficients A, B, C, F, to determine the level of detail for sampling the texture (and preferably by determining the level of detail of the texture as: lod=0.5 (log2(2f)-log2(A+C+root) in: LOD is a specific level of detail; and root = sqrt( (A - C)^2 + B^2 ) ) The device further includes: The mipmap selection circuit is configured to use the determined level of detail to select one or more mipmap levels of the texture for sampling from the texture to provide output sampled texture values; A texture sampling circuit, configured to sample or sample one or more locations along an anisotropic direction at one or more selected mipmap levels; and A sample combination circuit is configured to use the samples or samples taken along the anisotropic direction at one or more mip map levels to provide output sampled texture values ​​for the sampled locations in the texture.

[0079] Those skilled in the art will understand that these aspects of the invention may and preferably include any one or all of the optional and preferred features of the invention described herein.

[0080] For example, the number of sampling locations along the anisotropic direction in the selected mipmap or mipmap is preferably determined according to the earlier aspects and embodiments of the invention discussed above.

[0081] In these aspects and embodiments of the invention, although the process may produce the selection of only a single mipmap level from the selection of only a single mipmap level based on the level of detail (and this will be discussed further), more typically, the level of detail will be used to identify and select two mipmap levels for the texture of a sample.

[0082] Therefore, in a particularly preferred embodiment, the determined level of detail is used to select (determine) a pair of mipmap levels, including a first more detailed mipmap level and a second more detailed mipmap level, from which samples are taken to provide texture values ​​for the output sample (and the method will include (and the device will be configured to) perform one or more, and preferably multiple, samples along the anisotropic direction), taking samples along the anisotropic direction in the more detailed mipmap level; taking one or more, and preferably multiple, samples along the anisotropic direction in the less detailed mipmap level; and combining the samples or samples taken along the anisotropic direction in the more detailed mipmap level and the samples or samples taken along the anisotropic direction in the less detailed mipmap level to provide texture values ​​for the output sample used).

[0083] In these aspects and implementations, the elliptic coefficients A and C are preferably determined by derivatives of the texture coordinates, as described above (and preferably, those values ​​are determined once and reused).

[0084] The ellipticity coefficient F can be determined accordingly from the texture coordinate derivative. In this case, this is preferably done as follows: F = (dTdx.x dTdy.y - dTdx.y dTdy.x)^2 In a preferred embodiment, the elliptic coefficient F is determined based on the (already determined) elliptic coefficients A, C, and B (instead of being determined directly from a derivative of the texture coordinates).

[0085] In this case, the elliptic coefficient F is preferably determined based on the following elliptic coefficients A, B, and C: F = A C - (B^2) / 4 In these aspects and embodiments of the invention (and others), in a preferred embodiment, the detail value used to determine the mipmap level of a sample is set to infinity if determined to be "Not a Number" (NaN), i.e.: lod = isnan(lod) ? inf:lod In a particularly preferred embodiment, as described above, the number of locations (anisotropy) can be clamped to a maximum value, and then, with the determined anisotropy clamped, the level of detail in the computation is modified to trigger (determine) the use of a less detailed mipmap. This helps to avoid aliasing.

[0086] Therefore, in a preferred embodiment, when clamping anisotropy (as discussed above), a more detailed mipmap level is used than that used according to the “standard” detail calculation level (i.e., the level of detail is modified so as to trigger the use of a less detailed mipmap level (more detailed than usually determined)).

[0087] Most preferably, in this case, the level of detail is determined by dividing the major axis radius by the maximum anisotropy (instead of using the minor axis radius). Therefore, in this case, when the anisotropy is already factored in, the level of detail is preferably modified as follows: If (aniso_degree_was_clamped) lod = 0.5 (log2( 2F ) - log2( A + C- root )) - log2( max_aniso ) The maximum anisotropy is set by max_aniso (as described above).

[0088] Correspondingly, in a particularly preferred embodiment, the level of detail for sampling the texture (and the level of detail to be used when determining the samples for the texture) is determined as follows: If (aniso_degree_was_clamped) lod = 0.5 (log2( 2F ) - log2( A + C- root )) - log2( max_aniso ) Otherwise, lod = 0.5 (log2( 2F ) - log2( A + C + root)) Of all these determinations, the appropriate values ​​for the elliptic coefficients A, B, and C should be, and preferably are, values ​​determined based on derivatives of the texture coordinates of the coefficients or (preferably at least) "clamping" values ​​(as described above) (wherein the coefficients are clamped).

[0089] In these aspects and embodiments of the invention (and in other ways), the level of detail selected based on the mipmap level used can simply be the initial “original” level of detail as discussed above (and in one embodiment, this is the case).

[0090] However, in a preferred embodiment, the level of detail used to select the mipmap level to be used can also, and preferably also, take into account other "level of detail" parameters that can be set and used, for example, by applications that require texture mapping operations.

[0091] For example, where it is possible to set a detail “bias” level that will modify the initially determined level of detail, preferably, the level of detail bias is taken into account when selecting a mipmap level, for example, and preferably, when selecting and choosing a mipmap level from a sample, the level of detail modified by the level of detail bias is used.

[0092] Correspondingly, while high and / or low levels of detail “clamps” can be set (in order to cover the highest or lowest level of detail that can be sampled), any such level of detail clamping is again preferably considered when determining the level of detail used to select mipmap levels from samples.

[0093] Similarly, taking into account any “level of detail” parameters, such as the level of detail deviation and the high and low level of detail fixtures discussed above, the level of detail actually used to select the mipmap level to be used also takes into account any (additional) adjustments, and depends on any (further) adjustments to the level of detail determined after applying any level of detail deviation and the high and low level of detail fixtures.

[0094] For example, and preferably, in the case of further adjustments (such as rounding), the level of detail determined after any level of detail deviation, and the levels of high and low detail fixtures have already been applied, is preferably "adjusted" (e.g., rounded) to determine and select the mipmap level to be used.

[0095] Therefore, in a particularly preferred embodiment, the “final” level of detail used to determine which mipmap level from the sample is the level of detail after any adjustments (such as rounding) have been applied, and is preferably determined based on the initially determined original level (preferably determined as described above), any set detail bias and / or fixture level, and any set adjustments (e.g., determined from the original level of detail and any level of detail bias and set detail bias and fixture level).

[0096] In a preferred embodiment, the system supports multiple different modes of "mip mapping" operation ("mipmap" modes), which specify the final level of detail to be determined for the mipmap to be sampled (e.g., and preferably from the initially determined original level of detail and any set detail deviations and / or fixture levels). In this case, the "mipmap" mode used is preferably, and preferably set by the application requiring graphics processing, and / or by, for example, the driver of the graphics processor (e.g., in addition to any specified mipmap mode setting and / or regardless of any application-specified mipmap mode setting).

[0097] In this case, it is preferable to have a "mipmap" mode, which allows for a level of detail used to determine the mipmap to be sampled, and can have a score value.

[0098] Preferably, there is then a second mode in which the level of detail is rounded to an integer value, preferably the closest integer value.

[0099] Of course, other arrangements are possible. For example, other LOD "rounding" patterns can also be used.

[0100] The mipmap used to determine the output sample texture values ​​to be used can be determined from the “final” LOD (i.e., after adjustment (rounding), if any) in any suitable and desired manner.

[0101] For example, when the "final" LOD value is a fractional value, preferably, the final LOD value is used to select the two mipmap levels from and "blended," for example, and preferably using an appropriate interpolation based on the fractional (partial) details. Therefore, in the case of fractional LOD values, the LOD value will be used to determine the two mipmap levels to be blended together, and preferably, how to perform the blending, for example, and preferably, a weighted average of the two mipmap levels in the blending result.

[0102] On the other hand, if the "final" LOD value (i.e., after adjustment (rounding)) is an integer value (which may be, for example, an integer value that mipmap mode specifies to ground the LOD value to, for example, the nearest integer LOD value), then it is preferable to use the (integer) "final" LOD value to determine the individual mipmap level from the sample.

[0103] In these aspects and embodiments of the invention (and other aspects), the number of samples using the selected mipmap level or level may be determined as needed, but as described above in the particularly preferred embodiments, it is determined according to the first and second aspects of the invention described above.

[0104] Therefore, in this invention, when only a single version of the texture to be sampled (e.g., a single mipmap level) is determined, multiple samples will be collected at one or more locations along the anisotropic direction (in the single mipmap level), preferably based on (equal to) the number of sample locations determined in the manner of the first and second aspects of this invention.

[0105] Correspondingly, when anisotropic filtering (including more detailed and less detailed mipmap levels) is performed from a pair of mipmaps, the samples should, and preferably at one or more locations along the anisotropic direction in each mipmap level, preferably determined in the manner of the first and second aspects of the invention.

[0106] In this context, in one implementation, the same number of locations are obtained along the anisotropic direction at both the more detailed mipmap level and the less detailed mipmap level. In another implementation, samples are taken at fewer locations along the anisotropic direction at the more detailed mipmap level than along the anisotropic direction at the more detailed mipmap level.

[0107] Therefore, in a preferred embodiment, when anisotropic filtering (including more detailed and less detailed mipmap levels) is performed from a pair of mipmaps, samples are acquired along the anisotropic direction at the more detailed mipmap level, and at a second smaller number of locations along the anisotropic direction at the more detailed mipmap level (samples (at) the texture sampled along the anisotropic direction at the more detailed mipmap level, and (at) a second smaller number of sampling locations along the anisotropic direction at the less detailed mipmap level).

[0108] Correspondingly, samples taken at a more detailed mipmap level along the anisotropic direction and samples taken at a less detailed mipmap level along the anisotropic direction are then combined to provide output sampled texture values ​​for use.

[0109] It should be noted here that, as will be discussed further below, a single (e.g., bilinear) sample is taken for each location along the anisotropic direction (and in one embodiment, in another embodiment), but multiple (e.g., bilinear) samples may also be collected for each location along the anisotropic direction. Therefore, unless the context otherwise requires, reference to samples taken or at locations along the anisotropic direction includes taking only a single (e.g., bilinear) sample at the location in question and acquiring multiple (e.g., bilinear) samples at the location in question.

[0110] Therefore, in a preferred embodiment, samples are taken at two or more locations along the anisotropic direction at a more detailed mipmap level, and for one or more locations (but fewer than those sampled along the anisotropic direction at the more detailed mipmap level), samples are taken along the anisotropic direction at a less detailed mipmap level. Thus, it is possible to sample only a single location along the anisotropic direction at the more detailed mipmap level (having multiple locations sampled along the anisotropic direction at the more detailed mipmap level), but in a preferred embodiment, there are still multiple (complex) locations even when multiple locations are sampled along the anisotropic level at the more detailed mipmap level.

[0111] The relative number of locations sampled in each mipmap level in these embodiments can be chosen as needed (as long as more locations are sampled in the more detailed mipmap level compared to the less detailed mipmap level). In a preferred embodiment, the ratio of the number of locations to samples relative to the number of locations sampled in the less detailed mipmap level is based on and preferably (substantially) equal to the ratio of the resolution of the more detailed mipmap level to the less detailed mipmap level. Thus, in a preferred embodiment, multiple locations are sampled twice in the more detailed mipmap level compared to the less detailed mipmap level. This may be particularly suitable where the resolutions of the two mipmap levels are different by a factor of 2. Of course, other arrangements will be possible.

[0112] In a preferred embodiment, the number of locations for sampling at each mip map level is determined based on a determined initial "base" anisotropy, where the "base" number represents the number of "bases" at locations sampled from the texture used for the anisotropic filtering process. The number of locations is then set, for example, based on the determined initial, base anisotropy (number of locations), for example, greater than and / or less than an appropriate number of locations, and set in an appropriate manner.

[0113] In this context, the anisotropy of “bases” (number of positions) used to determine the number of positions from each mipmap level in these embodiments is preferably based on the number of positions of the sample as discussed above (i.e., in the manner of the first and second aspects of the invention), and may, for example, simply be the “original” anisotropy (number of positions) determined as described above (and in a preferred embodiment, the “bases” anisotropy based on (from / using) the “original” anisotropy).

[0114] In these implementations, the actual number of sample locations in each mipmap level can be determined from the location of the base anisotropy number in any suitable and desired manner.

[0115] Typically, the number of locations sampled relative to the base number of locations can be increased or decreased in one or both of the more detailed mipmap levels (appropriately) in any suitable and desired manner, as long as there are more locations in the more detailed mipmap level than in the less detailed mipmap level.

[0116] In a preferred embodiment, the increase or decrease of the sampling position in the mipmap level relative to the basic number of positions is based at least in part on the level of detail of the texture to be sampled, and most preferably, at least in part on the distance from the level of detail intended to be sampled (in terms of its level of detail) according to the mipmap level in question.

[0117] In a preferred embodiment, the level of detail of the sampled texture is derived from the level of detail of a more detailed mipmap, and then the increase in the number of sampling locations at the more detailed mipmap level is greater than the base number of locations (and vice versa). (Therefore, if the level of detail of the texture to be sampled is close to the level of detail of a more detailed mipmap, the number of sampling locations at the more detailed mipmap level is preferably close to the base number of locations.)

[0118] Correspondingly, in a preferred embodiment, the level of detail to be sampled for the texture comes from the level of detail of the less detailed mipmap, and then the number of locations sampled from the less detailed mipmap level of the base location decreases more significantly (and vice versa). (Therefore, if the level of detail of the texture to be sampled is close to the level of detail of the less detailed mipmap, the number of locations sampled in the less detailed mipmap level is preferably close to the number of bases at the location.)

[0119] Therefore, although in the implementation, the number of sampling locations in each mipmap level can be simply determined based on the "base" anisotropy, which is determined, for example, as discussed above or preferably as described above, the level of detail of the texture sampling operation can also be and preferably considered and used when selecting the number of sample locations in each mipmap level.

[0120] When determining the number of sample locations in each mipmap level, the level of detail used can simply be the initial "raw" level of detail, which is, for example and preferably, determined as described above. However, in a preferred embodiment, the level of detail used for this purpose also takes into account other "level of detail" parameters (as discussed above), and most preferably includes the actual level of detail used to select the mipmap level to use, taking into account any additional "level of detail" parameters that may have been set, and / or, for example, based on the selected mipmap mode (as discussed above), most preferably corresponding to the "final" level of detail (the level of detail used) determined to the mipmap level of the sample in the manner described above (if the level of detail used is after any mipmap mode adjustment).

[0121] Therefore, in a particularly preferred embodiment, the number of sample positions in each mipmap level is determined based on the determined number of “base” positions for the sample (i.e., “base” anisotropy), preferably as described above, and the level of detail at which the texture is sampled (and most preferably, for determining which mipmap level is the final “final” level of detail from the sample).

[0122] In this regard, the applicant further recognizes that, as stated above, the level of detail of the sampled texture (final level of detail) may not correspond to the initial “original” level of detail, which may not correspond to, for example, the initial “original” level based on the projection of the sampled points onto the surface to which the texture is to be applied, but may also be subject to and depend on other parameters, such as the level of detail deviation and / or high and / or low detail “fixtures” and / or any application adjustment (e.g., rounding) based on the “mipmap” mode.

[0123] In a particularly preferred embodiment, a positive “effective level of detail” is determined, i.e., the number of locations sampled at the sampled mipmap level (the number of locations sampled along the anisotropic direction) is reduced when the texture is a more detailed version of the texture for the set “mipmap” mode (preferably after any adjustments (rounding), preferably after applying the projection based on the sampling points) to the initial “original” level of detail on the surface to which the texture is to be applied (and preferably determined from (and only from) the estimated elliptical projection of the sampling points).

[0124] (This assumes that a lower level of detail implies a more detailed mipmap level, and vice versa. A corresponding arrangement can be used where a higher level of detail indicates a more detailed mipmap level.)

[0125] Most preferably, at a positive and effective level of detail deviation, the "base" anisotropy (number of positions along the anisotropic direction) is set to fewer positions than the number indicated by the "original" anisotropy (number of positions) determined by the area occupied by the projected ellipse of the output sampling point. The "original" anisotropy is determined by the area occupied by the projected ellipse of the output sampling point. Thus, the number of positions used to sample the texture is reduced and used as the "base" position number, and then the number of positions sampled along the anisotropic direction is selected at more and less detailed mipmap levels.

[0126] The reduction in the number of locations determined in the presence of a positive effective level of detail deviation can be selected as needed and based on any suitable and desired parameters. In a preferred embodiment, the modified number of locations to be sampled is provided based on the effective level of detail deviation (i.e., the difference between the texture's level of detail and the "original" level of detail determined based on an estimated elliptical occupancy area, which is the projection of the applied sampling points onto the surface of the sampled surface). (And, for example, the actual number of locations of samples in each of the two mipmap levels can be determined, for example, and preferably one or more of the methods discussed above.)

[0127] As described above, in this invention, samples are collected based on the number of positions determined along the anisotropic direction in the texture being sampled (at the mipmap level or horizontal).

[0128] Therefore, the present invention preferably further includes determining the anisotropic direction of taking samples in the texture (and the device of the present invention accordingly preferably includes anisotropic direction determining circuitry configured to determine the anisotropic direction of samples along the texture) (then taking samples, and then obtaining an appropriate number of positions along the determined anisotropic direction).

[0129] The anisotropic direction of the sampling can be determined in any suitable and desired manner. In a preferred embodiment, this is done by assuming that the sampling points that will use the texture values ​​will be projected as ellipses onto the surface on which the texture is being applied (as discussed above).

[0130] Therefore, preferably, when projected onto the surface on which the texture is being applied, the anisotropic orientation of the sample in the texture is selected and determined based on the estimated elliptical occupancy area of ​​the sampling points.

[0131] In a preferred embodiment, the anisotropic direction is based on and preferably corresponds to the major axis (direction) of the assumed elliptical area occupied by the sampling point onto which the texture value is being applied. Therefore, in a preferred embodiment, the anisotropic direction includes a defined major axis direction corresponding to the ellipse onto which the sampling point is projected onto the surface onto which the texture is being applied. Of course, other arrangements are possible.

[0132] When the anisotropic direction is determined as the direction of the major axis of an ellipse corresponding to the projection of the sampling point onto the surface on which the texture is applied, the direction of the major axis of the ellipse can be determined accordingly in any suitable and desirable manner.

[0133] In a particularly preferred embodiment, a normalized vector (i.e., a vector (unit vector) with a length of "1") is determined along the major axis of the ellipse, and then used to represent and serve as the anisotropic direction to be followed in the texture to obtain samples.

[0134] Then, the vector can be the coordinates of individual samples obtained along the anisotropy direction and is preferably used to offset these coordinates, for example, preferably by adding anisotropy_vector. The step_length between each sample. (The position of the first sample should be the texture coordinates provided by the application, and preferably offset appropriately from those texture coordinates so that a set of samples is centered on the texture coordinates provided by the application.)

[0135] The X and Y components of the unit (normalized) vector in the major axis of the ellipse, which corresponds to the projection of the sampling points onto the surface on which the texture is applied, can be determined in any suitable and desired manner.

[0136] For example, the major axis direction can be determined by determining the angle of that direction relative to the coordinate axes in the texture, and then the X and Y components of a normalized (unit length) vector with that angle can be determined (and then multiplied by the step size between samples when that vector is used to offset the coordinates of sample points).

[0137] In a particularly preferred embodiment, the X and Y components of a unit vector representing the anisotropic (major axis) direction are determined by first determining the X and Y components of an arbitrary (any) length vector corresponding to the direction of the major axis of the assumed elliptical projection of the sampling point onto the surface to which the texture is applied; then normalizing those components to provide the X and Y components of a unit vector corresponding to the direction of the major axis of the elliptical area occupies by the projection of the sampling point onto the surface to which the texture is applied.

[0138] (Then preferably, the determined X and Y components of the unit vector are used to determine (and as) the anisotropic direction along the texture to acquire the sample, the unit vector corresponding to the major axis of the elliptical projection of the sampling point onto the surface to which the texture is applied.)

[0139] In this regard, the applicant has recognized that the direction of the major axis of the elliptical projection of the sampling point onto the surface to which the texture is applied can be determined in this manner, and recognizes that doing so specifically avoids and eliminates the need for any angles used to determine this direction (and thus avoids the need to perform any trigonometric calculations when determining the anisotropic direction). This then reduces hardware costs when performing anisotropic filtering to determine the anisotropic direction along its sampled texture.

[0140] Accordingly, the applicant believes that when anisotropic filtering is performed in this manner, determining the anisotropic direction along which the texture is sampled may be novel and to the right of the present invention.

[0141] Therefore, according to a fifth aspect of the invention, a method is provided for performing anisotropic filtering when sampling a texture to provide output sampled texture values ​​for use when rendering output in a graphics processing system, the method comprising: When using anisotropic filtering to sample textures, output sample texture values ​​are provided for positions x and y in the text: The anisotropic direction to be along in the texture to obtain the sample is determined in the following way: Determine the X and Y components of a vector of arbitrary length from the direction of the major axis of the assumed elliptical projection corresponding to the sampling point to the surface on which the texture is being applied; The determined X and Y vector components are normalized to provide the X and Y components of a unit vector corresponding to the direction of the major axis of the area occupied by the ellipse at the sampling point, as if projected onto the surface of the texture onto the surface of the texture; and The determined X and Y components of the unit vector to which the texture is applied on the surface of the texture are directed from the direction of the major axis of the elliptical projection corresponding to the sampling point, and the determined X and Y components are applied along the anisotropic direction in the file. The method further includes: One or more samples are taken in the text along the determined anisotropic direction; and The sample or sample taken along the anisotropic direction in the texture is used to provide an output sampled texture value for the sampled location in the texture.

[0142] According to a sixth aspect of the invention, there is provided an apparatus for performing anisotropic filtering when sampling a texture to provide output sampled texture values ​​for use when rendering output in a graphics processing system, the apparatus comprising: An anisotropic direction determination circuit is configured to determine the anisotropic direction along the texture when sampling a texture using anisotropic filtering to provide output sampled texture values ​​at positions x and y in the texture: Determine the X and Y components of a vector of arbitrary length from the direction of the major axis of the assumed elliptical projection corresponding to the sampling point to the surface on which the texture is being applied; and The determined X and Y vector components are normalized to provide the X and Y components of a unit vector corresponding to the direction of the major axis of the area occupied by the ellipse at the sampling point, as if the texture projected onto the surface is used as the direction of the major axis of the anisotropic direction. The device further includes: A texture sampling circuit, configured to capture samples or samples in a texture along a defined anisotropic direction; and A sample combination circuit is configured to use samples or samples taken along the anisotropic direction of the texture to provide output sampled texture values ​​for the locations sampled in the texture.

[0143] Those skilled in the art will understand that these aspects of the invention may and preferably include any one or all of the optional and preferred features of the invention described herein.

[0144] Therefore, for example, according to the earlier aspects of the invention discussed above, it is preferable to determine the number of sampling locations along the anisotropic direction. Accordingly, it is preferable to determine the level of detail, and thus the mipmap level or level, for sampling the texture, according to the earlier aspects and embodiments of the invention discussed above.

[0145] In a particularly preferred embodiment, the X and Y components of a vector (of arbitrary length) corresponding to the direction of the major axis of the elliptical projection at the sampling location are determined using (and preferably only using) elliptic coefficients A, B, and C to the surface on which the texture is being applied. In a particularly preferred embodiment, only the elliptic coefficient B (and preferably as B or -B) is used to determine one of the components, and all coefficients A, B, and C (and preferably as AC roots or AC roots (where the root is the parameter "root" as determined above) are used to determine the other components.

[0146] In this case, the X and Y vector components are preferably determined based on whether the elliptic coefficient A is greater than the elliptic coefficient C (i.e., using the elliptic coefficient B to determine the X or Y component), or more preferably based on whether the elliptic coefficient A is greater than the elliptic coefficient C.

[0147] Most preferably, the X and Y components of a vector of arbitrary length representing the anisotropic direction are determined by the elliptic coefficients A, B, and C (and determined according to whether the value of the elliptic coefficient A is greater than the value of the elliptic coefficient C) as follows: if (A > C) { aniso_vec.x = -B aniso_vec.y = A - C + root } if (A < C) { aniso_vec.x = A - C - root aniso_vec.y = B } in: asil_vect.X and amin_vect.Y are the X and Y components of a vector of arbitrary length, respectively, which correspond to the direction from the major axis of the elliptical projection of the sampling position to the surface on which the texture is being applied; A, B, and C are ellipticity coefficients, preferably determined as described above; and root is the parameter "root" as defined above (i.e., root = sqrt((A - C)^2 + B^2)). When A=C, the X and Y components of arbitrary length in the anisotropic direction can be determined from the elliptic coefficients A, B, and C according to the method shown above for A>C or the method shown above for A. C, that is, such that: if (A > C) { aniso_vec.x = -B aniso_vec.y = A - C + root } else { aniso_vec.x = A - C - root aniso_vec.y = B } or if (A >= C) { aniso_vec.x = -B aniso_vec.y = A - C + root } else { aniso_vec.x = A - C - root aniso_vec.y = B } In a preferred embodiment, the X and Y components of the vector representing the anisotropic direction, of arbitrary length, are determined in the same way from the elliptic coefficients A, B, and C, except when A is greater than or equal to C (i.e., when A is less than C, in a different way). if (A >= C) { aniso_vec.x = -B aniso_vec.y = A - C + root } else { aniso_vec.x = A - C - root aniso_vec.y = B } Then, the determined X and Y components for an anisotropic direction vector of arbitrary length should be, and preferably are used to determine the X and Y components of a unit-length vector (normalized vector) in the anisotropic direction. This can be done in any suitable and desirable manner.

[0148] In a preferred embodiment, this is done by determining the length of the arbitrary length vector from the determined X and Y components of the determined major axis direction vector and then dividing the determined X and Y components by the determined length of the vector to provide the corresponding X and Y components of the unit (normalized) vector for projection onto the surface on which the texture is being applied in the direction of the major axis of the ellipse, thereby segmenting the determined X and Y components.

[0149] In this case, the length of the major axis vector is preferably determined as the square root of the sum of the squares of the X and Y components of the vector (i.e., using Pythagoras' theorem). Most preferably, the reciprocal of the length of the major axis direction vector is determined, and then each of the X and Y components of the vector is multiplied by the reciprocal (the reciprocal of the vector's length) to determine the X and Y components of the unit (normalized) vector along the major axis direction (this will thus indicate and be used as the anisotropic direction when sampling is used for anisotropic filtering).

[0150] Therefore, in a preferred embodiment, the X and Y components of the unit vector corresponding to the anisotropic direction are determined based on the X and Y components determined with respect to an arbitrary length vector corresponding to the major axis of the ellipse, as follows: inv_len = 1.0 / sqrt( aniso_vec.x^2 + aniso_vec.y^2 ) aniso_vec.X = aniso_vec.x inv_len aniso_vec.Y = aniso_vec.y inv_len in: asil_vect.X and amin_vect.Y are the X and Y components of a vector of arbitrary length from the direction of the major axis of the elliptical projection corresponding to the sampling position to the surface on which the texture is being applied, preferably determined as described above; int_len is the reciprocal of the length of the vector; and inval_vec.X and amin_vect.Y are the X and Y components of a normalized vector (a vector of unit length), respectively, which correspond to the direction from the major axis of the elliptical projection of the sampling position to the surface on which the texture is being applied.

[0151] Once the number of positions of the sample along the anisotropic direction is determined, the mipmap level or the average direction of the sample is determined, and the anisotropic direction of the sample will be taken, then the number of positions of the sample should be determined to be, and preferably, cropped along the anisotropic direction in the texture at the mipmap level or level in question.

[0152] The desired number of sampling locations can be arranged along the anisotropic direction at the mipmap level in any suitable and desired manner. In a particularly preferred embodiment, they are equidistantly spaced along the anisotropic direction and preferably located on a defined anisotropic direction (i.e., on a defined major axis corresponding to the area occupied by the ellipse in the texture to which the sampling points to be textured will be projected). Most preferably, the defined number of sampling locations are positioned on the defined major axis with the elliptical projection of the sampling points onto the surface to which the texture is to be applied, and equidistantly spaced along a defined length of the major axis. The samples are preferably centered on the center of the ellipse (therefore, if two samples are taken, they are preferably placed equidistantly on either side of the center of the ellipse along the major axis).

[0153] The mipmap level should be, and preferably, sampled at each location where samples are to be taken. In one implementation, a single sample is taken for each location along the anisotropic direction to be sampled. In this case, it is preferable to acquire a single sample at said location.

[0154] In another implementation, multiple samples are taken at each location along the anisotropic direction to be sampled (and preferably the same number of samples are taken at each location). In this case, the multiple samples are preferably merged to provide the resulting sampled values ​​for the location in question. The multiple samples are preferably appropriately arranged around the location where the samples were taken, for example, and preferably in a suitable “hypersampling” pattern around the location.

[0155] Most preferably, in the case of the final level of detail of the texture sampling samples, the texture is a more detailed form of texture than the initial, "original" level of detail, and a more detailed version of the detail determined based on the elliptical projection of the sampling points on the surface to which the texture is applied, i.e., where the "effective level of detail deviation" (as described above) is negative (less than 0). (Again, assuming that a smaller detail value indicates a more detailed mipmap level), preferably by increasing the number of samples taken at the mipmap level or at least (and preferably both) of the sampled mipmap levels by acquiring more samples (by "more than") per location in the anisotropic direction of the sample taking.

[0156] The number of samples determined and acquired can be increased as needed, where a negative effective level of detail exists, and based on any suitable and desired parameters. In a preferred embodiment, this is based on the effective level of detail (i.e., the difference between the level of detail at which the texture is sampled and the “original” level of detail determined based on the estimated elliptical occupancy area, which is the projection of the sampling point onto the surface of the texture to be applied).

[0157] In a preferred embodiment, the determined effective level of detail deviation is used to select one or more, preferably two, and preferably all of the following: the number of samples to take pictures of each location along the anisotropic direction to be sampled; the spacing of those samples (e.g., around the locations along the anisotropic direction); and the weighting of those samples (their relative contribution to the "exceeding" output value).

[0158] Each sample taken at a location along the anisotropic direction can be a single point sample from the texture (e.g., the value corresponding to the nearest text).

[0159] However, in a preferred embodiment, each sample taken for a location at the mipmap level includes a bilinear filtered sample (e.g., and preferably according to the bilinear filtering process of the graphics processing system in question). In this case, one (or more) cross-shaped filtered samples will be taken for each location at each mipmap level along the anisotropic direction.

[0160] The samples themselves can be obtained from the texture (and the determined sampled values) in any suitable and desired manner. This is preferably done by sampling the texture in other ways in the graphics processor and the graphics processing system in question (e.g., when performing anisotropic filtering or otherwise).

[0161] (This invention primarily relates to selecting the number of sampling locations in each mipmap level, determining one or more mipmap levels to be sampled, and / or determining the anisotropic direction towards the sample. Therefore, there is no limitation on the actual samples obtained at the locations, or any existing process or procedure for sampling textures in graphics processors and graphics processing systems can be used, and is preferably used, for sampling at the desired number of locations in each mipmap level.)

[0162] As will be understood from the above, in a preferred embodiment of the invention, at least in a preferred embodiment, operation in the manner of the invention can determine that sampling should be performed for non-integer positions in one or both of the two mipmap levels. In this case, the number of sampled positions can be simply rounded to an integer value as needed, for example, and preferably the nearest integer (or the nearest highest integer or the nearest lowest integer). Alternatively, where the graphics processor and graphics processing system support taking fractional samples from the texture, the operation can be used to sample for desired non-integer positions in the mipmap level or the level.

[0163] Once samples have been taken at the mipmap level or level, those samples are used to provide output sample texture values ​​for use by the graphics processor (e.g., when generating the rendering output in question).

[0164] Samples (combined) within a mipmap level or dimension can be used to provide output sampled texture values ​​for use by the graphics processor (e.g., when generating the rendering output in question in any suitable and desired manner). In a preferred embodiment, samples taken along anisotropic directions within a given mipmap level are preferably (appropriately) combined within and for the mipmap level in question to give a combined sampled value for the mipmap level in question. Thus, samples for a more detailed mipmap level will be appropriately combined to provide combined sampled values ​​for said more detailed mipmap level, and correspondingly, samples for a less detailed mipmap level will be appropriately combined to give (individual) combined sampled values ​​for the less detailed mipmap level.

[0165] For each of the two mipmap levels, the determined (individual) combined sampled values ​​(if present) are preferably then merged according to the (score) level of the detail value and the distance from the mipmap level in question (the distance from the mipmap level in question to the mipmap level to which the sample is expected to be taken at the texture), for example, and preferably using linear interpolation based on a fraction of any (the) LOD value to provide the final, output sampled texture value.

[0166] Samples taken along the anisotropic direction at the mipmap level can be combined to provide combined sampled values ​​for the mipmap level in any suitable and desired manner. They are preferably combined based on the distance of the sample (location) from the center of the major axis of the projected ellipse along the anisotropic direction. Preferably, the samples are combined in a suitably weighted manner based on these factors, and most preferably, a suitable weighted average of the samples is determined.

[0167] When sampling an integer number of locations at the mipmap level, as described above, those samples are preferably equidistant from the center of the ellipse along the anisotropic direction, and are preferably combined based on the distance of the samples (locations) from the center of the major axis of the projected ellipse along the anisotropic direction (e.g., and preferably by weighting the contribution of the samples (locations) to the combined result based on the distance of the samples (locations) from the center of the ellipse).

[0168] In the case of a sample number of samples, and then in the case where the sample number is between 1 and 2, when the sample number increases from 1 to 2, it is preferable to take two samples with a preferred gradually increasing interval between them (until they are exactly one texel when exactly two samples are taken). For a sample number greater than 2, it is then preferable to add another (e.g., two) new samples on either side of the existing two samples (and outside of said two samples), since the number of samples exceeds two (and preferably, spaced one texel), but the interpolation weight is more than twice the actual number of samples to be taken (e.g., and preferably, such that the interpolation weight of the additional samples will actually start at a sample count of 2), and gradually increases as the number of samples to be taken increases (e.g., for a sample count of 0.25). (Correspondingly, in a preferred embodiment, as the sample count increases to more than 2, the interpolation weight of the initial (inner) two samples can be gradually reduced to allow the contribution (weighing) of the additional samples in 2, as the number of samples to be taken increases (this will help to provide a smoother transition since the sample count is greater than 2).)

[0169] Once the output sampled texture values ​​have been determined, appropriate elements for the graphics processor and graphics processing pipeline (e.g., for fragment shaders) can and preferably be provided.

[0170] The output sampled texture values ​​can be used in any suitable and desired manner, and should preferably be used in accordance with normal texture mapping operations and texture usage in graphics processors and graphics processing systems. (As mentioned above, the present invention essentially relates to determining how the output sampled texture values ​​are. The output values ​​can then be used as needed, and in the normal manner of such texture values.)

[0171] The output sampled texture values ​​should be used accordingly based on and according to the data represented by the texture. Therefore, in the case where the texture represents color values ​​(e.g., an image), the output sampled texture values ​​can be appropriately used when the graphics processor renders the sampled points in the rendered output (e.g., an image, such as a displayed image). Similarly, where the texture represents other data values, such as light or shadow values, depth values, etc., the output sampled texture values ​​will then be appropriately used, for example, to determine and / or set the lighting or shadow effects at the sampled locations in question. Of course, other arrangements will be possible.

[0172] In a particularly preferred embodiment, the invention is implemented at the texture mapping level (texture mapping / texture mapping circuitry) of the graphics processor of a graphics processing system. Therefore, in a preferred embodiment, the graphics processor includes a texture mapper (texture mapping circuitry), and the texture mapper of the graphics processor is operable to determine the various anisotropic filtering parameters discussed above, and to set and select the number of locations where textures should be sampled, at the level of detail of the sampled textures, etc., as described above.

[0173] Therefore, the invention extends to, and preferably includes, a texture mapping circuit for a graphics processor, the texture mapping circuit comprising any aspect of the invention.

[0174] In addition to the specific circuitry required to perform the operation in the manner of the present invention, the texture mapper (texture mapping circuit) may further include any suitable and desired circuitry, units, and stages for performing the texture mapping operation and performing the desired texture mapping operation in any suitable and desired manner.

[0175] Therefore, it may, and preferably includes, one or more of the following: a texture filtering circuit for performing texture filtering operations (and may perform anisotropic filtering at least in the manner of the invention, but preferably also supports other filtering operations, such as bilinear and trilinear filtering); a texture data acquisition circuit operable to acquire data values ​​of texture data elements for texture filtering operations (e.g., and preferably, via a suitable texture cache); a coordinate calculation circuit (stage); a level (stage) of a detail calculation circuit; a texel selection circuit (stage); and an output result providing circuit (stage).

[0176] Operating in the manner of the invention can be triggered in any suitable and desired way. In a preferred embodiment, it is performed in response to an appropriate texture mapping request (for textures to be anisotropically sampled), for example and preferably to the texture mapping stage (texture mapping circuitry). Such requests can be triggered as needed, for example and preferably by the renderer (e.g., fragment shader) of the graphics processor and graphics pipeline, for example, in response to and when the texture mapping operation needs to be performed, triggering the rendering of the graphics processor and graphics pipeline.

[0177] Anisotropic filtering operations in the manner of the present invention can be automatically triggered, for example, whenever anisotropic filtering texture mapping operations are required. Alternatively or additionally, operations in the manner of the present invention can be controlled by an application that requires graphics processing (e.g., by exposing it to an API), so that the application (application programmer) can subsequently specify when anisotropic filtering should be performed in the manner of the present invention.

[0178] Of course, other arrangements are possible.

[0179] Although the invention has been described above with reference to a single texture mapping and texture filtering operation (e.g., for a given sampling position in the rendered output), in practice, when generating the rendered output, the texture mapping operation will be repeated for multiple times, such that the output sampling position spans, for example, the entire original region being rendered. Therefore, the invention is preferably performed with respect to multiple texture mapping operations, for example, and preferably for each of the multiple sampling positions in the generated rendered output.

[0180] The operation in the manner of the present invention can be used for any suitable and desired form of texturing operation and graphics (or other) processing operation, which can be performed using textures, for example, and preferably when generating frames (images) for display, but also when generating other, such as non-graphical output.

[0181] The texture mapping apparatus of the present invention may include any one or more of the processing stages, circuitry, and components typically included in a graphics processing pipeline (GPU). Thus, for example, a GPU may include raw setup circuitry, a quasi-gate (circuit), and / or a renderer (circuit). Alternatively or concurrently, the GPU may be capable of performing ray tracing and / or hybrid ray tracing.

[0182] In a preferred embodiment, the graphics processor includes a renderer operable to perform graphics rendering operations, and a texture mapper operable to perform graphics texturing operations in response to a request for graphics texturing operations from the renderer. The renderer is preferably in the form of a programmable fragment shader or includes a programmable fragment shader (which processes graphics fragments for sampling locations of the rendering output generated by the graphics processor by executing a fragment shader program using a corresponding execution thread).

[0183] The graphics processing unit (processing pipeline) may also include any other suitable and desired processing stages that the graphics processing pipeline may include, such as a depth (or depth and stencil) tester, a mixer, a tile buffer, a write unit, etc.

[0184] If needed, texture mappers and texture mapping devices can also be coprocessors of the CPU, for example (i.e., coupled to the CPU that executes the rendering pipeline).

[0185] The graphics processor and / or texture mapping device of the present invention can be, and typically will be, part of an overall graphics and / or data processing system. Therefore, the invention also extends to data or graphics processing systems having the graphics processor and / or texture mapping device as described herein.

[0186] A data or graphics processing system may include a memory or storage system (memory system) for storing data, etc., as mentioned herein, which may be external to the graphics processor and texture mapping device. The memory or storage system may be operable to store, and may store, a set of texture icons used in texturing operations.

[0187] Therefore, as will be understood, embodiments of the present invention can be implemented in a data / graphics processing system including memory and a graphics processing unit (GPU) (graphics processor), the GPU including texture mapping devices as described herein. In embodiments, the data / graphics processing system may further include a host processor that executes applications that may require data or graphics processing by the GPU and instructs the GPU accordingly (e.g., via a driver for the GPU). The system may further include suitable storage devices (e.g., memory), caches, etc.

[0188] In one embodiment, the data or graphics processing system and / or (e.g., graphics) processor further includes one or more memory and / or memory devices storing the data described herein and / or storing software for performing the processes described herein, and / or communicating with said one or more memory and / or memory devices. The data / graphics processing system and / or graphics processor and / or texture mapping device may also communicate with a host microprocessor and / or have a display showing images based on the generated data.

[0189] In one implementation, the various functions of the technology described herein are performed on a single graphics processing platform that generates and outputs data (such as rendered fragment data written to the frame buffer) for example, for a display device.

[0190] This invention can be implemented in any suitable system, such as a microprocessor-based system with a suitable configuration. In one embodiment, the techniques described herein are implemented in a computer and / or microprocessor-based system.

[0191] The various functions of the present invention can be performed in any desired and suitable manner. For example, the functions of the present invention can be implemented in hardware or software when needed. Thus, for example, the various functional elements and stages of the present invention may include suitable processors, controllers, functional units, circuits, processing logic, microprocessor arrangements, etc., capable of operating to perform various functions, such as suitable dedicated hardware elements (processing circuits) and / or programmable hardware elements (processing circuits) that can be programmed to operate in a desired manner.

[0192] It should also be noted here that, as those skilled in the art will understand, the various functions of the present invention can be repeated and / or performed in parallel on a given processor. Similarly, various processing stages can share processing circuitry / circuits, etc., if desired.

[0193] Furthermore, any one or more processing levels of the present invention may be embodied, for example, in the form of one or more fixed functional units (hardware) (processing circuits) and / or in the form of programmable processing circuits that can be programmed to perform desired operations. Similarly, any one or more processing levels and processing level circuits of the present invention may be provided as separate circuit elements to other processing levels or any one or more processing levels and processing level circuits, and / or any one or more processing levels and processing level circuits may be formed at least partially by shared processing circuits.

[0194] Those skilled in the art will also understand that all described embodiments of the present invention may, where appropriate, include any one or all of the features described herein.

[0195] The method according to the invention can be implemented at least in part using software, such as a computer program. Therefore, further embodiments of the technology described herein include: computer software particularly adapted to perform the methods described herein when mounted on a data processor; a computer program element including computer software code portions for performing the methods described herein when the program element is run on a data processor; and a computer program including code adapted to perform all steps of one or more methods described herein when the program is run on a data processing system. The data processing system may be a microprocessor, a programmable FPGA (Field-Programmable Gate Array), etc.

[0196] The invention also extends to computer software carriers that include software that, when used to operate a graphics processor, renderer, or other system including a data processor, causes the steps of the methods of the invention to be performed in conjunction with said graphics processor, renderer, or system. Such computer software carriers can be physical storage media, such as ROM chips, CD-ROMs, RAM, flash memory, or disks, or they can be signals, such as electronic signals, optical signals, or radio signals, such as signals to satellites, etc.

[0197] It will also be understood that not all steps of the method of the present invention need to be performed by computer software, and therefore, according to a broader aspect, the present invention provides computer software mounted on a computer software carrier for performing at least one step of the method described herein, and such software.

[0198] This invention can therefore be suitably embodied as a computer program product for use with a computer system. Such embodiments may include a series of computer-readable instructions fixed on a tangible, non-transitory medium, such as a computer-readable medium, for example, a disk, CD-ROM, ROM, RAM, flash memory, or hard disk. It may also include a series of computer-readable instructions that can be invisibly transmitted to a computer system via a modem or other interface device, through a tangible medium (including but not limited to optical or analog communication lines), or using wireless technologies (including but not limited to microwave, infrared, or other transmission technologies). This series of computer-readable instructions embodies all or part of the functions described above.

[0199] Those skilled in the art will understand that such computer-readable instructions can be written in a variety of programming languages ​​to be used with many computer architectures or operating systems. Furthermore, such instructions can be stored using any current or future memory technology (including, but not limited to, semiconductor, magnetic, or optical technologies), or transmitted using any current or future communication technology (including, but not limited to, optical, infrared, or microwave technologies). It is conceivable that such computer program products can be distributed as removable media with accompanying printed or electronic documentation (e.g., shrink-wrapping software), pre-loaded with a computer system on, for example, a system ROM or a fixed disk, or distributed via a network (e.g., the Internet or the World Wide Web) from a server or electronic bulletin board. Attached Figure Description

[0200] Embodiments of the invention will now be described by way of example only and with reference to the accompanying drawings, wherein: Figure 1 This illustrates the principle of anisotropic filtering when sampling textures; Figure 2 An example of sampling two mipmap levels for texture anisotropy is shown; Figure 3 An exemplary data processing system in which the present invention can be implemented is shown; Figure 4 A graphics processor including a texture mapper is schematically shown; Figure 5 An exemplary graphics texture mapper is illustrated in more detail; Figure 6 This is a flowchart illustrating anisotropic filtering in an embodiment of the present invention; Figure 7 This is a flowchart illustrating the determination of anisotropic filtering parameters in an embodiment of the present invention; Figure 8 The generation of texture coordinate derivatives in an embodiment of the present invention is shown; and Figure 9 and 10 The determination of the anisotropy direction in the implementation scheme is shown.

[0201] Where appropriate, similar figures are used for similar features in the accompanying figures. Detailed Implementation

[0202] Several embodiments of the present invention will now be described in the context of texture mapping in a graphics processor within a data processing system.

[0203] Figure 3 An exemplary data processing system in which the present invention and embodiments can be implemented is shown.

[0204] Figure 3 The exemplary data processing system shown includes a host processor that includes a central processing unit (CPU) 57, a graphics processing unit (GPU) 100, a video codec 51, a display controller 55, and a memory controller 58. Figure 3 As shown, these units communicate via interconnect 59 and have access to off-chip memory 20. In this system, GPU 100, video codec 51, and / or CPU 57 generate frames (images) to be displayed, and display controller 55 then provides the frames to display 54 for display.

[0205] During the use of this system, an application 60 (such as a game) executing on the host processor (CPU) 57 will, for example, need to display frames on the display 54. To do this, the application 60 will submit appropriate commands and data to the driver 61 for the graphics processor 100 executing on the CPU 57. The driver 61 will then generate appropriate commands and data to cause the graphics processor 100 to render appropriate frames for display and store those frames in appropriate frame buffers, such as in main memory 20. The display processor 55 will then read these frames into the buffer for the display, and then these frames will be read from the buffer and displayed on the display panel of the display 54.

[0206] Figure 4 An exemplary graphics processor (graphics processing unit (GPU)) 100 capable of performing texture mapping is shown. Figure 3 Used in data processing systems.

[0207] like Figure 4 As shown, GPU 100 includes data processing circuitry that implements the graphics processing pipeline. The pipeline includes, in particular, a renderer in the form of a rasterizer 102 and a programmable (fragment) shader core 104. The pipeline uses a buffer 106 (e.g., in external memory 108) to store an output array (e.g., frames or images to be displayed).

[0208] GPU 100 also includes a texture mapper 110, and memory 108 will also store, in particular, graphics textures that will be used by GPU 100 when performing texture mapping operations.

[0209] In this system, rasterizer 102 rasterizes the input primitives into individual graphic fragments for processing. To do this, rasterizer 102 rasterizes the primitives to sampled locations representing the rendered output and generates graphic fragments representing the appropriate sampled locations for rendering the primitives. Each fragment can represent a single sampled location or a set of multiple sampled locations. The fragments generated by rasterizer 102 are then forwarded to fragment shader (renderer) 104 for shading.

[0210] Fragment shader 104 executes the shader program for the fragment issued by rasterizer 102 in order to render the fragment (color the fragment). The fragment is processed using execution threads in the shader core, where these threads execute the shader program to be used to process the fragment. Threads are executed for each sampled position to be colored.

[0211] The shader program may include texturing instructions for texture mapping operations that need to be executed by the texture mapper 110.

[0212] When the fragment shader 104 encounters a texturing instruction, it sends the texturing instruction from the fragment shader 104 to the texture mapper 110, thereby requesting the texture mapper 110 to perform a texturing operation.

[0213] When requested to perform a texture mapping operation by fragment shader 104, texture mapper 110 reads a texture from memory 108 (as needed), performs the texture mapping operation, and returns the sampled (e.g., RGB color) values ​​from the texture to fragment shader 104 for use when shading the fragment and sampled location in question.

[0214] Then, the “shaded” fragment sampling positions from fragment shader 104 are stored in buffer 106 as part of the output rendering target, for example, in memory 108, for example, for subsequent post-processing or display.

[0215] Figure 5 An exemplary texture mapper (texture mapping device) 110 is shown in more detail.

[0216] like Figure 5 As shown, the texture mapper 110 includes multiple processing stages (circuits), including an input request stage (circuit) 200 that accepts input requests from the renderer (e.g., Figure 4 The fragment shader 104 in the process requests a texture mapping operation. This is followed by a coordinate calculation stage (circuit) 201, which, for example, converts any coordinates included in the texture mapping operation request into appropriate regular coordinates between 0.0 and 1.0 to be used when sampling the texture.

[0217] Then comes the Level of Detail (LOD) calculation stage (circuit) 202, which determines the level of detail of the texture to be sampled for the texture mapping operation (this LOD calculation stage selects the mipmap levels to use and how to filter among them if the texture is in mipmap form). For example, this level of detail calculation may not be necessary if the fragment shader program itself can explicitly indicate the level of detail to use or if the texture is not stored in mipmap form.

[0218] Then comes the texel selection stage (circuit) 203, which uses the coordinates determined by the coordinate calculation stage 201 to determine the actual texels (texture data elements) in the texture to be used for the texture mapping operation (and, if appropriate, the determined mipmap level in the texture).

[0219] The required texels (their data) are then retrieved via the cache lookup stage (circuit) 204.

[0220] like Figure 5 As shown, although the texture data will be stored in the memory system 108, when the texture mapper 110 needs the texture data, it will retrieve the texture data required for the textured operation from the memory 108 where the texture data is stored, and first load the texture data into the texture cache 205 of the texture mapper 110 or accessible to the texture mapper, wherein the texture mapper 110 (by the cache lookup circuit 204) reads the texture data from the texel cache 205 for use.

[0221] like Figure 5 As shown, texture mapper 110 may accordingly include a texel loader (texel loading circuitry) 206, which is operable to load texel data from a texture stored in memory 108 for storage in texel cache 205. A decompressor (decoder) stage (circuit) 207 may also be present, which can decompress (decode) the texture stored in memory system 108 in a compressed (encoded) format before storing the texel values ​​in texel cache 205.

[0222] Once the required texels (texel data values) have been retrieved from the texel cache 205, these texels are used by the texture filtering stage (circuit) 208 in the desired texture filtering operation to generate appropriate output results for the sampled texture locations (coordinates). This output result is then appropriately packaged by the output result stage (circuit) 209 and returned to the fragment shader. The texture filtering circuit 208 can, for example, use the retrieved texel values ​​to perform any desired form of filtering, such as bilinear, trilinear, anisotropic, or any other form of filtering, to generate the desired filtered sample result.

[0223] This implementation specifically relates to the case where the texture mapper 110 needs to perform anisotropic filtering to sample the texture. In this case, such as Figure 2 As shown, for a location along a defined anisotropic direction, samples can be obtained at each of the two mipmap levels (including a more detailed mipmap level and a less detailed mipmap level).

[0224] Figure 6 The operation of texture mapper 110 in this embodiment is shown.

[0225] like Figure 6 As shown, when anisotropic filtering is to be performed (step 70), the texture mapper first determines appropriate parameters for the elliptical occupancy area, which actually corresponds to the projection of the sampling points onto the surface on which the texture is applied (step 71). The manner in which this is accomplished in the embodiments of the invention will be described in more detail below.

[0226] Then, the determined elliptical area (parameter of the ellipse) is used to determine the level of detail (LOD) of the texture to be sampled, the anisotropic direction along which the texture will be sampled, and the "anisotropy," which represents the number of locations in the texture to be sampled along the anisotropic direction (step 72). Similarly, the manner in which this is accomplished in the embodiments of the invention will be described in more detail below.

[0227] Once the level of detail, anisotropy direction, and anisotropy degree of the texture to be sampled are determined, the mipmap to be sampled for that texture is selected (step 73).

[0228] The mipmap to be sampled is selected based on the level of detail of the texture to be sampled, and in terms of fractional level of detail, it will correspond to a mipmap level that is more detailed than the determined level of detail (i.e., includes a higher resolution version of the texture), and another mipmap level that includes a less detailed (lower resolution) version of the texture than the determined level of detail.

[0229] In this embodiment, although the “final” level of detail used to determine the mipmap level from which to sample may be the level of detail determined from the determined ellipse parameters, the level of detail is preferably the level of detail after any adjustments have been applied (such as rounding, biasing, clamping, etc.), and is preferably determined from the initial level of detail of the “original” level of detail, which is determined from the ellipse parameters together with any level of detail biases and / or clamping set, and any adjustments (such as rounding) to be applied (to be applied to the level of detail from the original level of detail and any level of detail biases and clamping set).

[0230] Then determine how many locations should be sampled in each mipmap (step 74).

[0231] The number of sampling locations at each mipmap level can be simply determined as (equal to) the anisotropy degree determined from the ellipse parameters, or it can be based on that determined anisotropy degree, but with some possible modifications. For example, the number of sampling locations at each mipmap level can be determined based on both the determined number of “basic” locations to be sampled (i.e., the “basic” anisotropy) determined from the ellipse parameters and the level of detail of the sampled texture.

[0232] If necessary, the same number of samples can be taken at all sampling mipmap levels along the anisotropic direction, or different numbers of samples can be taken at each mipmap level, such as taking samples at fewer locations along the anisotropic direction at less detailed mipmap levels than at more detailed mipmap levels.

[0233] Once the number of locations along the anisotropic direction for which samples should be acquired for each mipmap level has been determined, the determined number of locations are acquired in the selected mipmap (step 75).

[0234] like Figure 2 As shown, in this embodiment, the sampling locations are spaced one texel apart in the texture along the anisotropic direction (along the length of the major axis of the area occupied by the projected ellipse). In this embodiment, a single bilinear sample is acquired at each location to be sampled along the anisotropic direction. (However, if desired, multiple (e.g., bilinear) samples can be acquired for each location along the anisotropic direction (e.g., to “supersample” at each location to be sampled)).

[0235] It should be understood that, in this implementation, it can be determined that a number of non-integer locations should be sampled at one or more mipmap levels. In this case, the number of locations to be sampled can simply be rounded to the nearest integer (or the nearest largest integer, or the nearest smallest integer, as needed).

[0236] However, if the texture mapper supports obtaining fractional samples from the texture, then this operation is preferably used to obtain the desired number of samples at non-integer locations in one or more mipmap levels in question.

[0237] Once the samples in the selected mipmap level have been obtained, those samples are used (combined) to provide output sampled texture values ​​for use by the graphics processor (fragment shader) (step 76).

[0238] In this implementation, for each mipmap level independently, as described above, the samples acquired in the mipmap level are appropriately combined based on the determined sample count (number of locations to be sampled) in the mipmap level in question to provide a combined sample value for the mipmap level in question.

[0239] Therefore, for each mipmap level, a weighted average of the generated samples is calculated (based on the distance of the sample (location) along the anisotropic direction from the center of the major axis of the projected ellipse).

[0240] Then, the values ​​obtained for each mipmap level are linearly interpolated based on the fractional LOD value (i.e., the distance between the mipmap level in question and the actual level of detail of the desired sampled texture) to provide the final overall output sampled texture value.

[0241] Typically, the weighting of these samples based on their distance from the center of the projected ellipse can follow, for example, a linear function of distance from the center of the ellipse, or a more complex function (weight distribution) such as following a Gaussian function or a similar function to a Gaussian function. Similar arrangements can be used for interpolation between mipmap levels.

[0242] Of course, other arrangements are possible.

[0243] Once the output sampled texture value has been determined, the value is returned to the fragment shader for use (step 77).

[0244] As described above, this embodiment uses the estimated elliptical projection of the sampling points (pixels) to which the texture is to be applied onto the surface to which the texture is to be applied to determine, in particular, how many samples to acquire in the texture and from where these samples should be acquired.

[0245] In this implementation, the operation is based on and performed according to the techniques described in the following literature: Paul S. Heckbert, “Fundamentals of Texture Mapping and Image Warping (Mastersthesis)”, Report No. UCB / CSD 89 / 516, Computer Science Division, University of California, Berkeley, June 1989, the entire contents of which are incorporated herein by reference.

[0246] Therefore, in this embodiment, the parametric circle in a coordinate system is: p = (x, y) = (cos t, sin t) This represents a circular pixel on the "screen," where x and y represent the horizontal and vertical axes of the "screen," respectively. Then, suppose a linear transformation (matrix) M is used to transform this circle p into another coordinate system (the texture, u, v coordinate system), such that:

[0247] This linear transformation transforms the circle in the first coordinate system into an ellipse in the second coordinate system. The ellipse is centered at the origin (0,0) and passes through the points (ux, vx) and (uy, vy) (and these points correspond to the parameter value t with a 90-degree phase difference).

[0248] This means that in the first coordinate system (the screen), the point (ux, vx) can be viewed as the texture coordinates of the pixel to its right, and (uy, vy) can be viewed as the texture coordinates of the pixel below the "current" pixel on the screen (the pixel whose texture is to be sampled), assuming the "current" pixel has texture coordinates (0, 0). (In other words, (ux, vx) are the partial derivatives of the texture coordinates on the screen in the X direction, and (uy, vy) are the partial derivatives of the texture coordinates in the Y direction.)

[0249] The linear transformation matrix M is then estimated by calculating (ux, vx) = Tx - T0 (where Tx is the texture coordinate of the neighboring pixel in the increasing x direction and T0 is the texture coordinate of the current pixel) and (uy, vy) = Ty - T0.

[0250] Based on the linear transformation matrix M, the implicit elliptic coefficients A, B, C, D, E, and F can be obtained. (The implicit equation of a conic section (an ellipse is a type of conic section) is:) Ax^2 + Bxy + Cy^2 + Dx + Ey - F = 0) In this case, assuming the projected ellipse will be centered at the origin, the coefficients D and E will both be equal to zero, thus giving a regular conic section: Ax^2 + Bxy + Cy^2 = F

[0251] Q is a quadratic implicit conic section matrix, and is defined as follows:

[0252] Therefore, the coefficients of implicit elliptic functions can be determined as follows: A = vx^2 + vy^2 B = -2 (ux vx + uy vy) C = ux^2 + uy^2 F = (ux vy - uy vx)^2 Since these basis vectors of the ellipse (ux, vx) and (uy, vy) are not necessarily perpendicular to each other (and in fact, there are many different basis vectors describing the same ellipse), a set of regular basis vectors corresponding to the minor and major axes of the (projected) ellipse can be determined (and the lengths of the minor and major axes of the ellipse will be the lengths of those vectors, respectively).

[0253] By using orthogonal basis vectors to determine the new linear transformation matrix M, the basis vectors corresponding to the minor and major axes of the ellipse are obtained based on the implicit elliptic coefficients A, B, C, and F. This matrix can be written in the following form:

[0254] As mentioned above:

[0255] Therefore, in this case, Q can be obtained as follows:

[0256] Because Λ is diagonal and R is orthogonal, Λ and R are then extracted from the conic section matrix Q (which is known from the aforementioned calculations). For this purpose, the diagonal form of Q is determined:

[0257] Where A is the diagonal matrix of eigenvalues ​​of Q and the columns of S are the corresponding eigenvectors. Eigenvectors are chosen to have unit length such that R = S and Λ. -2 = A can be equal.

[0258] The eigenvalues ​​of the 2×2 symmetric matrix Q are:

[0259] This means that matrix M can be obtained as follows:

[0260] in: p = A - C q = A + C t = sgn(p) sqrt(p^2 + B^2) The matrix M is assumed to have F = 1, but as mentioned above, F is actually: F = (ux vy - uy vx)^2.

[0261] Therefore, multiplying matrix M by F yields the orthogonal basis vectors of the ellipse with the correct actual scaling: ux' = F sqrt((t + p) / (t (q + t))) vx' = F sgn(B p) sqrt((t - p) / (t (q + t))) uy' = -F sgn(B p) sqrt((t - p) / (t (q - t))) vy' = F sqrt((t + p) / (t (q - t))) This can be viewed as an orthogonalized set of derivative vectors.

[0262] From this, we can see that the length of the vector is: lx = sqrt(ux'^2 + vx'^2) = F sqrt(((t + p) / (t (q + t))) + ((t -p) / (t (q + t)))) = F sqrt(2 / (q + t)) ly = sqrt(uy'^2 + vy'^2) = F sqrt(((t - p) / (t (q - t))) + ((t +p) / (t (q - t)))) = F sqrt(2 / (q - t)) The degree of anisotropy is: aniso_degree = major_axis_radius / minor_axis_radius To determine this, we need to determine which of lx and ly is the major axis and which is the minor axis. It is known that q must be positive and t can be positive or negative. If t is positive, then ly must be the major axis and lx must be the minor axis. If t is negative, then lx must be the major axis and ly must be the minor axis. Therefore, this can be defined as: T = abs(t) = sqrt(p^2 + B^2) major_axis_radius = F sqrt(2 / (q - T)) minor_axis_radius = F sqrt(2 / (q + T)) Then the anisotropy degree can be determined as: anisotropy_degree = sqrt((q + T) / (q - T)) And the level of detail (LOD) can be determined as follows: LOD = log2(minor_axis_radius) = log2(F sqrt(2 / (q + T))) = log2(F)+ 0.5 - 0.5 log2(q + T) Now refer to Figure 7 , Figure 8 , Figure 9 and Figure 10 The method for determining the degree of anisotropy, the direction of anisotropy, and the level of detail based on the principles of the techniques described above in this embodiment is described in more detail.

[0263] Figure 7 This embodiment illustrates the process performed by texture mapper 110 to determine anisotropic filtering parameters, namely level of detail, degree of anisotropy, and anisotropic direction (essentially corresponding to the parameters related to the anisotropic filtering). Figure 6 (Steps 71 and 72 of the texturing mapper operation).

[0264] Figure 8 , Figure 9 and Figure 10 Showing more details Figure 7 Some aspects of the operation shown.

[0265] When a texturing request for an anisotropically filtered texture sample arrives at the texture mapper (step 80), Figure 7 The process begins. This basically corresponds to... Figure 6 Step 70 in the process.

[0266] Then there are a series of steps 81 to 87 to determine the elliptical area (parameters) corresponding to the projection of the sampling location onto the surface to which the texture is to be applied. These steps essentially correspond to Figure 6 Step 71 in the process.

[0267] like Figure 7 As shown, the determination of the elliptical area begins by determining the derivatives dTdx and dTdy of the texture coordinates in the X and Y directions of the screen space (in the generated render output), respectively (step 81). Derivatives are given in texel coordinate space such that these derivatives indicate the difference (and therefore can be fractional values) between the texture coordinates of the current sampling position on the screen (in the render output) and the texture coordinates of the next sampling position on the screen (in the render output) in the X and Y directions, respectively.

[0268] In this implementation, the texture coordinate derivatives in the X and Y directions in screen space (rendering target space) are determined by grouping the sampling positions into 2×2 sampling position "quadrilaterals". The X derivative is then determined as the coordinate difference between the texture coordinates of the top two positions (in the X direction) in the 2×2 quadrilateral, and the Y derivative is determined as the coordinate difference between the texture coordinates of the two left-hand positions (in the Y direction) in the 2×2 quadrilateral.

[0269] Figure 8 This is illustrated, and the X derivative 100 and Y derivative 101 for the 2x2 sampling position quadrilateral 102 are shown.

[0270] Then, the coefficients A and C for the implicit function Ax^2 + Bxy + Cy^2 = F are determined using the texture coordinate derivatives thus determined, which define the elliptical area occupied by the sampling position on the surface to which the texture is to be applied (step 82).

[0271] In this implementation scheme, the elliptic coefficients A and C are determined based on the texture coordinate derivatives as follows: A = dTdx.y^2 + dTdy.y^2 C = dTdx.x^2 + dTdy.x^2 In this embodiment, the values ​​of the elliptic coefficients A and C are restricted to be greater than a certain minimum value, and the difference between them is not greater than a certain maximum value. This helps to avoid numerical instability in particularly eccentric ellipses. This is accomplished by applying an "eccentric clamp" to the elliptic coefficients A and C (step 83) (if necessary).

[0272] In this implementation scheme, the values ​​of the ellipticity coefficients A and C are clamped as follows: Eccentric clamping for A and C: If (A < 2^-63) then A = 2^-63 If (C < 2^-63) then C = 2^-63 if (A < C ((1 / max_supported_aniso)^2)) A = C ((1 / max_supported_aniso)^2) if (C < A ((1 / max_supported_aniso)^2)) C = A ((1 / max_supported_aniso)^2) Of these "clamps", max_supported_aniso is the maximum anisotropy the hardware intends to support. A higher max_supported_aniso will result in more precise calculations being required.

[0273] Then, the elliptic coefficient B (and its square, B) are determined accordingly. 2 (Step 84). Determine the elliptic coefficient B based on the derivative of the texture coordinates as follows: B = -2 (dTdx.x dTdx.y + dTdy.x dTdy.y) Then, based on the thus determined elliptic coefficient B, determine B. 2 .

[0274] Similarly, to avoid numerical instability in eccentric elliptical shapes, appropriate "eccentric" clamping is applied to B. 2 The value is set so that the value is less than or equal to the selected maximum value (step 85).

[0275] In this implementation plan, B 2 The values ​​are as follows for clamping: Eccentric clamping for B^2 (BB): BB = B B If (BB > 4 A C (1 - (1 / max_supported_aniso))) BB = 4 A C (1 - (1 / max_supported_aniso)) Then based on A, C, and B 2 The value of (clamping if necessary) determines the final elliptic coefficient F (step 86). In an embodiment of the invention, this is accomplished as follows: F = A C - (B^2) / 4 Then the coefficients A, C, and B, which are determined in this way, can be used. 2 And F (clamping if necessary) to determine the appropriate elliptical shape parameters p, q and t as follows (step 87): p = A - C; q = A + C; t = sqrt(p p + B B); These steps thus determine the elliptical area occupied by the projection of the sampling point onto the surface to which the texture is to be applied.

[0276] Then, the anisotropy (the number of locations of the texture to be sampled) is determined using the elliptical area (the parameter of the elliptical area), the anisotropy direction (the direction along which the sample should be taken in the texture), and the level of detail of the texture to be sampled (thus determining which mipmap of the texture to sample).

[0277] Figure 7 Steps 88 to 93 illustrate how to perform this operation in this embodiment. These steps correspond to... Figure 6 Step 72 in the process.

[0278] like Figure 7 As shown, the first step is to determine the anisotropy degree and the anisotropy vector (anisotropy direction) (step 88).

[0279] An anisotropic vector is a vector that describes the direction of the major axis of an ellipse, which is the projection of the sampling point onto the surface to which the texture is to be applied.

[0280] In this implementation, the anisotropic vector (direction) is determined based on the elliptic coefficients as follows (the x and y components of the unit vector in the anisotropic direction, amin_vect.x and amin_vect.y): if (A > C) { aniso_vec.x = -B aniso_vec.y = A - C + root } else { aniso_vec.x = A - C - root aniso_vec.y = B } inv_len = 1.0 / sqrt(aniso_vec.x^2 + aniso_vec.y^2) aniso_vec.x = aniso_vec.x inv_len aniso_vec.y = aniso_vec.y inv_len in: root = sqrt((A - C)^2 + B^2) This is cheap to implement in hardware, especially considering that the final aniso_vec does not need to have very high precision.

[0281] Figure 9 and Figure 10 This demonstrates how to determine the anisotropic direction in this way in more detail.

[0282] For an ellipse of the form Ax^2 + Bxy + Cy^2 = F, if A ≤ C, then the angle theta of the major axis of the ellipse is given by the following: theta = arctan(B / (A - C)) / 2 Correspondingly, if A > C, then theta above is actually the angle of the minor axis, so this angle should be rotated by 90 degrees (pi / 2 radians) to make it the angle of the major axis: if (A > C) theta = theta + (pi / 2); The anisotropic direction is then a vector with that angle: vec2 aniso_vec; aniso_vec.x = cos(theta); aniso_vec.y = sin(theta); However, this calculation involves an arctan, a cosine, and a sinine. These are computations that are very expensive to implement in hardware.

[0283] Figure 9 This demonstrates a relatively simple way to determine the angle theta based on the elliptic coefficients A, B, and C. Vector V of 2: V = vec2 (AC, B).

[0284] However, anisotropic directions require vectors with an angle theta.

[0285] Figure 10 This demonstrates how a vector M can be generated along the major axis (theta) (and thus the correct anisotropic direction) by adding a horizontal vector H (with an angle of 0) to a vector V. This horizontal vector H has the same length as vector V (i.e., sqrt((AC)x(AC)+BxB)) and an X component with the same sign as the X component of vector V. That is, the horizontal vector: H = vec2(sqrt((A - C)). (A - C) + B B, 0).

[0286] therefore: M=V+H M is in the direction of the major axis (theta) (and thus gives the correct anisotropy direction).

[0287] Then the vector M can be normalized to a length of 1 to obtain the desired anisotropic vector (direction), i.e.: / / Determine the direction of the anisotropic vector p = A - C; t = sqrt(p p + B B); if (p >= 0) { aniso_vec.x = -B; aniso_vec.y = p + t; } else { aniso_vec.x = p - t; aniso_vec.y = B; } / / Normalize the vector length to 1.0 float length = sqrt(aniso_vec.x aniso_vec.x + aniso_vec.y aniso_vec.y); aniso_vec = aniso_vec / length; (The determination of p and t is also used to determine the degree of anisotropy, so hardware can be shared.) (As can be seen from the following, adding a vector with an angle of 0 to an angle of theta...) A vector of 2 (where both vectors have the same length) has the effect of providing a vector with an angle theta: let Let θ be a vector, which represents and The sum of.

[0288]

[0289] because and If the magnitude is the same and does not affect the angle (because the magnitude simply limits the scaling, it does not affect the shape), then if the magnitude is assumed to be 1, and the angle θ0 = 0, the vector to be added can be defined as follows:

[0290] According to the tangent half-angle formula:

[0291] It can be seen that: .)

[0293] In this implementation scheme, the anisotropy degree (aniso_degree) for determining the number of sampling locations is determined based on the elliptic coefficients A, B, and C as follows: root = sqrt((A - C)^2 + B^2) aniso_degree = sqrt((A + C + root) / (A + C - root)) It should be noted here that determining this degree of anisotropy does not require the use of the coefficient F, specifically, it does not require any scaling of the elliptic coefficient F. This simplifies the determination in hardware.

[0294] In this implementation, if the determined anisotropy degree is not a number (non-numerical), it is set to 1, thereby effectively disabling anisotropy filtering, i.e.: if (isnan(aniso_degree)) aniso_degree = 1 Once the anisotropy degree has been determined, then, if necessary, clamp the determined anisotropy degree with respect to the maximum permissible anisotropy degree (step 89). That is: if (aniso_degree > max_aniso) aniso_degree = max_aniso Using the maximum permissible anisotropy in this way caps the computational cost of anisotropic filtering. The maximum permissible anisotropy can be set, for example, by an application requiring graphics processing.

[0295] Then, the final stage of the process is used to determine the level of detail of the texture to be sampled.

[0296] like Figure 7 As shown, the method of determining the level of detail depends on whether the anisotropy is clamped to the maximum permissible anisotropy or not clamped at step 89 (step 90).

[0297] Specifically, when the anisotropy is not clamped, the level of detail is determined in one way (step 91), and when the anisotropy is clamped, the level of detail is determined in a different way (step 92).

[0298] In this implementation scheme, the level of detail is determined based on whether the anisotropy is clamped, as follows: if (aniso_degree_was_clamped) lod = 0.5 (log2(2F) - log2(A + C -root)) - log2(max_aniso) else lod = 0.5 (log2(2F) - log2(A + C + root)) This method for determining the level of detail is inexpensive in hardware because the level of detail values ​​are not very precise, and the base-2 logarithm can be calculated cheaply.

[0299] Once already Figure 7 Having determined the level of detail, anisotropy degree, and anisotropic direction (step 93), textures can be sampled accordingly based on those samples (as described above). Figure 6 (Step 73 in the preceding steps).

[0300] The following is used for execution Figure 7 The following is an example pseudocode of the process shown.

[0301] / Anisotropy degree, vector, and LOD calculation.

[0302] @param input dTdx X-axis texel coordinate derivative.

[0303] @param input dTdy Y-axis texel coordinate derivative.

[0304] @param input max_aniso (maximum anisotropy).

[0305] @param output lod will receive the calculated LOD @param output aniso_degree will receive the calculated maximum anisotropy degree. @param output aniso_vec will receive the computed anisotropy vector. / void aniso_lod_calculations(in vec2 dTdx, in vec2 dTdy, in int max_aniso, out float lod, out float aniso_degree, out vec2 aniso_vec) { const float max_supported_aniso = 16.0; const float eccentricity_clamp = 1.0 / (max_supported_aniso max_supported_aniso); / / Elliptic Transformation Unless otherwise specified, all calculations are performed using 16-bit mantissa precision. / / Calculate horizontal and vertical coefficients float A = dTdx.y dTdx.y + dTdy.y dTdy.y; float C = dTdx.x dTdx.x + dTdy.x dTdy.x; / / Ensure that A and C are at least 2^-63 for numerical stability in subsequent calculations. A = max(A, pow(2.0, -63)); C = max(C, pow(2.0, -63)); / / Eccentric clamping (necessary for numerical stability calculations in subsequent operations) A = max(A, C eccentricity_clamp); / / Propagate non-numerical values C = max(C, A eccentricity_clamp); / / Propagate non-numerical values / / Calculate the rotation coefficient float B = -2.0 (dTdx.x dTdx.y + dTdy.x dTdy.y); float BB = B B; / / Eccentric clamping (limiting anisotropy in diagonal cases) BB = min(BB, 4.0 A C (1.0 - eccentricity_clamp)); / / Calculate scaling factor float F = A C - BB 0.25; / / We now have the formula A x x + B x y + C y The ellipse described by y = F / / Calculate some parameters describing the shape of the ellipse float p = A - C; float q = A + C; float t = sqrt(p p + B B); / / Calculate anisotropy float dividend = q + t; float divisor = q - t; float aniso_degree = sqrt(dividend / divisor); / / If aniso_degree is not a number, replace it with 1 to disable anisotropic filtering.

[0306] if (isnan(aniso_degree)) aniso_degree = 1;

[0307] / / Clamping anisotropy

[0308] bool num_samples_clamped = false;

[0309] if (aniso_degree > float(max_aniso))

[0310] {

[0311] num_samples_clamped = true;

[0312] aniso_degree = float(max_aniso);

[0313] }

[0314] / / Get at least one sample

[0315] if (aniso_degree < 1.0) aniso_degree = 1.0;

[0316] / / Calculate LOD

[0317] float lod = 0.0;

[0318] if (num_samples_clamped)

[0319] {

[0320] lod = 0.5 (log2(2.0 F) - log2(divisor)) - log2(max_aniso);

[0321] }

[0322] else

[0323] {

[0324] lod = 0.5 (log2(2.0 F) - log2(dividend));

[0325] }

[0326] / / If the LOD ends in a non-numerical value, then set the LOD to infinity.

[0327] / / Because the infinite derivative will cause LOD to be non-numerical.

[0328] lod = isnan(lod) ? inf : lod;

[0329] / / Calculate the direction of the anisotropic vector

[0330] if (p >= 0)

[0331] {

[0332] aniso_vec.x = -B;

[0333] aniso_vec.y = p + t;

[0334] }

[0335] else

[0336] {

[0337] aniso_vec.x = p - t;

[0338] aniso_vec.y = B;

[0339] }

[0340] / / Length of the normalized anisotropy vector

[0341] / / invsqrt(x) = 1.0 / sqrt(x)

[0342] float inv_aniso_vec_len = invsqrt(aniso_vec.x aniso_vec.x + aniso_vec.y aniso_vec.y);

[0343] aniso_vec = inv_aniso_vec_len;

[0344] }

[0345] Of course, other arrangements are possible.

[0346] As will be understood from the foregoing, the present invention, at least in its preferred embodiments, can provide an improved technique for anisotropic filtering, which can, for example, reduce the processing burden when performing anisotropic filtering.

Claims

1. A method for performing anisotropic filtering while sampling a texture to provide output sampled texture values ​​used when rendering output in a graphics processing system, the method comprising: When using anisotropic filtering to sample textures to provide output sampled texture values ​​for positions x and y in the texture: The anisotropic direction to be along in the texture to obtain the sample is determined by the following method: Determine the X and Y components of an arbitrary length vector, the arbitrary length vector corresponding to the direction of the major axis of the assumed elliptical projection of the texture from the sampling points of the texture being sampled onto the surface to which the texture is applied; The determined X vector components and the determined Y vector components are normalized to provide the X and Y components of a unit vector, which corresponds to the direction of the major axis of the elliptical area occupied by the sampling point projected onto the surface on which the texture is applied. as well as The X and Y components of the unit vector are used as the anisotropic direction to be followed in the texture to obtain samples, the unit vector corresponding to the direction of the major axis of the elliptical projection of the sampling point onto the surface on which the texture is applied; The method further includes: One or more samples are obtained in the texture along the determined anisotropic direction; as well as The one or more samples acquired along the anisotropic direction in the texture are used to provide an output sampled texture value for the sampled location in the texture, for use.

2. The method according to claim 1, comprising: Determine if it has the form Ax 2 +Bxy+Cy 2 =F, the coefficients A, B, and C of the ellipse, the ellipse corresponding to the projection of the sampled points of the texture onto the surface to which the texture is to be applied, where x and y are the coordinates of the position in the texture, and the output sampled texture value for the position will be provided; as well as The X and Y components of the arbitrary length vector are determined using only the determined coefficients A, B, and C from the elliptic coefficients A, B, C, and F, the arbitrary length vector corresponding to the direction of the major axis of the elliptical projection from the sampling point to the surface on which the texture is applied.

3. The method of claim 2, wherein only the elliptic coefficient B is used to determine one of the X component and the Y component, and all of the coefficients A, B and C are used to determine the other of the X component and the Y component.

4. The method of claim 3, wherein determining which of the X components and the Y components is based on whether the elliptic coefficient A is greater than the elliptic coefficient C: using only the elliptic coefficient B to determine which of the X components and the Y components is used, and using all of the coefficients A, B, and C to determine which of the X components and the Y components is used.

5. The method of claim 2, wherein the X component and the Y component of the arbitrary length vector are determined according to the elliptic coefficients A, B, and C as follows, the arbitrary length vector corresponding to the direction from the sampling point where the texture is sampled to the major axis of the assumed elliptical projection onto the surface on which the texture is applied: if (A > C) { aniso_vec.x = -B aniso_vec.y = A - C + root } if (A < C) { aniso_vec.x = A - C - root aniso_vec.y = B } in: aniso_vec.x and aniso_vec.y are the X and Y components of the arbitrary length vector, respectively, the arbitrary length vector corresponding to the direction of the major axis of the elliptical projection from the sampling point to the surface on which the texture is applied; A, B, and C are the elliptic coefficients; and root = sqrt ((A - C)^2 + B^2).

6. The method according to claim 1, comprising: The determined X-vector components and Y-vector components are normalized to provide the X and Y components of a unit vector corresponding to the direction of the major axis of the area occupied by the ellipse on the surface to which the sampling point is projected. The length of the arbitrary length vector is determined based on the determined X component and the determined Y component of the arbitrary length vector. as well as Then the determined X component and the determined Y component of the arbitrary length vector are divided by the determined length of the vector to provide the X component and the Y component of the unit vector in the direction of the major axis of the ellipse, the ellipse being the projection of the sampling point onto the surface on which the texture is applied.

7. The method according to claim 1, comprising: The X and Y components of the unit vector are determined based on the determined X and Y components of the arbitrary length vector corresponding to the major axis of the ellipse, wherein the unit vector corresponds to the direction of the major axis of the assumed elliptical projection of the texture from the sampling point where the texture is sampled to the surface on which the texture is applied: inv_len = 1.0 / sqrt(aniso_vec.x^2 + aniso_vec.y^2) aniso_vec.X = aniso_vec.x inv_len aniso_vec.Y = aniso_vec.y inv_len in: aniso_vec.x and aniso_vec.y are the X and Y components of the arbitrary length vector, respectively, the arbitrary length vector corresponding to the direction of the major axis of the elliptical projection from the sampling point to the surface on which the texture is applied; inv_len is the reciprocal of the length of the vector; and aniso_vec.X and aniso_vec.Y are the X and Y components of the unit vector, respectively, the unit vector corresponding to the direction of the major axis of the elliptical projection from the sampling point to the surface on which the texture is applied.

8. The method according to claim 1, comprising: When anisotropic filtering is used to sample textures as two or more mipmaps to provide output sampled texture values ​​for positions x, y in the texture: The level of detail to be sampled for the texture is determined using the following method: Determine if it has the form Ax 2 +Bxy+Cy 2 =F, the coefficients A, B, C, and F of the ellipse, the ellipse corresponding to the projection of the sampled points of the texture onto the surface to which the texture is to be applied, where x and y are the coordinates of the position in the texture, and the output sampled texture value for that position will be provided; and Use one or more of the determined elliptic coefficients A, B, C, and F to determine the level of detail of the texture to be sampled; The method further includes: The determined level of detail is used to select one or more mipmap levels from the mipmap levels of the texture from which samples are obtained, in order to provide the output sampled texture values.

9. A method for performing anisotropic filtering while sampling a texture to provide output sampled texture values ​​used when rendering output in a graphics processing system, the method comprising: When anisotropic filtering is used to sample textures as two or more mipmaps to provide output sampled texture values ​​for positions x, y in the texture: The level of detail to be sampled for the texture is determined using the following method: Determine if it has the form Ax 2 +Bxy+Cy 2 =F, the coefficients A, B, C, and F of the ellipse, the ellipse corresponding to the projection of the sampled points of the texture onto the surface to which the texture is to be applied, where x and y are the coordinates of the position in the texture, and the output sampled texture value for that position will be provided; and Use one or more of the determined elliptic coefficients A, B, C, and F to determine the level of detail of the texture to be sampled; The method further includes: The determined level of detail is used to select one or more mipmap levels from the mipmap levels of the texture from which samples are obtained, in order to provide the output sampled texture values; In the texture, one or more samples are acquired along anisotropic directions at one or more locations within one or more selected mipmap levels; and The one or more samples acquired along the anisotropic direction at the one or more mipmap levels are used to provide output sampled texture values ​​for the sampled location in the texture for use.

10. The method of claim 9, further comprising determining the level of detail (LOD) of the texture to be sampled as follows: lod = 0.5 (log2(2F) - log2(A + C + root)) in: lod is the level of detail that is determined; root = sqrt((A - C)^2 + B^2); and A, B, C, and F are the elliptic coefficients.

11. An apparatus for performing anisotropic filtering while sampling a texture to provide output sampled texture values ​​used when rendering output in a graphics processing system, the apparatus comprising: An anisotropic direction determination circuit is configured to determine the anisotropic direction along which samples are acquired in the texture when anisotropically filtered sampling texture is used to provide output sampled texture values ​​for positions x and y in the texture, by: Determine the X and Y components of an arbitrary length vector, the arbitrary length vector corresponding to the direction of the major axis of the assumed elliptical projection of the texture from the sampling points of the texture being sampled onto the surface to which the texture is applied; as well as The determined X vector components and the determined Y vector components are normalized to provide the X and Y components of a unit vector, which are used as the anisotropic direction, the unit vector corresponding to the direction of the major axis of the elliptical area occupied by the sampling point projected onto the surface on which the texture is applied. The device also includes: A texture sampling circuit configured to acquire one or more samples in a texture along a defined anisotropic direction; and A sample combination circuit is configured to use one or more samples acquired along an anisotropic direction in the texture to provide an output sampled texture value for a sampled location in the texture, for use.

12. The device according to claim 11, further comprising: An ellipticity coefficient determination circuit is configured to determine ellipticity coefficients having the form Ax 2 +Bxy+Cy 2 =F, the coefficients A, B, and C of the ellipse, the ellipse corresponding to the projection of the sampled points of the texture onto the surface to which the texture is to be applied, where x and y are the coordinates of the position in the texture, for which the output sampled texture value will be provided; and The anisotropic direction determination circuit is configured to determine the X and Y components of the arbitrary length vector using only the determined coefficients A, B, and C of the elliptic coefficients A, B, C, and F, the arbitrary length vector corresponding to the direction of the major axis of the elliptical projection from the sampling point to the surface on which the texture is applied.

13. The device of claim 12, wherein only the elliptic coefficient B is used to determine one of the X component and the Y component, and all of the coefficients A, B and C are used to determine the other of the X component and the Y component.

14. The device of claim 13, wherein determining which of the X components and the Y components is based on whether the elliptic coefficient A is greater than the elliptic coefficient C: using only the elliptic coefficient B to determine which of the X components and the Y components is used, and using all of the coefficients A, B and C to determine which of the X components and the Y components is used.

15. The device of claim 12, wherein the anisotropic direction determination circuit is configured to determine the X component and the Y component of the arbitrary length vector according to the ellipticity coefficients A, B, and C as follows, the arbitrary length vector corresponding to the direction from the sampling point where the texture is sampled to the major axis of the assumed elliptical projection onto the surface on which the texture is applied: if (A > C) { aniso_vec.x = -B aniso_vec.y = A - C + root } if (A < C) { aniso_vec.x = A - C - root aniso_vec.y = B } in: aniso_vec.x and aniso_vec.y are the X and Y components of the arbitrary length vector, respectively, the arbitrary length vector corresponding to the direction of the major axis of the elliptical projection from the sampling point to the surface on which the texture is applied; A, B, and C are the elliptic coefficients; and root = sqrt ((A - C)^2 + B^2).

16. The device of claim 11, wherein the anisotropic direction determination circuit is configured to: The determined X-vector components and Y-vector components are normalized to provide the X and Y components of a unit vector corresponding to the direction of the major axis of the area occupied by the ellipse on the surface to which the sampling point is projected. The length of the arbitrary length vector is determined based on the determined X component and the determined Y component; and Then the determined X component and the determined Y component of the arbitrary length vector are divided by the determined length of the vector to provide the X component and the Y component of the unit vector in the direction of the major axis of the ellipse, the ellipse being the projection of the sampling point onto the surface on which the texture is applied.

17. The device of claim 11, wherein the anisotropic direction determining circuit is configured to: The X and Y components of the unit vector are determined based on the determined X and Y components of the arbitrary length vector corresponding to the major axis of the ellipse, wherein the unit vector corresponds to the direction of the major axis of the assumed elliptical projection of the texture from the sampling point where the texture is sampled to the surface on which the texture is applied: inv_len = 1.0 / sqrt(aniso_vec.x^2 + aniso_vec.y^2) aniso_vec.X = aniso_vec.x inv_len aniso_vec.Y = aniso_vec.y inv_len in: aniso_vec.x and aniso_vec.y are the X and Y components of the arbitrary length vector, respectively, the arbitrary length vector corresponding to the direction of the major axis of the elliptical projection from the sampling point to the surface on which the texture is applied; inv_len is the reciprocal of the length of the vector; and aniso_vec.X and aniso_vec.Y are the X and Y components of the unit vector, respectively, the unit vector corresponding to the direction of the major axis of the elliptical projection from the sampling point to the surface on which the texture is applied.

18. The apparatus of claim 11, further comprising: A detail level determination circuit is configured to: when anisotropically filtered samples are provided as two or more mipmaps to provide output sampled texture values ​​for positions x, y in the texture: The level of detail to be sampled for the texture is determined using the following method: Determine if it has the form Ax 2 +Bxy+Cy 2 =F, the coefficients A, B, C, and F of the ellipse, the ellipse corresponding to the projection of the sampled points of the texture onto the surface to which the texture is to be applied, where x and y are the coordinates of the position in the texture, and the output sampled texture value for that position will be provided; and Use one or more of the determined elliptic coefficients A, B, C, and F to determine the level of detail of the texture to be sampled; The device also includes: The mipmap selection circuit is configured to select one or more mipmap levels from which samples of a texture are obtained using a determined level of detail, in order to provide output sampled texture values.

19. An apparatus for performing anisotropic filtering while sampling a texture to provide output sampled texture values ​​used when rendering output in a graphics processing system, the apparatus comprising: A detail level determination circuit is configured to: when anisotropically filtered samples are provided as two or more mipmaps to provide output sampled texture values ​​for positions x, y in the texture: The level of detail to be sampled for the texture is determined using the following method: Determine if it has the form Ax 2 +Bxy+Cy 2 =F, the coefficients A, B, C, and F of the ellipse, the ellipse corresponding to the projection of the sampled points of the texture onto the surface to which the texture is to be applied, where x and y are the coordinates of the position in the texture, and the output sampled texture value for that position will be provided; and Use one or more of the determined elliptic coefficients A, B, C, and F to determine the level of detail of the texture to be sampled; The device also includes: The mipmap selection circuit is configured to select one or more mipmap levels from which samples of a texture are obtained using a determined level of detail to provide output sampled texture values. A texture sampling circuit, configured to acquire one or more samples in the texture at one or more locations along anisotropic directions at one or more selected mipmap levels; and A sample combination circuit is configured to use one or more samples acquired along the anisotropic direction at one or more mipmap levels to provide output sampled texture values ​​for a sampled location in the texture for use.

20. The device of claim 19, wherein the level of detail (LOD) determination circuit is configured to determine the LOD of the texture to be sampled as follows: lod = 0.5 (log2(2F) - log2(A + C + root)) in: lod is the level of detail that is determined; root = sqrt((A - C)^2 + B^2); and A, B, C, and F are the elliptic coefficients.

21. A computer program product comprising computer software code, which, when run on one or more data processors, performs the method according to claim 1 or claim 9.

Citation Information

Patent Citations

  • Image plotting method and image plotting equipment using omnidirectional different pattern mapping

    CN1845178A

  • Image rendering method and image rendering apparatus using anisotropic texture mapping

    US20060250409A1