Anti-Aliasing for Distance Field Graphics Rendering
Abstract
In one embodiment, a computing system may determine, for a pixel, a sampling location within a texture that comprises a plurality of texels, and based on the sampling location, select a set of texels in the plurality of texels. Each texel in the set of texels may encode a distance field. An interpolated distance field associated with the sampling location may be computed based on the distance fields associated with the set of texels. The interpolated distance field may represent a relative distance between the sampling location and a texture edge. According to a blending proportion based on the interpolated distance field, the computing system may determine a blended color for the sampling location by blending, a first and second color associated with a first side of the edge and a second side of the edge, and output a color for the pixel based on the blended color.
Claims
exact text as granted — not AI-modified1 - 20 . (canceled)
21 . A method comprising, by a computing system:
selecting, for a pixel and based on a sampling location within a texture comprising a plurality of texels, a set of texels, wherein each texel in the set of texels encodes two distance fields; computing, based on the distance fields associated with the set of texels a first interpolated distance field and a second interpolated distance field associated with the sampling location, wherein the first interpolated distance field represents a first relative distance between the sampling location and a first edge depicted in the texture, and the second interpolated distance field represents a second relative distance between the sampling location and a second edge depicted in the texture; scaling the first and second interpolated distance fields from texel units to pixel units; determining a blending proportion based on the scaled first and second interpolated distance fields; determining a blended color for the sampling location by blending, according to the blending proportion, colors associated with different sides of the first and second edges; and outputting the blended color for the pixel.
22 . The method of claim 21 , further comprising:
accessing a predetermined offset for the scaled first and second interpolated distance fields; wherein the blending proportion is further determined based on the predetermined offset for the scaled first and second interpolated distance fields.
23 . The method of claim 22 , further comprising:
determining a first sampling spacing of the plurality of texels in a first direction in pixel space; determining a second sampling spacing of the plurality of texels in a second direction in pixel space, the second direction being perpendicular to the first direction; and comparing the first sampling spacing and the second sampling spacing to determine which is smaller; wherein a scaling factor used to scale the first and second interpolated distance fields is determined based on the smaller one of the first sampling spacing or the second sampling spacing.
24 . The method of claim 21 , further comprising:
determining one or more second blended colors for one or more second sampling locations for the pixel; and determining a color for the pixel based on the blended color of the sampling location and the one or more second blended colors of the one or more second sampling locations for the pixel; wherein the color for the pixel is included in a frame.
25 . The method of claim 24 , further comprising:
determining a first sampling spacing of the plurality of texels in a first direction in pixel space; determining a second sampling spacing of the plurality of texels in a second direction in pixel space, the second direction being perpendicular to the first direction; and determining a jitter orientation based on a comparison between the first sampling spacing and the second sampling spacing; wherein the sampling location and the one or more second sampling locations in the texture correspond to locations in the pixel that are distributed along the jitter orientation.
26 . The method of claim 25 , further comprising:
determining a jitter range based on a difference between the first sampling spacing and the second sampling spacing; wherein the locations in the pixel corresponding to the sampling location and the one or more second sampling locations in the texture are distributed within the jitter range along the jitter orientation.
27 . The method of claim 21 , wherein the blended color for the pixel is associated with a first frame in a sequence of frames, the method further comprising:
determining a second blended color for a second sampling location associated with a second pixel in a second frame in the sequence of frames, wherein:
a relative location of the pixel in the first frame and a relative location of the second pixel in the second frame are the same; and
a location in the pixel corresponding to the sampling location within the texture and a second location in the second pixel corresponding to the second sampling location within the texture are different;
outputting a second color for the second pixel based on the second blended color of the second sampling location; wherein the second color for the second pixel is included in the second frame.
28 . The method of claim 27 , further comprising:
determining a first sampling spacing of the plurality of texels in a first direction in pixel space; determining a second sampling spacing of the plurality of texels in a second direction in pixel space, the second direction being perpendicular to the first direction; and determining a jitter orientation based on a comparison between the first sampling spacing and the second sampling spacing; wherein the location in the pixel and the second location in the second pixel are distributed along the jitter orientation.
29 . The method of claim 21 , wherein the colors associated with the different sides of the first and second edges are blended in response to a determination that the sampling location is within a predetermined range from the first and second edges depicted in the texture.
30 . The method of claim 29 , wherein the predetermined range is half a pixel from the edge depicted in the texture.
31 . The method of claim 21 , wherein the output blended color contains a first percent proportion of a first color of the colors associated with the first edge and a second percent proportion of a second color of the colors associated with the second edge associated with the different sides of the first and second edges.
32 . The method of claim 31 , wherein the first percent proportion and the second percent proportion respectively correspond to an apparent transparency of the first color and the second color.
33 . One or more computer-readable non-transitory storage media embodying software that is operable when executed to:
select, for a pixel and based on a sampling location within a texture comprising a plurality of texels, a set of texels, wherein each texel in the set of texels encodes two distance fields; compute, based on the distance fields associated with the set of texels a first interpolated distance field and a second interpolated distance field associated with the sampling location, wherein the first interpolated distance field represents a first relative distance between the sampling location and a first edge depicted in the texture, and the second interpolated distance field represents a second relative distance between the sampling location and a second edge depicted in the texture; scale the first and second interpolated distance fields from texel units to pixel units; determine a blending proportion based on the scaled first and second interpolated distance fields; determine a blended color for the sampling location by blending, according to the blending proportion, colors associated with different sides of the first and second edges; and output the blended color for the pixel.
34 . The media of claim 33 , wherein the software is further operable when executed to:
access a predetermined offset for the scaled first and second interpolated distance fields; wherein the blending proportion is further determined based on the predetermined offset for the scaled first and second interpolated distance fields.
35 . The media of claim 34 , wherein the software is further operable when executed to:
determine a first sampling spacing of the plurality of texels in a first direction in pixel space; determine a second sampling spacing of the plurality of texels in a second direction in pixel space, the second direction being perpendicular to the first direction; and compare the first sampling spacing and the second sampling spacing to determine which is smaller; wherein a scaling factor used to scale the first and second interpolated distance fields is determined based on the smaller one of the first sampling spacing or the second sampling spacing.
36 . The media of claim 33 , wherein the software is further operable when executed to:
determine one or more second blended colors for one or more second sampling locations for the pixel; and determine the color for the pixel based on the blended color of the sampling location and the one or more second blended colors of the one or more second sampling locations for the pixel; wherein the color for the pixel is included in a frame.
37 . A system comprising:
one or more processors; and one or more computer-readable non-transitory storage media coupled to one or more of the processors and comprising instructions operable when executed by one or more of the processors to cause the system to: select, for a pixel and based on a sampling location within a texture comprising a plurality of texels, a set of texels, wherein each texel in the set of texels encodes two distance fields; compute, based on the distance fields associated with the set of texels a first interpolated distance field and a second interpolated distance field associated with the sampling location, wherein the first interpolated distance field represents a first relative distance between the sampling location and a first edge depicted in the texture, and the second interpolated distance field represents a second relative distance between the sampling location and a second edge depicted in the texture; scale the first and second interpolated distance fields from texel units to pixel units; determine a blending proportion based on the scaled first and second interpolated distance fields; determine a blended color for the sampling location by blending, according to the blending proportion, colors associated with different sides of the first and second edges; and output the blended color for the pixel.
38 . The system of claim 37 , wherein the processors are further operable when executing the instructions to:
access a predetermined offset for the scaled first and second interpolated distance fields; wherein the blending proportion is further determined based on the predetermined offset for the scaled first and second interpolated distance fields.
39 . The system of claim 38 , wherein the processors are further operable when executing the instructions to:
determine a first sampling spacing of the plurality of texels in a first direction in pixel space; determine a second sampling spacing of the plurality of texels in a second direction in pixel space, the second direction being perpendicular to the first direction; and compare the first sampling spacing and the second sampling spacing to determine which is smaller; wherein a scaling factor used to scale the first and second interpolated distance fields is determined based on the smaller one of the first sampling spacing or the second sampling spacing.
40 . The system of claim 37 , wherein the processors are further operable when executing the instructions to:
determine one or more second blended colors for one or more second sampling locations for the pixel; and determine the color for the pixel based on the blended color of the sampling location and the one or more second blended colors of the one or more second sampling locations for the pixel; wherein the color for the pixel is included in a frame.Join the waitlist — get patent alerts
Track US2022245783A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.