Graphical texture mapping
Patent Information
- Application Number
- CN202210007705.0
- 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-25
- Estimated Expiration
- 2042-01-05
AI Technical Summary
[0008]在这种情况下,简单地从要施加到表面的纹理中采取“圆形”双线性样本将导致误差,例如,就表面上的再现纹理而言,可能会使表面模糊和/或存在有利
Smart Images

Figure CN114782598B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to methods and apparatus for performing texture mapping in a graphics processing system. Background Technology
[0002] In a graphics processing system, so-called textures or texture data are applied to the surface to be drawn to generate colors (and other data) for sampling locations in the rendered output (such as an image to be displayed).
[0003] Computer graphics textures are typically configured as arrays of texture data elements (text), each with a corresponding texture dataset (such as color, brightness, and / or light / shadow). The sampling locations in the rendered output where the texture is applied are then mapped to 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 is that the surface to which the texture is applied is at an oblique angle relative to the viewpoint (camera). In such cases, the “projection” (and therefore the sampled texture) of the sampling position seen from the viewpoint onto the surface (assuming that the sampled point is projected as a circle) will not be circular (if the surface is perpendicular to the view direction), but will be 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 the plane of the screen where the image will be displayed, and includes multiple sampling locations (pixels) 2 (assumed to be circular), and, for example, will need to take corresponding texture samples to render the pixels properly. Figure 1 This is a simplified illustration 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 It also shows a "camera" 3 corresponding to the viewpoint of the rendered output.
[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 view “cone” 6 of the view “cone” 6 projected from camera position 3 through the (circular) pixel 4 in the rendering output (screen) 1 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 the surface and / or creating an advantage in terms of the reproduced texture on the surface.
[0009] To address this issue, a texture sampling technique known as "anisotropic filtering" is used, in which multiple (e.g., bilinear) samples are taken along lines in the texture (often referred to as anisotropic directions) that are designed to correspond to the major axis of an "ellipse" (an elliptical area) that corresponds to the projection of the sampling point onto the surface to be applied.
[0010] Then, for example, complex numbers, such as bilinear samples, taken along the anisotropic direction are appropriately combined based on their distance from the center of the projected "ellipse" along the anisotropic direction to provide a total 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 "mipfilms," which are sequences (chains) of progressively lower resolution (less detailed) versions of textures, where each mipmap level is, for example, half the resolution (as in a detailed description).
[0012] Mipfilm is designed to increase rendering speed and reduce synchronization artifacts. Higher resolution mipmaps will be used for high-density samples, such as objects close to the viewpoint (camera), while lower resolution mipfilms will be used for objects further away.
[0013] When using mipfilms (typically the desired level of detail (LOD)), they will be defined (e.g., based on the distance (camera) from the surface from which the texture is applied from the viewpoint), and the texture sampling operation will then sample the nearest mipmap to the level of detail, or sample both mipmap levels that fall on either side of the desired level of detail, and then appropriately combine the samples from the two mipmap levels (e.g., based on their relative "distance"). The latter can be accomplished using a trilinear sampling process, where bilinear filtering is used from each mipmap level, and then the two samples, one from each mipmap level, are appropriately combined (e.g., using a weighted average based on the difference between the mipmap's level of detail and the actual level of detail to be sampled) to provide the sampled texture values for the output.
[0014] For example, when using the texture of an image with a resolution of 40 × 40 sampling locations, interpolation can be used, for example, mipmaps of 128 × 128, 64 × 64, and 32 × 32 text, and 64 × 64 and 32 × 32 mipmaps (with trilinear interpolation).
[0015] When performing anisotropic filtering using mipmaps, an appropriate number of bilinear samples are taken along the anisotropic direction in each mipmap to be sampled, and then appropriately combined to provide the output sampled texture values to be used. For example, a corresponding number of bilinear samples can be taken at each mipmap level along the anisotropic direction, and then corresponding trilinear sample values are provided from the corresponding bilinear sample pairs combined at each mipmap level, and these trilinear sample values are then appropriately combined to provide the texture values of the overall output sample.
[0016] Figure 2 This is illustrated, and a complex number (in this case, six) of texture samples 20 are shown along the anisotropic direction 21 corresponding to the major axis of the “ellipse” 22, corresponding to the projection of the sampling positions in a suitable pair of mipmap levels onto the surface (as discussed above), including a more detailed mipmap level 23 and a less detailed mipmap level 24. Samples from each mipmap level can then be appropriately combined in pairs to provide a set of multiple trilinear samples along the anisotropic direction, and these trilinear samples are then appropriately merged accordingly to obtain the texture values of the final output samples.
[0017] While anisotropic filtering provides an improvement over “basic” bilinear or trilinear filtering when sampling textures of surfaces viewed at an angle relative to the view direction, the applicant believes that there is still a range of improved techniques for anisotropic filtering when performing graphics texture mapping. Summary of the Invention
[0018] According to a first aspect of the invention, a method is provided for performing anisotropic filtering while sampling a texture to provide output sampled texture values for rendering output in a graphics processing system, the method comprising: When using anisotropic filtering to sample textures, output sample texture values are provided for locations 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: The cardinality for sampling the texture along the anisotropic direction is determined based on an estimate of the ellipse corresponding to the projection of the sampling point, and the texture is sampled onto the surface of the texture corresponding to the projection of the sampling point; and A step factor is applied to the determined base number of locations for sampling the texture along the anisotropic direction to provide a number of step-adjusted locations for sampling the texture along the anisotropic direction, the step factor representing the interval between adjacent sampling locations along the anisotropic direction used when sampling the texture. The method further includes: Based on the number of positions adjusted by the step size, samples are sampled or sampled along the anisotropic direction in the texture, where each position of the sample is taken is spaced out from any adjacent position of the sample along the anisotropic direction in the texture, based on the step size factor applied to the determined positions of the sampling along the anisotropic direction of the texture. 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.
[0019] According to a second 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 sample determination circuit is configured to sample the texture using anisotropic filtering to provide output sampled texture values for locations within the text. Determine the number of locations for sampling the texture along the anisotropic direction, and sample the texture along the anisotropic direction: The cardinality for sampling the texture along the anisotropic direction is determined based on an estimate of the ellipse corresponding to the projection of the sampling point, and the texture is sampled onto the surface of the texture corresponding to the projection of the sampling point; and A step factor is applied to the determined base number of locations for sampling the texture along the anisotropic direction to provide a number of step-adjusted locations for sampling the texture along the anisotropic direction, the step factor representing the interval between adjacent sampling locations along the anisotropic direction used when sampling the texture. The device further includes: A texture sampling circuit is configured to capture samples or samples along an anisotropic direction in the texture based on a number of positions adjusted by a step size. Each position where a sample is acquired is spaced apart from any adjacent position of the sample along the anisotropic direction in the texture. The step size factor is applied to the determined number of positions for sampling the texture along the anisotropic direction. 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.
[0020] 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.
[0021] In these aspects of the invention, the location of a base number of samples in the texture is determined based on an assumed ellipse, which is a projection of the texture values to be used onto the sampling locations on the surface where the texture is being applied. However, a “step” factor, representing the interval between sampling locations used when sampling the texture, is then applied to the base number of sample locations to determine the number of “step-adjusted” locations of samples in the texture (where the number of samples sampled along the anisotropy in the texture is then based on the step size of the sample locations).
[0022] As will be discussed further below, the applicant has recognized that while for the highest quality sampling when performing anisotropic filtering, it is desirable to sample the texture along the anisotropic direction at intervals corresponding to the text intervals, it may be necessary to sample along the anisotropic direction at, for example, larger intervals, while still achieving a suitable and acceptable (output) image quality (at least in some cases), and furthermore, doing so would reduce the number of samples taken (and thus reduce the processing cost of anisotropic filtering).
[0023] The present invention in these aspects contributes to this, rather than simply using multiple locations for which samples should be acquired in the texture along anisotropic directions, the locations being determined based on elliptical projections of the sampling locations, where texture values will be applied to the surface on which the texture is being applied, instead applying a step factor to the determined number of locations to apply (potential) modification to the samples.
[0024] Specifically, and as will be discussed further below, a step size factor is used to adjust the number of locations to be sampled along the anisotropic direction, thereby controlling the anisotropic filtering process and, for example, reducing the selective setting and use of the number of locations to be sampled along the anisotropic direction, where possible or desired, can be selectively performed by choosing and setting the step size factor accordingly (thus allowing selective anisotropic filtering to be performed).
[0025] In this invention, the sampled texture can be any suitable and desired texture that can be used 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. Therefore, the 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 the 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.
[0026] Correspondingly, the texture being sampled should and preferably includes 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.
[0027] The texture being sampled should be, and preferably is, provided as multiple mipmaps (mipmap levels), where each mipmap level gradually decreases from the previous level. The set of mipmaps for the texture may include only two mipmap levels, but preferably includes more than two, for example, extending from the most detailed mipmap level through gradually decreasing mipmap levels to at least a detailed mipmap level, such as including a single text. 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 for the graphics processor and graphics processing system's mipmap levels and / or the application requiring graphics processing.
[0028] This invention relates to the case of anisotropically sampled textures. In this case, as described above, one or more, and typically multiple, samples are taken along the anisotropic directions in the texture and are appropriately used (combined) to provide the sampled texture values for output.
[0029] In these aspects of the invention, the number of positions ("bases" or "anisotropy") for sampling along the anisotropic direction is determined by applying a step factor to the position of the determined initial number of "bases" to be sampled.
[0030] The initial, base "anisotropy" is determined by assuming that the sampling locations (points) of the texture values will be projected as ellipses onto the surface on which the texture is being applied (the number of "base" positions initially determined from the texture samples is used for the anisotropic filtering process).
[0031] In a preferred embodiment, the basal anisotropy (number of locations) applied by the step size factor is based at least in part on a determined length of the minor axis of the estimated elliptical footprint of the sample point to the minor axis on the surface to which the texture is applied. In a preferred embodiment, this is based on the basal anisotropy, and preferably determined as the ratio of the length of the major axis of the estimated projected ellipse of the sample point to the length of the minor axis of the projected ellipse of the sample point. This can be done in any suitable and desirable manner.
[0032] The lengths of the major and minor axes of the projected ellipse for the sampling point in question can be determined in any suitable and desirable manner. In a particularly preferred embodiment, the determined lengths of the major and minor axes of the projected ellipse for the sampling point indicate the radii of the major and minor axes of the projected ellipse for the sampling point, respectively, and most preferably, the radius of the major axis and the radius of the minor axis of the projected ellipse for the sampling point. Therefore, in a preferred embodiment, the underlying anisotropy (number of positions) to which the step size factor is applied is determined at least in part based on the determined radius of the major axis and the determined radius of the minor axis of the projected ellipse for the sampling point in question.
[0033] As described above, the basic anisotropy (number of locations to be sampled) is determined based on the parameters of the estimated (and assumed) elliptical projection of the sampling location, which will be used for the texture value applied to the surface on which the texture is applied (i.e., based on the estimated elliptical coverage area within the texture, which is intended to correspond to the projection on the surface of the applied texture).
[0034] To facilitate this, the method of the present invention preferably 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 the 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.
[0035] 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 "sampled" location in the texture.
[0036] The present invention preferably determines, in particular, elliptic coefficients A, B, and C, and uses those coefficients to determine the cardinality of the locations to be sampled in the texture when performing anisotropic filtering.
[0037] 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.
[0038] 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).
[0039] 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.
[0040] 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.
[0041] In a preferred embodiment, if, for any reason, the determined basic anisotropy (where the step factor is applied) is not a significant number, the basic anisotropy is preferably set (clamped) to "1". Therefore, in a preferred embodiment: if (isnan(aniso_degree)) aniso_degree = 1 Where aniso_degree is the “basic” anisotropy degree (the number of locations to be sampled) determined as described above.
[0042] Furthermore, in a particularly preferred embodiment, a specific, preferably selected, preferably predetermined maximum allowable value (with a step size factor applied) is set for the base anisotropy (number of samples), and the basic anisotropy determined according to the ellipse 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.
[0043] The determined basic anisotropy is limited to no greater than the set maximum anisotropy setting. 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.
[0044] 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.
[0045] For example, there may be a maximum (supported) anisotropy degree of the graphics processor texture mapping circuitry (hardware) (which is allowed to sample) discussed in this paper (i.e., the maximum number of locations that can be sampled along the anisotropic direction when performing anisotropic filtering).
[0046] 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.
[0047] In this case, the maximum allowed number of bases for the locations that can be sampled when performing anisotropic filtering can, for example, 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 bases that can be sampled in the absence of any locations with a smaller maximum allowed number of bases, which may be the absence of locations that can be sampled when performing anisotropic filtering).
[0048] In a particularly preferred embodiment, or alternatively, it may also be possible to specify the location of the maximum permissible number of reference samples that can be sampled when performing anisotropic filtering, which is different from the maximum anisotropy set (intended to be set).
[0049] In a preferred embodiment of this type, applications requiring graphics processing (and therefore, in particular, texture mapping) are able to set the maximum permissible base anisotropy to be used (for this purpose). Alternatively, a maximum base anisotropy setting may 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 base anisotropy during use (but not above the maximum supported anisotropy) if needed.
[0050] In a particularly preferred embodiment, the determination of the cardinality (basic anisotropy) of the sample locations is further configured to ensure that at least one location is sampled; that is, if the number of determined basic locations is less than 1 compared to the number of samples (determined basic anisotropy), then the determined basic anisotropy is set to 1. if (aniso_degree is <1.0) aniso_degree = 1.0.
[0051] In a preferred embodiment, the aforementioned adjustment (e.g., any clamping to the maximum permissible value) of the number of locations to be sampled (to anisotropy) is performed on a basic anisotropy (number of locations), which is determined based on an assumed elliptical projection of the sampling points, and the texture is sampled onto the surface to which the texture is to be applied (i.e., when a step factor is applied to the determined basic number of locations for sampling). However, or alternatively, if desired, some or all of these anisotropies (to the number of locations sampled) may also be adjusted (e.g., clamping) after the determined basic number of locations has been sampled, with the step factor applied to the determined basic number of locations.
[0052] Once the basic number of locations for sampling the texture along the anisotropic direction has been determined, a step factor is applied to the determined basic number of locations to provide a step-adjusted number of locations for sampling the texture along the anisotropic direction. The number of locations (position count) from the texture is then set based on the basic anisotropy of the step-adjusted location.
[0053] In this regard, the number of sample positions to which the step size is adjusted can be greater than, less than, or equal to the base position. In a preferred embodiment, the number of sample positions to which the step size is adjusted is equal to or less than the determined number of base positions.
[0054] The step factor applied to a given base number of locations for sampling the texture along the anisotropic direction represents the interval between adjacent sampling locations along the anisotropic direction used when sampling the texture.
[0055] In a particularly preferred embodiment, it represents and indicates the interval between adjacent sampling locations along the anisotropic direction, based on the interval between textures (text-to-text distance) in the sampled texture (mipmap level).
[0056] The step size factor is preferably expressed as a multiple of the texel interval in the texture (mipmap) under discussion, that is, a length factor of step size 1 will correspond to the interval of a texture between the sampling positions along the anisotropic direction, and a step size factor greater than 1 will correspond to the interval of the texel interval (texel-to-texel distance) between the sampling positions along the anisotropic direction.
[0057] In other words, in the preferred embodiment, a step size of 1 will affect the interval between positions along the anisotropic direction to be (substantially) equal to the interval between textures in the texture under discussion (at the mipmap level) (i.e., such that there is an interval of one text at each position), and a step size factor greater than 1 will correspondingly be greater than the interval between textures in the texture under discussion (i.e., such that there will be an interval of more than one text at each position) between positions.
[0058] Therefore, this would mean that when the step length factor is greater than 1, the positions will be further spaced out, and thus, in this case, the positions at which samples are taken at a given distance along the anisotropic direction.
[0059] Therefore, in a preferred embodiment, the first-order length factor corresponds to sampling the texture at a position separated by one character (and in a preferred embodiment, the base quantity of the position determined based on the elliptical projection of the sampling position is left on the texture, and the texture value will be used on the surface applied to the position for the sampling position, and the texture value remains unchanged when the base quantity is applied).
[0060] Accordingly, a step size factor greater than 1 would correspond to sampling the texture at positions with an interval of more than one text (and in a preferred embodiment, the number of positions for step size adjustment is generated for sampling the texture along an anisotropic direction, which is less than the basic number of positions in the texture determined based on the elliptical projection of the sampling positions used on the texture).
[0061] The step size factor can be applied to a defined number of locations for sampling the texture along the anisotropic direction to provide a number of positions for step size adjustment for sampling the texture along the anisotropic direction in any suitable and desired manner.
[0062] In a preferred embodiment, the step factor is applied as a divisor to a determined base number of locations for sampling the texture along the anisotropic direction, which means that applying the step factor to the determined base number of locations for sampling the texture along the anisotropic direction includes dividing the determined number of locations by the determined base number of locations for sampling the texture along the anisotropic direction.
[0063] In a preferred embodiment, the determined base number is partitioned by multiplying the determined base number of the location of the determined base number by the determined base number of the texture sampled along the anisotropic direction, the inverse of the step factor (i.e., the partitioning of the step factor is preferably implemented as a multiplication operation rather than a partitioning operation) to avoid the need to perform a partitioning operation on it, which will be more efficient in hardware.
[0064] Of course, other arrangements are possible.
[0065] In a preferred embodiment, the step size factor is equal to or greater than 1 (and therefore the sample position interval is equal to or greater than the text interval).
[0066] In a particularly preferred embodiment, specifically, a preferredly selected, preferredly predetermined maximum allowable step size factor value (and therefore sample position interval) may be used. Accordingly, a specific, preferredly selected, preferredly predetermined minimum allowable step size factor value (and therefore sample position interval) may also be used, preferably also or alternatively.
[0067] Most preferably, a specific preferred selection can be used, preferably a predetermined range of allowed step size factor values (and therefore sample location intervals). In a preferred embodiment, the allowed step size factor falls within (and falls within) the range of 1.000 to 1.3333, and most preferably within the range of 1.0000 to 1.2500.
[0068] Using these ranges, the bottom of the range corresponds to sampling at the text interval (texel-to-texel distance) and should therefore provide the highest quality sampling. The top of the range takes samples (texel-to-texel distance) at intervals greater than the texel interval and will therefore have reduced output quality. In this regard, the applicant has found that increasing the texel interval (texel-to-texel distance) by more than 1.3333 times and, more generally, by more than 1.25 times the texel interval (step size factor) will (very) result in unacceptably poor image quality, and therefore using even longer sampling position intervals (step size length factor) will provide almost no benefit.
[0069] While a single step size factor can be used, which is always applied to a determined base number of locations for sampling the texture along the anisotropic direction, in a particularly preferred embodiment, multiple different step size factors are available that can be applied to a determined base number of locations for sampling the texture along the anisotropic direction. Most preferably, multiple different step size factors can be applied to a determined base number of locations for sampling the texture along the anisotropic direction (wherein one of the multiple different step size factors is then selected and used for any given anisotropic filtering operation).
[0070] The step size factor (sampling position interval) can be freely set within an allowed range (and in one embodiment, this is the case). However, in a particularly preferred embodiment, there exists a set of multiple predetermined values within a range that can be set and selected; that is, the step size factor (sampling position interval) can be selected and set to one of N values having a value within a particularly preferred, preferred predetermined range (where N is an integer greater than 1).
[0071] Limiting the permissible step size factor (sampling position interval) that can be set and used, rather than making it a freely adjustable parameter, simplifies the implementation of these aspects of the invention in use. For example, it facilitates the partitioning of the base position and samples based on the elliptical projection of the sampling position, where texture values are applied to the surface of the texture by the step size factor to be implemented as a multiplication with a constant (which is the reciprocal of the step length factor), rather than having to use partitioning hardware. Therefore, this simplifies the implementation of these aspects of the invention in hardware.
[0072] There should be, and preferably there should be, multiple predetermined step size factors (sampling position intervals) that can be set and selected during use. In a preferred embodiment, there are between two and eight (predetermined) step size factors that can be selected and set during use. In a particularly preferred embodiment, there are four step size factors that can be selected and set.
[0073] In a particularly preferred embodiment, at least two of the following step size factors (sampling position intervals) can be selected, and preferably all of them: 1.000; 1.0625; 1.250; and 1.2500.
[0074] In this scenario, a step size factor (sampling location interval) of 1.0000 will not reduce the number of sample locations in the texture and will provide the highest image quality. A step size factor (sampling location interval) of 1.0625 will slightly reduce the number of sample locations (and thus reduce processing costs), but will have almost no (if any) adverse effect on image quality.
[0075] A step size factor (sampling position interval) of 1.125 will provide an intermediate setting with some quality degradation, but the reduction in processing cost will be more significant. A step size factor (sampling position interval) of 1.2500 will provide the highest reduction in processing cost, where image degradation may (potentially) be acceptable in at least some cases.
[0076] Of course, other step size factor values and step size factor intervals (sampling position intervals) can be used within the entire allowable range of step size factors.
[0077] In a preferred embodiment, the step size factor (sampling position interval) in use can be selected and set to be further configured such that the multiplication of the anisotropic direction vector with the step size factor (which will be discussed in more detail below) can be efficiently implemented in hardware, for example, by using an adder (and preferably a single adder) instead of a multiplier.
[0078] As will be understood from the above, in a preferred embodiment, the invention includes selecting a step factor to be applied to a determined number of base locations for sampling the texture along anisotropic directions (and then applying the selected step factor to the determined number of locations for sampling the texture along anisotropic directions). As described above, most preferably, the applied step factor is selected from a range of permissible step factors, and most preferably from a set of permissible multiple steps, and preferably from predefined step factors.
[0079] The step size factor used for anisotropic filtering operations can be set and selected in any suitable and desirable manner and based on any suitable and desirable criteria.
[0080] In a preferred embodiment, the step size factor is selected based on one or more, and preferably multiple, criteria.
[0081] In a preferred embodiment, the step size factor used is selected based on the nature or characteristics of the texture being sampled, for example, and preferably involves the appearance of the texture being sampled.
[0082] This can be based on one or more of the following, and preferably multiple, and preferably all of them: whether the texture contains any smooth gradients and / or constant color areas (in which case a larger step factor should be acceptable); whether the texture contains a lot of detail and / or high contrast and / or sharply defined shapes (in which case a smaller step factor would be preferred).
[0083] This can be indicated as appropriate, for example, a state, information associated with the texture (e.g., set by the artist who designed the texture), and / or the texture can be analyzed, for example, after it has been automatically created by using an algorithm that analyzes textures to determine such properties of the texture.
[0084] In a preferred embodiment, the step size factor used is also or alternatively (and preferably also) selected based on one or more of the following and preferably both: (desired) image quality and (expected) rendering performance, and preferably based on an appropriate trade-off or optimization between image quality and rendering performance.
[0085] For example, a step size factor can be chosen to achieve higher image quality (e.g., at the expense of rendering performance) or vice versa. For instance, in some cases, achieving the best possible image quality may be critically important (e.g., when performing offline rendering of motion pictures), while in others, higher rendering performance (e.g., a higher frame rate) may be more important than the resulting image quality. For example, for virtual reality applications that require low latency to avoid motion sickness, a step size might be preferred to facilitate a higher frame rate at the cost of reduced image quality. This could also be the case in video games running at unacceptably slow frame rates. Therefore, in such cases, the step size factor can be chosen based on a desired, for example, minimum frame rate.
[0086] In a preferred embodiment, the step factor is set and selected by the driver of the graphics processor used to perform anisotropic filtering. The driver may, for example, be configured to select and set the step factor for the anisotropic filtering operation based on the required graphics processing workload (e.g., the nature of the graphics processing output being generated, such as the application requesting graphics processing).
[0087] In a particularly preferred embodiment, the step factor may be, and preferably is, selected and set by an application requiring graphics processing (and therefore especially the texture map), which has, for example, a driver, and then sets the step factor according to the indicated step factor requested by the application. In this case, the driver can simply follow and use the step factor requested by the application, or the driver can be configured, for example, to potentially override any step factor requested by the application, such as based on the processing power or conditions of the graphics processor when performing anisotropic filtering.
[0088] In a preferred implementation of this type, the step factor is exposed to an API (Application Programming Interface), allowing the application programmer to set the step factor or factor to be used in the application.
[0089] For example, there may be a default step factor set by the driver, but the application can set a lower or higher step factor during use if needed (but not higher than the maximum allowed step factor or lower than the minimum allowed step factor).
[0090] Of course, other arrangements are possible.
[0091] The selected step factor to be used can be fed to the texture mapping process (and texture mapping device) in any suitable and desired manner. This is preferably done by indicating the step factor as appropriate state information, for example in a descriptor, stored in memory, used for texture sampling operations, or via I / O registers, etc.
[0092] The texture sampling process (texture sampling device) then reads state information (e.g., descriptors) to determine the step size factor to use, and then uses that step size factor accordingly.
[0093] Therefore, in a particularly preferred embodiment, the method of the present invention includes (and the texture mapping device is accordingly configured to) determine a step factor to be used from an indication of a step factor provided to the texture mapping operation, and then apply the determined step factor to the determined base number of locations for sampling the texture along the anisotropic direction to provide the number of step adjustment locations for sampling the texture along the anisotropic direction.
[0094] Correspondingly, according to another aspect of the present invention, a method is provided for performing anisotropic filtering during texture sampling to provide output sampled texture values, which are used when presenting output in a graphics processing system, the method comprising: When sampling a texture to provide an output sampled texture value, a step size factor is selected for anisotropic filtering, the step size factor representing the interval between adjacent sampling positions along the anisotropic direction used when sampling the texture using anisotropic filtering; When sampling the texture into a texture sampling operation, an indication of the selected step size factor to be used is provided; and Performing a texture sampling operation to sample the texture using anisotropic filtering to provide output sampled texture values for locations within the texture, the texture sampling operation using anisotropic filtering to sample the texture includes: 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: The cardinality for sampling the texture along the anisotropic direction is determined based on an estimate of the ellipse corresponding to the projection of the sampling point, and the texture is sampled onto the surface of the texture corresponding to the projection of the sampling point; and The indicated step size factor is applied to the determined base number of locations for sampling the texture along the anisotropic direction to provide a number of step size adjustments for sampling the texture along the anisotropic direction. The texture sampling operation further includes: Based on the number of positions adjusted by the step size, samples or samples are taken along the anisotropic direction in the texture, the samples or samples being acquired spaced apart from any adjacent positions in the texture along the anisotropic direction, and the step size factor is applied to the determined base number of positions for sampling the texture along the 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.
[0095] According to another aspect of the invention, a system is provided for performing anisotropic filtering when sampling a texture to provide output sampled texture values, which are used when presenting output in a graphics processing system, the system comprising: A texture sampling device configured to perform anisotropic filtering while sampling samples to provide output sampled texture values; The step size factor selection circuit is configured as follows: When sampling a texture to provide output sampled texture values using anisotropic filtering, a step size factor is selected for the anisotropic filtering, the step size factor representing the interval between adjacent sampling positions along the anisotropic direction used when sampling the texture; and Provides an indication of the selected step size factor to be used when sampling the texture to the texture sampling device; in: The texture sampling device includes: The sample determination circuit is configured to sample the texture using anisotropic filtering to provide output sampled texture values for locations within the text. Determine the number of locations for sampling the texture along the anisotropic direction, and sample the texture along the anisotropic direction: The cardinality for sampling the texture along the anisotropic direction is determined based on an estimate of the ellipse corresponding to the projection of the sampling point, and the texture is sampled onto the surface of the texture corresponding to the projection of the sampling point; and The step size factor provided to the texture sampling device is applied to the determined base number of positions for sampling the texture along the anisotropic direction, to provide a number of positions for step size adjustment for sampling the texture along the anisotropic direction; Furthermore, the texture sampling device further includes: A texture sampling circuit is configured to capture samples or samples in the texture along an anisotropic direction based on a number of positions adjusted by a step size. Each position where a sample or sample is acquired is any adjacent position in the texture spaced along the anisotropic direction. The step size factor is based on a determined number of positions applied to sample the texture along the anisotropic direction. 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.
[0096] 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.
[0097] Therefore, for example, the step factor is preferably selected and set by the application that requires graphics processing (and therefore texture sampling) and / or by the driver of the graphics processor, and is preferably indicated as a texture sampling operation (texture sampling device) as part of the state information of the graphics processing, for example in a suitable descriptor that can be read by the texture sampling operation (texture sampling device).
[0098] Similarly, the step size factor used is preferably selected from a range of allowed step size factors, and most preferably from a set of allowed multiple steps, and is preferably a predefined step size factor.
[0099] Similarly, the texture mapping device is preferably a texture mapping circuit (texture mapping) of a graphics processor (graphics processing unit (GPU)).
[0100] Once the number of step adjustment locations for the sample texture (the anisotropy of the step adjustment) is determined, samples should be taken along the anisotropic direction in the texture based on the number of step adjustment locations, and preferably along the anisotropic direction. As will be discussed further below, this can include samples taken along the anisotropic direction in the texture (and in a preferred embodiment, this can include samples taken along the anisotropic direction in the texture at locations that are not the same as the number of step adjustment locations (the locations are different from) the number of adjusted locations, but are based on the number of step adjustment locations (e.g., determined using the number of step adjustment locations) (and in other embodiments, this is the case).
[0101] There may be only a single "version" of the texture (e.g., mipmap level) to be sampled for anisotropic filtering operations. In this case, the number of positions in the texture (mipmap) should be sampled in an appropriate manner based on the number of positions adjusted by the step size (e.g., and preferably equal to the number of positions adjusted by the step size).
[0102] 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 mipfilms (the number of positions adjusted according to the step size to be sampled).
[0103] 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).
[0104] Correspondingly, the device of the present invention preferably includes: The mipmap level selection circuit is configured to provide output sampled texture values 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, thereby obtaining samples to provide output sampled texture values. Furthermore, the texture sampling circuit is configured to sample one or more (preferably more) locations at a more detailed mipmap level and along the anisotropic direction at a more detailed mipmap level; Furthermore, the sample combination circuit is configured to combine the samples captured along the anisotropic direction at both a more detailed mipmap level and a less detailed mipmap level to provide output sample texture values for use.
[0105] 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.
[0106] In a preferred embodiment, the two mipmap levels for acquiring texture samples include adjacent levels in the mipmap hierarchy.
[0107] 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.
[0108] 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 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.
[0109] 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.
[0110] 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.
[0111] 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.
[0112] 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 log2 of the minor axis of the projected ellipse in question, and preferably determined by applying one or more, preferably complex, log2 operations on the ellipse coefficients.
[0113] 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 specific level of detail; root = sqrt( (A - C)^2 + B^2 )); and A, B, C, and F are the elliptic coefficients as defined above.
[0114] In these implementations, the elliptic coefficients A, B, and C are preferably determined by derivatives of the texture coordinates, as discussed above (and preferably, those values are determined once and reused).
[0115] 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).
[0116] 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 embodiments of the invention (and in other ways), 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 basic number of positions (basic anisotropy) can be clamped to a maximum value, and then, with the determined base anisotropy clamped, the level of detail in the calculation can be modified to trigger (determine) the use of a less detailed mipmap. This helps to avoid aliasing.
[0117] Therefore, in the preferred embodiment, when the basic anisotropy is clamped (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 than usually determined)).
[0118] 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 basic anisotropy is already clamped, 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 allowed base anisotropy is set by max_aniso (as described above).
[0119] 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)) In these embodiments of the invention (and additionally), the level of detail based on the mipfilm level used can simply be the initial “original” level of detail as discussed above (and in one embodiment, this is the case).
[0120] However, in the preferred embodiment, the level of detail used to select the mipmap level to be used can also, and preferably also, consider other "level of detail" parameters that can be set and used, for example, by applications that require texture mapping operations.
[0121] 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 the mipmap level, for example, and preferably, when selecting and choosing the mipmap level from the sample, the level of detail modified by the level of detail bias is used.
[0122] 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 detail clamping level is again preferably considered when determining the level of detail used to select mipmap levels from the samples.
[0123] 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.
[0124] 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.
[0125] 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 detail deviation level and set detail bias and fixture level).
[0126] 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).
[0127] 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.
[0128] Preferably, there is then a second mode in which the level of detail is rounded to an integer value, preferably the closest integer value.
[0129] Of course, other arrangements are possible. For example, other LOD "rounding" patterns can also be used.
[0130] 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.
[0131] 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 the "blending" process, 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 the blending is performed, for example, and preferably, a weighted average of the two mipmap levels in the blending result.
[0132] 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.
[0133] Once a mipmap level or sample level is selected based on the LOD value, the number of sample positions in the selected mipmap level or the level along the anisotropic direction will be determined based on the number of positions adjusted for the sample step size.
[0134] Therefore, when only a single version of the texture to be sampled (e.g., a single mipmap level) is determined, multiple samples will be obtained on the texture (in the single mipmap level) based on and preferably corresponding to one or more positions of the determined samples, said one or more positions along the anisotropic direction and preferably corresponding to the number of adjusted positions.
[0135] Correspondingly, when performing anisotropic filtering (including more detailed and less detailed mipmap levels) from a pair of mipfilms, the samples should be, and preferably, performed at each mipmap level at one or more locations along the anisotropic direction, again determined based on the step size adjusted to the location of the sample.
[0136] In a preferred embodiment, the number of sample locations along the anisotropic direction is determined for each mipmap level to be sampled, and then a step size factor (adjustment) is applied to the determined number of sample locations in the mipmap level to determine the number of locations for step size adjustment of the samples in the mipmap level. In other words, the number of sample locations in each mipmap level is determined before applying the step size adjustment.
[0137] 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.
[0138] Therefore, in a preferred embodiment, when anisotropic filtering (including more detailed and less detailed mipmap levels) is performed from a pair of mipfilms, 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).
[0139] 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.
[0140] 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.
[0141] 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, multiple (complex) locations still exist even when multiple locations are sampled along the anisotropic level at the more detailed mipmap level.
[0142] 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 a more detailed mipmap level compared to a 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 a 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. Therefore, in a preferred embodiment, multiple locations are sampled twice in a more detailed mipmap level compared to a less detailed mipmap level. This may be particularly suitable where the resolutions of the two mipmap levels differ by a factor of two. Of course, other arrangements will be possible.
[0143] The number of locations for each mipmap level can be determined based on a defined step size adjustment of the anisotropy degree (the number of locations to be sampled at the step size adjustment) in the anisotropy filtering process. The number of locations from each mipmap level is then set, for example, based on the defined step size adjustment of the anisotropy degree (number of locations), to be greater than and / or less than the number of locations, as appropriate. In one implementation, this is done.
[0144] Alternatively, the number of positions for each mipmap level can be determined based on a different number of positions for the samples before applying the step size factor (e.g., as described above). Then, the number of positions from each mipmap level (e.g., set to be greater than or less than the number of positions based on an initial or base anisotropy), as appropriate, is applied to the determined number of positions for the samples taken at each mipmap level, and then the determined number of positions for each mipmap level is provided with the determined step size adjustment. Thus, in this case, the number of positions for the samples is determined at each mipmap level before applying the step size adjustment. In a preferred embodiment, this is done.
[0145] In these implementations, the actual number of positions of a sample in each mipmap level can be determined in any suitable and desired manner from the bases (initial) or step size adjusted to the appropriate anisotropy (number of positions).
[0146] Typically, the number of positions relative to the base (initial) or step size adjustment can be increased or decreased in any suitable and desired manner, in one or both of more and less detailed mipmap levels (appropriately), or in any suitable and desired manner, as long as more positions exist in the more detailed mipmap level.
[0147] In a preferred embodiment, the increase or decrease in the number of positions adjusted relative to the base (initial) or step length at the mipmap level 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 of the texture (in terms of its level of detail) from the distance of the texture to the level of detail it is intended to sample (in terms of its level of detail).
[0148] 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 compared to the base (initial) or the step size adjustment (or vice versa). (Therefore, if the level of detail of the texture to be sampled is close to the level of detail of the more detailed mipmap level, the number of sampling locations at the more detailed mipmap level is preferably close to the base (initial) or the step size adjustment, and the number of locations (appropriate).)
[0149] Correspondingly, in a preferred embodiment, the further level of detail of the sampled texture comes from the level of detail of the less detailed mipmap level, and then the number of sampling positions at the less detailed mipmap level from the base (initial) or step size adjustment position decreases as much as the number of positions decreases (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 level, then the number of sampling positions at the less detailed mipmap level is preferably close to the step size of the base (initial) or step size adjustment, and the number of positions (appropriate).)
[0150] Therefore, although in the implementation, the number of sampling locations at each mipmap level can be simply determined based on the anisotropy of the step size adjustment as determined above, in the preferred implementation, the level of detail of the texture sampling operation can also be, and preferably can also be taken into account and used when selecting the number of sample locations at each mipmap level.
[0151] 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 pattern (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 pattern adjustment).
[0152] Therefore, in a particularly preferred embodiment, the number of sample positions in each mipmap level is determined based on both the determined number of positions of step size adjustment for the sample (i.e., the anisotropy of the step size adjustment), preferably as described above, and the level of detail of the texture sampled (and most preferably, for determining the “final” level of detail with respect to the mipmap level from the sample).
[0153] In this regard, the applicant further recognizes that, as stated above, the level of detail (final level of detail) of the sampled texture 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.
[0154] 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 relative to the initial “original” level of detail on the surface to which the set “mipmap” pattern (preferably after any adjustments (rounding) are applied, preferably after applying the projection based on the sampling points) is reduced.
[0155] (This assumes that a lower level of detail implies a more detailed mipmap level, and vice versa. Corresponding arrangements can be used, where a higher level of detail indicates a more detailed mipmap level.)
[0156] Most preferably, at a positive effective detail deviation level, the anisotropy (the number of positions along the anisotropic direction) is set to a number of positions (number of positions) that is less than the anisotropy (number of positions) adjusted by the step size. This reduced number of positions is used to sample the texture and is then used as the number of positions to be varied subsequently in order to select the number of positions sampled at more and less detailed mipmap levels along the anisotropic direction (as discussed above).
[0157] 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 number of locations to be sampled is modified 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 footprint, 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 two mipmap levels can be determined, for example, and preferably one or more of the methods discussed above.)
[0158] As described above, in this invention, samples are acquired by adjusting the number of positions based on the step length along the anisotropic direction in the texture being sampled (at the mipmap level or horizontal).
[0159] 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).
[0160] 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).
[0161] 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 footprint of the sampling points.
[0162] In a preferred embodiment, the anisotropic direction is based on and preferably corresponds to the major axis (direction) of the area of the assumed ellipse 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.
[0163] When the anisotropic direction is determined as the direction of the major axis of an ellipse corresponding to the projection of the sampling point on the surface to which the texture is being applied, the direction of the major axis of the ellipse can be determined accordingly in any suitable and desirable manner.
[0164] In a particularly preferred embodiment, a normalized vector (i.e., a vector with a length of "one") is determined along the major axis of the ellipse, and is then used to represent and serve as the anisotropic direction of the sample taken along the texture. This anisotropic direction vector is preferably determined as the corresponding X and Y components of the carrier.
[0165] The anisotropic direction vector (normalized) can be determined in any suitable and desired manner (the X and Y components of the unit (normalized) vector in the direction of the major axis of the ellipse correspond to the projection of the sampling point onto the surface of the applied texture).
[0166] For example, the major axis direction can be determined by determining the angle of the direction relative to the coordinate axes in the texture, wherein the X and Y components of a normal (unit length) vector are then determined to have the angle.
[0167] 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 adopted, then the number of positions of the sample should be determined to be, and preferably, truncated along the anisotropic direction in the texture of the mipmap level or level in question.
[0168] The desired number of sampling locations can be arranged in any suitable and desired manner along the anisotropic direction (at the mipmap level) in the texture. In a particularly preferred embodiment, they are located along a defined major axis of the elliptical area in the texture corresponding to the projection of the sampling points on the surface to which the texture will be applied. Most preferably, the defined number of sampling locations are equidistant along a defined length of the major axis (along the anisotropic direction). 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).
[0169] As described above, the interval between adjacent positions sampled in a texture along the anisotropic direction (in a given mipmap) should be, and preferably based on, and preferably corresponding to, a step factor applied to the determined number of positions along the anisotropic direction. Therefore, as described above, when the step factor is 1, the positions sampled along the anisotropic direction should be, and preferably be, spaced apart by one texture (with an interval of texel-to-texel distance), and where the step factor is greater than 1, the sampled positions should be separated, and preferably spaced apart by more than one texture (by the distance between text and text).
[0170] Most preferably, the distance between adjacent locations to be sampled, spaced apart by a texel interval along the anisotropic direction (text-to-text distance) (in the mipmap discussed), is multiplied by a step size factor.
[0171] The desired interval between sampling locations along the anisotropic direction can be achieved in any suitable and desirable manner. In a preferred embodiment, this is accomplished using a unit (normalized) vector along the major axis of the ellipse (corresponding to the anisotropic direction). Most preferably, the unit (normalized) vector representing the anisotropic direction is multiplied by a step size factor to set the interval between each sampling location along the anisotropic direction.
[0172] In a particularly preferred embodiment, the position of the sample along the anisotropic direction is determined by offsetting the next position to be sampled relative to the immediately preceding position of the sampled position based on the normalized anisotropic direction vector and the step length factor, for example, and preferably by adding (amintoropy_vector) between each sample position. (step_length). (The position of the first sample should be, and preferably appropriately offset from, the texture coordinates given by the application, such that a set of samples is centered on the texture coordinates given by the application.)
[0173] Therefore, if an even number of positions are to be sampled, the first pair of positions is preferably multiplied by a step factor by a normalized anisotropic direction vector, and is also placed on the major axis of the ellipse on each side of the center of the ellipse, and then any additional sample positions are multiplied by a step factor by a normalized anisotropic vector spaced along the anisotropic direction.
[0174] Correspondingly, when sampling an odd number of positions, one sample position is placed at the center of the ellipse, and the other sample positions are then separated by a normalized anisotropic vector multiplied by a step length factor along the anisotropic direction.
[0175] The mipmap level should be, and preferably, sampled at each location where samples are to be taken. In one embodiment, a single sample is taken at each location along the anisotropic direction to be sampled. In this case, it is preferable to acquire a single sample at said location.
[0176] 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.
[0177] Most preferably, in the case of the final level of detail of the texture sampling samples, the texture is in a more detailed form than the initial, "original" level of detail, and is 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 in at least one (and preferably both) of the mipmap levels or in the sampled mipmap levels by acquiring more samples (by "more than") per location in the anisotropic direction in which the samples are taken.
[0178] 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 an estimated elliptical footprint, which is the projection of the sampling point onto the surface of the texture to be applied).
[0179] 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).
[0180] 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).
[0181] However, in a preferred embodiment, each sample taken for a location at a 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.
[0182] 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).
[0183] (This invention primarily relates to selecting the number of sampling locations in each mipmap level. Therefore, there is no limitation on obtaining actual samples at the locations, or existing processes or procedures for sampling textures in graphics processors and graphics processing systems can be used, and are preferably used to collect samples at the desired number of locations in each mipmap level.)
[0184] Once samples have been taken at or within the mipmap 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).
[0185] Samples (combined) at or within a mipmap level 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 combined sampled values 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.
[0186] 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 where it is expected to be sampled 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.
[0187] 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.
[0188] As will be understood from the above, in a preferred embodiment of the invention, at least in a preferred embodiment of the invention, operation in the manner of the invention can determine the number of non-integer (for fractions) samples that should be taken for a location in the texture (e.g., in one or both of the two mipmap levels being sampled).
[0189] In this case, in a preferred embodiment, the number of sample locations is simply rounded to an integer value (such as the nearest integer or the nearest highest integer, or the nearest lowest integer as needed).
[0190] In this case, an integer number of positions are sampled in the texture (at the mipmap level), and then, as described above, those positions are preferably equidistant from the center of the ellipse along the anisotropic direction, and preferably combined based on the distance of the positions 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 combined result based on the distance of the positions from the center of the ellipse).
[0191] In a particularly preferred embodiment, the method and apparatus of the present invention support a number of samples from fractional (non-integer) positions of a texture (at the mipmap level). In this case, instead of grounding the number of positions to integer values, a sampling arrangement is used to implement the samples, where the number of sampling fractional (non-integer) positions is used.
[0192] In this case, locations (non-integer locations) representing a fractional number of textures can be sampled in any suitable and desired manner. For example, if the graphics processor and graphics processing system support taking fractional samples from the texture, then this operation can be used to sample desired non-integer locations in the texture (at the mipmap level or the level discussed).
[0193] In one embodiment where the method and apparatus support sampling at a non-integer number of locations in the texture (at the mipmap level), then sampling at an integer number of locations in the texture (at the mipmap level), wherein those locations are spaced apart from the center of the ellipse along an anisotropic direction (using as described above), and preferably combined based on the distance of the 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 locations to the combined result).
[0194] In a preferred embodiment where the method and apparatus support sampling at a non-integer number of locations in the texture (at the mipmap level), in the case of sampling at an integer number of locations in the texture (at the mipmap level), the integer number of locations are sampled, wherein these locations are preferably spaced apart from the center of the ellipse along the anisotropic direction (using as described above), and are preferably combined based on the distance of the locations along the anisotropic direction from the center of the major axis of the projected ellipse (e.g., and preferably, by based on the contribution of the locations to the combined result, and preferably, by weighting the contribution of the locations to the combined result).
[0195] In a preferred embodiment, the method and apparatus support sampling at a non-integer number of locations in the texture (at the mipmap level), and then sampling a single location (say one) in the case that (exactly) one location is sampled in the texture (at the mipmap level).
[0196] On the other hand, where the method and device support sampling at a non-integer number of locations in the texture (at the mipmap level), in the texture (at the mipmap level), sampling at an odd integer number of locations along the anisotropic direction (at the mipmap level) instead of sampling at odd integer locations (more than the determined integer odd locations to be sampled), but with intervals and / or contribution (interpolation) weights set (appropriately) for the locations being sampled to account for and allow the actual integer odd locations to be sampled.
[0197] For example, when determining to sample three locations along the anisotropic direction, it is preferable to sample four locations with weights of 1 / 6, 1 / 3, 1 / 3, and 1 / 6, respectively.
[0198] Most preferably, when the number of odd integer positions to be sampled is greater than one, the (higher) or even integer (number of positions) of the sampling (position count) is the next higher multiple of the determined odd integer position (position count) to be sampled. Therefore, when the number of positions to be sampled is 3, four positions will be sampled, and when the number of positions to be sampled (position count) is 5, six positions will be sampled, and so on.
[0199] The applicant has discovered that obtaining additional samples with appropriate weighting in this manner can help avoid visible artifacts, for example, when the number of sampled locations varies.
[0200] In a particularly preferred embodiment, in the case of sampling a number of fractional (non-integer) positions, it is then permissible to sample a number of fractional (non-integer) positions along anisotropic directions. In a particularly preferred embodiment, higher integer positions (sampling higher than the determined number of fractional (non-integer) positions) are sampled along anisotropic directions, but with intervals and / or contribution (interpolation) weights set for the sampled positions to account for and allow the actual fractional (non-integer) positions to be sampled.
[0201] Most preferably, when sampling a number of fractional (non-integer) positions, the (high) integer of the sampling (position count) is the next higher multiple of the determined fractional (non-integer) position (position count) to be sampled. Therefore, in cases where the number of positions to be sampled is between 2 and 4, two positions will be sampled; in cases where the number of positions to be sampled (position count) is between 4 and 6, six positions will be sampled, and so on.
[0202] In this case, there will be a higher number of locations than the actual number of determined (score) locations of the samples. Therefore, to account for this situation, it is preferable to set one or both of the interval of the locations being sampled and the contribution weight (interpolation weight), and preferably one or both, so as to effectively provide a sampling arrangement that will return values corresponding to the determined number of locations of the samples to be taken.
[0203] In a particularly preferred embodiment, this is done differently, wherein the number of locations (scores) of the sample to be determined is between 1 and 2, compared to the case where the number of locations of the determined samples is greater than 2.
[0204] Most preferably, when the number of determined score (non-integer) positions is between 1 and 2, two positions are sampled, and the interval (and setting) between the two sampled positions depends on the actual number of score (non-integer) positions in the sample.
[0205] In a preferred embodiment, as the number of locations to be sampled increases from 1 to 2 (until they are correctly (just) appropriate step size factor intervals (e.g., texel interval multiplied by the step factor), the interval between the two locations sampled gradually increases when exactly two locations are sampled).
[0206] In this case, the contribution weights (interpolation weights) for the two sampled locations are preferably set equally to each other, and preferably remain the same for any number of locations between 1 and 2 (regardless of the actual score used to determine the sampled locations). Each sampled location is preferably given ½ of the interpolation (contribution) weight.
[0207] This approximates an elliptical sample, where the major axis is the position counting time, which is longer than the minor axis.
[0208] Therefore, in this case, the interval between the sampled locations will be changed based on and taking into account the actual number of locations that should be sampled, rather than changing the contribution (interpolation) weights of the locations for this purpose.
[0209] In these arrangements, the interval between sampled locations can be varied based on, and taking into account, the actual number of locations determined to be sampled in any suitable and desirable manner. For example, the interval between sampled locations can vary linearly based on determining the actual number of locations that should be sampled.
[0210] In a preferred embodiment, the interval between sampling positions varies based on a determined number of actual determined positions, which should be sampled in a non-linear manner, and preferably, such that the positions initially move faster as the number of positions to be sampled increases, as the number of fractions of the positions to be sampled increases, and as the number of positions to be sampled reaches 2 (and preferably reaches an interval of exactly one text for a position count of 2).
[0211] In a particularly preferred embodiment of this type, the interval between sampling locations varies based on the determined number of actual locations that should be sampled: Position_spacing = 2.0 – (2.0 / position_count).
[0212] It has been found that, for example, simply using a linear dependency between the location interval and the number of locations to be sampled can provide reduced aliasing (which may in some cases result in some slight aliasing).
[0213] Of course, other arrangements are possible.
[0214] On the other hand, if the score (non-integer) (position count) of the location to be sampled is greater than 2, then the interval between the sampling locations preferably remains the same (depending on the actual score of the location to be sampled), but the contribution (interpolation) weight of the location being sampled is (alternatively) preferably varied based on the actual number of determined locations to be sampled (determined position count).
[0215] Therefore, in this case, the contribution (interpolation) weight of the sampled location will be based on and take into account the actual number of scores (non-integer) of the locations determined to be sampled, rather than changing the interval between the sampled locations for this purpose.
[0216] In this case, the intervals between sampling locations are preferably kept constant, regardless of the actual number of fractions at each location (2). Sampling is to be performed. Preferably, all sampling locations are equally spaced along the anisotropic direction, preferably with an appropriate step size factor (e.g., the texel interval multiplied by the step size factor).
[0217] Correspondingly, the contribution (interpolation) weight of the location being sampled is preferably changed to take into account and based on the determined number of fractions (non-integer) that the location should actually be sampled.
[0218] Preferably, the contribution (interpolation) weights of different positions are based on the number of actual score (non-integer) positions determined as samples, and most preferably based on the proximity (determined expected position count) of the determined number of positions to be sampled to the determined number of positions to be sampled (to the determined expected position count) (i.e., based on the number of determined positions to be sampled that is higher than the determined number of positions) (determined position count).
[0219] As described above, for a determined number of locations to be sampled (location count) greater than 2, then preferably take the number of locations corresponding to the next higher multiple of the determined fractional (non-integer) locations to be sampled (spaced apart along the anisotropic direction (and located along the anisotropic direction), preferably spaced by an appropriate step factor (e.g., texel interval multiplied by the step factor)).
[0220] Then, as the determined number of locations to be sampled exceeds a given multiple of 2, two additional locations are sampled, and preferably two additional locations are added at each end outside of the locations to be sampled. In this case, these new “external” locations sampled preferably have their contribution weights gradually increasing from 0, as the fractional number of locations to be sampled (location count) increases from a lower multiple of 2 to the next higher multiple of 2. Correspondingly, the contribution (interpolation) weight of the “internal” (existing) locations being sampled preferably gradually decreases as the number of locations (location count) increases from a lower multiple of 2 to the next higher multiple of 2.
[0221] The effect of this is that for a number of fractions (non-integer) of positions to be sampled that are between twice 2, the number of positions corresponding to the higher multiples of 2 will be sampled. Therefore, in this respect, the sampled positions can be considered as positions corresponding to multiple positions corresponding to the lower multiples of 2, and two additional positions sampled that are effectively added at each end along an anisotropic direction to the position to be sampled, the positions corresponding to the lower multiples of 2. Thus, the set of “internal” positions corresponding to the positions corresponding to the next lower multiple of 2, where the number of fractions (non-integer) of the determined number of positions to be sampled is greater than the number of two “external” positions sampled together (one at each end along anisotropic direction) corresponding to the two “outer” positions that will be sampled when the determined fractions (non-integer) of the positions to be sampled are sampled, can be considered as two “outer” positions that will be sampled when the determined fractions (non-integer) of the positions to be sampled are sampled.
[0222] Most preferably, when the number of scores of the location to be sampled is closer to the determined number of scores of the location to be sampled, the contribution (interpolation) weight of the "internal" sample corresponding to the next lower number of locations in the two-number locations is set to be higher and gradually decreases from the maximum value of the number of locations to be sampled, which further decreases from the next lower multiple of (greater than) 2.
[0223] Correspondingly, when the number of locations to be sampled is closer to the next lower number of locations to be sampled, the contribution (interpolation) weights of the two “outer” locations sampled (i.e., the other locations sampled) are preferably set to a lower value, and gradually increased from a minimum value (e.g., and preferably 0) to the actual score (actual location count) of the locations to be sampled as the number of scores of the locations to be sampled is closer to the next lower number of locations to the determined number of locations to be sampled.
[0224] Preferably, the contribution weight of a position is gradually changed based on the position count, so that when the number of positions to be sampled reaches the next higher multiple, all positions will have the same weight (contribution to the overall sampling result) (e.g., 1 / 6 when sampling four positions, 1 / 6 when sampling six positions).
[0225] Therefore, for the number of locations to be sampled between 2 and 4, in a preferred embodiment, two new locations are added to either side of the two existing locations to be sampled, since the number of locations exceeds two (and preferably, the interval is a suitable step factor interval (e.g., texel interval multiplied by the step factor)), but based on the actual number of locations determined above 2 (e.g., and preferably, such that the interpolation weights for the additional (external) locations are in 2), it will actually start in 2 and gradually increase as the number of locations to be sampled increases (e.g., ¼ for a location count of 4).
[0226] Correspondingly, in a preferred embodiment, as the position count increases, the interpolated (contribution) weight of the initial (inner) two sampled positions gradually decreases (e.g., from ½ to ¼) to allow for additional contribution (weighing) of the additional positions as the number of sampled positions increases (this helps to provide a smoother transition since the position count is higher than 2).
[0227] Therefore, in the preferred embodiment, as the number of locations to be sampled increases to 2.0, additional locations are sampled at each end of the area beyond the two locations already sampled. Thus, once the location count reaches 2.0, four locations are sampled along the anisotropic direction, preferably with a constant distance between the locations (an appropriate step factor interval between the sampled locations). The outer locations will initially have an interpolation (contribution) weight of 0.0, and their interpolation weight will gradually increase as the location count increases to 4.0. Correspondingly, the inner locations will initially have an interpolation weight of 0.5 (when the sample count is 2.0). And as the location count increases toward 4.0, their interpolation weight will gradually decrease. When the location count reaches 4.0, all four locations will have the same interpolation weight of 0.25.
[0228] Correspondingly, as the number of locations to be sampled increases above 4.0, in a preferred embodiment, new locations are added at each end of the footprint (along the anisotropic direction) (so that a total of six locations are sampled as the location count increases toward 6.0), wherein the interpolation (contribution) weights of those new locations gradually increase (and the interpolation weights of the “inner” locations sampled as the location count moves toward 6.0 gradually decrease), wherein each of the locations has the same interpolation weight when the location count is 6.0.
[0229] Preferably, this process is repeated as the position count is further increased (i.e., from 6 to 8, from 8 to 10, etc.).
[0230] The contribution (interpolation) weights, which are the fractions of the locations to be sampled (location counts), gradually increase and decrease within the range of the next lower position, and can be applied to the next two higher positions in any suitable and desirable manner. For example, for an "outer" position, the contribution (interpolation) weights can vary linearly between minimum values (e.g., 0.0), and these contribution weights will have the weights of the contribution at the next higher positions, where the "inner" positions correspondingly change linearly from their initial contribution values when the determined number of positions is a multiple of the next lower number of 2, and the "interpolated" positions correspondingly change linearly when the fractions of the positions are the next higher number of 2. Other ways of varying the contribution (interpolation) weights to the number of locations to be sampled, such as those with non-linear variations, are of course possible.
[0231] It is believed that these arrangements for fractional sampling of the number of positions in the texture along the anisotropic direction can be novel and advantageous to its own right (and not only when the number of sample positions is determined in the manner of an earlier aspect of the invention).
[0232] Therefore, according to another aspect of the present invention, a method is provided for performing anisotropic filtering during texture sampling to provide output sampled texture values, which are used when presenting output in a graphics processing system, the method comprising: When using anisotropic filtering to sample textures, output sample texture values are provided for locations in the text: Determine the number of locations for sampling the texture along anisotropic directions that will take the samples along the text: and When the determined number of locations for sampling the texture along the anisotropic direction is used, the determined number of locations along the texture will take samples in the texture as non-integer values: Samples are taken in the texture along the anisotropic direction to correspond to the positions from the next higher 2 to the determined non-integer positions to be sampled; and The samples taken along the anisotropic direction in the texture are used to provide output sampled texture values for the sampled locations in the texture; in: The sample is taken along the anisotropic direction in the texture, for the position corresponding to the next higher 2 and the determined non-integer position to be sampled.
[0233] Using samples acquired along anisotropic directions in the texture to provide output sampled texture values for use at the location being sampled in the texture, including at least one of the following: The interval is set in the texture along the anisotropic direction of the determined non-integer position to be sampled, and the sampling is performed in the texture; and The contribution weight of the position sampled into the output sampled texture value is set based on the determined non-integer position to be sampled.
[0234] According to another aspect of the invention, an apparatus is provided for performing anisotropic filtering while sampling a texture to provide output sampled texture values for rendering output in a graphics processing system, the apparatus comprising: The number of locations for the sample determination circuit is configured to sample the texture using anisotropic filtering to provide output sampled texture values for locations in the texture, determine the number of locations for sampling the texture along the anisotropic direction, and sample the texture along the anisotropic direction. A texture sampling circuit, configured to sample along anisotropic directions in the texture, wherein the texture sampling circuit is configured to: When the determined number of locations for sampling the texture along the anisotropic direction is used, the determined number of locations along the texture will take samples in the texture as non-integer values: Sample multiple locations along the anisotropic direction in the texture, these locations correspond to the next higher multiple of 2 up to a specific number of non-integer locations to be sampled; and A sample combination circuit is configured to use samples taken along the anisotropic direction of the texture to provide output sampled texture values for the sampled locations in the texture; The texture sampling circuit and / or the sample combination circuit are configured as follows: When the determined number of locations for sampling the texture along the anisotropic direction is used, the determined number of locations along the texture will take samples in the texture as non-integer values: The interval is set along the anisotropic direction of the position where the sample is extracted from the texture based on the determined non-integer position to be sampled; and / or The contribution weight of the position sampled into the output sampled texture value is set based on the determined non-integer position to be sampled.
[0235] 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.
[0236] Therefore, for example, it is preferable to determine the interval between the sampled locations and / or contribution weights, and to vary the number of (non-integer) locations to be sampled based on one or more of the methods discussed above, and preferably to set the distance from the next higher plurality of 2 based on the determined (non-integer) number of locations, in order to determine the number of non-integer locations to be sampled in one or more of the methods described above.
[0237] For example, when the determined number of locations is a non-integer number between 1 and 2, it is preferable to sample two locations with equal contribution weights, but the interval between the locations varies based on the determined number of locations to be sampled. Correspondingly, when the determined number of locations to be sampled is a non-integer number greater than 2, it is preferable that the sampled locations are equidistant from each other along the anisotropic direction, but their contribution weights are set (and varied) based on the determined non-integer locations to be sampled.
[0238] In these aspects and embodiments of the invention, the location (which may have a non-integer value) for sampling the (initial) amount of texture along the anisotropic direction can be determined in any suitable and desirable manner. As described above, it is preferably determined by assuming that the sampling location (point) for which the sampled texture values are to be used will be projected as an ellipse onto the surface on which the texture is being applied, and preferably based, at least in part, on the determined length of the minor axis of the estimated elliptical footprint, preferably the radius, and preferably as the ratio of the length of the major axis of the estimated projected ellipse to its preferred radius, the length of the minor axis of the projected ellipse used to set the sampling point, preferably its radius.
[0239] Most preferably, the number of locations used to sample the texture along the anisotropic direction is the number of “step length adjustment” locations of the sample discussed above, that is, determined by applying a step length factor to a defined initial number of “bases” of the location to be sampled, the number of locations being sampled for the texture (as described above).
[0240] Correspondingly, the anisotropic direction can be determined in any suitable and desirable manner, but preferably based on the direction of the major axis of the assumed elliptical area of the sampling point, as the texture value is projected onto the surface by the direction of the major axis applied to the surface.
[0241] The relevant ellipse parameters can be determined accordingly in any suitable and desirable manner, for example, and preferably using derivatives of texture coordinates.
[0242] "Extra" locations to be sampled can be added for all non-integer (fractional) numbers of locations to be sampled, i.e., once the determined location count is greater than 1.0, for example, two locations will be sampled and interpolated in the manner described above (and correspondingly, once the determined location count is greater than 2.0, and thus in one implementation, this is done).
[0243] However, in this respect, the applicant has recognized that, at least in the case where the determined non-integer positions are sampled, if appropriate, 2 or to the next lower multiple, then, as in this case, the “other” positions sampled in these aspects and embodiments of the invention should only be sampled for the final sampling result, and preferably, the contribution to those other positions, where their contribution will be relatively (and sufficiently) low, can be omitted.
[0244] Therefore, in a particularly preferred embodiment, when sampling a fractional (non-integer) number of positions, for all non-integer (fractional) numbers of positions to be sampled, instead of increasing the number of positions sampled to the next higher multiple of 2, the number of positions sampled is increased when the number of positions with a determined (fractional) (non-integer) number of positions to be sampled exceeds 1 or when, as needed, at least one (or more) specific, preferably selected, preferably predefined threshold amount is required. In other words, the number of positions sampled is not always increased (to the next higher multiple of 2) when there is a fractional (non-integer) number of positions to be sampled; only once the determined (fractional) number of positions to be sampled exceeds the threshold amount (or at least exceeds the threshold amount) of the relevant lower integer positions, are additional (incremental) positions (to consider the number of positions to be sampled).
[0245] This has the effect of adding new locations to be sampled as the number of locations to be sampled exceeds 1 or a multiple of 2 (appropriately) until a useful contribution is actually made to the output sampled texture result, and then delaying (postponing) the addition of new locations to be sampled (and avoiding (omitting) those additional locations accordingly when they do not need to make a "useful" contribution to the output sampled texture result).
[0246] Therefore, in a preferred embodiment, once the number of determined locations to be sampled (determined location count) exceeds the associated next smaller integer value (at least) one (or more) threshold, only the additional locations to be sampled are used.
[0247] Therefore, in a particularly preferred embodiment, the methods of these aspects and embodiments of the invention include (and the texture sampling circuit is configured accordingly): (Only) when the number of determined positions where the texture sampled along the anisotropic direction is greater than a threshold value, the number of positions corresponding to the determined non-integer positions to be sampled along the anisotropic direction in the texture is increased. However, when the number of determined positions where the texture sampled along the anisotropic direction is consistent with the determined non-integer number, the number of determined positions where the texture sampled along the anisotropic direction does not exceed the lower integer value when the texture is sampled along the anisotropic direction.
[0248] In this case, as described above, the smaller integer value is preferably 1, where the determined non-integer position to be sampled is between 1 and 2, or the next lower multiple 2, where the number of determined non-integer positions to be sampled is greater than 2.
[0249] Therefore, in this case, when the determined number of locations for the sample texture is between 1 and 2, one location will be sampled until the determined number of locations is equal to or exceeds an appropriate 1 plus a threshold amount, at which point two locations will be sampled. Correspondingly, between the determined number of locations to be sampled, two locations will be sampled until the determined number of locations is equal to or greater than an appropriate 2 plus a threshold amount, at which point four locations will be sampled. When the determined number of locations is between 4 and 6, four locations will be sampled until the determined number of locations is equal to (or exceeds) 4, at which point six locations will be sampled, and so on.
[0250] It is believed that these arrangements can also be new and advantageous to oneself.
[0251] Therefore, according to another aspect of the present invention, a method is provided for performing anisotropic filtering during texture sampling to provide output sampled texture values, which are used when presenting output in a graphics processing system, the method comprising: When using anisotropic filtering to sample textures, output sample texture values are provided for locations in the text: Determine the number of locations for sampling the texture along the anisotropic direction, and acquire samples in the file along the anisotropic direction; and When the determined number of positions along the texture for obtaining the sample is a non-integer value that exceeds a threshold value, the sample is taken at the next higher position 2 along the anisotropic direction in the texture, corresponding to the determined non-integer position to be sampled. When the number of determined positions sampled along the anisotropic direction of the texture does not exceed the smaller integer value at least the threshold amount when the texture is obtained in the texture, multiple positions corresponding to the lower integer value are sampled or sampled along the anisotropic direction in the texture. The method further includes: 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.
[0252] According to another aspect of the invention, an apparatus is provided for performing anisotropic filtering while sampling a texture to provide output sampled texture values for rendering output in a graphics processing system, the apparatus comprising: The number of locations for determining the sample location circuit is configured to sample the texture using anisotropic filtering to provide output sampled texture values for locations in the texture, determine the number of locations for sampling the texture along the anisotropic direction, and sample the texture along the anisotropic direction; and A texture sampling circuit, configured to sample along anisotropic directions in the texture, wherein the texture sampling circuit is configured to: When the number of determined locations along the texture that will sample the texture using the anisotropic direction of the sample is a non-integer value that exceeds a threshold value, samples are taken along the anisotropic direction in the texture at the number of locations corresponding to the next higher 2 positions of the determined non-integer positions to be sampled; and When the number of determined locations along the anisotropic direction for sampling the texture does not exceed the smaller integer value at least the threshold amount when the texture will be obtained in the texture, samples or samples are taken in the texture at multiple locations corresponding to the next smaller integer value along the anisotropic direction. The device further includes: 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.
[0253] 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.
[0254] Therefore, for example, and as described above, the smaller integer value is preferably 1, wherein the determined non-integer positions to be sampled are between 1 and 2, and preferably a plurality of the next lower part of 2, wherein the number of determined non-integer positions to be sampled is greater than 2.
[0255] Similarly, the number of samples taken along the anisotropic direction in the texture corresponding to the next higher 2 positions corresponds to the determined non-integer positions to be sampled, and samples taken along the anisotropic direction in the texture are used to provide output sampled texture values for the positions to be sampled in the texture, preferably including at least one of the following: The interval is set in the texture along the anisotropic direction of the determined non-integer position to be sampled, and the sampling is performed in the texture; and The contribution weight is set to the output sampled texture value of the sampled position based on the determined non-integer position to be sampled.
[0256] Therefore, in these aspects and embodiments of the invention, in the case where the determined non-integer position does indeed exceed the threshold amount, the sample is preferably acquired and processed in one or more of the methods discussed above, the plurality of positions corresponding to the next higher 2 position and the determined non-integer position to be sampled, i.e., by setting the interval along the anisotropic direction for the position of the sampled sample and / or the contribution weight of the position of the output sampled texture value based on the determined non-integer position to be sampled.
[0257] On the other hand, if the number of non-integer positions to be sampled does not exceed the relevant smaller integer value by at least a threshold amount, then multiple positions corresponding to the smaller integer value are sampled, and the sampled positions are preferably spaced along anisotropic directions, and their contributions are weighted as if the specific integer position were sampled (i.e., any dependence on the determined non-integer positions to be sampled).
[0258] Therefore, when the texture is sampled at a determined non-integer position along the anisotropic direction, between 1 and 2 and exceeding the required threshold amount (or exceeding the required threshold amount by an appropriate threshold amount), two positions are then preferably sampled, where their interval set is based on the determined non-integer positions, the interval of which is set to sample the texture, and their contribution weight is set to 0.5.
[0259] Similarly, in the case of non-integer positions of the texture between 2 and 4, then once the number of determined positions exceeds 2 × or is greater than the required threshold amount, the number of positions corresponding to the next higher position of the 2 and the number of determined non-integer positions (i.e., 4 positions) will be sampled, preferably equidistant along the anisotropic direction, but based on the contribution (interpolation) weight of the sampled positions is set and the actual score (non-integer) number of determined positions is taken into account (e.g., and preferably in the manner discussed above).
[0260] For example, the contribution weighting of additional “outside” samples can be set to actually start at 0, as the number of determined scores for the location to be sampled exceeds the corresponding next smaller integer value, or based on the number of scores (non-integer) for the location to be sampled gradually increasing to an appropriate maximum value (i.e., linearly or following some other form of progression) as the number of determined locations to be sampled exceeds a threshold amount.
[0261] In another approach, this can be thought of as actually setting the contribution weight of additional "outside" locations sampled to 0 until a threshold is reached (or exceeded where appropriate), where additional "outside" samples then begin to contribute to the subsequent overall sampling texture result.
[0262] The contribution weight of the internal samples can be, and preferably is, set accordingly, based on the actual determined number of scores (non-integer) of the positions where the number of determined sampling positions exceeds the next smaller integer value of the threshold amount.
[0263] In this regard, it will be understood that in these aspects and embodiments of the invention, if the determined non-integer position exceeds a threshold value by a smaller integer value, additional positions will be sampled, and if the determined non-integer position exceeds a threshold value by a smaller integer value, then no additional positions (i.e., the number of positions corresponding to the smaller integer value) will be sampled.
[0264] In the case of the determined number of non-integer locations to be sampled, which is (exactly) equal to the smaller integer value plus the threshold (i.e., exceeding the lower integer value (full) threshold), then other locations in the case can be sampled (i.e., if the determined non-integer locations exceed the lower integer value exceeding the threshold), or multiple locations corresponding to the smaller integer value can be sampled (i.e., the case corresponding to the determined number of non-integer locations to be sampled is less than the threshold).
[0265] In other words, when sampling at a determined non-integer position, the operation is followed to be exactly equal to the associated smaller integer value, and the threshold amount can be selected and set as needed.
[0266] Therefore, in one implementation, additional locations will be sampled where the determined non-integer location is equal to or greater than the smaller integer value plus a threshold amount, and in other implementations, additional locations will be sampled (only) where the determined non-integer location exceeds the lower integer value by a threshold amount (but not when the determined non-integer location is equal to the smaller integer value plus a threshold amount).
[0267] It should be understood that in these arrangements, depending on the threshold amount already set, additional samples can be started for different non-integer numbers of locations to be sampled. To take this into consideration, for example, there can be intervals for each of the multiple possible different numbers of location (location count) thresholds that can be used and / or corresponding sets of values for the respective non-integer numbers of locations (i.e., the fact that additional samples are allowed at different fractional numbers of locations to be sampled, depending on the actual location count threshold used) (and in one implementation, this is accomplished).
[0268] However, in a particularly preferred embodiment, where the number of position thresholds (position counting thresholds) used in the manner described in these aspects and embodiments of the invention is such that the position counting threshold is used to determine the number of positions to be adjusted along the anisotropic direction from an initially determined (e.g., and preferably) step size of the position counting threshold, the number of positions sampled along the anisotropic direction, and then the number of positions adjusted along the anisotropic direction is sampled accordingly (and in the case where the number of positions adjusted by the position counting threshold is sampled, and in the case where the number of positions to be sampled by the number of positions adjusted by the position counting threshold is a non-integer (fractional) number), wherein it is preferred to sample a fractional (non-integer) number of positions.
[0269] Therefore, in this case, there will be, and preferably, a single appropriate location interval and contribution weight for all non-integer (fractional) numbers of locations to be sampled, but wherein the number of locations to be sampled is the number of locations adjusted for the location count threshold (the number of locations adjusted for the location count threshold is then used to select the interval and / or contribution weight for the number of locations to be sampled).
[0270] This will then affect a single set of contribution weights, location intervals, etc., used only when sampling a non-integer (fractional) number of locations along the anisotropic direction, while still allowing the use of thresholds to control when and how many additional locations are sampled.
[0271] Similarly, these arrangements are believed to be new and advantageous in themselves.
[0272] Therefore, according to another aspect of the present invention, a method is provided for performing anisotropic filtering during texture sampling to provide output sampled texture values, which are used when presenting output in a graphics processing system, the method comprising: When using anisotropic filtering to sample textures, output sample texture values are provided for locations 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 the initial number of locations for sampling the texture along the anisotropic direction; A position count threshold is used to provide the number of positions for position count threshold adjustment, the number of positions for position count threshold adjustment being used to sample the texture from the determined initial number of positions along the anisotropic direction, the position count threshold adjustment being used to sample the texture from the determined initial number of positions along the anisotropic direction; The method further includes: Based on the adjusted number of positions according to the position counting threshold, samples or samples are captured along the anisotropic direction 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.
[0273] According to another aspect of the invention, an apparatus is provided for performing anisotropic filtering while sampling a texture to provide output sampled texture values for 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 for locations within the text. Determine the number of locations for sampling the texture along the anisotropic direction, and sample the texture along the anisotropic direction: Determine the initial number of locations for sampling the texture along the anisotropic direction; and A position count threshold is used to provide the number of positions for position count threshold adjustment, the number of positions for position count threshold adjustment being used to sample the texture from the determined initial number of positions along the anisotropic direction, the position count threshold adjustment being used to sample the texture from the determined initial number of positions along the anisotropic direction; The device further includes: A texture sampling circuit, configured to capture samples or samples along an anisotropic direction in the texture based on a position number adjusted according to the position count; 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.
[0274] 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.
[0275] Therefore, for example, the initial number of positions to which the position count threshold is then applied is preferably based on an estimate of the ellipse corresponding to the projection of the sampling point, with respect to which the texture is sampled onto the surface to which the texture is to be applied.
[0276] Most preferably, the initial number of locations to which the position counting threshold is applied is the number of positions for step size adjustment used to sample the texture along the anisotropic direction (preferably determined as described above). Therefore, it is preferable to apply the position counting threshold to adjust to the number of positions to be sampled after any step size adjustment.
[0277] The position count threshold can be used to provide the number of positions to be sampled along the anisotropic direction in any suitable and desired manner, thereby sampling the texture in any suitable and desired manner (the initially determined number of positions to be sampled can be adjusted based on the number of positions (position count) threshold in any suitable and desired manner).
[0278] In a particularly preferred embodiment, when the initially determined number of locations to be sampled is less than or equal to the required number, and the threshold value is higher than the next integer value, the location count threshold is preferably adjusted so that the number of locations to be sampled is set to the next smaller integer value. Therefore, in this case, the number of locations whose threshold is adjusted (location count) will be the next lower integer value of the initially determined number of locations to be sampled.
[0279] On the other hand, when the number of initially determined locations to be sampled exceeds or equals or exceeds the next lower integer number of expected locations, the next lower integer number of locations to be sampled is determined by adding the location count threshold. It is preferable to determine the location count threshold adjustment amount to be sampled based on and using the location number (location count) threshold, which is greater than the next lower integer value (the number of initially determined locations to be sampled).
[0280] Most preferably, the number of locations to be sampled is adjusted to the number of locations to be sampled is set to the next smaller integer value of the initially determined number of locations to be sampled, and the location counting threshold is adjusted to the initially determined number of locations based on the fractional part of the initially determined number of locations to be sampled and the location counting threshold.
[0281] In a particularly preferred embodiment, the number of locations for which the location count threshold to be sampled is adjusted is determined as follows: float frac_sample_count = initial_sample_count - floor( initial_sample_count ); if ( frac_sample_count <= performance_aniso_threshold ) { adjusted_sample_count = floor( initial_sample_count ); } else { adjusted_sample_count = floor( initial_sample_count ) + ((frac_sample_count - performance_aniso_threshold) / (1.0 -performance_aniso_threshold)); } in: initial_sample_counts is the number of initially determined locations to be sampled; performance_ausil_threshold is the location counting threshold; and adjusted_sample_count is the number of locations whose count threshold is adjusted to be sampled.
[0282] Of course, other arrangements are possible.
[0283] Once the number of locations to be sampled is determined, that number of locations should and preferably be sampled appropriately, for example by sampling the next higher multiple of the number of locations after the location count threshold adjustment that exceeds the smaller integer value (i.e., 1 if the number of locations after the location count threshold adjustment is between 1 and 2, and the next lower multiple of 2, where the number of sampled locations after the location count threshold adjustment exceeds 2), and the location interval and / or contribution weight are appropriately set according to the number of sampled locations after the location count threshold adjustment.
[0284] The number of locations (location count) threshold used in these aspects and embodiments of the invention can be any suitable and desired threshold amount. In a preferred embodiment, a specific, preferably selected, preferably predetermined maximum allowable location count threshold can be used. Correspondingly, preferably also or alternatively, it can also be a specific, preferably selected, preferably predetermined minimum location count threshold factor value.
[0285] Most preferably, there exists a specific, preferably selected, and preferably predetermined range of allowable location counting thresholds that can be used. In a preferred embodiment, the allowable location counting threshold falls within (and falls within) the range of 0.000 to 1.000, and most preferably within the range of 0.000 to 0.500.
[0286] A value of 0.000 corresponds to no position count threshold, meaning that additional samples will always be taken for a non-integer determined number of positions to be sampled. This should provide the highest quality sampling (and effectively disable thresholding). The applicant has found that a threshold of 0.500 should not have a significantly adverse effect on the overall sampled texture results.
[0287] While it is possible to use only a single location count threshold, which is always applied to a defined number of locations (location counts) for sampling the texture along the anisotropic direction, in a particularly preferred embodiment, there are multiple different location count thresholds that can be used. Most preferably, multiple different location count thresholds can be used (and one of the multiple different location count thresholds can be selected and used for any given anisotropic filtering operation).
[0288] The location counting threshold can be freely set within an allowed range (and in one embodiment, this is the case). However, in a particularly preferred embodiment, there exists a set of multiple predetermined values within a range that can be set and selected; that is, the location counting threshold can be selected and set to one of N values having a value within a specific, preferably selected, preferably predetermined range (where N is an integer greater than 1).
[0289] Limiting the allowed position count threshold that can be set and used, rather than making it a freely adjustable parameter, simplifies the implementation of these aspects and embodiments of the invention in use. For example, it will facilitate partitioning based on a position count threshold that is implemented as having a constant (based on an appropriate reciprocal of the position count threshold), rather than having to use multiplication in the partitioning hardware. Therefore, this simplifies the implementation of these aspects and embodiments of the invention in hardware.
[0290] Multiple predetermined position counting thresholds should exist, and preferably can be set and selected during use. In a preferred embodiment, two to eight (predetermined) position counting thresholds can be selected and set during use. In a particularly preferred embodiment, four position counting thresholds can be selected and set.
[0291] In a particularly preferred embodiment, at least two of the following position counting thresholds can be selected, and preferably all of the following position counting thresholds: 0.000; 0.125; 0.250; and 0.500.
[0292] Of course, other position count thresholds and position count threshold intervals can be used within the entire allowed range of position count thresholds.
[0293] As will be understood from the above, in a preferred embodiment, the present invention includes selecting a position counting threshold to be applied to a determined number of locations for sampling the texture along an anisotropic direction (and then applying the selected position counting threshold to the determined number of locations for sampling the texture along the anisotropic direction). As described above, most preferably, the applied position counting threshold is selected from a range of allowed position counting thresholds, and most preferably from a set of allowed complex numbers, and preferably from predefined position counting thresholds.
[0294] The position count threshold used for anisotropic filtering operations can be set and selected in any suitable and desired manner and based on any suitable and desired criteria.
[0295] In a preferred embodiment, the location counting threshold is selected based on one or more, and preferably multiple, criteria.
[0296] In a preferred embodiment, the location count threshold is selected based on one or more of the following, and preferably both: (desired) rendering performance and (desired) image quality, and preferably based on the desired optimization and / or trade-off between rendering performance and image quality. For example, and preferably, when image quality is considered a more important factor, a lower location count threshold is preferably set and used. On the other hand, when rendering performance (e.g., based on frame rendering time and / or frame rate) is considered more important, a higher location count threshold can then be set and used to compromise some image quality in order to improve rendering performance.
[0297] Alternatively, a position count threshold based on the use of the texture can be selected (and specifically based on the characteristics of the sampled texture, and preferably on the appearance of the texture). For example, a texture with a smooth gradient and constant color regions should show a reduction in image quality for a given position count threshold.
[0298] In a preferred embodiment, the position count threshold is set and selected by the driver of the graphics processor used to perform anisotropic filtering. The driver may, for example, be configured to select and set the position count threshold for the anisotropic filtering operation based on the required graphics processing workload (e.g., the nature of the graphics processing output being generated, such as the application requesting graphics processing).
[0299] In a particularly preferred embodiment, the position counting threshold can be, and preferably is, selected and set by an application requiring graphics processing (and therefore especially, texture mapping), where, for example, the driver, the position counting threshold is then set according to the position counting threshold indicated by the application. In this case, the driver can simply follow and use the position counting threshold requested by the application, or the driver can be configured, for example, to potentially overtake any position counting threshold requested by the application, such as based on the processing power or conditions of the graphics processor to perform anisotropic filtering.
[0300] In a preferred embodiment of this type, the location counting threshold is exposed to an API (Application Programming Interface), allowing the application programmer to set a location counting threshold or threshold for the application.
[0301] For example, there may be a default location counting threshold, which is set by the driver, but the application can set a lower or higher location counting threshold during use (but not higher than the maximum allowed location counting threshold or lower than the minimum allowed location counting threshold).
[0302] Of course, other arrangements are possible.
[0303] The selected position count threshold to be used can be fed to the texture mapping process (and texture mapping device) in any suitable and desired manner. This is preferably done by indicating the position count threshold as appropriate state information, for example in a descriptor, stored in memory, used for texture sampling operations, or via I / O registers, etc.
[0304] The texture sampling process (texture sampling device) then reads state information (e.g., descriptors) to determine the position count threshold to use, and then uses that position count threshold accordingly.
[0305] Therefore, in a particularly preferred embodiment, the method of the present invention includes (and the texture mapping device is accordingly configured to) determine a position counting threshold to be used based on an indication provided to the texture mapping operation, and then apply the position counting threshold thus determined to a determined initial number of positions of the texture sampled along the anisotropic direction to determine the number of positions of the texture sampled along the anisotropic direction, etc.
[0306] Correspondingly, according to another aspect of the present invention, a method is provided for performing anisotropic filtering during texture sampling to provide output sampled texture values, which are used when presenting output in a graphics processing system, the method comprising: When sampling the texture to provide output sampled texture values, select the position count threshold to use for anisotropic filtering; Provides an indication of the selected location counting threshold to be used when sampling the texture to a texture sampling operation; and Performing a texture sampling operation to sample the texture using anisotropic filtering to provide output sampled texture values for locations within the texture, the texture sampling operation using anisotropic filtering to sample the texture includes: Determine the number of locations for sampling the texture along the anisotropic direction, and acquire samples in the file along the anisotropic direction; and When the number of determined locations along the texture of the sampled sample is a non-integer value that exceeds the smaller integer value of the indicated location count threshold, the sample is taken along the anisotropic direction in the texture at the number of the next higher 2 locations corresponding to the determined non-integer locations to be sampled. When the determined number of locations along the anisotropic direction of sampling the texture does not exceed the smaller integer value when the texture is obtained in the texture, at least through the indicated location count threshold, samples or samples are taken in the texture at multiple locations corresponding to the next smaller integer value along the anisotropic direction. The method further includes: 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.
[0307] According to another aspect of the invention, a system is provided for performing anisotropic filtering when sampling a texture to provide output sampled texture values, which are used when presenting output in a graphics processing system, the system comprising: A texture sampling device configured to perform anisotropic filtering while sampling samples to provide output sampled texture values; Position counting threshold selection circuit, wherein the position counting threshold selection circuit is configured to: When sampling textures to provide output sampled texture values using anisotropic filtering, select the position count threshold to use for anisotropic filtering; and Provides an indication of the selected location counting threshold to be used when sampling the texture to the texture sampling device; in: The texture sampling device includes: The number of locations for the sample determination circuit is configured to sample the texture using anisotropic filtering to provide output sampled texture values for locations in the texture, determine the number of locations for sampling the texture along the anisotropic direction, and sample the texture along the anisotropic direction. A texture sampling circuit, configured to sample along anisotropic directions in the texture, wherein the texture sampling circuit is configured to: When the determined number of locations along the texture to sample the texture using the anisotropic direction of the sample is a non-integer value that exceeds the smaller integer value of the indicated location counting threshold, samples are collected along the anisotropic direction in the texture at the next higher position of 2 corresponding to the determined non-integer position to be sampled; When the determined number of locations along the anisotropic direction of sampling the texture does not exceed the lower integer value when the amount of sampling along the texture will not exceed the lower integer value at least by the indicated position count threshold, samples or samples are taken along multiple locations in the texture corresponding to the next lower integer value. 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.
[0308] Correspondingly, according to another aspect of the present invention, a method is provided for performing anisotropic filtering during texture sampling to provide output sampled texture values, which are used when presenting output in a graphics processing system, the method comprising: When sampling the texture to provide output sampled texture values, select the position count threshold to use for anisotropic filtering; Provides an indication of the selected location counting threshold to be used when sampling the texture to a texture sampling operation; and Performing a texture sampling operation to sample the texture using anisotropic filtering to provide output sampled texture values for locations within the texture, the texture sampling operation using anisotropic filtering to sample the texture includes: 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 the initial number of locations for sampling the texture along the anisotropic direction; The indicated position count threshold is used to provide the number of positions for position count threshold adjustment, the number of positions for position count threshold adjustment being used to sample the texture from the determined initial number of positions along the anisotropic direction, the position count threshold adjustment being used to sample the texture from the determined initial number of positions along the anisotropic direction; Based on the adjusted number of positions according to the position counting threshold, samples or samples are captured along the anisotropic direction 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.
[0309] According to another aspect of the invention, a system is provided for performing anisotropic filtering when sampling a texture to provide output sampled texture values, which are used when presenting output in a graphics processing system, the system comprising: A texture sampling device configured to perform anisotropic filtering while sampling samples to provide output sampled texture values; and Position counting threshold selection circuit, wherein the position counting threshold selection circuit is configured to: When sampling textures to provide output sampled texture values using anisotropic filtering, select the position count threshold to use for anisotropic filtering; and Provides an indication of the selected location counting threshold to be used when sampling the texture to the texture sampling device; in: The texture sampling device includes: The sample determination circuit is configured to sample the texture using anisotropic filtering to provide output sampled texture values for locations within the text. Determine the number of locations for sampling the texture along the anisotropic direction, and sample the texture along the anisotropic direction: Determine the initial number of locations for sampling the texture along the anisotropic direction; and The indicated position count threshold is used to provide the number of positions for position count threshold adjustment, the number of positions for position count threshold adjustment being used to sample the texture from the determined initial number of positions along the anisotropic direction, the position count threshold adjustment being used to sample the texture from the determined initial number of positions along the anisotropic direction; A texture sampling circuit, configured to capture samples or samples along an anisotropic direction in the texture based on a position number adjusted according to the position count; 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.
[0310] 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.
[0311] Therefore, for example, the location counting threshold used is preferably selected and set by the application that requires graphics processing (and therefore texture sampling) and / or by the graphics processor's driver, and is preferably indicated as a texture sampling operation (texture sampling device) as part of the state information of the graphics processing, for example in a suitable descriptor that can be read by the texture sampling operation (texture sampling device).
[0312] Similarly, the location counting threshold used is preferably selected from a range of allowed location counting thresholds, and most preferably from a set of allowed complex numbers, and preferably from a predefined location counting threshold.
[0313] Similarly, the texture mapping device is preferably a texture mapping circuit (texture mapping) of a graphics processor (graphics processing unit (GPU)).
[0314] Once the number of locations for sampling the texture based on the location count threshold is determined, samples should be acquired based on the number of locations, for example, and preferably in one of the ways described above, along the anisotropic direction in the texture (e.g., in each mipmap to be sampled).
[0315] 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.
[0316] 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.)
[0317] 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.
[0318] In a particularly preferred embodiment, the invention is implemented in 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, to sample the textures at the level of detail as described above.
[0319] Therefore, the present invention extends to and preferably includes texture mapping circuitry for a graphics processor, which includes any aspect of the present invention.
[0320] 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.
[0321] Therefore, it may, and preferably includes, one or more of the following: a texture filtering circuit for performing texture filtering operations (and may at least perform anisotropic filtering 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 text selection circuit (stage); and an output result providing circuit (stage).
[0322] 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.
[0323] 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.
[0324] Of course, other arrangements are possible.
[0325] 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.
[0326] 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.
[0327] 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 (processor). Thus, for example, a graphics processor may include raw setup circuitry, a quasi-grating (circuit), and / or a renderer (circuit). Alternatively or concurrently, the graphics processor may be capable of performing ray tracing and / or hybrid ray tracing.
[0328] 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).
[0329] 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.
[0330] 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).
[0331] 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.
[0332] A data or graphics processing system may include a memory or storage device (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 device may be operable to store, and may store, a set of texture icons used in texturing operations.
[0333] 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.
[0334] 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.
[0335] 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.
[0336] 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.
[0337] 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.
[0338] 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.
[0339] 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.
[0340] Those skilled in the art will also understand that all described embodiments of the invention may, where appropriate, include any one or all of the features described herein.
[0341] 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.
[0342] 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.
[0343] 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.
[0344] 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.
[0345] 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
[0346] Implementations of the technology described herein will now be described by way of example only, with reference to the accompanying drawings, wherein: Figure 1 The principle of anisotropic filtering when sampling files is illustrated; Figure 2 An example of sampling two mipmap levels for anisotropic text is shown; Figure 3 An exemplary graphics 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 shown 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 the number of sample positions when performing anisotropic filtering in an embodiment of the present invention; and Figure 8A and 8B Examples of anisotropically sampled textures are shown in embodiments of the present invention.
[0347] Similar reference numerals are used for similar features in the accompanying drawings (where appropriate). Detailed Implementation
[0348] Several embodiments of the present invention will now be described in the context of graphics processing systems.
[0349] Figure 3 An exemplary graphics processing system 1 in which the present invention and this embodiment can be implemented is shown.
[0350] Figure 1The exemplary graphics processing system shown includes a host processor that includes a central processing unit (CPU) 1, 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.
[0351] In 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 monitor 54. To do this, the application 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 controller 55 will then read those frames into the buffer for the monitor, where they are then read out and displayed on the display panel of the monitor 54.
[0352] Figure 4 It shows that it can be used Figure 3 An exemplary graphics processor (graphics processing unit (GPU)) 100 used in a data processing system is capable of performing texture mapping.
[0353] like Figure 4 As shown, GPU 100 includes data processing circuitry that implements a 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).
[0354] GPU 100 further includes a texture mapper 110, and memory 108 will also store, in particular, the graphics textures used by GPU 100 when performing texture mapping operations.
[0355] In this system, the cracker 102 esterifies the input primitives into individual graphic fragments for processing. To do this, the rasterizer 102 esterifies the primitives to sampled locations representing the rendered output and generates graphic fragments representing the appropriate sampled locations for the rendered primitives. Each fragment can represent a single sampled location or a set of multiple sampled locations. The fragments generated by the cracker 102 are then sent to the fragment shader (rasterizer) 104 for shading.
[0356] Fragment shader 104 executes the fragment shader program issued by chromatograph 102 to render (shade) the fragments. The fragments are processed using execution threads in the shader core, where threads of the shader program for processing the fragments are executed. Threads are executed for each sampling location to be shaded.
[0357] The shader program may include texturing instructions for texture mapping operations that require execution by the texture mapper 110.
[0358] When the fragment shader 104 encounters a texturing instruction, it sends the texturing instruction from the fragment shader 104 to the texture mapper 110, requesting the texture mapper 110 to perform the texturing operation.
[0359] When requested by fragment shader 104 to perform a texture mapping operation, texture mapper 110 reads a texture from memory 108 (if needed), performs the texture mapping operation, and returns (e.g., RGB color) values from the texture to fragment shader 104 for use when occluding the fragment in question and the sampling location.
[0360] Then, the “shading” fragment sampling position from fragment shader 104 is stored as part of the output in buffer 106, such as in memory 108, for example, for subsequent post-processing or display.
[0361] Figure 5 An exemplary texture mapper (texture mapping device) 110 is shown in more detail.
[0362] like Figure 5 As shown, the texture mapper 110 includes multiple processing stages (circuits), including an input request stage (circuit) 200, which accepts texture mapping operation requests from the renderer (e.g., Figure 4 (Fragment shader 104 in the image). This is followed by a coordinate calculation stage (circuit) 201, which, for example, will convert any coordinates included in the texture mapping operation request into appropriate typical coordinates used between 0.0 and 1.0 when sampling the texture.
[0363] Then, the Level of Detail (LOD) calculation stage (circuit) 202 can determine the level of detail to be sampled for the texture mapping operation (this selects the mipmap level to use and how to filter between them if the texture is in mipmap form). For example, if the fragment shader program itself can explicitly indicate the level of detail to use, this level of detail calculation may not be needed, or the texture may not be stored in mipfilm form.
[0364] Then, the texel selection stage (circuit) 203 uses the coordinates determined by the coordinate calculation stage 201 to determine the actual texture (texture data element) in the texture (and, if appropriate, the mipmap level determined in the texture) for the texture mapping operation.
[0365] Then the required text (its data) is obtained through the cache lookup stage (circuit) 204.
[0366] like Figure 5 As shown, although texture data is stored in memory system 108, when texture mapper 110 needs texture data, the texture data required for the textureization operation is retrieved from memory 108, where textured data is stored. The textured data storage is first loaded into the texture cache 205 of texture mapper 110, where texture mapper 110 then reads the texture data via cache lookup circuitry 204. The texture data is then used from the texel cache 205.
[0367] like Figure 5 As shown, texture mapper 110 may accordingly include a text loader (text element loading circuit) 206, operable to load texture data from textures stored in memory 108 for storage in text cache 205. A decompressor (decoder) stage (circuit) 207 may also be present, which may decompress (decode) the compressed (encoded) texture stored in memory system 108 before storing the text element values in text element cache 205.
[0368] Once the required text (text data values) has been retrieved from the text cache 205, it is used in the desired texture filtering operation through the texture filtering stage (circuit) 208 to generate appropriate output for the sampled texture locations (coordinates). The output is then appropriately packaged and returned to the fragment shader through the output stage (circuit) 209. The texture filtering circuit 208 can, for example, use the retrieved text 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 results.
[0369] This embodiment particularly relates to the case where the texture mapper 110 performs anisotropic filtering to sample the texture. In this case, such as Figure 2 As shown, samples can be obtained in each of the two mipmap levels (including more detailed and less detailed mipmap levels) for the location along the defined anisotropic direction.
[0370] Figure 6 The operation of texture mapper 110 in this embodiment is shown.
[0371] like Figure 6 As shown, when anisotropic filtering is to be performed (step 70), the texture mapper first determines appropriate parameters for the elliptical footprint, which actually corresponds to the projection of the sampling point onto the surface on which the texture is being applied (step 71). The manner in which this is accomplished in the embodiments of the invention will be described in more detail below.
[0372] Then, using the determined elliptical footprint (parameters of the ellipse), the level of detail (LOD) for sampling the texture, the anisotropic direction of the texture to be sampled, and the "anisotropy degree," which represents the number of locations where samples are taken along the anisotropic direction in the texture (step 72). Again, the manner in which this is accomplished in the embodiments of the invention will be described in more detail below.
[0373] Once the level of detail, anisotropy direction, and anisotropy degree of the sample texture are determined, a mipfilm for the sample is selected for the texture (step 73).
[0374] The mipfilm of the sampled texture is selected based on the level of detail of the sampled texture, and in the case of a detail score level, a mipmap level corresponding to a more detailed level than the determined level of detail (i.e., including a higher resolution version of the texture) will be selected, and another mipmap level will include a less detailed (lower resolution) version of the texture than the determined level of detail.
[0375] In this embodiment, while the mipmap level used to determine which mipmap level for a sample can be the “final” level of detail determined from the determined ellipse parameters, it is preferable, in the case that any adjustments (such as rounding, bias, clamping, etc.) have been applied, to be based on the level of detail determined from the initially determined “original” level from the ellipse parameters, and any detail bias and / or clamping levels to be applied, and any adjustments to be applied (e.g., determined from the original level of detail and any level bias bias and clamping levels).
[0376] Then determine how many locations should be sampled in each mipmap (step 74).
[0377] The number of sampling locations in each mipmap level can be simply determined as (equal to) the anisotropy determined by the elliptic parameters, or it can be based on the determined anisotropy, but with some potential modifications. For example, the number of sampling locations in each mipmap level can be determined based on the determined number of “base” locations of the sample (i.e., the “base” anisotropy) from the elliptic parameters and the level of detail of the texture being sampled.
[0378] The same number of locations along the anisotropic direction can be taken in all sampled mipmap levels, or, if desired, a different number of samples can be taken in each mipmap level, such as taking fewer locations along the anisotropic direction in a more detailed mipmap level.
[0379] Once the number of positions along the anisotropic direction has been taken for each mipmap level, a sample of a determined number of positions is obtained in the selected mipfilm (step 75).
[0380] like Figure 2 As shown, in this embodiment, the sampling locations are spaced apart along the texture along the anisotropic direction (along the length of the major axis of the area covered by the projected ellipse). In this embodiment, a single bilinear sample is taken at each location along the anisotropic direction to be sampled. (However, if desired, multiple (e.g., bilinear) samples (e.g., "supersamples" at each location to be sampled) can be acquired for each location along the anisotropic direction.)
[0381] It should be understood that in this implementation, it can be determined whether sampling should be performed for non-integer positions within the mipmap level. In this case, the number of sampled positions can simply be rounded to the nearest integer (or the nearest highest integer, or the nearest lowest integer, as needed).
[0382] However, where the texture mapper supports taking fractional samples from the texture, this operation is preferably used to sample at desired non-integer positions within the mipmap level or level in question.
[0383] Once samples have been taken from the selected mipmap level, those samples (combined) are used to provide output sampled texture values for use by the graphics processor (step 76).
[0384] In this implementation, for each individual mipmap level, the samples collected in the mipmap level are appropriately combined based on the sample count (number of locations to be sampled) determined in the mipmap level in question to provide a combined sample value for the mipmap level in question.
[0385] Therefore, for each mipmap level, a weighted average of the samples is generated (based on the distance of the sample (location) from the center of the major axis of the projected ellipse along the anisotropic direction).
[0386] Then, the resulting values for each mipmap level are linearly interpolated based on the fractional LOD value (i.e., based on the distance of the mipmap level in question from the actual level of detail that is expected to be sampled at the quality control) to provide the texture values of the final, overall output sample.
[0387] Typically, the weighting of samples based on their distance from the center of the projected ellipse can follow, for example, a linear function of the distance to the ellipse center, or more complex features (weight distributions) can be used, such as a Gaussian function or a certain approximation of a Gaussian function. Similar arrangements can be used for interpolation between mipmap levels.
[0388] Of course, other arrangements are possible.
[0389] Once the output sampled texture value has been determined, it is returned to the fragment shader to be used (step 77).
[0390] As discussed above, this embodiment uses the estimated elliptical projection of the sampling points (pixels) to which the texture will be applied to determine the texture being applied to the surface. Specifically, it determines how many samples are taken from the texture and from which these samples should be taken.
[0391] In embodiments of this invention, this is based on and according to the techniques described below: Paul S. Heckbert, Fundamentals of texting, Mapping and Image Warping (Masters), 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.
[0392] 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:
[0393] This linear transformation converts the circle in the first coordinate system into an ellipse in the second coordinate system. The ellipse is centered at the source (0,0) and passes through the points (ux, vx) and (uy, vy) (and these points correspond to the parameter vauest with a 90-degree phase difference).
[0394] This means that in the first coordinate system (the screen), the point (ux, vx) can be viewed as the texture coordinates of the adjacent pixel to the right, and (uy, vy) can be viewed as the texture coordinates of the adjacent pixel below the "current" pixel on the screen, assuming the "current" pixel has texture coordinates (0,0) at (0,0). (In other words, (ux, vx) are the partial derivatives of the texture coordinates on the screen, and (uy, vy) are the partial derivatives of the texture coordinates in the Y direction.)
[0395] Then, the linear transformation matrix M is estimated by calculating (ux, vx) = Tx - t0 (where Tx is the texture coordinate of the adjacent pixel in the x direction and t0 is the texture coordinate of the current pixel), and (uy, vy) = Ty - t0.
[0396] Based on the linear transformation matrix M, the implicit elliptic coefficients A, B, C, D, E, and F can be found. (The implicit equation of conc (where the ellipse is a class) 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 typical cone shape: Ax^2 + Bxy + Cy^2 = F
[0397] Q is an implicit matrix of quadratic form and is defined as follows:
[0398] 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 fundamental vectors of the ellipse (ux, vx) and (uy, vy) are not necessarily perpendicular to each other (and in fact, many different fundamental vectors describe the same ellipse), a set of fundamental 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).
[0399] By using orthogonal basis vectors to determine a new linear transformation matrix M, the fundamental vectors corresponding to the minor and major axes of the ellipse are found from the implicit elliptic coefficients a, B, C, and F. This matrix can be written in the following form:
[0400] As mentioned above:
[0401] Therefore, in this case, Q can be found to be:
[0402] Here, Λ is diagonal and R is orthogonal. Λ and R are then used to extract Q from the cone matrix (known from the preceding calculations). For this purpose, the diagonal form of Q is determined:
[0403] Where A is a diagonal matrix Q and column S are the corresponding eigenvectors. The eigenvectors are chosen to have unit length so that R = S and Λ -2 = A can be equal.
[0404] The eigenvalues of a 2 × 2 symmetric matrix Q are:
[0405] This means that matrix M can be found:
[0406] in: p = A - C q = A + C t = sgn( p ) sqrt( p^2 + B^2 ) This matrix M assumes F=1, but as mentioned above, F in the surface is: F = (ux vy - uy vx)^2.
[0407] Therefore, the matrix M is multiplied together with F to find the orthogonal basis vectors for the actual correct scaling of the ellipse: 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 orthogonal set of derived vectors.
[0408] From this, we can see that the length of the carrier 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)) Anisotropy is: aniso_degree = major_axis_radius / minor_axis_radius To determine this, we need to determine which lx and ly are the major and minor axes. It is known that q must be positive and t can be positive or negative. If t is positive, then q must be the major axis, and lx must be the minor axis. If t is negative, then lx must be both the major and minor axis. Therefore, we can define: 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 ) The anisotropy degree, anisotropy direction, and level of detail are determined based on the principles of the techniques described above in this implementation scheme.
[0409] Therefore, for example as described above (step 71, Figure 6 The appropriate parameters are determined for the elliptical footprint corresponding to the position projection onto the surface to which the texture is to be applied. In this embodiment, this operation determines the length and direction of the major axis and the length of the minor axis of the elliptical footprint in the texture's coordinate system, using the derivative of the texture coordinates to be sampled.
[0410] Then, using the thus determined elliptical footprint (parameters of the elliptical footprint), the anisotropy degree (the number of locations for sampling the texture), the anisotropy direction (the direction along which the vector takes samples in the texture), and the level of detail for the sample texture (thus determining which mipmap the texture corresponds to for the sample) (step 72, Figure 6 ).
[0411] In this implementation, the “final” level of detail of the texture to be sampled is determined from the determined length of the minor axis of the projected ellipse of the sampling point, as well as any level of detail deviation and high and low detail fixture levels that have been set, and any level of detail adjustment, such as rounding, applied based on the specified “mipmap mode”.
[0412] The anisotropic direction of the sample is used to determine the major axis (direction) of the elliptical area occupied by the sampling point in the texture.
[0413] Anisotropy is initially determined at least as the ratio of the length of the major axis of the estimated projection ellipse of the sampling point to the length of the minor axis of the projection ellipse of the sampling point (and as a representation of the expected "original" position of the sample in the "original" level determined based on the projection ellipse).
[0414] As described above, once the level of detail for the sample texture, anisotropy direction, and anisotropy degree is determined, a mipfilm for the sample is selected for the texture (step 73). Figure 6The mipmap of the sample is selected based on the determined “final” detail value, and in the case of a final_lod score, a mipmap level will correspond to a more detailed level than the final detail level (i.e., including a higher resolution version of the texture), and another mipmap level will include a less detailed (lower resolution) version of the texture than the final detail level.
[0415] Then determine how many locations should be sampled in each mipmap (step 74). Figure 6 Compared to a less detailed mipmap level, the same number of samples can be taken at each mipmap level, or a larger number of samples can be obtained at a more detailed mipmap level. The number of locations to be sampled at each mipmap level is preferably based on a determined number of locations to be sampled, and for example, preferably, at the actual level of detail to be sampled, such that twice as many locations are sampled at a more detailed mipmap level compared to a less detailed mipmap level.
[0416] Once the number of locations along the anisotropic direction has been taken for each mipmap level, a sample of a determined number of locations is collected within the mipmap level in question (step 75). Figure 6 ).
[0417] Once more and more detailed samples have been taken at the mipmap level, those samples are used (combined) to provide output sampled texture values for use by the graphics processor (step 76). Figure 6 The output sampled texture value used.
[0418] In this implementation, for each individual mipmap level, the samples collected in the mipmap level are appropriately combined according to the sample count (number of locations to be sampled) determined in the mipmap level in question to provide a combined sample value for the mipmap level in question.
[0419] Therefore, for each mipmap level, a weighted average of the samples is generated (based on the distance of the sample (location) from the center of the major axis of the projected ellipse along the anisotropic direction).
[0420] Then, the resulting values for each mipmap level are linearly interpolated based on the fractional LOD value (i.e., based on the distance of the mipmap level in question from the actual level of detail that is expected to be sampled at the quality control) to provide the texture values of the final, overall output sample.
[0421] Typically, the weighting of samples based on their distance from the center of the projected ellipse can follow, for example, a linear function of the distance to the ellipse center, or more complex features (weight distributions) can be used, such as a Gaussian function or a certain approximation of a Gaussian function. Similar arrangements can be used for interpolation between mipmap levels.
[0422] Of course, other arrangements are possible.
[0423] Once the output sampled texture value has been determined, this value is returned to the fragment shader used for processing (step 77). Figure 6 ).
[0424] This embodiment specifically relates to determining the number of locations along the anisotropic direction, wherein samples are collected in the texture when anisotropic filtering is performed. As described above, in this embodiment, the initial (base) number of locations for sampling the texture (anisotropy) is determined from ellipse parameters, and preferably as the ratio of the length of the major axis of the estimated projected ellipse of the sampling point to the length of the minor axis of the projected ellipse of the sampling point.
[0425] However, in this embodiment, instead of simply using the initially determined anisotropy as the number of locations to sample the texture when performing anisotropic filtering, a step factor corresponding to and representing the interval along the anisotropic direction between the locations to be sampled is applied to the initially determined anisotropy, and then the step-adjusted anisotropy (number of locations to be sampled) is provided.
[0426] In this implementation, this is done by dividing the anisotropy degree initially determined from the ellipse parameters by the desired step size factor. This can then be used to reduce the number of locations actually sampled when anisotropic filtering is performed.
[0427] In this regard, the applicant has recognized that by using an increased interval between sampling locations along the anisotropic direction, the number of actual sampling locations will be reduced, thereby reducing the cost of the anisotropic filtering process.
[0428] The step size factor used in this regard is set to be a multiplier applied to the interval between the sampled positions relative to the position sampled along the anisotropic direction, where there is a single texel-to-texel distance.
[0429] Therefore, with a step size of 1, the sampling positions will be spaced apart by one texture along the length of the major axis of the elliptical area projected in the texture. For step sizes greater than 1, the sampling positions will be spaced apart by multiple corresponding texel-to-texel distances along the length of the major axis of the elliptical area projected in the texture.
[0430] In this implementation, four step length factors can be used: 1.0000, 1.0625, 1.1250, and 1.2500. Of course, other step length factors can be used.
[0431] The step size factor used is selected by the driver for the graphics processor and / or the application that requires graphics processing, and is indicated as a texture mapper, for example, as part of the appropriate descriptor for the texture mapping operation.
[0432] The texture mapper then divides the initially determined anisotropy by an indicated step factor to provide the number of positions for step-adjustment sampling along the anisotropic direction, and then samples the positions along the anisotropic direction. (The initially determined anisotropy by step factor is implemented as a multiplication with a constant (1 / step factor) to avoid using partitioning hardware.)
[0433] The number of positions for step size adjustment is then sampled along the anisotropic direction at intervals corresponding to the set step size factor. This is achieved by multiplying the unit anisotropic vector indicating the anisotropic direction by the step size factor to appropriately offset each position of the sample with the desired step size.
[0434] Figure 8A and 8B This is illustrated. Figure 8A The number and spacing of positions 90 sampled along the anisotropic direction 91 in texture 92 using a step size factor of 1 are shown. Figure 8B By comparing the position 93 shown, position 93 will obtain a step factor of 1.5 along the anisotropic direction 91 in the texture.
[0435] from Figure 8A and 8B The comparison shows that when a step length factor of 1.5 is used, the sampled positions are further spaced along the anisotropic direction 91, and correspondingly, the number of positions 93 along the anisotropic direction 91 is smaller (sampling four positions 93 with a step length factor of 1.5, while six positions 90 are sampled with a first-order length factor of 1).
[0436] It should be understood that, in embodiments of the present invention, it can be determined that samples should be taken for non-integer locations in the texture (in one or both of the two mipmap levels). In this case, the number of sampled locations can simply be rounded to the nearest integer (or the nearest highest integer, or the nearest lowest integer, as needed).
[0437] However, in the preferred embodiment, the number of non-integer (fractional) locations to be sampled is not only rounded to an integer value, but the texture mapper also supports obtaining samples of fractional (non-integer) locations along the anisotropic direction.
[0438] Therefore, when the number of determined fractional (non-integer) positions is between 1 and 2, two positions with equal contribution weights of 0.5 are sampled, wherein the interval between the two sampled positions varies (and is set) according to (based on) the actual number of fractional (non-integer) positions to be sampled (and specifically, gradually increases as the number of positions to be sampled increases from 1 to 2 (until they are (just) separated by an appropriate step factor interval (e.g., texel interval multiplied by step factor)) when exactly two positions are to be sampled).
[0439] On the other hand, for scores greater than 2, the number of sampling locations (location counts) is obtained, and then the next higher number of locations corresponding to the number of sampling locations (location counts) for the determined scores (non-integers) is obtained, spaced along the anisotropic direction by an appropriate step factor interval (e.g., texel intervals multiplied by the step factor, but their contribution (interpolation) weights vary based on and take into account the actual determined number of scores (determined location counts) of the locations to be sampled).
[0440] Specifically, since the number of locations to be sampled exceeds a given multiple of 2, two additional locations will be sampled, meaning two extra locations will be added at each end beyond the locations that will be sampled at multiples of 2. These new “outer” locations being sampled have their contribution weights gradually increasing from 0, as the number of fractions of locations to be sampled (location count) increases from multiples of 2 at the bottom to the next higher multiple of 2.
[0441] Correspondingly, the contribution (interpolation) weight of the “internal” (existing) location being sampled gradually decreases as the location’s score (location count) increases from a lower multiple of 2 to the next higher multiple of 2.
[0442] Therefore, for the number of locations to be sampled between 2 and 4, two new locations are then added to either side of the two existing locations to be sampled, since the number of locations exceeds two (intervals of an appropriate step factor (e.g., texel interval multiplied by step size multiplied by step factor)), but the interpolation (contribution) weight based on the actual determined number of locations above 2 will be (and such that in the case of 2, the interpolation weight of the additional (outer) locations will actually start at 0), and will gradually increase as the number of locations to be sampled increases (for a location count of 1 / 4).
[0443] Correspondingly, as the position count increases from 2 to 4, the interpolation (contribution) weight of the initial (inner) two positions gradually decreases (from ½ to ¼) to allow for the contribution (weighing) of additional positions as the number of positions to be sampled increases (this will help provide a smoother transition since the position count is above 2).
[0444] The table below illustrates the interpolation weights and distances between sample locations, where the number of locations to be sampled increases from 1 to 6 as used in embodiments of the invention (in this table, "sample count" corresponds to the number of sample locations after the step factor has been applied, and the "sample distance" value will be multiplied by the step factor before sampling):
[0445] (Note that the sample location indices (-2.5, -1.5, -0.5, 0, 0.5, 1.5, 2.5) in this table are because the sampling locations are centered on the ellipse and spaced apart by an appropriate step factor (e.g., the texel interval multiplied by the step factor).)
[0446] Note from the table that as the interpolation weight of the "external" location (sample) gradually increases, the interpolation weight of the "internal" location (sample) gradually decreases, in order to provide a smoother transition for the increase in sample count (number of sample locations).
[0447] In these implementations, the sample count will be, for example, the number of “step-adjusted” positions of the samples as discussed above, determined by applying a step factor to the positions of a determined initial number of “bases” to be sampled for the texture (as described above).
[0448] As long as the number of locations to be sampled exceeds a given integer value (a multiple of 1 or 2, where appropriate), additional external locations can be sampled in the manner described above.
[0449] However, in a particularly preferred embodiment, when sampling a fraction (non-integer) number of locations, instead of increasing the number of locations sampled to the next higher multiple of 2 for all non-integer (fraction) numbers of locations to be sampled, when the determined (fraction) (non-integer) number of locations to be sampled exceeds 1 or correspondingly exceeds a threshold amount, the number of locations sampled is only increased to the next higher multiple.
[0450] Therefore, in this case, when the determined number of locations for the sample texture is between 1 and 2, one location will be sampled until the determined number of locations exceeds 1 plus a threshold, at which point two locations will be sampled. Correspondingly, between the determined number of locations to be sampled, two locations will be sampled until the determined number of locations is greater than 2 plus a threshold, at which point four locations will be sampled. When the determined number of locations is between 4 and 6, four locations will be sampled until the determined number of locations exceeds 4 plus a threshold, at which point six locations will be sampled, and so on.
[0451] To facilitate this, in this embodiment, the driver for the graphics processor and / or the application requiring graphics processing can set a position count threshold, which is then used to adjust the position count threshold from an initially determined step size, the number of positions to be sampled along the anisotropic direction, and then sample the number of positions adjusted along the anisotropic direction accordingly (and in the case that the number of positions adjusted by the position count threshold is sampled, and in the case that the number of positions to be sampled by the number of positions adjusted by the position count threshold is a non-integer (fractional) number), wherein sampling is performed in the manner described above.
[0452] In this embodiment, the location counting threshold can be set to: 0.000; 0.125; 0.250; and 0.500, and the number of locations to be sampled based on the location counting threshold adjustment is determined as follows: float frac_sample_count = initial_sample_count - floor( initial_sample_count ); if ( frac_sample_count <= performance_aniso_threshold ) { adjusted_sample_count = floor( initial_sample_count ); } else { adjusted_sample_count = floor( initial_sample_count ) + ((frac_sample_count - performance_aniso_threshold) / (1.0 -performance_aniso_threshold)); } in: initial_sample_counts is the number of initially determined locations to be sampled (in this implementation, the number of locations to be sampled with step size adjustment). performance_ausil_threshold is the location counting threshold; and adjusted_sample_count is the number of locations whose count threshold is adjusted to be sampled.
[0453] Once the number of locations to be sampled for the location count threshold adjustment has been determined, the locations are sampled in the manner described above for the number of locations to be sampled, i.e., by sampling one or more of two locations, i.e., by sampling two locations where the number of locations to be sampled for the location count threshold adjustment exceeds a lower integer value (i.e., 2 if the number of locations to be sampled for the location count threshold adjustment is between 1 and 2, where the number of locations to be sampled for the location count threshold adjustment exceeds 2), and the location interval and / or contribution weight are appropriately set based on the number of locations to be sampled for the location count threshold adjustment, for example as illustrated in the table above.
[0454] As will be understood from the above, in a preferred embodiment of the invention, at least when performing anisotropic filtering, an initial anisotropy will be determined, but when performing anisotropic filtering, the initial anisotropy (the number of positions sampled along the anisotropic direction) will be determined, and then modified (potentially) by first applying a step size factor to it, and then the initial anisotropy will be adjusted by applying a position count threshold to the step size factor, thereby determining the actual number of positions sampled along the anisotropic direction.
[0455] Figure 7 This is illustrated.
[0456] like Figure 7 As shown, the initial anisotropy degree based on the elliptical projection of the sampling points will be determined (step 80).
[0457] The indicated step size factor 81 is then applied to the determined initial anisotropy (by dividing the initially determined anisotropy by the step size factor (step 82)).
[0458] The anisotropy of the step size factor adjustment is then further adjusted by applying a position count threshold 83 (as described above) (step 84).
[0459] The anisotropy degree adjusted by the position count threshold is then used as the number of positions of the sample along the anisotropic direction.
[0460] like Figure 7 As shown, once the number of locations to be sampled and the location count threshold adjustment is determined, the interval of those locations along the anisotropic direction is determined using a step factor 81 (as described in step 85).
[0461] Then, the determined number of sampling locations are sampled at the determined intervals (step 86).
[0462] As described above, in the preferred embodiment, operation in the manner of the invention uses and supports a step length factor and a position count threshold. However, it is also possible to use and apply only one or more of those factors when performing anisotropic filtering (and in other preferred embodiments, is performed). In a preferred embodiment, the texture mapper and the anisotropic filtering process can be optionally configured to use one or both of the step length factor and the position count threshold when performing anisotropic filtering (e.g., by appropriately setting the values of the step length factor and the position count threshold).
[0463] As will be understood from the above, the present invention, in its preferred embodiments, can at least 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 locations within the texture: Determine the number of locations along the anisotropic direction in which samples will be acquired from the texture; and When the number of determined positions of the texture to be sampled along the anisotropic direction in which samples are to be obtained is a non-integer value that exceeds a smaller integer value by more than a threshold amount, samples are obtained along the anisotropic direction in the texture corresponding to the next larger multiple of 2 of the determined non-integer number of positions to be sampled. When the number of determined positions of the texture to be sampled along the anisotropic direction in which samples are to be obtained does not exceed the smaller integer value at least the threshold amount, one or more samples corresponding to the smaller integer value are obtained along the anisotropic direction in the texture. The method further includes: 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 of claim 1, wherein when the number of non-integer positions to be sampled is between 1 and 2, the smaller integer value is 1, and when the number of non-integer positions to be sampled is greater than 2, the smaller integer value is a multiple of the next smaller 2.
3. The method according to claim 1, wherein: Determining the number of locations in the texture to be sampled along the anisotropic direction in which samples will be acquired includes: Determine the initial number of locations to sample the texture along the anisotropic direction; The number of positions to be sampled along the anisotropic direction is provided by adjusting the position count threshold from the determined initial number of positions to be sampled along the anisotropic direction. And the method includes: When the number of positions along the anisotropic direction in which samples are to be acquired is a non-integer value that exceeds a smaller integer value by more than a threshold value, samples are acquired along the anisotropic direction in the texture at the next larger multiple of 2 corresponding to the number of determined non-integer positions to be sampled. When the number of positions to be sampled along the anisotropic direction in the texture to obtain samples does not exceed the smaller integer value at least the threshold amount, one or more samples corresponding to the smaller integer value are obtained along the anisotropic direction in the texture.
4. The method according to claim 1, wherein: Determining the number of locations in the texture to be sampled along the anisotropic direction in which samples will be acquired includes: The number of base locations to be sampled along the anisotropic direction is determined based on the estimated ellipse corresponding to the projection of the sampled points of the texture onto the surface to which the texture is applied; and A step factor is applied to the determined number of base locations where the texture is to be sampled along the anisotropic direction to provide the number of step-adjusted locations where the texture is to be sampled along the anisotropic direction. The step factor represents the interval between adjacent sampling locations in the texture along the anisotropic direction to be used when sampling the texture. The method also includes: When the number of positions along the anisotropic direction in which samples are to be acquired is a non-integer value that is more than a smaller integer value than a threshold value, samples are acquired along the anisotropic direction in the texture at the next larger multiple of 2 corresponding to the number of determined non-integer positions to be sampled. When the number of positions along the anisotropic direction in which samples are to be acquired does not exceed the smaller integer value at least the threshold amount, one or more samples corresponding to the smaller integer value are acquired along the anisotropic direction in the texture; and When one or more samples are acquired in the texture along the anisotropic direction, each position of the acquired sample is spaced apart from any adjacent position of the acquired sample in the texture along the anisotropic direction based on the step factor, which is applied to a determined number of base positions of the texture to be sampled along the anisotropic direction.
5. 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 locations within the texture: The number of locations along the anisotropic direction in which samples will be acquired in the texture is determined by the following method: Determine the initial number of locations to sample the texture along the anisotropic direction; The number of positions to be sampled along the anisotropic direction is provided by adjusting the position count threshold from the determined initial number of positions to be sampled along the anisotropic direction. The method further includes: Based on the number of positions adjusted according to the position counting threshold, one or more samples are obtained in the texture along the anisotropic direction; as well as The output sampled texture value for the sampled location in the texture is provided using one or more samples acquired along the anisotropic direction in the texture.
6. The method according to claim 5, wherein: When the initially determined number of locations to be sampled is less than the location counting threshold greater than a smaller integer value, the number of locations to be sampled, adjusted according to the location counting threshold, is set to the smaller integer value; and When the number of initially determined locations to be sampled exceeds a smaller integer value by more than the location counting threshold, the number of locations to be sampled that is greater than the smaller integer value is determined based on the location counting threshold.
7. The method according to claim 5, wherein: In the texture, along the anisotropic direction, acquire the number of samples corresponding to the next larger multiple of 2 of the determined number of non-integer positions to be sampled; and Providing an output sampled texture value for the sampled location in the texture using the samples acquired along the anisotropic direction in the texture includes at least one of the following operations: The intervals along the anisotropic direction for the locations of samples acquired in the texture are set based on the determined number of non-integer locations to be sampled; and The contribution weight of the sampled location is set to the output sampled texture value based on the determined number of non-integer locations to be sampled.
8. The method of claim 7, comprising: When the number of non-integer locations to be sampled is between 1 and 2: Based on the determined number of non-integer positions to be sampled, the interval along the anisotropic direction for the positions where samples are acquired in the texture is set as follows: position_spacing = 2.0 – (2.0 / position_count) Where position_spacing is the interval along the anisotropic direction at which the position of the sample is obtained in the texture; and position_count is the number of non-integer positions to be sampled.
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 using anisotropic filtering to sample textures to provide output sampled texture values for locations within the texture: The number of locations along the anisotropic direction in which samples will be acquired in the texture is determined by the following method: The number of base locations to be sampled along the anisotropic direction is determined based on the estimated ellipse corresponding to the projection of the sampling points of the texture to the surface on which the texture is applied; as well as A step factor is applied to the determined number of base locations where the texture is to be sampled along the anisotropic direction to provide the number of step-adjusted locations where the texture is to be sampled along the anisotropic direction. The step factor represents the interval between adjacent sampling locations in the texture along the anisotropic direction to be used when sampling the texture. The method further includes: Based on the number of positions adjusted by the step size, one or more samples are acquired in the texture along the anisotropic direction. Each position of the acquired sample is spaced apart from any adjacent position of the acquired sample in the texture along the anisotropic direction based on the step size factor, which is applied to a determined number of base positions of the texture to be sampled along the anisotropic direction. as well as The output sampled texture value for the sampled location in the texture is provided using one or more samples acquired along the anisotropic direction in the texture.
10. The method of claim 9, wherein the step factor represents the interval between adjacent sampling positions along the anisotropic direction in the texture, expressed as the texel-to-texel distance in the sampled texture.
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: The circuit for determining the number of sampling locations is configured to: when using anisotropic filtering to sample a texture to provide output sampled texture values for locations in the texture, determine the number of locations in the texture to be sampled along anisotropic directions that will be used to acquire samples in the texture; and A texture sampling circuit, configured to acquire samples in the texture along anisotropic directions, wherein the texture sampling circuit is configured to: When the number of determined positions of the texture to be sampled along the anisotropic direction in which samples are to be obtained is a non-integer value that exceeds a smaller integer value by more than a threshold amount, samples are obtained along the anisotropic direction in the texture corresponding to the next larger multiple of 2 of the determined non-integer number of positions to be sampled. as well as When the number of determined positions of the texture to be sampled along the anisotropic direction in which samples are to be obtained does not exceed the smaller integer value at least the threshold amount, one or more samples corresponding to the smaller integer value are obtained along the anisotropic direction in the texture. The device also includes: 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 of claim 11, wherein when the number of non-integer positions to be sampled is between 1 and 2, the smaller integer value is 1, and when the number of non-integer positions to be sampled is greater than 2, the smaller integer value is a multiple of the next smaller 2.
13. The device of claim 11, wherein the circuit for determining the number of locations to be sampled is configured to: The number of locations along the anisotropic direction in which samples will be acquired in the texture is determined by the following method: Determine the initial number of locations to sample the texture along the anisotropic direction; as well as The number of positions to be sampled along the anisotropic direction is provided by adjusting the position count threshold from the determined initial number of positions to be sampled along the anisotropic direction. And the texture sampling circuit is configured as follows: When the number of positions along the anisotropic direction in which samples are to be acquired is a non-integer value that exceeds a smaller integer value by more than a threshold value, samples are acquired along the anisotropic direction in the texture at the next larger multiple of 2 corresponding to the number of determined non-integer positions to be sampled. When the number of positions to be sampled along the anisotropic direction in the texture to obtain samples does not exceed the smaller integer value at least the threshold amount, one or more samples corresponding to the smaller integer value are obtained along the anisotropic direction in the texture.
14. The device according to claim 11, wherein: The texture sampling circuit and / or the sample combination circuit are configured to: When the goal is to obtain a number of samples in the texture along the anisotropic direction, corresponding to the next larger multiple of 2 of the determined number of non-integer positions to be sampled: The interval along the anisotropic direction of the location where samples are acquired in the texture is set based on the determined number of non-integer locations to be sampled; And / or The contribution weight of the sampled location is set to the output sampled texture value based on the determined number of non-integer locations to be sampled.
15. The device of claim 11, wherein the circuit for determining the number of locations to be sampled is configured to: The number of locations along the anisotropic direction in which samples will be acquired in the texture is determined by the following method: The number of base locations to be sampled along the anisotropic direction is determined based on the estimated ellipse corresponding to the projection of the sampling points of the texture to the surface on which the texture is applied; as well as A step factor is applied to the determined number of base locations where the texture is to be sampled along the anisotropic direction to provide the number of step-adjusted locations where the texture is to be sampled along the anisotropic direction. The step factor represents the interval between adjacent sampling locations in the texture along the anisotropic direction to be used when sampling the texture. And the texture sampling circuit is configured as follows: When the number of positions along the anisotropic direction in which samples are to be acquired is a non-integer value that is more than a smaller integer value than a threshold value, samples are acquired along the anisotropic direction in the texture at the next larger multiple of 2 corresponding to the number of determined non-integer positions to be sampled. When the number of positions at which the determined step size adjustment of the texture is to be sampled along the anisotropic direction in which samples are to be acquired does not exceed the smaller integer value at least the threshold amount, one or more samples corresponding to the smaller integer value are acquired along the anisotropic direction in the texture. as well as When one or more samples are acquired in the texture along the anisotropic direction, each position of the acquired sample is spaced apart from any adjacent position of the acquired sample in the texture along the anisotropic direction based on the step factor, which is applied to a determined number of base positions of the texture to be sampled along the anisotropic direction.
16. 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: The circuit for determining the number of sampling locations is configured to: when using anisotropic filtering to sample a texture to provide output sampled texture values for locations in the texture: The number of locations along the anisotropic direction in which samples will be acquired in the texture is determined by the following method: Determine the initial number of locations to sample the texture along the anisotropic direction; as well as The number of positions to be sampled along the anisotropic direction is provided by adjusting the position count threshold from the determined initial number of positions to be sampled along the anisotropic direction. The device also includes: A texture sampling circuit, configured to acquire one or more samples in the texture along the anisotropic direction based on a number of positions adjusted according to the position counting threshold; 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.
17. The device of claim 16, wherein the circuit for determining the number of locations to be sampled is configured to: When the initially determined number of locations to be sampled is less than the location counting threshold greater than a smaller integer value, the number of locations to be sampled is adjusted to the smaller integer value; and When the number of initially determined locations to be sampled exceeds a smaller integer value that is greater than the location counting threshold, the number of locations to be sampled that is greater than the smaller integer value is determined based on the location counting threshold.
18. A system for performing anisotropic filtering while sampling a texture to provide output sampled texture values used when rendering output in a graphics processing system, the system comprising: A texture sampling device configured to perform anisotropic filtering when sampling a texture to provide output sampled texture values; and Position counting threshold selection circuit, wherein the position counting threshold selection circuit is configured to: When using anisotropic filtering to sample textures to provide output sample texture values, select the position count threshold to use for anisotropic filtering; as well as Provide the texture sampling device with an indication of a selected position counting threshold to be used when sampling the texture; in: The texture sampling device includes: The circuit for determining the number of sampling locations is configured to: when using anisotropic filtering to sample a texture to provide output sampled texture values for locations in the texture: The number of locations along the anisotropic direction in which samples will be acquired in the texture is determined by the following method: Determine the initial number of locations to sample the texture along the anisotropic direction; and The determined initial number of locations for sampling the texture along the anisotropic direction is used to provide the number of locations to be sampled along the anisotropic direction, adjusted by the indicated location count threshold. A texture sampling circuit, configured to: acquire one or more samples in the texture along the anisotropic direction based on a number of positions adjusted according to the position counting threshold; 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.
19. The system of claim 18, wherein the circuit for determining the number of locations to be sampled is configured to: When the initially determined number of locations to be sampled is less than the location counting threshold greater than a smaller integer value, the number of locations to be sampled is adjusted to the smaller integer value; and When the number of initially determined locations to be sampled exceeds a smaller integer value that is greater than the location counting threshold, the number of locations to be sampled that is greater than the smaller integer value is determined based on the location counting threshold.
20. 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: The circuit for determining the number of sampling locations is configured to: when using anisotropic filtering to sample a texture to provide output sampled texture values for locations in the texture: The number of locations along the anisotropic direction in which samples will be acquired in the texture is determined by the following method: The number of base locations to be sampled along the anisotropic direction is determined based on the estimated ellipse corresponding to the projection of the sampling points of the texture to the surface on which the texture is applied; as well as A step factor is applied to the determined number of base locations where the texture is to be sampled along the anisotropic direction to provide the number of step-adjusted locations where the texture is to be sampled along the anisotropic direction. The step factor represents the interval between adjacent sampling locations in the texture along the anisotropic direction to be used when sampling the texture. The device also includes: A texture sampling circuit configured to acquire one or more samples in the texture along the anisotropic direction based on the number of positions adjusted by the step size, and to space each position of acquiring one or more samples from any adjacent position of acquiring one or more samples in the texture along the anisotropic direction based on the step size factor, the step size factor being applied to a determined base number of positions for sampling the texture along the anisotropic direction; as well as 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.
21. The device of claim 20, wherein the step size factor represents the interval between adjacent sampling positions along the anisotropic direction in the texture, expressed as the texel-to-texel distance in the sampled texture.
22. A computer program product comprising computer software code, which, when run on one or more data processors, performs the method according to claim 1, claim 5, or claim 9.
Citation Information
Patent Citations
Systems and methods for providing controllable texture sampling
CN1467687A
Spread-compensated anisotropic texture sampling
US7271810B1