Distance Field Palette

By using distance field labels and interpolated distance field technology in texture, the problem of blurring edges of 2D graphics rendering in computer graphics is solved, achieving high-quality and clear rendering effects.

CN113261032BActive Publication Date: 2025-03-18CTRL-LABS CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201980087423.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-09-26
Filing Date
2019-10-28
Publication Date
2025-03-18
Estimated Expiration
2039-10-28

AI Technical Summary

Technical Problem

Efficient and high-quality rendering of 2D graphics in computer graphics is difficult, especially when resampling filtering is required, resulting in blurred edges and unclear edges.

Method used

By using the distance field label in the texture, determine the color of the sampling position, calculate the interpolated distance field, select the subset of the tex, and determine the color of the sampling position using the color index of the selected tex.

Benefits of technology

It realizes high-quality rendering with clear edges in 2D graphics, suitable for applications such as augmented reality and virtual reality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113261032B_ABST
    Figure CN113261032B_ABST
Patent Text Reader

Abstract

In one embodiment, a method for determining a color at a sample location includes determining, using a computing system, a sampling location within a texture comprising a plurality of texels. Each texel may encode a distance field and a color index. Based on the sampling location, the system may select a set of texels from the plurality of texels, the set of texels used to determine the color of the sampling location. The system may calculate an interpolated distance field based on the distance field of the set of texels. The system may select a subset of the set of texels based on the interpolated distance field. Based on a distance between the texel and the sampling location, the system may select a texel from the subset of texels. The system may then determine the color of the sampling location using the color index of the selected texel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates generally to text rendering in real-time computer graphics for augmented reality and / or virtual reality environments.

[0002] background

[0003] In general, computer graphics are visual scenes created using computers. Three-dimensional (3D) computer graphics provide users with a view of 3D objects from a specific viewpoint. Each object in a 3D scene (e.g., a teapot, a house, a person, etc.) can be defined in a 3D modeling space using basic geometric shapes. For example, a cylindrical object can be modeled using a cylindrical tube and a top and bottom circular cover. The cylindrical tube and the circular cover can each be represented by a network or mesh of smaller polygons (e.g., triangles). Each polygon can then be stored based on the coordinates of their respective vertices in the 3D modeling space.

[0004] Although 3D objects in computer graphics can be modeled in three dimensions, they are usually presented to viewers through rectangular two-dimensional (2D) displays (such as computer or television monitors). Due to the limitations of the human visual perception system, humans expect to perceive the world from roughly the same vantage point at all times. In other words, humans expect some parts of 3D objects to be visible and other parts to be hidden. Therefore, for each 3D scene, a computer graphics system may only need to render the part of the scene that is visible to the user, and not the rest. This allows the system to significantly reduce the amount of computation required.

[0005] One problem in computer graphics is the efficient and high-quality rendering of 2D graphics (e.g., images consisting of solid color areas, as opposed to 3D graphics that typically contain shaded or patterned areas). 2D graphics can be placed in a 3D scene and viewed from any viewpoint, which can make the original 2D graphics appear distorted. When generating a scene for a display, the rendering system typically samples the 2D graphics from the user / camera's viewpoint to determine the appropriate color that the screen's pixels should display. The color that a pixel will display is typically determined using a filtering technique (such as bilinear interpolation) that estimates the color based on multiple color information in the 2D graphics near the corresponding sampling point. Because multiple color information is used to estimate the color of a single pixel, the edges of the rendered graphics can appear blurry or less sharp. The goals of solving the aforementioned 2D graphics problem can be described as: (1) defining a more compact way to represent 2D graphics images, and (2) defining a way to have crisp edges between solid color areas, although resampling filtering is required in many graphics applications (such as augmented reality and virtual reality) to accommodate geometric distortions that typically result in blurriness.

[0006] When rendering text, it is necessary to render fine edge details between text and background areas, and these problems are particularly acute. When the text is static, it is not a problem to spend time and computing resources to pre-render the text with high precision. For example, characters can be stored as a texture with color data (e.g., red, green, and blue) for each texel and rendered on the screen when needed. When the character is small, it may look quite good, but if it is enlarged, rotated, or distorted (e.g., due to transformations, changes in perspective, or changes in the text itself), pixelation (pixilation) and aliasing (aliasing) may become more obvious. In order to improve the appearance and sharpness of fonts when rendering, specialized techniques must be used, such as storing character shapes (e.g., glyphs) in a structure called a signed distance field.

[0007] Overview of Certain Embodiments

[0008] According to the present invention, a method is provided, the method comprising: determining, by a computer system, a sampling position within a texture comprising a plurality of texels, wherein each texel encodes a distance field and a color index; selecting, based on the sampling position, a group of texels from the plurality of texels for use in determining a color of the sampling position; calculating an interpolated distance field based on the distance field of the group of texels; selecting a subset of the group of texels based on the interpolated distance field; selecting a texel from the subset of texels based on a distance between the texel and the sampling position; and determining the color of the sampling position using the color index of the selected texel.

[0009] Optionally, the texture depicts a 2D image having one or more edges separating an interior of the 2D image from an exterior of the 2D image; the distance field for each of the plurality of texels encodes: (1) a first distance between the associated texel and one of the one or more edges of the 2D image, and (2) whether the associated texel is inside or outside the 2D image; and the interpolated distance field encodes: (1) a second distance between a sampling position and one of the one or more edges of the 2D image, and (2) whether the sampling position is inside or outside the 2D image.

[0010] Optionally, a subset of texels is selected according to whether the sampling position is inside or outside the 2D image according to the interpolated distance field.

[0011] Optionally, the set of texels includes a pair of even texels and a pair of odd texels; and the subset of texels is the pair of even texels or the pair of odd texels.

[0012] Optionally, the plurality of texels each have a u coordinate and a v coordinate in the texture; the plurality of texels include a plurality of even texels, wherein the least significant bit of the binary representation of the u coordinate of each even texel and the least significant bit of the binary representation of the v coordinate of the even texel are equal; and the plurality of texels include a plurality of odd texels, wherein the least significant bit of the binary representation of the u coordinate of each odd texel and the least significant bit of the binary representation of the v coordinate of the odd texel are different.

[0013] Optionally, the color index of the selected texel is mapped to a color in a predetermined color set. Optionally, the predetermined color set comprises more than two colors.

[0014] Optionally, the distance field for each texel of the plurality of texels uses a distance representation scheme lacking on-edge representation.

[0015] Optionally, the group of texels are four texels closest to the sampling position among the plurality of texels; and the sampling position is associated with the pixel, and the color of the sampling position will be displayed by the pixel.

[0016] According to the present invention, a system is also provided, the system comprising: one or more processors; and one or more computer-readable non-transitory storage media, which are coupled to the one or more processors and include instructions, which when executed by the one or more processors are operable to cause the system to: determine a sampling position within a texture comprising a plurality of texels, wherein each texel encodes a distance field and a color index; based on the sampling position, select a group of texels from the plurality of texels for determining a color of the sampling position; based on the distance field of the group of texels, calculate an interpolated distance field; based on the interpolated distance field, select a subset of the group of texels; based on the distance between the texel and the sampling position, select a texel from the subset of texels; and determine the color of the sampling position using the color index of the selected texel.

[0017] According to the present invention, one or more computer-readable non-transitory storage media are also provided, which embody software that, when executed, is operable to: determine a sampling location within a texture comprising a plurality of texels, wherein each texel encodes a distance field and a color index; based on the sampling location, select a group of texels from the plurality of texels for use in determining a color of the sampling location; based on the distance field of the group of texels, calculate an interpolated distance field; based on the interpolated distance field, select a subset of the group of texels; based on the distance between the texel and the sampling location, select a texel from the subset of texels; and determine the color of the sampling location using the color index of the selected texel.

[0018] As discussed above, the embodiments described herein address issues associated with graphics rendering. Specific embodiments relate to using distance field labels ("labels" as used herein refer to characters, fonts, glyphs, icons, and other 2D images consisting of solid color areas) to support more complex label patterns, such as those that require more than two color patterns rather than just the binary color schemes (e.g., background and foreground) supported by traditional distance field techniques. Since text is an example of a particularly difficult and common problem that can be solved by the present disclosure, text will be used as the primary example to illustrate the various techniques described. However, it should be noted that the techniques described herein can be applied to different types of labels, including icons and other 2D images.

[0019] In a particular embodiment, when a point on a particular surface is sampled, a distance field for the particular sampled point may be calculated using bilinear interpolation of the distance fields of the four closest texels. The sampled distance field may indicate whether the sampled point falls "in" or "out" of the label (e.g., in the body of text or in the background). The next step may then be to select a color index encoded within the four texels. Two of the four texels may encode the "in" color, while the other two texels encode the "out" color. In a particular embodiment, if the sampled distance field is determined to be "out", then the index of one of the two "out" texels closest to the sampled point is used. Similarly, if the sampled distance field is determined to be "in", then the index of the closer "in" texel is used.

[0020] Specific embodiments described herein involve using dual distance field tags based on four interleaved indexed distance sets. Dual distance fields are used to support complex shapes with sharp convex inner and outer corners. In specific embodiments, using a single distance field based on the distance to only one edge may cause the corners to not be reconstructed correctly, but appear rounded or chipped in the resulting image. The solution to this is to use dual distance fields based on the distance to two different types of edges. The ambiguity introduced by the dual distance field is that at the edge intersection, there may be four different regions associated with four different combinations of being inside or outside each edge. Specific embodiments enable the dual distance field tag to encode the color that should be used in each inside / outside case (e.g., if the sample point falls in a region that is inside two edges, it should be painted red; if the sample point falls in a region that is inside one edge and outside the other edge, it should be painted purple, etc.). As the name implies, each dual distance field tag has two distance fields: distance0 (e.g., distance to type0 edges) and distance1 (e.g., distance to type1 edges). The two distance fields of each tag can encode two corresponding color indices. Therefore, a pair of dual distance field tags can be used to encode four indices, one for each combination of "inside" and "outside". Then, once the four combinations of "inside" and "outside" have been determined with respect to each of the two different edge types, the index specified for each "inside / outside" combination can be accessed to determine the color lookup table entry used to mark the color of the sample point.

[0021] Specific embodiments described herein relate to using distance field optimization techniques. As a first example, in order to minimize undesirable pixelation and / or aliasing effects, mipmaps can be used to accommodate different pixel sampling sizes. Mipmaps are a technique that scales an original high-resolution texture map and pre-filters the texture map to multiple resolutions, which can be selectively used during rendering based on the relative size between texture texels and sampled pixels. For distance fields, when the distance between two edges is less than two texels, there will be at most a single texel between the edges. Because of this, there is an inherent ambiguity as to which edge the distance value for the texel measures. To address this issue, specific embodiments can configure the mipmap chain of a tag to have a distance field texture and an RGBA texture. When a texture with a larger resolution is required, a distance field texture can be used, and when a smaller texture is required, an RGBA texture can be used. The poor quality of the RGBA texture will not stand out because its screen coverage is small. As a second example of distance field optimization, the most significant bits can be compared to eliminate interpolation when interpolation is not required. As a third example of distance field optimization, transparent results can be detected so that the corresponding pixels can be discarded.

[0022] Embodiments of the present invention may include an artificial reality system or be implemented in conjunction with an artificial reality system. Artificial reality is a form of reality that has been adjusted in some way before being presented to a user, which may include, for example, virtual reality (VR), augmented reality (AR), mixed reality (MR), hybrid reality, or some combination and / or derivative thereof. Artificial reality content may include fully generated content or generated content combined with captured content (e.g., photos of the real world). Artificial reality content may include video, audio, tactile feedback, or some combination thereof, and any of them may be presented in a single channel or in multiple channels (e.g., stereoscopic video that produces a three-dimensional effect to the viewer). In addition, in some embodiments, artificial reality may be associated with an application, product, accessory, service, or some combination thereof, which is used, for example, to create content in artificial reality and / or to be used in artificial reality (e.g., to perform activities in artificial reality). Artificial reality systems that provide artificial reality content can be implemented on a variety of platforms, including a head-mounted display (HMD) connected to a host computer system, a standalone HMD, a mobile device or computing system, or any other hardware platform capable of providing artificial reality content to one or more viewers.

[0023] The embodiments disclosed herein are merely examples, and the scope of the present disclosure is not limited to them. Specific embodiments may include all, some, or none of the components, elements, features, functions, operations, or steps of the embodiments disclosed herein. Embodiments according to the present invention are specifically disclosed in the attached claims relating to methods, storage media, systems, and computer program products, wherein any feature mentioned in one claim category (e.g., method) may also be claimed in another claim category (e.g., system). The dependencies or back-references in the attached claims are selected only for formal reasons. However, any subject matter generated by intentional back-references (especially multiple references) to any previous claim may also be claimed, so that any combination of the claims and their features is disclosed and may be claimed, regardless of the dependencies selected in the attached claims. The subject matter that may be claimed includes not only the combination of features as set forth in the attached claims, but also any other combination of features in the claims, wherein each feature mentioned in the claims may be combined with any other feature or combination of other features in the claims. Furthermore, any of the embodiments and features described or depicted herein may be claimed in a separate claim and / or in any combination with any embodiment or feature described or depicted herein or in any combination with any features of the appended claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 is an example distance field tag with various sample positions placed inside and outside the edges of the character shape.

[0026] Figure 2A and Figure 2B Example diagrams showing even texel positions and odd texel positions on a texel array for fine grain color index selection, respectively.

[0027] Figure 3A The use of a fine-grained color index selection method on a texel array associated with a single distance field is shown. Figure 3B An example color lookup table for use with fine-grained color index selection is shown.

[0028] Figure 4 An example method is shown for using a fine-grained color index to determine the color of a sample location using a single distance field.

[0029] Figure 5A and Figure 5B Example diagrams showing even-row texel positions and odd-row texel positions on a texel array for coarse grain color index selection, respectively.

[0030] Fig. 6A The use of a coarse-grained color index selection method on a texel array is shown. Figure 6B An example color lookup table for use with coarse-grained color index selection is shown.

[0031] Figure 7 An example method is shown for using a coarse-grained color index to determine the color of a sample location using a single distance field.

[0032] Figure 8 An example region is shown where edges of two different edge types meet at a vertex and result in four different regions associated with the four different combinations of being inside or outside each edge.

[0033] Fig.9A The use of a fine-grained color index selection method on a texel array associated with a dual distance field is shown. Fig. 9B Shown are example distance field tags associated with aligned 2x2 sets of texels for fine-grained color index selection.

[0034] Fig.10 An example method is shown for using a fine-grained color index to determine the color of a sample location using a dual distance field.

[0035] Fig.11A The use of a coarse-grained color index selection method on a texel array associated with a dual distance field is shown. Fig. 11B Example distance field tags associated with aligned 2x2 sets of texels for coarse-grained color index selection are shown.

[0036] Fig.12 An example method is shown for using a coarse-grained color index to determine the color of a sample location using a dual distance field.

[0037] Fig.13 An example mipmap with a blended distance field texture and an RGBA texture is shown.

[0038] Fig.14 An example method for calculating the color value of a pixel using a mipmap with mixed mipmap levels is shown.

[0039] Fig.15 An example method for determining the color of a sample location without interpolation is shown.

[0040] Fig.16 An example computer system is shown.

[0041] Description of Example Embodiments

[0042] This application describes techniques for text rendering in computer graphics when the transform, perspective, or text itself can be changed dynamically in real time, such as in the case of text rendering in augmented reality (AR) and virtual reality (VR) (or rendering of other types of labels such as icons, glyphs, 2D images, etc.). An example technique used in real-time graphics rendering relies on storing character shapes (e.g., glyphs) in a structure called a signed distance field or simply a distance field. In general, a distance field is the result of a signed distance transform applied to a subset of an N-dimensional space, which is a vector shape to be rendered (e.g., text, icons, etc.). The distance field maps each point P in the space to a scalar signed distance value. The signed distance can be defined as follows: if point P belongs to the subset (e.g., if point P is within the text or icon to be rendered), the signed distance is the positive minimum distance to the closest edge of the shape of the subset. This is also referred to as being "inside" or "in", and can be encoded by making the most significant bit (MSB) of the m-bit distance field 1. If it does not belong to the subset (e.g., if point P is outside the text or icon to be rendered), the signed distance is the negative distance to the closest edge of the shape of the subset. This is also called being "outside" or "out", and can be encoded by making the MSB of the m-bit distance field 0. The distance field can use Euclidean distance whose domain is only two-dimensional space.

[0043] Typically, a specific embodiment of a display engine for driving an AR display and / or a VR display is fed data for display and performs distortion, resampling, composition, and color correction necessary to accommodate the characteristics of an AR / VR display device (e.g., a device used or worn by a user). Each frame of a scene displayed to a user is generated based on the current head position, the current eye position, the current eye movement, other relevant positions of the user, or any combination thereof. The scene details for each frame can be generated by performing bilinear interpolation on a surface generated based on a rendering result of a standard computer processing unit (CPU) or a graphics processing unit (GPU). The surface can be a rectangular texture map with a transformation matrix to specify its position in the scene. The basic unit of a texture map is a texel (also known as a texture element or texture pixel), and the texture map includes an array of texels representing a specific texture space. Specifically, there are two types of surfaces: image surfaces and label surfaces. An image surface may have a texture that stores the RGB (red, green, blue color space) or RGBA (red, green, blue, transparency (alpha) color space) components of each texel, and the texture is used to render a shadow image (e.g., a video frame or scene rendered by a GPU). A label surface may have a texture that stores signed distance and color indexes, and the texture is used to render an object consisting of a solid color area, which includes text (such as letters, numbers, characters, etc.) in addition to icons. Unlike RGBA labels, distance field labels are not susceptible to blurred edges caused by interpolation operations. The specific embodiments described herein will focus on techniques associated with label surfaces.

[0044] Currently, distance field tags are limited to two colors, such as black text or foreground with a white background and / or cutouts (or vice versa). As such, in order to support more complex tag color patterns, the embodiments discussed herein describe how improved distance field tags can support more than two colors. In a particular embodiment, an 8-bit texel can be encoded with: (1) the distance field stored on 6 bits of the texel and (2) a color index (e.g., a value indicating the desired color, or conceptually a pointer to an entry in a color lookup table) stored on the remaining 2 bits of the texel. For example, an 8-bit texel can be used to define white text with a transparent background (e.g., a color index of 0), which allows other objects behind the text to be seen. The number of bits allocated to the index determines how many colors the tag can support. For example, a 2-bit index allows the selection of up to four unique colors (e.g., transparent, orange, yellow, and purple). The embodiments described herein also contemplate concatenating the indices of two texels to form an index with more bits. For example, by concatenating the 2-bit indices of two texels, a 4-bit index can be formed, which allows up to 16 unique colors to be selected (e.g., one transparent color and 15 colors). The color index is used to look up RGBA colors based on the high-order bits of the interpolation distance, as discussed in more detail below.

[0045] Use a single distance field to determine the color at the sample location

[0046] Specific embodiments described herein are directed to texels that each have a single distance field. At a high level, the distance field is used to indicate the location of edges between solid color areas (e.g., foreground and background) on the label surface. Each texel stores a representation of the distance from the center of the texel to the closest edge, bounded by a maximum distance beyond which the texel is determined to be outside of a particular array. In specific embodiments, 6 bits may be allocated to indicate the distance value, with the MSB indicating whether the texel center is "inside" (e.g., represented by 1) or "outside" (e.g., represented by 0). If the texel is far from the edge, the remaining 5 bits will be large values; conversely, if the texel is close to the edge, the remaining 5 bits will be small. In specific embodiments, for a sample position P, a bilinear interpolation of the distance fields of the four closest texels may be used to determine which side of the edge the sample position P is on. As an example, a zero (0) in the high-order bits (e.g., MSBs) of the interpolated distance indicates that the sample position P is outside the area defined by the edge, and a one (1) in the high-order bits of the interpolated distance indicates that the sample position P is inside the area defined by the edge. It is worth noting that the distance field in the specific embodiments described herein can be an unsigned number, such that the lowest value is zero, and no value encodes a position exactly on an edge. This is in contrast to other distance fields that are encoded using signed values ​​(e.g., the MSB of the distance field can indicate whether the value is positive or negative (corresponding to "inside" or "outside"), or zero (corresponding to "on the edge")). Unsigned distance field encoding is beneficial because it avoids certain problems, such as when an edge passes through the center of a texel.

[0047] As discussed above, each texel of a tag texture can include a distance and a color index value. The color index value is used to select an entry in a color lookup table, which can be customized for each tag. For a given sample position, which texel's color index is selected depends on the interpolated distance of the sample position (e.g., whether its MSB=0 (outside) or MSB=1 (inside)) and the position of the sample position in texture space relative to nearby texels. In a particular embodiment, each tag surface specifies a base address of the color table and a control bit that selects whether the surface uses a single set of color table entries for each combination of inside edge and outside edge, or whether a different set of color table entries is used for each combination.

[0048] Each color index selects a color for all samples within a given region in the texture, not just for the texel where it is stored. For a single distance label, the two interleaved color indices specify the color to use when the MSB of the interpolated distance is zero (outside) or one (inside). For a dual distance label, the four interleaved color indices specify the colors to use for the four combinations of the MSBs of the two interpolated distances.

[0049] Certain cases deserve additional consideration. As an example, to determine which edge a texel is on when the edge passes exactly through the center of a texel (e.g., when the distance is zero), a "top-left" rule can be used, where pixels that fall on the edge are included if the interior of the object is to the right of the pixel, or for horizontal edges, pixels that fall on the edge are included if the interior of the object is below the pixel. As another example, all texels outside the array are treated as having a distance of zero and an index of zero. Thus, any sample position that is more than 0.5 texels outside the grid of distance texels results in MSB=0 (outside) for all edges and produces an index of 0. The first color table entry for each surface is typically set to transparent (i.e., no color). For this reason, nothing is rendered for sample positions more than 0.5 texels outside the array.

[0050] Figure 1 An example texel array 100 is shown with various sample locations placed inside and outside the edge of a character shape 110. The character shape 110 shows an "A" where an edge 120 separates the color of the character shape 110 (e.g., a shaded area) from the color of the background 130. Texels within the shaded area (not shown for simplicity) are encoded with distance values ​​indicating that they are "inside" (MSB=1), while texels outside the shaded area are encoded with distance values ​​indicating that they are "outside" (MSB=0). Additionally, a border 140 depicts the background 130 from an area beyond the texel array 100. Various sample points are shown, including a sample point 150 located inside the area defined by the edge 120 of the character shape 110, a sample point 160 located outside the area defined by the edge 120 of the character shape 110, a sample point 170 located on the edge 120 of the character shape 110, and a sample 180 located outside the border 140 of the texel array 100.

[0051] As will be discussed in more detail below, for each of the sample points 150, 160, linear interpolation of the unsigned distance functions of the four nearest texels will determine that the interpolated distance for sample point 150 has MSB=1 (inside) and the interpolated distance for sample point 160 has MSB=0 (outside). Additionally, for sample point 170, linear interpolation of the distance functions of the four nearest texels will determine that the interpolated distance is exactly half the range of the unsigned distance field, indicating that sample point 170 is exactly on edge 120 (if the distance field is signed rather than unsigned, the "on edge" situation would be represented by an interpolated distance of 0). The color of sample point 170 will therefore be determined based on the "upper left" rule. Additionally, sample point 180 will be determined to be outside of the texel array 100 and therefore have an unsigned distance of zero and a zero index associated with no color (or a "transparent" result).

[0052] In a particular embodiment, there may be two ways to specify a color index. The first method allows for a finer granularity of color selection from four colors, the first of which is transparent. For example, as mentioned above, a texel may be represented by 8 bits, 6 of which encode the distance field and 2 of which encode the color index. The 2-bit color index may be mapped to four colors. Although this example allocates a specific number of bits to encode the distance field and the color index, a person of ordinary skill in the art will recognize that any other bit allocation may be used instead (e.g., 7, 8, 9, or 20 bits to encode the distance field, and 1, 4, 6, or 10 bits to encode the color index). For example, the second method described herein may have a coarser granularity of color selection and allow sixteen color options, the first of which is transparent. These two methods are described as having "fine granularity" and "coarse granularity" in the sense that the size of the texture area indicated by a set of color indices in the "fine granularity" method is smaller than the size of the "coarse granularity" method. Each of these methods will be discussed in detail below.

[0053] Single distance field fine-grained color selection

[0054] The discussion of fine-grained color selection methods for single distance field labels will focus on Figure 2A , Figure 2B , Figure 3A , Figure 3B The embodiments shown and Figure 4 In short, Figure 2A and Figure 2B Example diagrams of even texel positions and odd texel positions on the texel array 200 for fine-grained color index selection are shown, respectively. Figure 3A The use of a fine-grained color index selection method on a texel array 300 associated with a single distance field is shown. Figure 3B An example color lookup table for use with fine-grained color index selection is shown. Additionally, Figure 4 An example method 400 is shown for using fine-grained color indexing to determine the color of a sample location using texels with a single distance field.

[0055] Figure 2A and Figure 2BAn example 6×6 array 200 of texels is shown, where texels located at even positions or odd positions, respectively, are depicted at the center of the diamond-shaped area. The texels in the array 200 are arranged in a texture map at positions on the U axis 210 and V axis 212 coordinate systems. The circles represent the centers of the texel positions on the array 200. In an embodiment where texel sampling is performed by hardware, binary values ​​can be used to specify coordinates. For example, rows 0-3 along the V axis 212 are referred to as rows 00, 01, 10, and 11, respectively, and columns 0-3 along the U axis 210 are referred to as columns 00, 01, 10, and 11, respectively (for simplicity, additional rows and columns are not referenced as doing so would increase the number of bits referring to them). For example, texel 214 is located at u=00 and v=00 (or (00,00)); texel 216 is located at (00,01), texel 218 is located at (01,00), texel 220 is located at (01,01), etc. For simplicity, only the first four rows and columns of the 6×6 array 200 are referenced herein.

[0056] For fine-grained color index selection, texels in array 200 are classified into even positions or odd positions (i.e., an "even" texel or an "odd" texel) in order to determine which texel to use to look up the color associated with a region. In a particular embodiment, whether a texel in array 200 is even or odd is determined based on whether the lowest-order bits (e.g., the least significant bits (LSBs)) of the U coordinate and the V coordinate associated with the texel are the same digit. As an example, texel 214 is located at a UV coordinate of u=00 and v=00, and because the U coordinate and the V coordinate have the same last digit (i.e., "0"), texel 216 is considered an even texel. Additionally, texel 220 is also an even texel because the UV coordinates of u=01 and v=01 have the same last digit (i.e., "1"). Even texels (e.g., 214 and 220) are even texels in the array 200. Figure 2A , are shown as being located within diamond-shaped regions (e.g., 222 and 224, respectively). As will be described in further detail below, assuming that the sample point is associated with an "even" texel (e.g., the MSB of the interpolated distance of the sample point as described in further detail below), the sample point falling within such a diamond-shaped region (e.g., 222) will be assigned the color specified by the color index of the texel at the center of the region (e.g., 214). On the other hand, texel 216 is located at the UV coordinates of u=01 and v=00, and since the U coordinate and the V coordinate do not have the same last digit, texel 216 is an odd texel. In addition, texel 218 is also an odd texel because the UV coordinates of u=00 and v=01 do not have the same last digit. Odd texels (e.g., 216 and 218) are in Figure 2B226 and 228, respectively. As will be described in further detail below, assuming that the sample point is associated with an "odd" texel (e.g., based on the MSB of the interpolated distance of the sample point as described in further detail below), the sample point falling within such a diamond-shaped area (e.g., 226) will be assigned the color specified by the color index of the texel at the center of the area. Figure 2A and Figure 2B As shown, each 2×2 region of array 200 includes two even texels (eg, texels 214 and 220 ) and two odd texels (eg, texels 216 and 218 ).

[0057] In a particular embodiment, texels 214, 216, 218, and 220 are each associated with a distance field that includes a 6-bit distance and a 2-bit color index (the bit length of the particular allocation may vary). As discussed above, the distance field for each of texels 214, 216, 218, and 220 stores a representation of the distance from the center of the texel to the closest edge, and the color index for each of texels 214, 216, 218, and 220 stores a reference to an entry in a color lookup table for determining the color associated with the texel. For the fine-grained color selection method, the purpose of determining whether a texel is even or odd is to select which texels to use based on a determination of whether a sample point is outside or inside a region defined by an edge. As discussed in more detail below, if the highest order bit of the interpolated distance of a sample point is 0 (i.e., MSB=0), the sample point is determined to be outside the region defined by an edge, and a pair of even texels (e.g., texels 214 and 220) are selected to determine the color of the sample. On the other hand, if the highest order bit of the interpolated distance for the sample point is 1 (i.e., MSB=1), the sample point is determined to be inside the region defined by the edge, and a pair of odd texels (e.g., texels 218 and 218) is selected to determine the color of the sample. Additionally, shaded region 230 represents locations outside of the texels of array 200 (e.g., texels greater than 0.5 texels outside the array), and therefore has a distance of zero and a zero index associated with no color (or a "transparent" result).

[0058] Figure 3A An example 4×4 array 300 of texels is shown. Figure 2A and Figure 2BIn the described embodiment, the texels in the array 300 are arranged on a texture map at positions on a U-axis 310 and a V-axis 312 coordinate system. In embodiments where texel sampling is performed by hardware, binary values ​​may be used to specify coordinates (e.g., rows 0-3 are referred to as rows 00, 01, 10, and 11, respectively, and columns 0-3 are referred to as columns 00, 01, 10, 11, respectively). Circles represent texel positions on the array 300. For example, texel 318 is located at u=00 and v=00 (or (00,00)); texel 322 is located at (00,01); and so on. Sample point P314 is selected (e.g., based on a visibility test, such as by using ray casting to cast a ray from the pixel position onto a label surface in 3D view space, and mapping the intersection into the texel array 300). A fine-grained color selection method 400 is used to determine the color to be selected for the sample point 314. As Figure 4 As shown, the method 400 may begin at step 410 , where the four closest texels to the sample point 314 are determined so that the distances of these texels may be used to determine an interpolated distance for the sample point 314 . Figure 3A The four closest texels to sample point 314 are shown to be texels in a 2×2 texel region 316 , and include texels 318 , 320 , 322 , and 324 .

[0059] In a particular embodiment, texels 318, 320, 322, and 324 are each associated with a distance field that includes a 6-bit distance and a 2-bit color index. As discussed above, the distance field for each of the texels 318, 320, 322, and 324 stores a representation of the distance from the center of the texel to the closest edge. Additionally, the color index for each of the texels 318, 320, 322, and 324 stores a reference to an entry in a color lookup table for determining the color associated with the texel. Figure 3B An example color lookup table with four different entries is shown. In the particular example shown, entry "0" corresponds to "transparent" (i.e., no color), entry "1" (or binary 01) corresponds to red, entry "2" (or binary 10) corresponds to green, and entry "3" (or binary 11) corresponds to blue. Thus, as an example, texel 318 may have a color index with entry "3" indicating that the texel is blue, texel 320 may have a color index with entry "3" indicating that the texel is blue, texel 322 may have a color index with entry "1" indicating that the texel is red, and texel 324 may have a color index with entry "2" indicating that the texel is green.

[0060] like Figure 4As shown, at step 420, the distance value D of the sample point 314 is interpolated based on the distance field of each of the texels 318, 320, 322, and 324. Then, at step 430, the highest-order bit of the interpolated distance value D of the sample point 314 is determined to be 0 or 1. In other words, if the MSB of the interpolated distance value D of the sample point 314 is determined to be 0, the sample point 314 is determined to be outside the area defined by the edge. On the other hand, if the MSB of the interpolated distance value D of the sample point 314 is determined to be 1, the sample point 314 is determined to be inside the area defined by the edge.

[0061] At step 440, if the MSB of the interpolated distance value D of the sample point 314 is determined to be 0, the sample point 314 is determined to be outside the region defined by the edge, and two even texels are selected from the region 316 of 2×2 texels. Figure 2A and Figure 2B In the discussion of embodiments of the invention, whether a texel in array 300 is even or odd is determined based on whether the lowest order bits (e.g., the least significant bits) of the U coordinate and the V coordinate associated with the texel are the same number. As an example, texel 318 is located at a UV coordinate of u=00 and v=00, and because the U coordinate and the V coordinate have the same last digit (i.e., "0"), texel 318 is considered to be an even texel. Additionally, texel 324 is also an even texel because the UV coordinates of u=01 and v=01 have the same last digit (i.e., "1"). On the other hand, texel 320 is located at a UV coordinate of u=01 and v=00, and because the U coordinate and the V coordinate do not have the same last digit, texel 320 is an odd texel. Additionally, texel 322 is also an odd texel because the UV coordinates of u=00 and v=01 do not have the same last digit. In other words, based on these determinations, the even texel pair 326 includes texels 318 , 324 , while the odd texel pair 328 includes texels 320 , 322 .

[0062] As such, at step 440, if it is determined that the MSB of the interpolated distance value D for the sample point 314 is 0, then the even texel pair 326 is selected. Once the texel pair is selected, the method 400 moves to step 450 to determine which even texel in the even texel pair 326 is closer in distance to the sample point 314. A specific embodiment of how this may be determined in hardware is as follows. In an array 300 where distance is measured in texel units, the distance between two adjacent and orthogonal texel positions is one distance unit (e.g., the distance between texels 318 and 322 is 1, and the distance between texels 318 and 320 is also 1). Since the four texels in the region 316 define a unit square, any point along the diagonal 332 of the unit square will have a U-axis distance and a V-axis distance that add up to 1 unit distance. For example, a point that coincides with where texel 320 is located has a U-axis distance of 1 from the left edge of the unit square and a V-axis distance of 0 from the top edge of the unit square, which, when added together, results in a total distance of 1 unit. As another example, a point at the center of the unit square will have a U-axis distance and a V-axis distance that are both 0.5, which results in a total distance of 1 unit. Because of this, one way for the hardware to determine which of the two even texels is closer to sample point 314 is to conceptually determine which side of diagonal 332 sample point 314 falls on. For even texel pair 326, the U-axis distance and V-axis distance of any point on or to the left of diagonal 332 will add up to 1 distance unit or less (in this example, points that fall on the diagonal are counted as being closer to the texel on the left). If so, the index of texel 326 is considered closer to sample point 314 and is selected accordingly. Conversely, any point to the right of diagonal line 332 will have a U-axis distance and a V-axis distance that add up to greater than 1 distance unit. If so, then the index of texel 324 is considered closer to sample point 314 and is selected accordingly.

[0063] A specific embodiment for selecting a fine index is defined more formally as follows. Let the position of a sample point (e.g., sample point 314) be given by [U 1, V 1 ] indicates. First, calculate U 1 '=U 1 mod 2 and V 1 '=V 1 mod 2, or in other words, U 1 and V 1Truncated to an integer bit (e.g., distance) and their fractional bits. Conceptually, truncation performs a normalization operation that converts the UV coordinates of the sample point 314 into coordinates of a smaller region. For example, conceptually, the texel array 300 can be divided into a grid where a horizontal grid line originates from each even V position (i.e., a V position whose least significant bit is 0) and a vertical grid line originates from each even U position (i.e., a U position whose least significant bit is 0). Thus, each grid is a square with sides of 2-unit-distance. Within each grid, the UV coordinates of the upper-left corner have zeros as their least significant two bits, and each grid can have its own region coordinate system. The result of the truncation U 1 ' and V 1 'Represents the transformed coordinates of the sample point in the regional coordinate system of the grid with a distance of 2 units. 1 ' and V 1 'It can also express the U-axis distance and V-axis distance of the grid relative to the 2 unit distance.

[0064] Each 2-unit distance grid contains four unit squares, each of which is defined by a set of adjacent and orthogonal texels (e.g., region 316 includes one such unit square). Conceptually, the next step is to determine which of the two even texels (if the MSB of the interpolation distance=0) or which of the two odd texels (if the MSB of the interpolation distance=1) is closest to the sample point within the unit square containing the sample point. In a particular embodiment, if the MSB of the interpolation distance=0, the closest even texel can be determined as follows. First, if U 1 '<1, then let the distance D u =U 1 '; Otherwise, let the distance D u =2-U 1 '. If V 1 '<1, then let the distance D v =V 1 '; Otherwise, let D v =2-V 1 '. Then, the combined UV distance D can be calculated by 1 :

[0065] Distance D 1 (For MSB = 0) = D u +D v .

[0066] If the distance D 1If V is equal to or less than 1, the index of the even texel at an even U position (i.e., the U position with the least significant bit being 0) is selected, otherwise the index of the even texel at an odd U position (i.e., the U position with the least significant bit being 1) is selected. The least significant bit of the V position and the least significant bit of the U position of the selected even texel will be the same. Use Figure 3A As an example, if the MSB of the interpolated distance of a sample point is 0, and if the sample point is located to the right of the diagonal line 332 separating the even-numbered texels 318 and 324, then D u It will be U 1 ', and D v It will be V 1 '. Since the sample points are on the right side of the diagonal, we know that D u +D v will be greater than 1. Because of this, the index of the even texel at the odd U position will be selected, in this case, texel 324 will be selected because its U coordinate is

[01] . As can be seen from the figure, the even texel 324 is closer to the sample point on the right side of the diagonal 232 than the even texel 318.

[0067] On the other hand, if it is determined at step 430 that the MSB of the interpolated distance value D for the sample point 314 is 1, the sample point 314 is considered to be inside the region defined by the edge, and at step 350, two odd texels are selected from the region 316 of 2×2 texels. Therefore, at step 350, if it is determined that the MSB of the interpolated distance value D for the sample point 314 is 1, then the odd texel pair 328 is selected. Once the texel pair is selected, the method 400 moves to step 470 to determine which odd texel in the odd texel pair 328 is closer in distance to the sample point 314. In a particular embodiment, if the MSB of the interpolated distance=1, the closest odd texel can be determined as follows. First, if U 1 '<1, then let the distance D u =U 1 '; Otherwise, let the distance D u =2-U 1 '. If V 1 '<1, then let the distance D v =1-V 1 '; Otherwise, let D v =V 1 '-1. Then, the combined UV distance D can be calculated by 2 :

[0068] Distance D 2 (for MSB=1)=D u +D v .

[0069] If the distance D2 is equal to or less than 1, then the index of the odd texel at an even U position (i.e. a U position with the least significant bit being 0) is selected, otherwise the index of the odd texel at an odd U position (i.e. a U position with the least significant bit being 1) is selected. In this case, the least significant bit of the V position and the least significant bit of the U position of the selected even texel will be reversed. Figure 3A As an example, if the MSB of the interpolation distance of a sample point is 1, and if the sample point is located to the right of the diagonal line 330 separating the odd-numbered texels 322 and 320, then D u It will be U 1 ', and D v It will be 1-V 1 '. Based on this definition, we know that D u +D v will be greater than 1. Because of this, the index of the odd texel at the odd U position will be selected, in this case, texel 320 will be selected because its U coordinate is

[01] . As can be seen from the figure, odd texel 320 is closer to the sample point on the right side of diagonal line 330 than odd texel 322.

[0070] Then, at step 480, the color index of the selected even texel or odd texel determined to be closest in distance to the sample point 314 is used to determine the color of the sample point 314. As an example, if at step 450 it is determined that the even texel 318 is closest in distance to the sample point 314 (which has MSB=0), then it is determined that the sample point 314 is encoded as blue (e.g., as determined based on the assumption that the index of the texel 318 points to blue as discussed above). Conversely, if at step 450 it is determined that the even texel 324 is closest in distance to the sample point 314, then it is determined that the sample point 314 is encoded as green. On the other hand, if at step 470 it is determined that the odd texel 320 is closest in distance to the sample point 314 (which now has MSB=1), then it is determined that the sample point 314 is encoded as blue. Conversely, if at step 470 it is determined that the odd texel 322 is closest in distance to the sample point 314, then it is determined that the sample point 314 is encoded as red. Where appropriate, specific examples may be repeated Figure 4 Although the present disclosure describes and illustrates one or more steps of a method that occurs in a particular order, Figure 4 The specific steps of the method are described in detail, but the present disclosure contemplates that the steps may occur in any suitable order. Figure 4 In addition, although the present disclosure describes and illustrates the method of Figure 4The present disclosure contemplates any suitable method for determining the color of a sample position using a single distance field using a fine-grained color index, including any suitable steps, which may include, where appropriate, Figure 4 All, some, or none of the steps of the method Figure 4 Furthermore, although the present disclosure describes and illustrates the steps of performing Figure 4 specific components, devices or systems for specific steps of the method, but the present disclosure contemplates performing Figure 4 Any suitable combination of any suitable components, devices, or systems of any suitable steps of the method.

[0071] As can be seen from the above-described embodiments of encoding the color index in the texel array and deriving the appropriate color index to be used based on the interpolation result, the distance field tag can be configured to support more than two colors. Therefore, the letter "A" shown in the example above can define, for example, the foreground "A" as black, the background in the internal cutout image of "A" as red, and the rest of the background as purple. In the boundary area of ​​the foreground of "A" and near the internal cutout image of "A", the texels in the area can define the desired color scheme for "inside" (e.g., black) and "outside" (e.g., red). Similarly, the texels near the boundary of the foreground of "A" and the rest of the background can have different definitions for the desired color scheme for "inside" (e.g., black) and "outside" (e.g., purple). This technology has the advantages of using distance fields (e.g., sharpness that is independent of size and / or orientation), while alleviating the disadvantages of having limited color options in the traditional way. If the number of bits allocated for specifying the index increases (e.g., 3 bits instead of 2 bits), the number of color options will also increase (e.g., 3 bits allow 8 color options).

[0072] Single distance field coarse-grained color selection

[0073] The discussion of coarse-grained color selection methods using a single distance field will focus on Figure 5A , Figure 5B , Fig. 6A and Figure 6B The embodiments shown and Figure 7 In short, Figure 5A and Figure 5B Example diagrams showing even-numbered row texel positions and odd-numbered row texel positions on a texel array for coarse-grained color index selection, respectively. Fig. 6A The use of a coarse-grained color index selection method on a texel array is shown. Figure 6BAn example color lookup table for use with coarse-grained color index selection is shown. In addition, Figure 7 An example method 700 is shown for using a coarse-grained color index to determine the color of a sample location using a single distance field.

[0074] Figure 5A and Figure 5B An example 6×6 array 500 of texels for coarse-grained color selection is shown, in which pairs of texels located at even or odd row positions, respectively, are depicted within a square area. The coarse-grained color selection method differs from the fine-grained color selection method in at least one aspect in that the coarse-grained color selection method uses texel pairs (rather than single texels) to specify a desired color index for the area around the texel pair (e.g., by concatenating the indices of the pair of texels). Therefore, the coverage area of ​​each texel pair is larger than the coverage area of ​​each texel used in the fine-grained method. Any sample point that falls within the area covered by the texel pair will have the color specified by the combined color index of the texel pair, provided that the texel pair is one of those assigned to a particular "inside" or "outside" state of the sample point (determined based on the MSB of the sample point in a particular embodiment). The benefit of using texel pairs to encode color indices is that the number of bits available for encoding the index is increased (e.g., from 2 bits to 4 bits), which means that more color options are available (e.g., from 4 to 16 colors). Since the first color table entry is typically set to transparent (i.e., no color), this leaves up to 15 unique colors that can be encoded by the 4-bit index used in the coarse-grained color selection method.

[0075] As shown, the texels in the array 500 are arranged in a texture map at positions on a U axis 510 and a V axis 512 coordinate system. Circles represent texel positions on the array 500. In an embodiment where texel sampling is performed by hardware, binary values ​​may be used to specify the coordinates of the texels. For example, rows 0-3 along the V axis 512 are referred to as rows 00, 01, 10, and 11, respectively, and columns 0-3 along the U axis 510 are referred to as columns 00, 01, 10, and 11, respectively (additional rows and columns may be similarly numbered using additional bits). For example, texel 514 is located at u=00 and v=00 (or (00,00)); texel 516 is located at (00,01), texel 518 is located at (01,00), texel 520 is located at (01,01), and so on. For simplicity, only the first four rows and columns of the 6×6 array 500 are referenced herein.

[0076] For coarse-grained color index selection, texels in array 500 are classified into even row positions or odd row positions (i.e., "even row" texels or "odd row" texels) in order to determine which texel to use to look up the color associated with the sample position. In a particular embodiment, even rows and odd rows in array 500 are determined based on the least significant bit of the V position of the associated row. As an example, texels 514, 516, 518, and 520 all have a V position v=00, where the least significant bit is 0. Therefore, texels 514, 516, 518, and 520 are all even row texels. On the other hand, texels 522, 524, 526, 528 all have a V position v=01, where the least significant bit is 1. Therefore, texels 522, 524, 526, 528 are all odd row texels.

[0077] like Figure 5A and Figure 5B As shown, each aligned 2×2 region includes two even rows of texels (e.g., texels 514 and 516) and two odd rows of texels (e.g., texels 522 and 524). In a particular embodiment, an even row of texel pairs (e.g., even texel pair 514 and 516, another even texel pair 518 and 520) can be used to encode a color index for the "outside" case. To illustrate the coverage area of ​​each aligned even row of texel pairs, Figure 5A Even-numbered row texel pairs are shown to be located within corresponding square regions of even-numbered row texel pairs (e.g., even-numbered row texel pairs 514 and 516 are located within region 530, even-numbered row texel pairs 518 and 520 are located within region 532, etc.). Additionally, odd-numbered row texel pairs (e.g., odd-numbered row texel pairs 522 and 524, and another odd-numbered row texel pair 526 and 528) may be used to encode a color index for the "inside" case, and in Figure 5B are shown as being located within square areas 534 and 536, respectively. In addition, similar to the above discussion Figure 3A and Figure 3B , shaded area 538 represents locations outside of the texels of array 500 (e.g., texels greater than 0.5 texels outside the array) and therefore has a zero distance and a zero index associated with no color (or a "transparent" result).

[0078] Fig. 6A An example 4×4 array 600 of texels is shown. The sixteen texels in the array 600 are arranged on a texture map at positions specified in a coordinate system having a U axis 610 and a V axis 612. In a specific hardware embodiment, as shown in FIG. Figure 2A As described above, the U position and V position can be specified in binary. The circles represent the texel positions on the array 600. Sample point 614 is selected (similar to how sample point 314 was selected above), and using Figure 7The coarse-grained color selection method 700 of FIG. 700 determines the color to be selected for the sample point 614. As discussed above, in particular embodiments, the texel pairs in each even row (e.g., determined based on the least significant bit of the V position of the even texels being 0) may be used to encode the color index for the "outside" case, while the texel pairs in each odd row (e.g., determined based on the least significant bit of the V position of the odd texels being 1) may be used to encode the color index for the "inside" case. In general, as used herein, an "even row texel" refers to a texel on an even row of a texel array (e.g., the least significant bit of the V position of the even row texture is 0), while an "odd row texel" refers to a texel on an odd row of a texel array (e.g., the least significant bit of the V position of the odd row texture is 1). The two indices of each texel pair are concatenated, and the result is associated with the two texels during filtering (i.e., both texels of the texel pair will be associated with the same concatenation index).

[0079] like Figure 7 As shown, method 700 may begin at step 710, where the indices of adjacent, aligned even-numbered texel pairs or odd-numbered texel pairs are concatenated and stored in a texel buffer in a pixel block along with the two associated texels. This may be part of a data loading process when texel data is loaded into memory. As an example, Fig. 6A As shown, for an even row of texels located at a V position v=00, the two indexes of an even row of texels pair 634 (including adjacent even row of texels 618 and 620) are connected, and the result is associated with two texels. Additionally, an even row of texels pair 636 (including adjacent even row of texels 622 and 624) is connected, and the result is associated with two texels. Similarly, for an odd row of texels located at a V position v=01, the two indexes of an odd row of texels pair 638 (including adjacent odd row of texels 626 and 628) are connected, and the result is associated with two texels, and the two indexes of an odd row of texels pair 640 (including adjacent odd row of texels 630 and 632) are connected, and the result is associated with two texels. In an embodiment in which the color index of each texel is 2 bits, concatenating the color indexes of two texels produces a 4-bit color index. For example, if the color index of texel 618 is the 2-bit binary number 11, and the color index of texel 620 is the 2-bit binary number 00, then concatenating the two may produce a 4-bit index of 0011 (if the low-order bits are filled with the index of the texel in the even U position) or 1100 (if the low-order bits are filled with the index of the texel in the odd U position). Thereafter, a 4-bit index (such as 0011) may be associated with (e.g., stored with) both texels 618 and 620.

[0080] Then, at step 720 , the four closest texels to the sample point 614 are determined and loaded into memory so that the distance values ​​of these texels can be used to determine the interpolated distance of the sample point 614 . Fig. 6A The four closest texels to the sample point 614 are shown to be even row texels 620, 622 and odd row texels 628, 630. In a particular embodiment, the even row texels 620, 622 and the odd row texels 628 and 630 are each associated with a distance field that includes a 6-bit distance and a 4-bit color index generated at step 710. As discussed above, the 4-bit color index stores a reference to an entry in a lookup table of 16 colors for determining the color associated with the texel. Figure 6B An example color lookup table with 16 different entries is shown. In the particular example shown, entry "0" corresponds to "transparent" (i.e., no color), entry "1" (or binary 0001) corresponds to red, entry "2" (or binary 0010) corresponds to green, and entry "3" (or binary 0011) corresponds to blue, and so on, until entry "16" (or binary 1111). Thus, as an example, an even row pair 634 including even row texels 618 and 620 may each have a connected color index of "3" or "0011", indicating that the color associated with the two texels is blue; an even row pair 636 including even row texels 622 and 624 may likewise have a connected color index of "3" or "0011", indicating that the color associated with the two texels is likewise blue; an odd row pair 638 including odd row texels 626 and 628 may have a connected color index of "1" or "0001", indicating that the color associated with the two texels is red; and an odd row pair 640 including odd row texels 630 and 632 may have a connected color index of "2" or "0010", indicating that the color associated with the two texels is green.

[0081] At step 730, the distance value D of the sample point 614 is interpolated based on the distance values ​​of the four closest texels 620, 622, 628, 630. Then, at step 740, the highest-order bit of the interpolated distance value D of the sample point 614 is determined to be 0 or 1. In other words, if the MSB of the interpolated distance value D of the sample point 614 is determined to be 0, the sample point 614 is determined to be outside the region defined by the edge. On the other hand, if the MSB of the interpolated distance value D of the sample point 614 is determined to be 1, the sample point 614 is determined to be inside the region defined by the edge. Therefore, at step 740, if the MSB of the interpolated distance value D of the sample point 614 is determined to be 0, the sample point 614 is determined to be outside the area defined by the edge, and at step 750, two even-row texels are selected from the nearest 4 texels (as previously described, according to a specific coarse-grained indexing embodiment, in the "outside" case, the color index is encoded using the even-row texels, and in the "inside" case, the color index is encoded using the odd-row texels). As such, in this example, the two even-row texels selected would be the even-row texels 620 and 622.

[0082] Once the even row texels 620 and 622 are selected, the method 700 moves to step 760 to determine which of the two even row texels 620 and 622 is closer in distance to the sample point 614. A specific embodiment of how this can be determined in hardware is as follows. As discussed above, in an array 600 where distance is measured in texel units, the distance between two adjacent texel positions is one distance unit (e.g., the distance between the even row texels 620 and 622 is 1, and the distance between the odd row texels 628 and 630 is also 1). Since these four closest texels 620, 622, 628, 6230 define a unit square, any point along the vertical line 642 between the even row texels 620 and 622 and between the odd row texels 628 and 630 corresponds to a position that is 0.5 texels away from each of the even row texels 620 and 622 and the odd row texels 628 and 630 along the U axis. As such, one way that the hardware determines which of the two even texels is closer to the sample point 614 is by conceptually determining which side of the vertical line 642 the sample point 614 falls on (e.g., by determining whether the sample point 614 is less than or equal to 0.5 texels (or, alternatively, greater than 0.5 texels) from the nearest integer U-axis position, as discussed in detail below). As an example, for the even row texels 620 and 622, any point on or to the left of the vertical line 642 will be less than or equal to 0.5 texels away from the nearest integer U-axis position (e.g., u=01). If so, then the index of the even row texel 620 (i.e., the "left" even row texel) will be considered closer to the sample point 614 and therefore selected. Conversely, any point to the right of the vertical line 642 will be greater than 0.5 texels away from the nearest integer U-axis position (e.g., u=01). If so, then the index of the even row texel 422 (ie, the "right" even row texel) would be considered closer to the sample point 614 and would therefore be selected.

[0083] A specific embodiment for selecting a coarse index is defined more formally as follows. Let the position of a sample point (e.g., sample point 614) be given by (U 2 , V 2 ) is expressed as follows. First, calculate U 2 '=U 2 mod 1, or in other words, U 2 Truncation to decimal places (i.e. remainder). Conceptually, truncation performs a normalization operation that calculates how far a sample point is from the nearest integer U position along the U axis. For example, for a sample point interpolated to a decimal position corresponding to 1.3 texels along the U axis, truncation of the distance value results in a remainder of 0.3. Similarly, for a sample point interpolated to a binary position corresponding to 2.7 texels along the U axis, truncation of the distance value results in a remainder of 0.7.

[0084] As discussed above, of the four texels closest to the sample point 614, based on the MSB of the interpolated distance value D for the sample point 614, the even row texel pair 620, 622 or the odd row texel pair 628, 630 is of interest. Conceptually, the next step is to determine which of the two even row texels (if the MSB of the interpolated distance = 0) or which of the two odd row texels (if the MSB of the interpolated distance = 1) is closest to the sample point. In a particular embodiment, if the MSB of the interpolated distance is 0 (thereby indicating that the even row texel pair is of interest), the closest texel of the even row texels can be determined as follows. As discussed previously, first calculate U 2 '=U 2 mod 1, where U 2 is the U position of the sample point in texture space. Then, if U 2 '>0.5, then select the index of the even texel in the even U position (that is, the U position with the least significant bit being 0). Otherwise, if U 2 '≤0.5, then select the index of the even texel in the odd U position (that is, the U position with the least significant bit being 1). Use Fig. 6A As an example, if the MSB of the interpolated distance of a sample point is 0, and if U 2 '=U 2 mod 1≤0.5, then the sample point will fall to the left of vertical line 642. Because of this, the index of the even row texel at the odd U position will be selected. In this case, the even row texel 620 will be selected because its U coordinate is

[01] . As can be seen from the figure, the even row texel 620 is closer to the sample point 614 than the even row texel 622.

[0085] On the other hand, if it is determined at step 740 that the MSB of the interpolated distance value D for the sample point 614 is 1, the sample point 614 is determined to be inside the area defined by the edge, and at step 770, two odd-row texels are selected from the closest 4 texels. As such, the two odd-row texels selected would be the odd-row texels 628 and 630. Once the odd-row texels 628 and 630 are selected, the method 700 moves to step 780 to determine which of the odd-row texels 628 and 630 is closer in distance to the sample point 614. As discussed above, the closest odd-row texel may be determined in a manner similar to determining the closest even-row texel. Specifically, if the texture position of a sample point (e.g., the sample point 614) is (U 2 , V 2 ), then first calculate U 2 '=U 2 mod 1, or in other words, U2 Truncate to decimal places (i.e., remainder). Then, if U 2 '>0.5, then select the index of the odd-numbered row texel in an even U position (i.e., the U position with the least significant bit being 0). Otherwise, if U 2 '≤0.5, then select the index of the odd-numbered row of texels in an odd U position (i.e., the U position with the least significant bit being 1). Use Fig. 6A As an example, if the MSB of the interpolated distance of a sample point is 1 (which indicates that odd-numbered rows of texels are of interest), and if U 2 '=U 2 mod 1≤0.5, then the sample point will fall to the left of vertical line 642. Because of this, the index of the odd row texel at the odd U position will be selected. In this case, the odd row texel 628 will be selected because its U coordinate is

[01] . As can be seen from the figure, the odd row texel 628 is closer to the sample point 614 than the odd row texel 630.

[0086] The example discussed above describes the case where sample point 614 is located between two groups of aligned texels (e.g., between texel pair 634 and texel pair 636), which also means that four adjacent texels (e.g., 620, 622, 628, and 630) can have unique 4-bit connected indices. In other words, Fig. 6A As shown, sample point 614 is located between a pair of even row texels 618, 620 and a pair of even row texels 622, 624, and similarly between a pair of odd row texels 626, 628 and a pair of odd row texels 630, 632. However, the sample point may alternatively be located within a set of aligned 2×2 texels (e.g., within texels 618, 620, 626, 628), meaning that the even row texels would have the same 4-bit connected index and the odd row texels would have the same 4-bit connected index. As an example, Fig. 6A As shown, located at (U 3 , V 3 ) is located between the texels of the pair of even-numbered row texels 622, 624, and similarly between the texels of the pair of odd-numbered row texels 630, 632. In this case, the 4 closest texels to the sample point 644 would include a pair of even-numbered row texels 622, 624 and a pair of odd-numbered row texels 630, 632. Using the above method 700, after determining whether to select an even-numbered row texel pair (if the MSB of the interpolation distance = 0) or an odd-numbered row texel pair (if the MSB of the interpolation distance = 1), by calculating U 3 '=U 3mod 1>0.5 or ≤0.5 to select the closest even or odd row texel, which leads to the opposite result of the conceptual idea of ​​selecting the closest texel. As an example, if an even row texel pair 622, 624 is selected (MSB=0 based on the interpolation distance), and U is determined 3 '=U 3 mod1>0.5, then the index of the even row texel in the even U position (i.e., the U position with the least significant bit being 0) is selected. However, this results in the selection of the "left" even row texel 622 (since the U position of the even row texel 622 is 10), even though conceptually the U 3 '>0.5 indicates that the "right" even row texel 624 is closer. Although this result may seem inconsistent, because the even row texels 622 and 624 have the same connected index, the final result is insignificant as to which even row texel's index is chosen. In a similar manner, the same result occurs when choosing between a pair of odd row texels 630, 632.

[0087] Back to Figure 7 , after determining which even row texel or odd row texel is closer to the sample point 614, at step 790, the color index of the connection of the selected even row or odd row texel determined to be closest in distance to the sample point 614 is used to determine the color of the sample point 614. As an example, if it is determined at step 760 that the even row texel 620 is closest in distance to the sample point 614 (which has MSB=0), then it is determined that the sample point 614 is encoded as blue (e.g., as determined based on the assumption that the indices of the even row texels 618 and 620 discussed above are encoded as blue). Conversely, if it is determined at step 760 that the even row texel 622 is closest in distance to the sample point 614 (which has MSB=0), then it is also determined that the sample point 614 is encoded as blue. On the other hand, if it is determined at step 780 that the odd row texel 628 is closest in distance to the sample point 614 (which has MSB=1), then it is determined that the sample point 614 is encoded as red. Conversely, if it is determined at step 780 that the odd-numbered row texel 630 is closest in distance to the sample point 614 (which has MSB=1), then it is determined that the sample point 614 is encoded as green. Where appropriate, certain embodiments may repeat Figure 7 Although the present disclosure describes and illustrates one or more steps of a method that occurs in a particular order, Figure 7 The specific steps of the method are described in detail, but the present disclosure contemplates that the steps may occur in any suitable order. Figure 7 In addition, although the present disclosure describes and illustrates the method of Figure 7The present disclosure contemplates any suitable method for using a coarse-grained color index to determine the color of a sample position using a single distance field, including any suitable steps, which may include, where appropriate, Figure 7 All, some, or none of the steps of the method Figure 7 Furthermore, although the present disclosure describes and illustrates the steps of performing Figure 7 specific components, devices or systems for specific steps of the method, but the present disclosure contemplates performing Figure 7 Any suitable combination of any suitable components, devices, or systems of any suitable steps of the method.

[0088] As can be seen from the above-described embodiments of encoding the connected color indices in the texel array and deriving the appropriate connected color index to be used based on the interpolation results, the distance field tag with the connected color indices of adjacent texels can be configured to support up to 16 colors (e.g., a "transparent" color and up to 15 unique colors). Similar to the fine-grained technique, this coarse-grained technique also has the advantages of using a distance field (e.g., sharpness that is independent of size and / or direction) while alleviating the traditional disadvantages of having limited color options.

[0089] Uses a dual distance field to determine the color at the sample location

[0090] In certain embodiments, using a single distance field based on the distance to only one edge may cause sharp corners of characters or glyphs (e.g., diamonds) to appear rounded or smoothed-out when rendered, especially when the resolution of the distance field is reduced. One solution to this is to use dual distance fields to capture information at the intersection between two edges. In certain embodiments, when a label (e.g., a character, glyph, etc.) is created, the authoring software that creates the label can identify edges and mark the edges, such as type0 edges and type1 edges. The dual distance field captures the distance of the texel to two different types of edges to preserve intersection data. Each texel in the dual distance field label has two distance values: distance0 represents the distance from the texel to the closest type0 edge; and distance1 represents the distance from the texel to the closest type1 edge.

[0091] As discussed previously, each distance value of a texel encodes whether the texel is "inside" or "outside" relative to the edge from which the distance is measured. For a dual distance field texel, each of its distance values ​​can be "inside" or "outside", which means there are four "inside" and "outside" combinations for each texel. Figure 8An example region associated with the letter "F" is shown where two edges of different edge types meet at a vertex, resulting in four different regions associated with four different combinations of being inside or outside each edge. Figure 8 As shown, type0 edge 810 and type1 edge 812 intersect at point 614. Although edges 810, 812 are drawn as solid lines, the entire length of each edge 810, 812 is not necessarily visible in the label. Figure 8 The content shown in can correspond to the upper left corner of the letter "F", where point 814 is the corner, the right half of edge 812 defines the horizontal edge of the corner, and the lower half of edge 810 defines the vertical edge of the corner. The rest of edges 810 and 812 can be conceptual extensions of the actual visible portions of those edges 810, 812, which are created for the purpose of defining distance values ​​for nearby texels. If the content shown is the upper left corner of the "F", the texels below edge 812 can be considered to be "inside" relative to edge 812, while the texels above edge 812 can be considered to be "outside" relative to edge 812. Similarly, the texels to the right of edge 810 can be considered to be "inside" relative to edge 810, while the texels to the left of edge 810 can be considered to be "outside" relative to edge 810. Because type0 edge 810 intersects type1 edge 812 at point 814, four different regions 816, 818, 820 and 822 are formed. The texels in each region will have a different combination of "inside" and "outside" relative to the two edges 810, 812. For example, the texels in region 816 will have an outside / outside combination relative to edges 810 / 812, respectively; the texels in region 818 will have an inside / outside combination; the texels in region 826 will have an outside / inside combination, and the texels in region 830 will have an inside / inside combination. Like traditional single distance field tags, traditional dual distance field tags only support two colors - foreground and background. The foreground and background will each be encoded by a specific combination of "inside" and "outside". For example, an area of ​​inside / inside will be considered foreground, while all others (i.e., outside / outside, inside / outside, or outside / inside) will be considered background. Figure 8 For example, for the acute angle of the letter "F" at point 814, inside / inside would designate the foreground, while the remainder would be set to background. However, for one of the obtuse angles in the letter "F" (e.g., any interior angle formed by a vertical bar of the letter and either of the two horizontal bars), outside / outside would need to designate the background, while the remainder would be set to foreground, to properly color the interior of the "F." Existing methods may attempt to solve this problem using three types of edges. In contrast, the embodiments described herein solve this problem using only two types of edges (e.g., type0 and type1).

[0092] Certain embodiments described herein extend the color options for dual distance field fonts to more than two, and further allow each "inside" and "outside" combination to be assigned a different color. Figure 8 As an example, region 816 is colored white, region 818 is colored red, region 820 is colored yellow, and region 822 is colored orange.

[0093] When the dual distance tag is mapped to screen space, interpolation is used to determine the color of the screen pixel based on the dual distance field of the tagged texel. As mentioned above, each texel can have a distance0 value and a distance1 value, which specify the distance of the texel to the closest edge0 and the closest edge1, respectively. In a specific hardware implementation, each distance value can be represented by a binary value (e.g., 110111). In a specific embodiment, the most significant bit (MSB) of each distance value can be used to indicate whether the texel is "inside" or "outside" with respect to the associated edge type, and the remaining bits can indicate the distance. For example, if distance0 is 110111, the MSB of distance0 (which can be represented by MSB(distance0)) will be 0 (indicating "outside"), and the distance of the texel to the closest edge0 will be 10111. Similarly, if distance1 is 000001, MSB(distance1)=1, and the distance of the texel to the closest edge1 will be 00001.

[0094] When the distance value of the texel is used in the interpolation calculation (such as bilinear interpolation) of the sample point of the pixel in the texture space, the sample point will be assigned the interpolated distance0, which is calculated based on the distance0 values ​​of the four neighboring texels. In addition, the sample point will be assigned the interpolated distance1, which is calculated based on the distance1 values ​​of the four neighboring texels. Based on the MSB of the interpolated distance0, it can be determined whether the sample point is "inside" (if MSB=1) or "outside" (if MSB=0) relative to the edge type0. Similarly, based on the MSB of the interpolated distance1, it can be determined whether the sample point is "inside" (if MSB=1) or "outside" (if MSB=0) relative to the edge type1. As an example, if Figure 8As shown, sample point 824 would be associated with the "outside / outside" combination because it would have MSB (interpolation distance0) = 0 (outside) and MSB (interpolation distance1) = 0 (outside), which means that sample point 824 is outside both type0 edge 810 and type1 edge 812. Sample point 826 would be associated with the "inside / outside" combination because it would have MSB (interpolation distance0) = 1 (inside) and MSB (interpolation distance1) = 0 (outside), which means that sample point 826 is inside type0 edge 810 but outside type1 edge 812. Sample point 828 would be associated with the "outside / inside" combination because it would have MSB (interpolation distance0) = 0 (outside) and MSB (interpolation distance1 = 1 (inside), which means that sample point 828 is outside of type0 edge 810 but inside of type1 edge 812. Additionally, sample point 830 would be associated with the "inside / inside" combination because it would have MSB (interpolation distance0) = 1 (inside) and MSB (interpolation distance0) = 1 (inside), which means that sample point 830 is inside of both type0 edge 810 and type1 edge 812. Additionally, similar to the single edge distance label discussed above, texels that are determined to be outside of the label's texel array are treated as zero. Therefore, any sample position that is more than 0.5 texels outside of the label will have an interpolated distance of MSB = 0, resulting in a "transparent" color to be selected for that sample position.

[0095] In certain embodiments, once it has been determined which of the four combinations of "inside" and "outside" is associated with a sample point, the color index may be accessed to determine the desired color for the sample point. As will be described in further detail below, the texels within the region of the label may specify the desired color index for each "inside / outside" combination. In certain embodiments, each distance value (e.g., 6 bits) may be associated with a color index (e.g., 2 bits).

[0096] In a particular embodiment, the dual distance field tag may encode the desired color (or foreground / background determination) for the four combinations of "inside" and "outside" using either a fine-grained technique or a coarse-grained technique. In a fine-grained embodiment described in further detail below, based on the MSB of the interpolated distance of the sample point and the location of the sample point in texture space, a color index may be selected from nearby texels and used to determine the desired color of the sample point. The index value may be used to select a color from a color lookup table. For example, a two-bit color index may correspond to the color orange in the lookup table. Alternatively, the index value may be used to select a Boolean function (e.g., AND, OR, etc.) to be applied to the MSB (interpolated distance0) and the MSB (interpolated distance1) to determine whether the sample point should be associated with the foreground or the background. For example, if the index selects an AND operation, then applying such an operation to the MSB of 1 and the MSB of 0 may produce 0, which may indicate that the sample point should be the background. On the other hand, if the index selects an OR operation, then applying the operation to the MSB of 1 and the MSB of 0 may produce 1, which may indicate that the sample point should be the foreground. In other words, the index of a texel can define how each "inside" / "outside" combination should be mapped to the background or foreground for the region where the texel is located.

[0097] In a coarse-grained embodiment as discussed in further detail below, the indices selected from the texel pair can be concatenated to form a larger index value (e.g., two 2-bit indices can be concatenated to form a 4-bit index). A 4-bit index can point to 16 different colors in the color lookup table (e.g., one of which is transparent, and 15 colors).

[0098] Dual distance field fine-grained color selection

[0099] The discussion of the fine-grained dual distance field color selection method for sample points will focus on Fig.9A and Fig. 9B The embodiments shown and Fig.10 In short, Fig.9A The use of a fine-grained color index selection method on a texel array with dual distance fields is shown. Fig. 9B An example distance field associated with an aligned 2×2 set of texels for fine-grained color index selection is shown. Fig.10 An example method 1000 is shown for determining the color of a sample point using a fine-grained color index encoded within a dual distance field texel.

[0100] Fig.9AAn example 4×4 array 900 of texels is shown. The sixteen texels in array 900 are arranged in a texture map at positions on a U axis 910 and a V axis 912. In a particular hardware embodiment, the U coordinate and the V coordinate are specified as binary numbers, starting at 00 (corresponding to a decimal value of 0) and ending at 11 (corresponding to a decimal value of 3). Circles represent texel locations in texel array 900. Sample point 914 is selected using the process described above (e.g., casting a ray from a pixel to a surface in 3D view space, finding the intersection, and mapping the intersection into 2D texture space). As such, sample point 914 corresponds to a pixel in the screen, and a fine-grained color selection method 1000 is used to determine the color to be selected for sample point 914. As described above, sample point 914 corresponds to a pixel in the screen, and a fine-grained color selection method 1000 is used to determine the color to be selected for sample point 914. Fig.10 As shown, method 1000 may start from step 1010 , where four texels closest to sample point 914 are determined. Fig.9A The four texels closest to sample point 914 are shown to be texels in a 2×2 texel region 916 , and include texel 918 , texel 920 , texel 922 , and texel 924 .

[0101] like Fig. 9B As shown, texels 918, 920, 922, and 924 are each associated with a dual distance field. In a particular embodiment, each distance field may be 8 bits long. The first distance field of a texel may include a distance field consisting of distance0 or D 0 The first 6-bit distance value represented by D is represented by a 2-bit color index. The MSB bit of distance0 can encode whether the texel is "inside" or "outside", while the remaining bits can specify the distance between the texel and the nearest type0 edge. A second distance field for the same texel can include the distance field specified by distance1 or D 1 The second 6-bit distance value represented by distance1 and the 2-bit color index. The MSB bit of distance1 can encode whether the texel is "inside" or "outside", while the remaining bits can specify the distance between the texel and the nearest type1 edge. Each color index of each of texels 918, 920, 922, and 924 references a 4-entry color lookup table (e.g., Figure 3B Entries in the color lookup table shown).

[0102] In particular embodiments, in each region of texel array 900, the desired colors for four "inside" / "outside" combinations can be specified by four color indices of adjacent texel pairs, respectively. For example, the distance0 index and distance1 index of texel 918 and the distance0 index and distance1 index of texel 920 can indicate the desired color of the region, depending on which "inside" / "outside" combination is associated with sample point 914 (described in further detail below). Therefore, each index can represent the desired color index for a particular "inside" / "outside" combination. In particular embodiments, the "inside" / "outside" combination represented by each index can be assigned according to a predetermined pattern. For example, Fig. 9B An example of a pattern of a 2×2 aligned set of texels, such as texels 918, 920, 922, and 924, is shown. As shown, the distance0 index of texel 918 specifies the desired color for the outside / outside case, and the distance1 index specifies the desired color for the outside / inside case; the distance0 index of texel 920 specifies the desired color for the inside / outside case, and the distance1 index specifies the desired color for the inside / inside case; the distance0 index of texel 922 specifies the desired color for the inside / outside case, and the distance1 index specifies the desired color for the inside / inside case; and the distance0 index of texel 924 specifies the desired color for the outside / outside case, and the distance1 index specifies the desired color for the outside / inside case. This pattern can be repeated throughout the texel array 900. For example, this pattern of aligned 2×2 texels can be repeated by 2×2 texels at (U,V) coordinates (10,00), (11,00), (10,01), and (11,01), 2×2 texels at (00,10), (01,10), (00,11), (01,11), and 2×2 texels at (10,10), (11,10), (10,11), and (11,11).

[0103] Fig. 9B The patterns shown in FIG. 1 can be described in various ways, such as in terms of even texels and odd texels. Each texel can be referred to as an even texel or an odd texel, which is the same as the above reference texel. Figure 3A-3B1 and 1 are defined in the same manner as described above. For example, texel 918 can be considered an even texel because the LSBs of its U coordinate and V coordinate are the same (i.e., both are 0 in this example). Texel 924 can also be considered an even texel because the LSBs of its U coordinate and V coordinate are also the same (i.e., both are 1 in this example). Conversely, texel 920 can be considered an odd texel because the LSBs of its U coordinate and V coordinate are different (i.e., 1 and 0 in this example). Similarly, texel 922 can be considered an odd texel because the LSBs of its U coordinate and V coordinate are also different (i.e., 0 and 1 in this example). Fig. 9B The pattern shown in can be described as follows: each even texel can have a distance0 index associated with the outer / outer combination and a distance1 index associated with the outer / inner combination, and each odd texel can have a distance0 index associated with the inner / outer combination and a distance1 index associated with the inner / inner combination. The pattern repeats in an interlaced manner. Within the aligned 2×2 set of texels, each distance0 index is associated with the outer / outer combination or the inner / outer combination, and each distance1 index is associated with the outer / inner combination or the inner / inner combination. It should be noted that although the inner / outer combination associated with each index can repeat, this does not mean that the index value itself needs to follow any particular pattern. For example, even though texel 918 and the texel at (10,00) can both have a distance0 index associated with the outer / outer combination, the distance0 index of texel 918 can correspond to red, while the distance0 index of the texel at (10,00) can correspond to blue.

[0104] Similar to the reference above Figure 2A and Figure 2B In the fine-grained single distance field embodiment described above, the even-numbered texels and odd-numbered texels in the fine-grained dual distance field embodiment also specify the desired color for their corresponding coverage area through their respective indices. For example, the even-numbered texels specify the color for their corresponding coverage area (e.g., Figure 2A ), and odd-numbered texels specify the color for their corresponding coverage area (e.g., as Figure 2B). As will be described in more detail below, if the MSB of the interpolated distance0 of the sample point 914 is 0, the closest even texel can be selected. The selected even texel has two indices associated with distance0 and distance1. If the MSB of the interpolated distance1 of the sample point 914 is 0, the index associated with distance0 will be selected. On the other hand, if the MSB of the interpolated distance1 is 1, the index associated with distance1 will be selected. The selected index can then be used to determine the color of the sample point 914 that is located within the coverage area of ​​the selected even texel. As another example, if the MSB of the interpolated distance0 of the sample point 914 is 1, the closest odd texel can be selected. The selected odd texel has two indices associated with distance0 and distance1. If the MSB of the interpolated distance1 of the sample point 914 is 0, the index associated with distance0 will be selected. On the other hand, if the MSB of the interpolated distance1 is 1, the index associated with distance1 will be selected. The selected index may then be used to determine the color of sample points 914 that are within the footprint of the selected odd-numbered texel.

[0105] The final index that has been selected can then be used to determine the color of the sample point 914. As described above, a particular embodiment of the index can specify a particular logical operation (e.g., AND, OR, XOR, NAND, NOR, XNOR, etc.) to be applied to the MSBs of the interpolated distance0 value and the interpolated distance1 value of the sample point 914. The result of the logical operation can indicate whether the sample point 914 is background (e.g., if the logical operation yields 0) or foreground (e.g., if the logical operation yields 1). In other embodiments, the selected index can point to a particular entry in the color lookup table (e.g., Figure 3B ).

[0106] like Fig.10 As shown, in step 1012, based on the distance value of each texel in texels 918, 920, 922 and 924, the distance value distance0 (D 0 ) and distance1(D 1 ) is interpolated. In a specific embodiment, the interpolation distance D 0 Specify the distance between sample point 914 and the closest type0 edge, and interpolate the distance D 1 The distance between the sample point 914 and the closest type1 edge is then determined in step 1014 by interpolating the distance value D of the sample point 914. 0The highest-order bit of is determined to be 0 or 1. In other words, if the interpolated distance value D of the sample point 914 0 is determined to be 0, then the sample point 914 is determined to be “outside” relative to the closest type0 edge (i.e., outside the region defined by the closest type0 edge). On the other hand, if the interpolated distance value D of the sample point 914 is 0 If the MSB of is determined to be 1, then sample point 914 is determined to be “inside” relative to the closest type0 edge (ie, inside the region defined by the closest type0 edge). Similarly, if the interpolated value D 1 = 0, then the sample point 914 is determined to be “outside” relative to the nearest type1 edge; if the interpolated D 1 =1, then sample point 914 is determined to be “inside” relative to the closest type1 edge.

[0107] If the interpolation distance value D of the sample point 914 is determined in step 1014 0 If the MSB is 0, then at step 1016, sample point 914 is determined to be "outside" relative to the nearest type0 edge, and therefore two even texels are selected from the 2×2 texel area 916. These even texels are in the same order as in the reference above. Figure 3A-3B 916. Specifically, within the 2×2 texel region 916, texel 918 can be considered an even texel because the LSBs of its U coordinate (u=00) and V coordinate (v=00) are the same (i.e., both are 0 in this example), and texel 924 can also be considered an even texel because the LSBs of its U coordinate (u=01) and V coordinate (v=01) are also the same (i.e., both are 1 in this example). Therefore, within the 2×2 texel region 916, texels 918 and 924 are selected as two even texels.

[0108] Then, at step 1018, method 1000 determines which of the two selected even texels is closer in distance to sample point 914. This is similar to Figure 3A The single distance fine-grained embodiment described in Figure 4 Specifically, one way for the hardware to determine which of the two even texels is closer to the sample point 914 is to conceptually determine which side of the diagonal 926 the sample point 914 falls on. This is done by interpolating the distance value D of the sample point 914. 0This is done by summing the U-axis distance and the V-axis distance of the sample point 914. Therefore, for the 2×2 texel area 916, the U-axis distance and the V-axis distance of any point on or to the left of the diagonal 926 add up to 1 distance unit or less than 1 distance unit (in this example, the point falling on the diagonal is counted as closer to the texel on the left). If so, then the index of the even texel 918 (e.g., including the distance0 index and the distance1 index) is considered to be closer to the sample point 914 and is therefore selected. Conversely, the U-axis distance and the V-axis distance of any point to the right of the diagonal 926 add up to greater than 1 distance unit. If so, then the index of the texel 924 (e.g., including the distance0 index and the distance1 index) is considered to be closer to the sample point 914 and is therefore selected. As an example, if the sample point 914 is determined to be on the left side of the diagonal 926, then the index of the even texel 918 (e.g., including the distance0 index and the distance1 index) will be selected.

[0109] Since two indices (the distance0 index and the distance1 index) are associated with the even texel 918, the method 1000 next determines which index of the even texel 918 to use. To make this determination, at step 1020, the method 1000 determines the interpolated distance value D for the sample point 914. 1 The highest-order bit of is 0 or 1. Therefore, if the interpolation distance value D of the sample point 914 is determined in step 1020, 1 is 0, then sample point 914 is determined to be "outside" relative to the nearest type1 edge, and at step 1022, the index associated with distance0 of the selected even texel will be selected to determine the color of sample point 914. On the other hand, if the interpolated distance value D of sample point 914 is determined at step 1020 1 is 1, then the sample point 914 is determined to be "inside" relative to the nearest type1 edge, and at step 1024, the index associated with the distance1 of the selected even texel will be selected to determine the color of the sample point 914. As discussed above, in certain embodiments, the selected final index can then be used to determine the color of the sample point 914 based on a specific logical operation specified by the index to indicate whether the sample point 914 is background (e.g., if the logical operation yields 0) or foreground (e.g., if the logical operation yields 1). In other embodiments, the selected index can point to a specific entry in the color lookup table, similar to the above description of Figure 3B As an example, if it is determined that the sample point 914 is closer in distance to the even-numbered texel 918, and the interpolated distance value D of the sample point 914 1If the MSB of is determined to be 0, the index associated with distance0 of the even-numbered texel 918 will be selected to determine the color of the sample point 914. Figure 3B If the 2-bit index of distance0 is encoded as "3", it is determined that the sample point 914 is encoded as blue.

[0110] On the other hand, if the interpolation distance value D of the sample point 914 is determined in step 1014 0 If the MSB is 1, then at step 1026, sample point 914 is determined to be "inside" relative to the nearest type0 edge, and therefore two odd texels are selected from the 2×2 texel area 916. These odd texels are in the same manner as in the reference above. Figure 3A-3B 916. Specifically, within the 2×2 texel region 916, texel 920 can be considered an odd texel because the LSBs of its U coordinate (u=01) and V coordinate (v=00) are different (i.e., 1 and 0 in this example), and texel 922 can also be considered an odd texel because the LSBs of its U coordinate (u=00) and V coordinate (v=01) are also different (i.e., 0 and 1 in this example). Therefore, within the 2×2 texel region 916, texels 920 and 922 are selected as two odd texels.

[0111] Then, at step 1028, method 1000 determines which of the two selected odd texels is closer in distance to sample point 914. This is similar to Figure 3A The embodiments described in Figure 4 Specifically, one way the hardware determines which of the two odd texels is closer to the sample point 914 is to conceptually determine which side of the diagonal line 928 the sample point 914 falls on. This is done by interpolating the distance value D of the sample point 914. 0This is done by summing the U-axis distance and V-axis distance of the sample point 914. Therefore, for the 2×2 texel area 916, the U-axis distance and V-axis distance of any point on or to the left of the diagonal 928 add up to 1 distance unit or less than 1 distance unit (in this example, the point falling on the diagonal is counted as closer to the texel on the left). If so, the index of the odd texel 922 (e.g., including the distance0 index and the distance1 index) is considered to be closer to the sample point 914 and is therefore selected. Conversely, the U-axis distance and V-axis distance of any point to the right of the diagonal 928 add up to greater than 1 distance unit. If so, the index of the texel 920 (e.g., including the distance0 index and the distance1 index) is considered to be closer to the sample point 914 and is therefore selected. As an example, if the sample point 914 is determined to be on the left side of the diagonal 928, the index of the odd texel 922 (e.g., including the distance0 index and the distance1 index) will be selected.

[0112] Since two indices (the distance0 index and the distance1 index) are associated with the odd texel 922, the method 1000 next determines which index of the odd texel 922 to use. To make this determination, at step 1030, the method 1000 determines the interpolated distance value D for the sample point 914. 1 The highest-order bit of is 0 or 1. Therefore, if the interpolation distance value D of the sample point 914 is determined in step 1030, 1 is 0, then sample point 914 is determined to be "outside" relative to the nearest type1 edge, and at step 1032, the index associated with distance0 of the selected odd-numbered texel will be selected to determine the color of sample point 914. On the other hand, if the interpolated distance value D of sample point 914 is determined at step 1030 to be 1 is 1, then the sample point 914 is determined to be "inside" relative to the nearest type1 edge, and at step 1034, the index associated with the distance1 of the selected odd texel will be selected to determine the color of the sample point 914. As discussed above, in certain embodiments, the selected final index can then be used to determine the color of the sample point 914 based on a specific logical operation specified by the index to indicate whether the sample point 914 is background (e.g., if the logical operation yields 0) or foreground (e.g., if the logical operation yields 1). In other embodiments, the selected index can point to a specific entry in the color lookup table, similar to the above description of Figure 3B As an example, if it is determined that the sample point 914 is closer in distance to the odd-numbered texel 922, and the interpolated distance value D of the sample point 914 1The MSB of is determined to be 0, then the index associated with distance0 of the odd-numbered texel 922 will be selected to determine the color of the sample point 914. Figure 3B If the 2-bit index of distance0 is encoded as "1", it is determined that the sample point 914 is encoded as red.

[0113] As can be seen from the above described embodiment of using a dual distance field to encode the color index in the texel array and deriving the appropriate color index to be used based on the interpolation result, the dual distance field tag can be configured to support more than two colors. The dual distance field can be used to capture color information at the intersection between two edges to help preserve intersection data and better render sharp corners of characters or glyphs.

[0114] Dual distance field coarse-grained color selection

[0115] The discussion of the coarse-grained dual distance field color selection method for sample points will focus on Figure 11A-11B The embodiments shown and Fig.12 In short, Fig.11A The use of a coarse-grained color index selection method on a texel array with dual distance fields is shown. Fig. 11B An example distance field associated with an aligned 2×2 set of texels for coarse-grained color index selection is shown. Fig.12 An example method of determining the color of a sample point using a coarse-grained color index encoded in dual distance field texels is shown.

[0116] Fig.11A An example 4×4 array 1100 of texels is shown. The sixteen texels in array 1100 are arranged in a texture map at positions on a U axis 1110 and a V axis 1112. In a particular hardware embodiment, the U coordinate and the V coordinate are specified in binary numbers, starting at 00 (corresponding to a decimal value of 0) and ending at 11 (corresponding to a decimal value of 3). Circles represent texel positions in texel array 1100. Sample point 1114 is selected (similar to the manner in which sample point 914 was selected above), and a coarse-grained color selection method 1200, as discussed below, is used to determine the color to be selected for sample point 1114.

[0117] In at least one aspect, the coarse-grained dual distance field color selection method 1200 differs from the fine-grained dual distance field color selection method 1000 in that the coarse-grained dual distance field color selection method uses texel pairs (rather than individual texels) to specify the desired color index for the area around the texel pair (e.g., by concatenating the indices of each pair of horizontally aligned texels). As a result, the footprint of each texel pair is larger than the footprint of each texel used in the fine-grained method. The benefit of using texel pairs to encode color indices is that the number of bits available to encode the index is increased (e.g., from 2 bits to 4 bits), which means that more color options are available (e.g., from 4 to 16 colors). Since the first color table entry is typically set to transparent (i.e., no color), there are up to 15 unique colors left that can be encoded using the 4-bit index used in the coarse-grained dual distance field color selection method.

[0118] As discussed above, for dual distance field texels, each texel may have a distance0 value and a distance1 value, which specify the distance of the texel to the closest edge0 and the closest edge1, respectively. In addition, each of its distance values ​​may be "inside" or "outside", which means that there are four "inside" and "outside" combinations for each texel. As discussed in more detail below, in certain embodiments, the dual distance field tag may encode the desired color (or foreground / background determination) for the four combinations of "inside" and "outside" using a coarse-grained technique. In the coarse-grained technique, the indexes selected from a pair of texels may be concatenated to form a larger index value (e.g., two 2-bit indexes may be concatenated to form a 4-bit index). In a dual distance field embodiment, each texel has two color indexes: one associated with distance0 and the other associated with distance1. In certain embodiments, the corresponding indexes of two pairs of aligned texels are concatenated together. For example, texel 1118 may have an index associated with distance0 and another index associated with distance1; similarly, texel 1120 may have an index associated with distance0 and another index associated with distance1. The distance0 index of each of texels 1120 and 1118 can be concatenated to form a single 4-bit index associated with distance0. Similarly, the distance1 index of each of texels 1118 and 1120 can be concatenated to form a single 4-bit index associated with distance1. The resulting distance0 4-bit index and distance1 4-bit index can both be stored with texels 1118 and 1120 so that they both have a copy of the index. As mentioned above, a 4-bit index can point to 16 different colors in the color lookup table (e.g., one of which is transparent, and 15 colors).

[0119] like Fig.12 As shown, method 1200 may start from step 1210, where the indices of adjacent even-row texel pairs or odd-row texel pairs are concatenated and stored in a texel buffer in a pixel block together with two associated texels. Figure 5A , Figure 5B and Fig. 6A In the described embodiment, the texel pair in each even row (e.g., determined based on the least significant bit of the V position of the even texel being 0) can be used to encode the color index for the "outside" case, while the texel pair in each odd row (e.g., determined based on the least significant bit of the V position of the odd texel being 1) can be used to encode the color index for the "inside" case. In general, an "even row texel" refers to a texel on an even row of a texel array (e.g., the least significant bit of the V position of the even row texture is 0), while an "odd row texel" refers to a texel on an odd row of a texel array (e.g., the least significant bit of the V position of the odd row texture is 1). As an example, in Fig.11A , texels 1118, 1120, 1122, and 1124 (all with v=00) are even-row texels, and texels 1126, 1128, 1130, and 1132 (all with v=01) are odd-row texels.

[0120] like Fig. 11B As shown, texels 1118, 1120, 1126, and 1128 are each associated with a dual distance field having a connected index. In a particular embodiment, each texel may have a first distance field and a second distance field, the first distance field including the distance field represented by distance0 or D 0 The first 6-bit distance value and the associated 4-bit color index are connected. The second distance field also includes the distance value obtained by distance1 or D 1 The first 6-bit distance value represented by the 4-bit connected color index. The MSB bit of distance0 can encode whether the texel is "inside" or "outside", and the remaining bits can specify the distance between the texel and the nearest type0 edge. Additionally, the MSB bit of distance1 can encode whether the texel is "inside" or "outside", and the remaining bits can specify the distance between the texel and the nearest type1 edge. Each of the connected color indices for each of texels 1118, 1120, 1126, and 1128 references a 16-entry color lookup table (e.g., Figure 6B Entries in the color lookup table shown).

[0121] In a particular embodiment, in each region of the texel array 1100, the desired colors for the four "inside" / "outside" combinations can be specified by two connected color indices of adjacent texel pairs, respectively. For example, the distance0-connected index of texel 1118 generated by connecting the distance0 indices of texel 1118 and texel 1120 can indicate the desired color for the region covered by the pair of texels 1118, 1120, depending on which "inside" / "outside" combination is associated with the sample point 1114 (described in further detail below). In addition, the distance1-connected index of texel 1118 generated by connecting the distance0 indices of texel 1118 and texel 1120 can also indicate the desired color for the same region depending on which "inside" / "outside" combination is associated with the sample point 1114 (the "inside" / "outside" combination associated with the distance1-connected index will be different from the "inside" / "outside" combination associated with the distance0-connected index). In other words, the two connected indices of each texel can represent the desired color indices for two different "inside" / "outside" combinations, one "inside" / "outside" combination associated with distance0 and the other "inside" / "outside" combination associated with distance1. In a particular embodiment, the two "inside" / "outside" combinations represented by the two connected indices of each texel can be assigned according to a predetermined pattern.

[0122] As an example, Fig. 11BAn example of a pattern of a 2×2 aligned set of texels is shown, such as a first group of texels 1118, 1120, 1126, and 1128, and a similar second group of texels 1122, 1124, 1130, and 1132. As shown, the connected indices of distance0 (which are the same for both texels) for the even rows of texels 1118 and 1120 specify the desired color for the outside / outside case, and the connected indices for distance1 specify the desired color for the outside / inside case. Additionally, the connected indices of distance0 (which are the same for both texels) for the odd rows of texels 1126 and 1128 specify the desired color for the inside / outside case, and the connected indices for distance1 specify the desired color for the inside / inside case. Similarly, the pattern may be repeated for adjacent texels 1122, 1124 and texels 1130, 1132. For example, the connected indices of distance0 for even-numbered rows of texels 1122 and 1124 (which are the same for both texels) specify the desired color for the outside / outside case, and the connected indices for distance1 specify the desired color for the outside / inside case. Additionally, the connected indices of distance0 for odd-numbered rows of texels 1130 and 1132 (which are the same for both texels) specify the desired color for the inside / outside case, and the connected indices for distance1 specify the desired color for the inside / inside case. Additionally, this pattern may be repeated through the remainder of the texel array 1100. For example, such a pattern for aligned 2×2 texels may be repeated by 2×2 texels located at (U,V) coordinates (00,10), (01,10), (00,11), and (01,11), and 2×2 texels located at (10,10), (11,10), (10,11), and (11,11).

[0123] Fig. 11B The patterns shown in FIG. 1 can be described in various ways, such as in terms of even rows of texels and odd rows of texels. Each texel can be referred to as an even row texel or an odd row texel, to be consistent with the above reference to FIG. Figure 5A-Figure 5BThe description is defined in the same manner. For example, as discussed above, the even row texels are located at V position v=00 ("even" because their LSB is 0), and therefore include texels 1118, 1120, 1122, and 1124. Among these four even row texels, the two indices of a pair of adjacent even row texels 1118 and 1120 are connected, and the result is associated with the connected indices of the two even row texels, and a pair of adjacent even row texels 1122 and 1124 are connected, and the result is associated with the connected indices of the two even row texels. Similarly, the odd row texels are located at V position v=01 ("odd" because their LSB is 1), and therefore include texels 1126, 1128, 1130, and 1132. Among these four odd row texels, the two indices of a pair of adjacent odd row texels 1126 and 1128 are connected and the result is associated with the connected indices of the two odd row texels, and the two indices of a pair of adjacent odd row texels 1130 and 1132 are connected and the result is associated with the connected indices of the two odd row texels.

[0124] Fig. 11B The pattern shown in can be described as follows: each even row of texels can have a connected distance0 index associated with an outer / outer combination and a connected distance1 index associated with an outer / inner combination, and each odd row of texels can have a connected distance0 index associated with an inner / outer combination and a connected distance1 index associated with an inner / inner combination. The pattern repeats in an interlaced manner. Within the aligned 2×2 set of texels, each distance0 index is associated with an outer / outer combination or an inner / outer combination, and each distance1 index is associated with an outer / inner combination or an inner / inner combination. It should be noted that although the inner / outer combination associated with each connected index can repeat, this does not mean that the index values ​​themselves need to follow any particular pattern. For example, even though texel 1118 and the texel at (00,10) can both have a distance0 index associated with an outer / outer combination, the distance0 index of texel 1118 can correspond to red, while the distance0 index of the texel at (00,10) can correspond to blue.

[0125] Similar to the reference above Figure 5A and Figure 5B In the coarse-grained single distance field embodiment described above, the even-numbered and odd-numbered rows of texels in the coarse-grained dual distance field embodiment also specify the desired color for their corresponding coverage area through their respective indices. For example, the even-numbered rows of texels specify the color for their corresponding coverage area (e.g., Figure 5A ), and odd-numbered rows of texels specify the color for their corresponding coverage area (e.g., as Figure 5B ). As will be described in more detail below, if the MSB of the interpolation distance0 of the sample point 1114 is 0, the closest even row texel can be selected. The selected even row texel has two connected indices associated with distance0 and distance1. If the MSB of the interpolation distance1 of the sample point 1114 is 0, the connected index associated with distance0 will be selected. On the other hand, if the MSB of the interpolation distance1 is 1, the connected index associated with distance1 will be selected. The selected connected index can then be used to determine the color of the sample point 1114 that is located within the coverage area of ​​the selected even row texel. As another example, if the MSB of the interpolation distance0 of the sample point 1114 is 1, the closest odd row texel can be selected. The selected odd row texel has two connected indices associated with distance0 and distance1. If the MSB of the interpolation distance1 of the sample point 1114 is 0, the connected index associated with distance0 will be selected. On the other hand, if the MSB of the interpolated distance1 is 1, then the connected index associated with distance1 will be selected. The selected connected index can then be used to determine the color of the sample point 1114 that is within the footprint of the selected odd row of texels.

[0126] The final index that has been selected can then be used to determine the color of sample point 1114. As described above, a particular embodiment of the connected index can specify a particular logical operation (e.g., AND, OR, XOR, NAND, NOR, XNOR, etc.) to be applied to the MSBs of the interpolated distance0 value and the interpolated distance1 value of sample point 1114. The result of the logical operation can indicate whether sample point 914 is background (e.g., if the logical operation yields 0) or foreground (e.g., if the logical operation yields 1). In other embodiments, the selected connected index can point to a color lookup table with up to 16 different entries (e.g., Figure 6B ) in a specific entry.

[0127] Back to Fig.12 In the illustrated method 1200 , at step 1220 , four texels closest to the sample point 1114 are determined. Fig.11AIt is shown that the four texels closest to the sample point 1114 are texel 1120, texel 1122, texel 1128, and texel 1130. Then, at step 1214, based on the corresponding distance0 value and distance1 value of each of the texels 1120, 1122, 1128, and 1130, the distance value distance0 (D 0 ) and distance1(D 1 ) is interpolated. In a specific embodiment, the interpolation distance D 0 Specify the distance between sample point 1114 and the closest type0 edge, and interpolate the distance D 1 Specify the distance between the sample point 1114 and the closest type1 edge. Next, at step 1216, the interpolated distance value D of the sample point 1114 is 0 The highest-order bit of is determined to be 0 or 1. In other words, if the interpolated distance value D of the sample point 1114 0 is determined to be 0, then the sample point 1114 is determined to be “outside” relative to the closest type0 edge (i.e., outside the region defined by the closest type0 edge). On the other hand, if the interpolated distance value D of the sample point 1114 is 0 If the MSB of is determined to be 1, then sample point 914 is determined to be “inside” relative to the nearest type0 edge (ie, within the region defined by the nearest type0 edge).

[0128] If the interpolated distance value D of the sample point 1114 is determined in step 1216 0 If the MSB of is 0, then at step 1218, sample point 1114 is determined to be "outside" relative to the closest type0 edge, and therefore two even-numbered row texels are selected from the closest 2×2 texel region 1116. The even-numbered row texels are in the same order as in the reference above. Figure 5A-Figure 5B Specifically, within the 2×2 texel region 1116, texels 1120 and 1122 can be considered as even-numbered texels because the LSB of their V coordinates is equal to 0. Therefore, at the interpolation distance D 0 In this example where the MSB is 0, texels 1120 and 1122 are selected.

[0129] Then, at step 1220, method 1200 determines which of the two selected even-row texels is closer in distance to sample point 1114. This is similar to Fig. 6A The single distance coarse-grained embodiment described in Figure 7114. Specifically, one way in which the hardware determines which of the two even row texels is closer to the sample point 1114 is by conceptually determining on which side of the vertical line 1134 the sample point 1114 falls (e.g., by determining whether the sample point 1114 is less than or equal to 0.5 texels (or, alternatively, greater than 0.5 texels) from the nearest integer U-axis position, as discussed above). As an example, for even row texels 1120 and 1122, any point on or to the left of the vertical line 1134 is less than or equal to 0.5 texels away from the nearest integer U-axis position (e.g., u=01). If so, then the connected indices (e.g., including the connected distance0 index and the connected distance1 index) of the even row texel 1120 (i.e., the "left" even row texel) are considered closer to the sample point 1114 and are therefore tentatively selected. Conversely, any point to the right of vertical line 1134 may be more than 0.5 texels away from the nearest integer U-axis position (e.g., u=01). If so, the connected indices (e.g., including the connected distance0 index and the connected distance1 index) of the even row texel 1122 (i.e., the "right" even row texel) may be considered closer to sample point 1114 and therefore be preliminarily selected.

[0130] Since two connected indices (the connected distance0 index and the connected distance1 index) are associated with the even row texel 1120, the method 1200 next determines which connected index of the even row texel 1120 to use. To make this determination, at step 1222, the method 1200 determines the interpolated distance value D for the sample point 1114. 1 The highest-order bit of is 0 or 1. If the interpolation distance value D of the sample point 1114 is determined in step 1222 1 is 0, the sample point 1114 is determined to be "outside" relative to the nearest type1 edge, and at step 1224, the connected index associated with distance0 of the selected even row texel 1120 will be selected to determine the color of the sample point 1114. On the other hand, if the interpolated distance value D of the sample point 1114 is determined at step 1122 1is 1, then the sample point 1114 is determined to be "inside" relative to the nearest type1 edge, and at step 1224, the connected index associated with distance1 of the selected even row texel 1120 will be selected to determine the color of the sample point 1114. As discussed above, in certain embodiments, the selected final index can then be used to determine the color of the sample point 1114 based on a specific logical operation specified by the index to indicate whether the sample point 1114 is background (e.g., if the logical operation yields 0) or foreground (e.g., if the logical operation yields 1). In other embodiments, the selected index can point to a specific entry in a color lookup table, similar to the above description of Figure 6B As an example, if it is determined that the sample point 1114 is closer in distance to the even-numbered row texel 1120, and the interpolated distance value D of the sample point 1114 is 1 If the MSB of is determined to be 0, the index associated with distance0 of the even-numbered row texel 1120 is selected to determine the color of the sample point 1114. Figure 6B If the index connected to the 4 bits of distance0 is encoded as "3", it is determined that the sample point 1114 is encoded as blue.

[0131] On the other hand, if the interpolated distance value D of the sample point 1114 is determined in step 1216 0 If the MSB of is 1, then at step 1228, sample point 114 is determined to be "inside" relative to the nearest type0 edge, and therefore two odd-numbered row texels are selected from the 2×2 texel area 1116. The odd-numbered row texels are in the same manner as in the reference above. Figure 5A-Figure 5B Specifically, within the 2×2 texel region 1116, texels 1128 and 1130 can be considered as odd-row texels because the LSB of its V coordinate is 1. Therefore, within the 2×2 texel region 1116, texels 1128 and 1130 are selected as two odd-row texels.

[0132] Then, at step 1230, method 1200 determines which of the two selected odd-numbered row texels is closer in distance to sample point 1114. This is similar to Fig. 6A The embodiments described in Figure 71 is determined at step 780 of method 700. Specifically, similar to the determination of the even row texels described above, one way in which the hardware determines which of the two odd row texels is closer to the sample point 1114 is by conceptually determining on which side of the vertical line 1134 the sample point 1114 falls (e.g., by determining whether the sample point 1114 is less than or equal to 0.5 texels (or, alternatively, greater than 0.5 texels) from the nearest integer U-axis position, as discussed above). As an example, for odd row texels 1128 and 1130, any point on or to the left of the vertical line 1134 may be less than or equal to 0.5 texels away from the nearest integer U-axis position (e.g., u=01). If so, then the connected indices (e.g., including the connected distance0 index and the connected distance1 index) of the odd row texel 1128 (i.e., the "left" odd row texel) may be considered closer to the sample point 1114 and is therefore preliminarily selected. Conversely, any point to the right of vertical line 1134 may be more than 0.5 texels away from the nearest integer U-axis position (e.g., u=01). If so, the connected indices (e.g., including the connected distance0 index and the connected distance1 index) of the odd row texel 1130 (i.e., the "right" odd row texel) may be considered closer to sample point 1114 and therefore be preliminarily selected.

[0133] Since two connected indices (the connected distance0 index and the connected distance1 index) are associated with the odd row texel 1128, the method 1200 next determines which connected index of the odd row texel 1128 to use. To make this determination, at step 1232, the method 1000 determines the interpolated distance value D for the sample point 1114. 1 The highest-order bit of is 0 or 1. If the interpolation distance value D of the sample point 1114 is determined in step 1232 1 is 0, the sample point 1114 is determined to be "outside" relative to the nearest type1 edge, and at step 1234, the connected index associated with distance0 of the selected odd-numbered row of texels will be selected to determine the color of the sample point 1114. On the other hand, if the interpolated distance value D of the sample point 1114 determined at step 1232 is 1is 1, then the sample point 1114 is determined to be "inside" relative to the nearest type1 edge, and at step 1236, the connected index associated with the distance1 of the selected odd-numbered row of texels will be selected to determine the color of the sample point 1114. As discussed above, in certain embodiments, the selected final index can then be used to determine the color of the sample point 1114 based on a specific logical operation specified by the connected index to indicate whether the sample point 1114 is background (e.g., if the logical operation yields 0) or foreground (e.g., if the logical operation yields 1). In other embodiments, the selected connected index can point to a specific entry in a color lookup table, similar to the above description of Figure 6B As an example, if it is determined that the sample point 1114 is closer in distance to the odd-numbered row texel 1128, and the interpolated distance value D of the sample point 1114 is 1 If the MSB of is determined to be 0, the connected index associated with distance0 of the odd-numbered row texel 1128 will be selected to determine the color of the sample point 1114. Figure 6B If the index connected by the 4 bits of distance0 is encoded as "1", it is determined that the sample point 1114 is encoded as red.

[0134] The example discussed above describes the case where the sample point 1114 is located between two groups of aligned texels (e.g., the first group includes texels 1118, 1120, 1126, and 1128, and the second group includes texels 1122, 1124, 1130, and 1132), which also means that four adjacent texels (e.g., 1120, 1122, 1128, and 1130) can have unique 4-bit connected indices. In other words, Fig.11A As shown, sample point 1114 is located between a pair of even row texels 1118, 1120 and a pair of even row texels 1122, 1124, and similarly between a pair of odd row texels 1126, 1128 and a pair of odd row texels 1130, 1132. However, the sample point may alternatively be located within a set of aligned 2×2 texels (e.g., within texels 1118, 1120, 1126, 1128), meaning that the even row texels (e.g., 1118 and 1120) would have the same 4-bit connected index and the odd row texels (e.g., 1126 and 1128) would have the same 4-bit connected index. As an example, assume that there is a texel (U) between the pair of even row texels 1118, 1120 and between the pair of odd row texels 1126, 1128. 3 ,V 3). In this case, the four texels closest to the sample point would include texels 1118, 1120, 1126, and 1128. Using the above method 1200, after determining whether to select an even row texel pair (if the MSB of interpolation distance0 = 0) or an odd row texel pair (if the MSB of interpolation distance0 = 1), by calculating U 3 '=U 3 mod 1>0.5 or ≤0.5 to select the closest even or odd row texel, resulting in the opposite result of the conceptual idea of ​​selecting the closest texel. As an example, if the even row texel pair 1118, 1120 is selected (based on the MSB of interpolation distance0 = 0), and U is determined 3 '=U 3 mod1>0.5, then the index of the even row texel at an even U position (i.e., a U position with the least significant bit being 0) is selected. However, this results in the selection of the "left" even row texel 1118 (since its U position is 00), even though conceptually the U 3 '>0.5 indicates that the "right" even row texel 1120 is closer. Although this result may seem inconsistent, because the even row texels 1118 and 1120 have the same connection index, the final result is insignificant as to which even row texel's index is chosen. In a similar manner, the same result occurs when choosing between a pair of odd row texels 1126, 1128.

[0135] As can be seen from the above described embodiments of using two distance fields to encode the connected color indexes in the texel array and deriving the appropriate color index to be used based on the interpolation results, the dual distance field tag with the connected color indexes of adjacent texels can be configured to support up to 16 colors (e.g., a "transparent" color and up to 15 unique colors). Similar to the fine-grained dual distance field technique, this coarse-grained dual distance field technique can be used to capture color information at the intersection between two edges to help preserve intersection data and better render sharp corners of characters or glyphs.

[0136] Distance Field Optimization Technique

[0137] Blending distance field mipmaps

[0138] Certain embodiments of distance field tags may produce suboptimal results in certain situations. For example, the above distance field tags are ideally used when the horizontal and vertical distances between edges are at least two texels, and the diagonal distance is the square root of two texels (for fine-grained indexing) or twice the square root of two texels (for coarse-grained indexing). When these characteristics are met, distance field tags can produce high-quality renderings with respect to sharpness, accuracy, and minimal distortion and artifacts (e.g., pixelation, etc.). However, when the distance between two edges is less than two texels, there is an inherent ambiguity as to which edge is measured by the distance value of the texel between these edges. In this case, the rendered tag may be affected by pixelation artifacts, which in turn can cause motion artifacts to appear.

[0139] Certain embodiments described herein relate to robust mipmaps for label textures that can accommodate different scaling requirements, including those where the distance between two edges in a label is less than two texels wide. The mipmap can include different mipmap levels, each of which corresponds to a specific resolution of the label texture. In certain embodiments, an original high-resolution label can be used to generate a series of labels with different resolutions. For example, the original label can be filtered (e.g., using bilinear interpolation) to generate one or more lower resolution labels.

[0140] Fig.13An example mipmap 1300 for a particular tagged texture is shown. Mipmap 1300 includes multiple mipmap levels, each corresponding to a tag of a different resolution. For example, the largest mipmap level 1310 can have a resolution of 256×256 texels. The remaining mipmap levels can have progressively lower resolutions (e.g., each dimension is a power of 2), such as 128×128 texels (mipmap level 1320), 64×64 texels (mipmap level 1330), 32×32 texels (mipmap level 1340), 16×16 texels (mipmap level 1350), and so on. The mipmap level selected for sampling the color of a pixel can be based on the ratio between the size of the texel in texture space and the size of the sample pixel. For example, when selecting a mipmap level, the rendering system can determine the texel-to-pixel ratio of the projected pixel to determine what mipmap level to use. In a particular embodiment, the mipmap level selected is a mipmap level at which texels are similar in size to the sampled pixels (in other words, the ratio of texels to pixels is closest to 1). The texture map at the selected mipmap level is then sampled to determine the color to use. For example, initially, a label displayed to a user may be generated from a 64×64 mipmap level. When the user zooms out, the label may appear smaller, so a lower resolution mipmap level (e.g., 8×8) may be selected to generate the label. However, as described above, when the resolution of the label texture is reduced to a point where the distance between two edges of the label (e.g., the width of the letter "I") is less than two texels, the rendering result may be suboptimal.

[0141] To address the aforementioned issues with distance field tags, certain embodiments may generate mipmaps for tags with two types of mipmap levels: mipmap levels defined using distance fields and mipmap levels defined using RGBA. For example, one or more higher resolution mipmap levels may be defined using a distance field texture, and one or more lower resolution mipmap levels may be defined using an RGBA texture. Such mipmaps take advantage of the benefits provided by distance fields (e.g., rendering clearer labels with less distortion and artifacts) while eliminating the aforementioned disadvantages of distance fields at lower resolutions. Specifically, when the distance between two edges in a tag is greater than or equal to two texels, rendering the tag using the mipmap levels defined by the distance field provides high quality results. However, as discussed above, when the distance between the two edges is less than two texels, rendering may be done using mipmap levels defined by RGBA components (rather than distance fields). Although RGBA tags at higher resolutions do not perform as well as distance field tags (because the edges of RGBA textures tend to blur when interpolated), they are more suitable than distance field tags at lower resolutions. The problem with using distance fields is aliasing when features are too narrow: edges may be skipped entirely, resulting in pixelated artifacts. While switching to RGBA replaces the pixelated artifacts with something that may appear blurry when viewed up close, the blur is introduced when feature details are too small to be noticeable.

[0142] In a particular embodiment, a tag processed by a rendering system or display engine may be associated with an attribute that indicates the number of mipmap levels implemented using distance fields and the number of mipmap levels defined in RGBA in the tag's mipmap. For example, if a tag has four mipmap levels, a two-bit attribute may specify the number of high-resolution mipmap levels defined using distance fields. For example, a two-bit attribute of 10, corresponding to the decimal number 2, would indicate that two higher-resolution mipmap levels are defined using distance fields. The remaining lower-resolution mipmap levels are considered to be defined in RGBA. Continuing with the example above, since the two-bit attribute indicates that two of the four mipmap levels are defined by distance fields, the remaining two lower-resolution mipmap levels are defined in RGBA. Although mipmap levels defined in RGBA may introduce some unnecessary artifacts when rendering, their visual impact on the overall scene may be small and unnoticeable because their screen coverage area may be small (which is why the lower-resolution mipmap levels are selected first).

[0143] Using this attribute information, the display engine can render the label as follows. The display engine can load the 3D surface definition into memory and perform a visibility test to determine which parts of the 3D surface are visible to which pixels on the screen. In a particular embodiment, this primary visibility test can be performed using ray casting. For example, based on the user's viewpoint, a conceptual ray can be projected from a specific pixel of the screen located in the 3D view space into the view space where the 3D surface is located. The intersection between the ray and the 3D surface can indicate that the intersection is visible through the pixel, so the color of the pixel will depend on the texture corresponding to the intersection. Therefore, once the intersection in the 3D space is determined, it is transformed into the 2D texture space of the texture associated with the surface to determine which part of the texture is to be sampled. In other embodiments, instead of casting a ray for each pixel separately, a ray bundle can be cast for a tile of pixels (for example, a tile can be 16×16 pixels). Specifically, a ray bundle can be cast from the four corners of the tile, which is conceptually similar to projecting the tile into 3D space to determine if and where it intersects with the surface. The intersection area is then transformed from 3D space to 2D texture space. Since a tile represents, for example, 16×16 pixels, the same number of 16×16 sample points will be determined within the intersection area in texture space.

[0144] When sampling, the display engine can determine which mipmap level to use for sampling. In a particular embodiment, the display engine can select the mipmap level whose texels are most similar in size to the sampled pixel size (e.g., whose texel-to-pixel ratio is closest to one-to-one). The display engine can then determine whether the selected mipmap level is defined using a distance field or using RGBA. For example, in an embodiment where each surface has a two-bit (or any other bit size) attribute value (the attribute value indicates the number of mipmap levels defined using a distance field (or RGBA) in its mipmap), the system can infer whether the selected mipmap level is defined by a distance field or by RGBA. For example, if the selected mipmap level is 1 (e.g., the level can be in the range of 0 to 3, where 0 is the highest resolution mipmap level and 3 is the lowest), the display engine can conclude that it is defined using a distance field because the two-bit attribute indicates that the two highest resolution mipmap levels correspond to distance field textures. Using the same logic, if the selected mipmap level is 2, the display engine can infer that the corresponding texture is defined using RGBA. Once the display engine determines which type of texture it is using, it can call the appropriate rendering logic to handle the subsequent sampling process. For example, for the distance field tag, the aforementioned process for the single distance field or dual distance field filtering process can be used to determine the color of the sample point. For the RGBA tag, the display engine can identify the four texels closest to the sample point and perform bilinear interpolation on the colors of these texels. By using a mixture of mipmaps that include mipmap levels defined using distance fields and mipmap levels defined using RGBA, the display engine is able to adapt to different rendering scales without losing quality due to the limitations of the distance field.

[0145] Fig.14 An example method for calculating a color value of a pixel using a mipmap with mixed mipmap levels is shown. The method may begin at step 1410, where a computing system may sample a pixel region within a texture. A texture may be associated with mipmap levels having different resolutions of the texture. The mipmap levels may be generated based on an original texture. The mipmap levels may include at least a first mipmap level defined by color texels and a second mipmap level defined by distance field texels. The first mipmap level defined by color texels may have a lower resolution than the second mipmap level defined by distance field texels. The first mipmap level may have the lowest resolution in the mipmap, while the second mipmap level defined by the distance field texels may have the highest resolution in the mipmap.

[0146] At step 1420, the system can select one of the mipmap levels based on the size of the sampled pixel area and the size of the texels in the selected mipmap level. For example, the selected mipmap level can be selected based on a ratio between the size of the sampled pixel area and the size of each texel in the selected mipmap level. For example, the system can identify a mipmap level that has a texel size that is similar to the size of the sampled pixel area (e.g., a ratio of pixel size to texel size that is close to 1 to 1).

[0147] At step 1430, the system may determine whether the selected mipmap level is defined by color texels or by distance field texels. If the system determines that the selected mipmap level is defined by color texels, then at step 1440, the system may select corresponding rendering logic configured to process color texels. Then at step 1445, the selected rendering logic may process the color texels to calculate the color value of the sampled pixel area using the selected mipmap level. For example, the rendering logic may identify the four closest color texels relative to the sampled pixel area based on the selected mipmap level and perform bilinear interpolation or bicubic interpolation to calculate the color value of the sampled pixel area.

[0148] On the other hand, if the system determines that the selected mipmap level is defined by a distance field texel, then at step 1450, a second rendering logic configured to process distance field texels can be selected. Then at step 1455, the system can use the selected second rendering logic and the mipmap level defined by the distance field texel to calculate the color value of the sampled pixel area. The rendering logic can be based on the above reference Figure 4 , Figure 7 , Fig.10 or Fig.12 Described embodiments.

[0149] Eliminate interpolation based on MSB comparison

[0150] In certain embodiments, the process of interpolating the distance fields of the closest four texels to determine the interpolated distance (or two distances in the case of dual distance field labels) of a sample point on a texture map can be optimized in the case where the MSBs of the distance fields of the closest four texels are the same. As described in further detail above, the primary purpose of interpolating the distance fields of the closest texels is to determine whether the sample point is "inside" or "outside", which is indicated by the MSB of the interpolated distance. As such, in the case where the four distance fields of the four closest texels all have the same MSB (e.g., 0 or 1), the MSB of the sample point can simply be selected to be the same MSB without having to calculate the interpolated distance (e.g., using point sampling rather than bilinear interpolation sampling). Being able to determine the MSB without having to perform bilinear interpolation helps optimize operational efficiency and remove unnecessary computationally intensive processing steps. The MSB determined in this manner can then be used to select an appropriate texel whose color index specifies the color of the sample point, as described above.

[0151] As an example, Figure 4 As shown, in the method 400 for determining the color of a sample point using a single distance field texel array with a fine-grained color index, after determining the four texels closest to the sample point 314 in step 410, and before calculating the distance of the sample point 314 by bilinear interpolation based on the distance fields of the texels 318, 320, 322, and 324, the pixel block can perform a preliminary analysis to determine whether the MSBs of the distance fields of the four texels 318, 320, 322, and 324 are the same. For example, if the MSBs of the distance fields of all four texels 318, 320, 322, and 324 are 0 (i.e., "outside"), then the MSB of the interpolated distance of the sample point 314 (if calculated) must also be 0. As such, the pixel block can simply bypass the computationally expensive interpolation step 420 and proceed to step 440 and subsequent steps to identify the texel whose color index specifies the color of the sample point 314. On the other hand, if the MSB of the distance field for all four texels 318, 320, 322, and 324 is 1 (i.e., "inside"), then the MSB of sample point 314 must also be 1, and method 400 can simply bypass interpolation step 420 and proceed to step 460 and subsequent steps to determine which texel's color index to use. This optimization technique can also be used in embodiments where a coarse color index is defined for a single distance field texel.

[0152] Similar optimization techniques may be applied in the dual distance field embodiment. In both the fine-grained indexing embodiment and the coarse-grained indexing embodiment, the "inside" or "outside" state of a sample point relative to distance0 and distance1 is used to select a color index for the sample point. In the above embodiment, whether a sample point is "inside" or "outside" relative to the closest type0 edge is determined by the MSB of its interpolated distance0, which is calculated using the distance0 values ​​of the four closest texels. If the MSBs of the distance0 values ​​of the four closest texels are the same (e.g., all 1s or all 0s), the MSBs of the distance0 value of the sample point may be set to the same MSB (e.g., by point sampling). Similarly, whether a sample point is "inside" or "outside" relative to the closest type1 edge is determined by the MSB of its interpolated distance1, which is calculated using the distance1 values ​​of the four closest texels. If the MSBs of the distance1 values ​​of the four closest texels are the same (e.g., all 1s or all 0s), then the MSBs of the distance1 value of the sample point can be set to the same MSB (e.g., by point sampling). The two MSBs of the sample point (i.e., one associated with distance0 and the other associated with distance1) can be calculated independently, which means that optimization techniques can be used to calculate one MSB, both MSBs, or neither MSB. For example, the MSB associated with distance0 can be calculated using optimization techniques, while the MSB associated with distance1 can be calculated using bilinear interpolation. Once the two MSBs have been determined, the pixel block can use them to select an appropriate index for the sample point, as described in more detail elsewhere herein.

[0153] Fig.15An example method 1500 for determining a color at a sampling location without interpolation is shown. The method may begin at step 1510, where a computing system may determine a sampling location within a texture comprising a plurality of texels. Each texel may encode a distance field that indicates (1) a distance between the texel and an edge depicted in the texture, and (2) an indicator indicating whether the texel is on a first predetermined side of the edge or on a second predetermined side of the edge. For example, the indicator may encode whether the texel is "inside" or "outside" relative to the edge. At step 1520, based on the sampling location, the system may select a group of texels from the plurality of texels that are used to determine the color of the sampling location. For example, the system may select the four texels that are closest to the sampling location. At step 1530, the system may determine whether the group of texels have the same indicator. If the indicators are different (e.g., some texels are "inside" and some are "outside"), then interpolation may be used to calculate the color of the sampling location, such as according to the method described above with reference to FIG. Figure 4 , Figure 7 , Fig.10 or Fig.12 Embodiment described. However, if it is determined that the group of texels have the same indicator, then at step 1540, based on the indicator of any texel in the group of texels, the system may select a subset of the group of texels. For example, if the common indicator between four texels is "outside", then two even texels may be selected. On the other hand, if the four texels are "inside", then two odd texels may be selected. At step 1550, based on the distance between the texel and the sampling location, the system may select a texel from the subset of texels. Then, at step 1560, the system may use the selected texel to determine the color of the sampling location. For example, each texel may encode a color index into a color table (e.g., Figure 3B ), the color table can be used to determine the color of the sampling position.

[0154] Detect transparent results to allow discarding pixels

[0155] In certain embodiments, the use of the distance fields of the closest four texels to determine the interpolated distance of a sample point on a texture map may be optimized and / or eliminated in the case where the distance field color index applied to the sample point is transparent. This may occur in two different cases. The first case is when the color index of the distance field of the four texels closest to the sample point all correspond to "transparent" in the color table entry. The second case is when the sample point is determined to be outside the texel array (e.g., more than 1 / 2 texel length outside the texel array), and is therefore considered to be transparent. In these cases, the sample point may simply be considered transparent, thereby eliminating unnecessary computationally intensive processing steps, such as bilinear interpolation.

[0156] As an example of the first case, in the method 400 of determining the color of a sample point in a single distance field texel array using a fine-grained color index, after determining the four texels closest to the sample point at step 410, and before calculating the distance of the sample point 314 by bilinear interpolation, the method can perform a preliminary analysis to determine whether the color index of each of the four texels 318, 320, 322, and 324 corresponds to "transparent". If this is the case, the method 400 can skip the remaining steps and simply encode the sample point as transparent. The same preliminary analysis can be performed in a coarse-grained single distance field embodiment. For dual distance field embodiments (i.e., fine-grained and coarse-grained), a similar preliminary analysis can be performed to determine whether all candidate color indices associated with four nearby texels (including those associated with distance0 and distance1) correspond to "transparent". If so, the sample point can be directly marked as "transparent" without performing bilinear interpolation.

[0157] System and method

[0158] Fig.16 An example computer system 1600 is shown. In certain embodiments, one or more computer systems 1600 perform one or more steps of one or more methods described or shown herein. In certain embodiments, one or more computer systems 1600 provide functionality described or shown herein. In certain embodiments, software running on one or more computer systems 1600 performs one or more steps of one or more methods described or shown herein, or provides functionality described or shown herein. Certain embodiments include one or more portions of one or more computer systems 1600. Herein, references to computer systems may include computing devices and vice versa, where appropriate. Furthermore, references to computer systems may include one or more computer systems, where appropriate.

[0159] The present disclosure contemplates any suitable number of computer systems 1600. The present disclosure contemplates computer systems 1600 taking any suitable physical form. By way of example and not limitation, computer system 1600 may be an embedded computer system, a system on a chip (SOC), a single board computer system (SBC) (e.g., a computer on a module (COM) or a system on a module (SOM)), a desktop computer system, a laptop or notebook computer system, an interactive kiosk, a mainframe, a mesh of computer systems, a mobile phone, a personal digital assistant (PDA), a server, a tablet computer system, an augmented / virtual reality device, or a combination of two or more of these systems. Where appropriate, computer system 1600 may include one or more computer systems 1600; be monolithic or distributed; span multiple locations; span multiple machines; span multiple data centers; or reside in a cloud, which may include one or more cloud components in one or more networks. Where appropriate, one or more computer systems 1600 may perform one or more steps of one or more methods described or illustrated herein without substantial spatial or temporal limitations. As an example and not as a limitation, one or more computer systems 1600 may perform one or more steps of one or more methods described or shown herein in real time or in batch mode. Where appropriate, one or more computer systems 1600 may perform one or more steps of one or more methods described or shown herein at different times or at different locations.

[0160] In a particular embodiment, computer system 1600 includes a processor 1602, memory 1604, storage 1606, input / output (I / O) interface 1608, communication interface 1610, and bus 1612. Although this disclosure describes and illustrates a particular computer system having particular numbers of particular components in a particular arrangement, this disclosure contemplates any suitable computer system having any suitable numbers of any suitable components in any suitable arrangement.

[0161] In a particular embodiment, the processor 1602 includes hardware for executing instructions (e.g., those that constitute a computer program). As an example and not by way of limitation, to execute instructions, the processor 1602 may retrieve (or fetch) instructions from an internal register, an internal cache, a memory 1604, or a storage device 1606; decode them and execute them; and then write one or more results to an internal register, an internal cache, a memory 1604, or a storage device 1606. In a particular embodiment, the processor 1602 may include one or more internal caches for data, instructions, or addresses. Where appropriate, the present disclosure contemplates a processor 1602 that includes any suitable number of any suitable internal caches. As an example and not by way of limitation, the processor 1602 may include one or more instruction caches, one or more data caches, and one or more translation lookaside buffers (TLBs). The instructions in the instruction cache may be copies of the instructions in the memory 1604 or the storage device 1606, and the instruction cache may speed up the retrieval of those instructions by the processor 1602. The data in the data cache may be: a copy of data in the memory 1604 or storage 1606 for operating instructions executed at the processor 1602; the result of a previous instruction executed at the processor 1602 for access by a subsequent instruction executed at the processor 1602 or for writing to the memory 1604 or storage 1606; or other suitable data. The data cache may speed up read or write operations performed by the processor 1602. The TLB may speed up virtual address translations for the processor 1602. In a particular embodiment, the processor 1602 may include one or more internal registers for data, instructions, or addresses. Where appropriate, the present disclosure contemplates a processor 1602 including any suitable number of any suitable internal registers. Where appropriate, the processor 1602 may include one or more arithmetic logic units (ALUs); be a multi-core processor; or include one or more processors 1602. Although the present disclosure describes and illustrates a particular processor, the present disclosure contemplates any suitable processor.

[0162] In a particular embodiment, the memory 1604 includes a main memory for storing instructions for the processor 1602 to execute or data for the processor 1602 to operate. As an example and not by way of limitation, the computer system 1600 can load instructions from the storage device 1606 or another source (e.g., another computer system 1600) to the memory 1604. The processor 1602 can then load the instructions from the memory 1604 to an internal register or an internal cache. To execute the instructions, the processor 1602 can retrieve the instructions from the internal register or the internal cache and decode them. During or after the execution of the instructions, the processor 1602 can write one or more results (which can be intermediate results or final results) to the internal register or the internal cache. The processor 1602 can then write one or more of these results to the memory 1604. In a particular embodiment, the processor 1602 executes only instructions in one or more internal registers or internal caches or in the memory 1604 (rather than the storage device 1606 or elsewhere), and operates only on data in one or more internal registers or internal caches or in the memory 1604 (rather than the storage device 1606 or elsewhere). One or more memory buses (which may each include an address bus and a data bus) may couple the processor 1602 to the memory 1604. As described below, the bus 1612 may include one or more memory buses. In a particular embodiment, one or more memory management units (MMUs) reside between the processor 1602 and the memory 1604 and facilitate access to the memory 1604 requested by the processor 1602. In a particular embodiment, the memory 1604 includes a random access memory (RAM). Where appropriate, the RAM may be a volatile memory. Where appropriate, the RAM may be a dynamic RAM (DRAM) or a static RAM (SRAM). In addition, where appropriate, the RAM may be a single-port RAM or a multi-port RAM. The present disclosure contemplates any suitable RAM. Where appropriate, memory 1604 may include one or more memories 1604. Although this disclosure describes and illustrates particular memories, this disclosure contemplates any suitable memories.

[0163] In a particular embodiment, storage device 1606 includes a mass storage device for data or instructions. As an example and not as a limitation, storage device 1606 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, storage device 1606 may include a removable or non-removable (or fixed) medium. Where appropriate, storage device 1606 may be inside or outside computer system 1600. In a particular embodiment, storage device 1606 is a non-volatile solid-state memory. In a particular embodiment, storage device 1606 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically variable ROM (EAROM), or a flash memory, or a combination of two or more of these. The present disclosure contemplates a mass storage device 1606 in any suitable physical form. Where appropriate, storage 1606 may include one or more storage control units that facilitate communications between processor 1602 and storage 1606. Where appropriate, storage 1606 may include one or more storage 1606. Although this disclosure describes and illustrates particular storage, this disclosure contemplates any suitable storage.

[0164] In a particular embodiment, I / O interface 1608 includes hardware, software, or both that provide one or more interfaces for communication between computer system 1600 and one or more I / O devices. Where appropriate, computer system 1600 may include one or more of these I / O devices. One or more of these I / O devices may enable communication between a person and computer system 1600. As an example and not as a limitation, an I / O device may include a keyboard, a keypad, a microphone, a monitor, a mouse, a printer, a scanner, a speaker, a static camera, a stylus, a tablet computer, a touch screen, a tracking ball, a video camera, another suitable I / O device, or a combination of two or more of these. An I / O device may include one or more sensors. The present disclosure contemplates any suitable I / O device and any suitable I / O interface 1608 for them. Where appropriate, an I / O interface 1608 may include one or more devices or software drivers that enable processor 1602 to drive one or more of these I / O devices. Where appropriate, an I / O interface 1608 may include one or more I / O interfaces 1608. Although this disclosure describes and illustrates a particular I / O interface, this disclosure contemplates any suitable I / O interface.

[0165] In a particular embodiment, the communication interface 1610 includes hardware, software, or both that provide one or more interfaces for communication (e.g., packet-based communication) between the computer system 1600 and one or more other computer systems 1600 or one or more networks. As an example and not by way of limitation, the communication interface 1610 may include a network interface controller (NIC) or network adapter for communicating with an Ethernet or other wired network, or a wireless NIC (WNIC) or wireless adapter for communicating with a wireless network (e.g., a WI-FI network). The present disclosure contemplates any suitable network and any suitable communication interface 1610 for it. As an example and not by way of limitation, the computer system 1600 may communicate with one or more parts of an ad hoc network, a personal area network (PAN), a local area network (LAN), a wide area network (WAN), a metropolitan area network (MAN), or the Internet, or a combination of two or more of these. One or more parts of one or more of these networks may be wired or wireless. As an example, computer system 1600 may communicate with a wireless PAN (WPAN) (e.g., a Bluetooth WPAN), a WI-FI network, a WI-MAX network, a cellular telephone network (e.g., a Global System for Mobile Communications (GSM) network), or other suitable wireless networks, or a combination of two or more of these. Where appropriate, computer system 1600 may include any suitable communication interface 1610 for any of these networks. Where appropriate, communication interface 1610 may include one or more communication interfaces 1610. Although this disclosure describes and illustrates particular communication interfaces, this disclosure contemplates any suitable communication interface.

[0166] In a particular embodiment, bus 1612 includes hardware, software, or both that couples components of computer system 1600 to each other. By way of example and not limitation, bus 1612 may include an accelerated graphics port (AGP) or other graphics bus, an extended industry standard architecture (EISA) bus, a front side bus (FSB), a HYPERTRANSPORT (HT) interconnect, an industry standard architecture (ISA) bus, an INFINIBAND interconnect, a low pin count (LPC) bus, a memory bus, a micro channel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCIe) bus, a serial advanced technology attachment (SATA) bus, a video electronics standard association local (VLB) bus, or another suitable bus, or a combination of two or more of these. Where appropriate, bus 1612 may include one or more buses 1612. Although the present disclosure describes and illustrates a particular bus, the present disclosure contemplates any suitable bus or interconnect.

[0167] Herein, where appropriate, one or more computer-readable non-transitory storage media may include one or more semiconductor-based or other integrated circuits (ICs) (e.g., field programmable gate arrays (FPGAs) or application-specific ICs (ASICs)), hard disk drives (HDDs), hybrid hard disk drives (HHDs), optical disks, optical disk drives (ODDs), magneto-optical disks, magneto-optical disk drives, floppy disks, floppy disk drives (FDDs), magnetic tapes, solid-state drives (SSDs), RAM drives, secure digital (SECURE DIGITAL) cards or drives, any other suitable computer-readable non-transitory storage media, or any suitable combination of two or more of these. Where appropriate, the computer-readable non-transitory storage media may be volatile, non-volatile, or a combination of volatile and non-volatile.

[0168] As used herein, "or" is inclusive and not exclusive, unless expressly indicated otherwise or indicated by context. Thus, herein, "A or B" means "A, B, or both," unless expressly indicated otherwise or indicated by context. Furthermore, "and" is both conjunctive and several, unless expressly indicated otherwise or indicated by context. Thus, herein, "A and B" means "A and B, jointly or severally," unless expressly indicated otherwise or indicated by context.

[0169] The scope of the present disclosure includes all changes, substitutions, variations, alterations and modifications to the example embodiments described or shown herein that will be understood by those of ordinary skill in the art. The scope of the present disclosure is not limited to the example embodiments described or shown herein. In addition, although the present disclosure describes and illustrates the corresponding embodiments herein as including specific components, elements, features, functions, operations or steps, any of these embodiments may include any combination or replacement of any components, elements, features, functions, operations or steps described or shown anywhere herein that will be understood by those of ordinary skill in the art. In addition, references to devices or systems or components of devices or systems that are suitable for, arranged to, capable of, configured to, implemented to, operable to, or operated to perform specific functions in the appended claims include the device, system, component, whether it or that specific function is activated, turned on or unlocked, as long as the device, system or component is adjusted, arranged, enabled, configured, implemented, operable, or operated in this way. In addition, although the present disclosure describes or illustrates specific embodiments as providing specific advantages, specific embodiments may provide some, all or none of these advantages.

Claims

1. A method for text rendering in real-time computer graphics for augmented reality and / or virtual reality, comprising: A sampling position within a texture comprising a plurality of texels is determined, wherein Each texel encodes the distance field and a color index; Based on the sampling position, selecting a set of texels from the plurality of texels for use in determining a color of the sampling position; Calculating an interpolated distance field based on the distance field of the set of texels; Based on the interpolated distance field, selecting a subset of the set of texels; selecting a texel from the subset of texels based on a distance between the texel and the sampling position; and The color index of the selected texel is used to determine the color of the sampling location.

2. The method according to claim 1, wherein: The texture depicts a 2D image having one or more edges that separate an interior of the 2D image from an exterior of the 2D image; The distance field for each texel of the plurality of texels encodes: (1) a first distance between the associated texel and one of the one or more edges of the 2D image, and (2) whether the associated texel is inside or outside the 2D image; and The interpolated distance field encodes: (1) a second distance between the sampling position and one of the one or more edges of the 2D image, and (2) whether the sampling position is inside or outside the 2D image; wherein the subset of texels is selected based on the interpolated distance field and based on whether the sampling position is inside or outside the 2D image.

3. The method according to claim 1, wherein: The set of texels includes a pair of even-numbered texels and a pair of odd-numbered texels; and The subset of texels is the pair of even texels or the pair of odd texels; wherein: Each of the plurality of texels has a u coordinate and a v coordinate in the texture; The plurality of texels comprises a plurality of even texels, wherein the least significant bit of the binary representation of the u coordinate of each even texel is equal to the least significant bit of the binary representation of the v coordinate of the even texel; and The plurality of texels includes a plurality of odd texels, wherein a least significant bit of a binary representation of a u coordinate of each odd texel is different from a least significant bit of a binary representation of a v coordinate of the odd texel.

4. The method according to claim 1, wherein: The color index of the selected texel is mapped to a color in a predetermined color set.

5. The method according to claim 4, wherein: The predetermined color set includes more than two colors.

6. The method according to claim 1, wherein: The distance field for each of the plurality of texels uses a distance representation scheme lacking on-edge representation.

7. The method according to claim 1, wherein: The group of texels is four texels of the plurality of texels that are closest to the sampling position; and The sampling position is associated with a pixel, and the color of the sampling position will be displayed by the pixel.

8. A system for text rendering in real-time computer graphics for augmented reality and / or virtual reality, comprising: one or more processors; and one or more computer-readable non-transitory storage media coupled to the one or more processors and comprising instructions that, when executed by the one or more processors, are operable to cause the system to: determining a sampling position within a texture comprising a plurality of texels, wherein each texel encodes a distance field and a color index; Based on the sampling position, selecting a set of texels from the plurality of texels for use in determining a color of the sampling position; Calculating an interpolated distance field based on the distance field of the set of texels; Based on the interpolated distance field, selecting a subset of the set of texels; selecting a texel from the subset of texels based on a distance between the texel and the sampling position; and The color index of the selected texel is used to determine the color of the sampling location.

9. The system of claim 8, wherein: The texture depicts a 2D image having one or more edges that separate an interior of the 2D image from an exterior of the 2D image; The distance field for each texel of the plurality of texels encodes: (1) a first distance between the associated texel and one of the one or more edges of the 2D image, and (2) whether the associated texel is inside or outside the 2D image; and The interpolated distance field encodes: (1) a second distance between the sampling position and one of the one or more edges of the 2D image, and (2) whether the sampling position is inside or outside the 2D image; wherein the subset of texels is selected based on the interpolated distance field and based on whether the sampling position is inside or outside the 2D image.

10. The system of claim 8, wherein: The set of texels includes a pair of even-numbered texels and a pair of odd-numbered texels; and The subset of texels is the pair of even texels or the pair of odd texels; wherein: Each of the plurality of texels has a u coordinate and a v coordinate in the texture; The plurality of texels comprises a plurality of even texels, wherein the least significant bit of the binary representation of the u coordinate of each even texel is equal to the least significant bit of the binary representation of the v coordinate of the even texel; and The plurality of texels includes a plurality of odd texels, wherein a least significant bit of a binary representation of a u coordinate of each odd texel is different from a least significant bit of a binary representation of a v coordinate of the odd texel.

11. The system according to claim 8, wherein: The color index of the selected texel is mapped to a color in a predetermined color set.

12. One or more computer-readable non-transitory storage media containing software that, when executed, is operable to: A sampling position within a texture comprising a plurality of texels is determined, wherein Each texel encodes the distance field and a color index; Based on the sampling position, selecting a set of texels from the plurality of texels for use in determining a color of the sampling position; Calculating an interpolated distance field based on the distance field of the set of texels; Based on the interpolated distance field, selecting a subset of the set of texels; selecting a texel from the subset of texels based on a distance between the texel and the sampling position; and The color index of the selected texel is used to determine the color of the sampling location.

13. The medium of claim 12, wherein: The texture depicts a 2D image having one or more edges that separate an interior of the 2D image from an exterior of the 2D image; The distance field for each texel of the plurality of texels encodes: (1) a first distance between the associated texel and one of the one or more edges of the 2D image, and (2) whether the associated texel is inside or outside the 2D image; and The interpolated distance field encodes: (1) a second distance between the sampling position and one of the one or more edges of the 2D image, and (2) whether the sampling position is inside or outside the 2D image; wherein the subset of texels is selected based on the interpolated distance field and based on whether the sampling position is inside or outside the 2D image.

14. The medium of claim 12, wherein: The set of texels includes a pair of even-numbered texels and a pair of odd-numbered texels; and The subset of texels is the pair of even texels or the pair of odd texels.

15. The medium of claim 14, wherein: Each of the plurality of texels has a u coordinate and a v coordinate in the texture; The plurality of texels comprises a plurality of even texels, wherein the least significant bit of the binary representation of the u coordinate of each even texel is equal to the least significant bit of the binary representation of the v coordinate of the even texel; and The plurality of texels includes a plurality of odd texels, wherein a least significant bit of a binary representation of a u coordinate of each odd texel is different from a least significant bit of a binary representation of a v coordinate of the odd texel.

Citation Information

Patent Citations

  • Accelerated texture lookups by using texture coordinate derivatives

    CN103782324A

  • Method for generating a composite glyph and rendering a region of the composite glyph in object-order

    US20040189666A1