CN110648386B - Method and system for antialiasing of primitives - Google Patents

Method and system for antialiasing of primitives Download PDF

Info

Publication number
CN110648386B
CN110648386B CN201910665902.XA CN201910665902A CN110648386B CN 110648386 B CN110648386 B CN 110648386B CN 201910665902 A CN201910665902 A CN 201910665902A CN 110648386 B CN110648386 B CN 110648386B
Authority
CN
China
Prior art keywords
bitmap
pixel
primitive
sampling
vertex
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910665902.XA
Other languages
Chinese (zh)
Other versions
CN110648386A (en
Inventor
徐行
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Perfect World Beijing Software Technology Development Co Ltd
Original Assignee
Perfect World Beijing Software Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Perfect World Beijing Software Technology Development Co Ltd filed Critical Perfect World Beijing Software Technology Development Co Ltd
Priority to CN201910665902.XA priority Critical patent/CN110648386B/en
Publication of CN110648386A publication Critical patent/CN110648386A/en
Application granted granted Critical
Publication of CN110648386B publication Critical patent/CN110648386B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/12Indexing scheme for image data processing or generation, in general involving antialiasing

Abstract

The invention discloses a method and a system for antialiasing of primitives. A method for antialiasing of primitives, comprising: amplifying the width of the primitive; generating a pixel of the primitive corresponding to the primitive with the enlarged width; and reducing the opacity of the primitive pixels.

Description

Method and system for antialiasing of primitives
Technical Field
The present invention relates to computer graphics technology, and more particularly, to an antialiasing method and system for primitives.
Background
Antialiasing techniques are an important component in the field of computer three-dimensional games or animations, which are implemented to make the rendered bitmap visually smoother. In the art, "rendering" refers to the process of capturing a virtual scene using a virtual camera, thereby obtaining an image. As shown in fig. 1, the virtual scene includes information such as a model, a virtual camera, and lamplight. A model is a virtual object in a virtual scene, the geometric surface of which may be represented by one or more "primitives," each of which may be composed of one or more basic geometries (e.g., line segments, triangles, quadrilaterals, etc.).
The image generated by rendering is commonly referred to as a "bitmap". As shown in fig. 2, a bitmap is a rectangular lattice in which each dot is a pixel, and certain information can be stored in each pixel, and the information is generally used to represent a color.
In the art, "sampling" refers to the retrieval of data from a particular location or point on an object or target. For example, "sampling" may refer to fetching a pixel at a location from a bitmap.
"rasterizing" refers to the method commonly used in rendering to generate pixels from primitives that ultimately will be saved on a bitmap. Fig. 3 shows the effect of a primitive on a bitmap after rasterization, wherein the dot marked by the pixel center is the "primitive sampling point". And during rasterization, generating pixels according to the information of the corresponding points of the primitive sampling points on the primitives, and extracting the information of the corresponding points on the primitives to obtain the sampling of the primitives. Rasterization is a "discrete" method that converts continuous geometry on primitives to discontinuous pixels on bitmaps.
The use of such discrete methods to transform and represent a graphical element has inherent defects commonly known as "jaggies" or "steps" and is commonly referred to in the art as "aliasing". The aliasing generally includes two classes, a "pixel level aliasing" and a "sub-pixel level aliasing", respectively. Fig. 4 shows a pixel level aliasing in which the boundary of a primitive is a smooth line segment, but after rasterizing the primitive into pixels, appears as a stepped polyline. Fig. 5 shows sub-pixel level aliasing, where the width of a primitive corresponds to less than one pixel in the bitmap, and where a portion of the primitive may be converted to pixels and a portion skipped when rasterizing, ultimately producing a discontinuous effect.
In general, the purpose of antialiasing techniques is to make the color on the pixels of the primitive boundary transition gradually rather than changing rapidly, visually diminishing the degree of aliasing, as shown in FIG. 6.
At present, the main stream anti-aliasing algorithm mainly has two main types. The first type of algorithm is typically implemented based on the "supersampling" principle, such as SSAA (Super Sampling Anti-activating), MSAA (Multi Sampling Anti-activating), etc. As shown in fig. 7A and 7B, in the foregoing rasterization operation, if a pixel is generated in a conventional manner, this manner will sample a point on the primitive; if a pixel is generated by the supersampling method, the supersampling method will sample multiple points on the primitive, and the color of the final pixel is a weighted average of the multiple sampling results. When the sampling times corresponding to each pixel are more, the finally generated image is smoother. However, since the calculation of sampling primitives is complicated, the time consumption increases significantly with the number of samples.
The second type of algorithm is typically implemented based on means of image processing, such as FXAA (Fast-adaptive Anti-Aliasing). For the image generated after rasterization, the algorithm firstly detects the area with the step-shaped pixel color change, and then blurs the area. Such algorithms are relatively high performance because sampling primitives are no longer required. However, such algorithms have difficulty detecting all stepped regions and therefore cannot eliminate a portion of the pixel level aliasing. In addition, the interrupted portion in fig. 5 cannot be caused to appear, that is, the problem of sub-pixel aliasing cannot be solved at all.
Disclosure of Invention
It is an object of embodiments of the invention to solve the problem of aliasing by a relatively simple computational procedure. For example, with respect to primitives having smaller widths such as hairs, a good antialiasing effect is obtained as much as possible while ensuring the computational efficiency.
One aspect of the invention discloses a method for antialiasing of primitives, comprising: amplifying the width of the primitive; generating a pixel of the primitive corresponding to the primitive with the enlarged width; and reducing the opacity of the primitive pixels.
Another aspect of the invention discloses a system for antialiasing of primitives, comprising: means for amplifying the width of the primitive; means for generating primitive pixels corresponding to the primitives with enlarged widths; and means for reducing the opacity of the primitive pixels.
Yet another aspect of the invention discloses a computer-readable medium having stored thereon computer-readable instructions which, when executed by a computer, are capable of performing a method according to an embodiment of the invention.
Advantages of embodiments of the present invention over the prior art include no need to increase the number of samples on primitives during the rasterization phase, and higher performance than supersampling methods. The embodiment of the invention can also well reduce the sub-pixel aliasing phenomenon, and can well solve the step aliasing with longer step length, and the effects in the two aspects are better than FXaA and similar methods.
Drawings
Fig. 1 is a schematic diagram of a virtual scene according to the prior art.
Fig. 2 is a schematic diagram of a bitmap according to the prior art.
Fig. 3 is a schematic diagram of rasterization according to the prior art.
Fig. 4 is a schematic diagram of pixel level aliasing according to the prior art.
Fig. 5 is a sub-pixel level aliasing schematic according to the prior art.
Fig. 6 shows a schematic of the antialiasing effect.
Fig. 7A and 7B are effect diagrams after no and no super-sampling algorithms are implemented according to the prior art.
FIG. 8 is a flow chart of an antialiasing method according to an embodiment of the invention.
Fig. 9 is a schematic diagram of a hair primitive according to an embodiment of the present invention.
Fig. 10 is a schematic view of a hair segment according to an embodiment of the present invention.
Fig. 11A and 11B are schematic diagrams of hair primitives in a world coordinate system and a bitmap coordinate system, respectively, according to an embodiment of the present invention.
Fig. 12A and 12B are effect diagrams after step 101 in fig. 8 is not implemented and step 101 is implemented, respectively, according to an embodiment of the present invention.
Fig. 13A and 13B are effect diagrams after step 102 in fig. 8 is not implemented and step 102 is implemented, respectively, according to an embodiment of the present invention.
Fig. 14 is a flow chart of a method of implementing step 103 in fig. 8 according to an embodiment of the present invention.
Fig. 15A and 15B are effect diagrams after step 103 in fig. 8 is not implemented and step 103 is implemented, respectively, according to an embodiment of the present invention.
Detailed Description
The present disclosure will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are merely illustrative to enable those of ordinary skill in the art to better understand and thus practice the present invention and are not meant to limit the scope of the present invention in any way.
As used herein, the term "comprising" and variants thereof should be interpreted to mean "including but not limited to" open-ended terms. The term "based on" should be read as "based at least in part on". The terms "one embodiment" and "an embodiment" should be read as "at least one embodiment. The term "another embodiment" should be read as "at least one other embodiment.
The invention provides an antialiasing method implemented for a graphic primitive. The method works particularly well for smaller width primitives such as hair primitives, fiber primitives, etc. The hair primitives will be described in detail below, but the principles and methods are also applicable to other primitives with smaller widths, such as fiber primitives. Thus, although reference is made hereinafter to the hair for its color, direction, position, etc., these references apply to other smaller width primitives. FIG. 8 shows a flow chart of an implementation of the antialiasing method according to an embodiment of the invention, the method shown comprising the steps of:
step 101: the width of the hair graphical element is enlarged.
Enlarging the width of the hair primitive can help reduce sub-pixel level aliasing such that the width of the hair primitive is not lower than the width of one pixel on the bitmap when rasterized.
In some embodiments, the hair graphical element is represented as shown in fig. 9. In fig. 9, a hair that will be curved in the real world is represented by a hair primitive divided into several segments, and one segment of the hair primitive (simply referred to as "hair segment") will be selected for description hereinafter.
As shown in fig. 10, the location of its two "endpoints" and the radius of the hair at the endpoints are recorded on each hair segment. In the real world, hair is in the shape of an elliptic cylinder; to simplify the calculation in some embodiments, one or more quadrilaterals parallel to the hair direction, always facing the virtual camera's line of sight, may be used to approximately represent the hair segment. Before performing the rasterization operation, in a world space coordinate system (simply referred to as a "world coordinate system"), the positions of vertices of hair segments representing a portion of a hair primitive are changed in accordance with the virtual camera line-of-sight direction such that the hair segments are oriented in the virtual camera line-of-sight direction. In some embodiments, a specific method of generating a quadrilateral that approximately represents a hair segment is as follows:
for each end point on the hair segment, an expansion vector is determined according to the following formula:
where in the above formula, x is the vector cross product, which represents the number multiplication between the number and the vector.
For each endpoint, two vertices are generated using the following method:
vertex position 1 =endpoint position+extension vector
Vertex position 2 =endpoint position-expansion vector
Two endpoints of a hair segment may generate four vertices that form a quadrilateral in the manner shown in fig. 10.
In the prior art rendering process, the coordinates of all vertices on the hair segment are transformed from the world coordinate system shown in fig. 11A to the bitmap coordinate system shown in fig. 11B using a method called "coordinate system transformation" prior to rasterization. The detailed process of the coordinate system transformation is as follows: the position in the world coordinate system is firstly transformed to the position in the camera coordinate system taking the position of the virtual camera as the origin through the View Matrix (View Matrix), then transformed to the position in the normalized equipment space (normalized device space) through the perspective projection Matrix (Projection Matrix) and perspective division, and finally the position of the corresponding pixel in the bitmap coordinate system is obtained through the View port transformation (viewport transform).
To enlarge the width of a hair primitive in a two-dimensional bitmap coordinate system, the positions of the two vertices corresponding to each endpoint on a hair segment can be modified using the following method:
top point locationPut 1 =midpoint position +v'
Vertex position 2 =midpoint position-V'
Wherein vertex position 1' and vertex position 2' represent positions of two vertices in the bitmap coordinate system, vertex position 1 "and vertex position 2" represent new vertex positions with respect to vertex position 1' and vertex position 2' after enlarging the width of the hair primitive, V ' and V are calculated intermediate values, and midpoint position represents a position of a midpoint between the two vertices in the bitmap coordinate system. Parameters in the above-mentioned max functionIs adjustable and can be used to control the magnification of the width. For example, in this embodiment, +.>The width of the graphic primitive in the two-dimensional bitmap coordinate system is at least not less than 1 pixel.
Fig. 12A and 12B show an effect comparison of whether step 101 is performed. As shown in fig. 12A, step 101 is not performed, and a pixel "break-up" phenomenon occurs; as shown in fig. 12B, step 101 is implemented, and as the primitive width increases, the result of rasterization is no longer interrupted.
Step 102: the opacity of the generated pixel is reduced.
Since the width of the primitive has been enlarged in step 101, by reducing the opacity of the pixels generated in the bitmap, it is possible to ensure that the degree of visual appearance of the pixels is unchanged. According to an embodiment of the invention, semi-transparent fusion may be allowed, i.e. the currently generated pixel color is mixed with the "background color" already present in the bitmap according to a certain weight. The background color refers to the color of the pixel that is already present at the location of the current pixel in the bitmap after rasterizing the current primitive and generating the current pixel, but prior to semi-transparent blending. According to an embodiment of the present invention, the semitransparent fusion may be omitted, and the approximate semitransparent effect may be achieved using a known Alpha differentiating method or the like.
For the case where semi-transparent fusion is to be performed, the color generated by the hair primitives in the rasterization operation can be mixed with the background color in the bitmap using the following formula:
final pixel color = current pixel color-opacity + background color · (1-opacity)
Where, represents the number multiplication between the number and the vector. The parameter opacity takes a value between 0 and 1. 0 indicates complete transparency, fully using the background color, and 1 indicates complete opacity, fully using the current color of the pixel. By choosing the opacity, a different degree of mixing between the current pixel color and the background color can be achieved.
Fig. 13A and 13B show an effect comparison of the color of the mixed hair primitive and the background color. As shown in fig. 13A, when step 102 is not implemented, the color of the pixel is darker; as shown in fig. 13B, and after step 102 is performed, the color of the pixel becomes lighter.
Step 103: the resulting hair pixels and adjacent non-hair pixels are blurred. This step is preferred to further reduce the aliasing phenomenon at the pixel level.
This step may be performed after rasterizing the current hair primitive or all hair primitives. In this step, the blurring process may be performed on the hair pixels and non-hair pixels adjacent thereto in the bitmap generated after rasterization. According to the embodiment of the invention, blurring processing can be performed on pixels one by one, with hair pixels or non-hair pixels adjacent to the hair pixels as origins, sampling a bitmap in a certain range along the hair direction of the pixels, and averaging the obtained pixel colors. Specific embodiments of the blurring process will be described in further detail below.
Before step 103, the color of the corresponding point of the sampling point on the primitive, the direction and the position in the world coordinate system are typically stored in three different bitmaps when rasterizing the hair primitive. In this disclosure, three different bitmaps are referred to as "color bitmaps", "direction bitmaps", "position bitmaps", respectively.
As shown in fig. 14, step 103 is divided into the following sub-steps:
substep C1: for each pixel on the color bitmap, it is determined whether it is a pixel generated by a hair primitive (i.e., a hair pixel). Data may be written to the aforementioned "direction bitmap" and "position bitmap" at the time of hair primitive rasterization, and this determination may then be made by means of the "direction bitmap" and the "position bitmap". For example, for hair pixels, the corresponding position in the "direction bitmap" holds a value representing the direction of the primitive, while for non-hair pixels, the value of the corresponding position in the "direction bitmap" is null or other specific value representing the non-hair pixel. For hair pixels, sub-step C2-1 is performed. For non-hair pixels, sub-step C2-2 is performed.
Substep C2-1: based on the coordinates of the current pixel on the color bitmap, the direction of the corresponding point (also called as the corresponding point direction) and the position of the corresponding point (also called as the corresponding point position) of the current pixel on the hair graphic element are taken out from the direction bitmap and the position bitmap, and then the substep C3 is executed;
substep C2-2: hair pixels are found within 1 pixel range around the current pixel position. If a hair pixel is not found, the exit is performed and the pixel is not processed in any way and order (e.g., counter-clockwise or clockwise). If the hair pixel is found, stopping searching and using the position of the hair pixel, taking out the corresponding point direction and the corresponding point position from the direction bitmap and the position bitmap, and then executing the sub-step C3;
substep C3: based on the corresponding point locations and the corresponding point directions, a "bitmap sample vector" is calculated.
In embodiments of the present invention, the "bitmap sample vector" may be calculated using the following method:
furthest sampling position world Corresponding point position + corresponding point Fang Xiang sample radius
Furthest sampling position pixel =coordinate system transformation (furthest sampling position) world )
Bitmap sample vector = furthest sample position pixel -current pixel position
Where "sampling radius" is a user-set value that is used to control the degree of blurring, each sampling point being farther from the origin as the value of the sampling radius is greater; the function "coordinate system transformation" means transforming the coordinates of the inputted position from the world coordinate system to the bitmap coordinate system; "current pixel location" means the coordinates of the current pixel in the bitmap coordinate system; "furthest sample position" means the coordinates of the position of the sample point on the bitmap that is furthest from the current pixel; the bitmap sample vector represents the vector from the current pixel position to the furthest sample position.
Substep C4: the color of the current pixel is modified using the bitmap sample vector.
In an embodiment of the present invention, the color of the current pixel may be modified using the following method.
Wherein m is the bitmap sampling times set by the user; i is the sequence number of the bitmap sampling points, which starts from 0 to m-1 and ends, m in total; "bit map sampling point position i "represents the position of the ith bitmap sample point in the bitmap coordinate system; "sampling color bitmap (sampling Point position) i ) "representing bit map sampling points from a color bit map i "take out the corresponding color". Calculation formulaWith the value of i from 0 to m-1, the corresponding point position is taken as the origin, and m sampling points are selected from a section formed by a bit map sampling vector and a vector opposite to the bit map sampling vector. Calculation type +.>Sampling color bitmap (bitmap sampling point position) i ) Representing a simple sum-averaging of the colors of the m sample points; in some casesIn embodiments, other averaging algorithms, such as weighted averaging, may also be employed.
In some embodiments, when performing the calculation in step 103, a color bitmap having the same number of blanks as the color bitmap of the primitive may be created in advance, and when performing the calculation in step 103 for each pixel, the above sampling and averaging operations are performed according to the data in the original color bitmap, and the finally calculated color data is written into the new color bitmap. This avoids contamination between pixels that would otherwise be unavoidable if the same bitmap were operated on.
The comparison effect after step 103 is not performed and step 103 is performed is shown in fig. 15A and 15B.
The methods and apparatus of embodiments of the present invention may be implemented as pure software modules (e.g., software programs written in Java language), as pure hardware modules (e.g., application specific ASIC chips or FPGA chips), or as modules combining software and hardware (e.g., firmware systems with fixed code stored).
Another aspect of the invention is a computer readable medium having stored thereon computer readable instructions which, when executed, may implement the methods of the embodiments of the invention.
Those of ordinary skill in the art will appreciate that the foregoing description is by way of example only, and is not intended to limit the invention so described. The present invention is also capable of numerous modifications and variations. Any modifications or variations which come within the spirit and scope of the invention are desired to be protected.

Claims (28)

1. A method for antialiasing of primitives, comprising:
amplifying the width of the primitive, including expanding endpoints of the primitive to form a first vertex and a second vertex in a world coordinate system, and obtaining a first vertex position and a second vertex position in the world coordinate system, the first vertex position and the second vertex position varying according to a virtual camera gaze direction, wherein for each endpoint:
first vertex position = endpoint position + expansion vector
Second vertex position = endpoint position-expansion vector
Where x is the cross product of the vectors, representing the number multiplication between the number and the vector;
generating a pixel of the primitive corresponding to the primitive with the enlarged width; and
the opacity of the primitive pixels is reduced.
2. The method of claim 1, further comprising:
blurring processing the primitive pixel and non-primitive pixels adjacent to the primitive pixel.
3. The method of claim 1, wherein the step of enlarging the width of the primitive causes the enlarged primitive to form a width on a bitmap after rasterization that is not less than a width of one pixel on the bitmap.
4. The method of claim 1, wherein the magnification in the step of magnifying the width of the primitive is adjustable.
5. The method of claim 1, wherein the step of enlarging the width of the primitive further comprises:
calculating first and second vertex positions of the first and second vertices in a bitmap coordinate system based on the first and second vertex positions in the world coordinate system; and
modifying the first vertex position and the second vertex position in the bitmap coordinate system.
6. The method of claim 5, wherein the modifying operation is performed according to the formula:
first vertex position ' =midpoint position+v ' '
Second vertex position '=midpoint position-V'
Wherein a first vertex position and a second vertex position represent the first vertex position and the second vertex position, respectively, in the bitmap coordinate system, and a first vertex position ' and a second vertex position ' represent new vertex positions, V ' and V being calculated intermediate values, respectively, with respect to the first vertex position and the second vertex position in the bitmap coordinate system after enlarging the width of the primitive.
7. The method of claim 1, wherein the step of reducing the opacity of the primitive pixel comprises blending the current color of the primitive pixel with a background color already present in the bitmap according to a predetermined weight.
8. The method of claim 7, wherein the mixing operation is performed according to the formula:
the final color of the pixel = current color of the pixel + opacity + background color (1-opacity) where the opacity is preset, its value is between 0 and 1.
9. The method of claim 1, wherein the step of reducing the opacity of the primitive pixels utilizes an Alpha Dithering method.
10. The method of claim 2, wherein blurring the primitive pixels and non-primitive pixels adjacent to the primitive pixels comprises:
(1) judging whether a current pixel is a primitive pixel or a non-primitive pixel, if the current pixel is the primitive pixel, entering the step (2), otherwise, entering the step (3);
(2) Taking the current pixel as an origin, sampling a bitmap in a certain range along the primitive direction of the current pixel, and averaging the pixel colors of the obtained sampling points to obtain the color of the current pixel;
(3) Searching for a pixel adjacent to the current pixel, ending if no adjacent pixel exists, otherwise, turning to the step (4); and
(4) And taking the found primitive pixel as an origin, sampling the bitmap in a certain range along the primitive direction of the primitive pixel, and averaging the pixel colors of the obtained sampling points to obtain the color of the current pixel.
11. The method of claim 10, wherein the certain range in step (2) is determined by a bitmap sample vector calculated as:
furthest sampling position world Corresponding point position + corresponding point Fang Xiang sample radius
Furthest sampling position pixel =coordinate system transformation (furthest sampling position) world )
Bitmap sample vector = furthest sample position pixel -the position of the current pixel
Wherein the corresponding point position and the corresponding point direction are the position and the direction of the current pixel in the bitmap, and the furthest sampling position world Coordinates representing the furthest sampling position in the world coordinate system, the furthest sampling position pixel Coordinates representing the furthest sampled position in the bitmap coordinate system, the position of the current pixel representing the current pixelCoordinates in a bitmap coordinate system.
12. The method of claim 10, wherein the certain range in step (4) is determined by a bitmap sample vector calculated as:
furthest sampling position world Corresponding point position + corresponding point Fang Xiang sample radius
Furthest sampling position pixel =coordinate system transformation (furthest sampling position) world )
Bitmap sample vector = furthest sample position pixel -the position of the found primitive pixel wherein the corresponding point position and corresponding point direction are the position and direction of the found primitive pixel in the bitmap, the furthest sampled position world Coordinates representing the furthest sampling position in the world coordinate system, the furthest sampling position pixel And the position of the searched primitive pixel represents the coordinates of the primitive pixel in the bitmap coordinate system.
13. The method of claim 11, wherein the sampling and averaging operation in step (2) is performed as follows:
the said
Wherein m is the preset sampling times; i is the sequence number of the bitmap sampling points, which starts from 0 to m-1 and ends, m in total; "bit map sampling point position i "represents the coordinates of the position of the i-th bitmap sampling point in the bitmap coordinate system; "sampling color bitmap (bitmap sampling point position) i ) "means from the" bitmap sampling point location of the bitmap i "fetch corresponds to the bitmap sample pointsIs a color of (c).
14. The method of claim 12, wherein the sampling and averaging operation in step (4) is performed as follows:
the said
Wherein m is the preset sampling times; i is the sequence number of the bitmap sampling points, which starts from 0 to m-1 and ends, m in total; "bit map sampling point position i "represents the coordinates of the position of the i-th bitmap sampling point in the bitmap coordinate system; "sampling color bitmap (bitmap sampling point position) i ) "means from the" bitmap sampling point location of the bitmap i "fetch the color corresponding to the bitmap sample points".
15. A system for antialiasing of primitives, comprising:
means for enlarging a width of the primitive, which expands endpoints of the primitive to form a first vertex and a second vertex in a world coordinate system, and to obtain a first vertex position and a second vertex position in the world coordinate system, the first vertex position and the second vertex position changing according to a virtual camera gaze direction, wherein for each endpoint:
first vertex position = endpoint position + expansion vector
Second vertex position = endpoint position-expansion vector
Where x is the cross product of the vectors, representing the number multiplication between the number and the vector;
means for generating primitive pixels corresponding to the primitives with enlarged widths; and
means for reducing the opacity of the primitive pixels.
16. The system of claim 15, further comprising:
means for blurring the primitive pixels and non-primitive pixels adjacent to the primitive pixels.
17. The system of claim 15, wherein the means for magnifying the width of the primitive is capable of causing the magnified primitive to form a width on a bitmap after rasterization that is not less than a width of one pixel on the bitmap.
18. The system of claim 15, wherein the means for magnifying the width of the graphical element is capable of making magnification adjustable.
19. The system of claim 15, wherein the means for amplifying the width of the primitive comprises:
means for calculating first and second vertex positions of the first and second vertices in a bitmap coordinate system based on the first and second vertex positions in the world coordinate system; and
means for modifying the first vertex position and the second vertex position in the bitmap coordinate system.
20. The system of claim 19, wherein the means for modifying the first vertex position and the second vertex position in the bitmap coordinate system performs a modifying operation according to the following formula:
first vertex position ' =midpoint position+v ' '
Second vertex position '=midpoint position-V'
Wherein a first vertex position and a second vertex position represent the first vertex position and the second vertex position, respectively, in the bitmap coordinate system, and a first vertex position ' and a second vertex position ' represent new vertex positions, V ' and V being calculated intermediate values, respectively, with respect to the first vertex position and the second vertex position in the bitmap coordinate system after enlarging the width of the primitive.
21. The system of claim 15, wherein the means for reducing the opacity of the primitive pixel comprises means for blending a current color of the primitive pixel with a background color already present in a bitmap according to a predetermined weight.
22. The system of claim 21, wherein the means for reducing the opacity of the primitive pixels performs a blending operation according to the formula:
the final color of the pixel = current color of the pixel + opacity + background color (1-opacity) where the opacity is preset, its value is between 0 and 1.
23. The system of claim 16, wherein the means for blurring the primitive pixel and non-primitive pixels adjacent to the primitive pixel comprises:
(1) means for determining whether a current pixel is a primitive pixel or a non-primitive pixel, if so, entering step (2), otherwise entering step (3);
(2) Means for sampling a bitmap in a certain range along a primitive direction of the current pixel with the current pixel as an origin, and averaging pixel colors of the obtained sampling points as colors of the current pixel;
(3) Means for finding a primitive pixel adjacent to the current pixel and ending if there is no adjacent primitive pixel, otherwise proceeding to step (4); and
(4) And the device is used for taking the found primitive pixel as an origin, sampling the bitmap in a certain range along the primitive direction of the primitive pixel, and averaging the pixel colors of the obtained sampling points to be used as the color of the current pixel.
24. The system of claim 23, wherein the means for sampling a bitmap over a range along a primitive direction of the current pixel with the current pixel as an origin and averaging pixel colors of the obtained sampling points, the range being determinable by a bitmap sampling vector calculated as:
furthest sampling position world Corresponding point position + corresponding point Fang Xiang sample radius
Furthest sampling position pixel =coordinate system transformation (furthest sampling position) world )
Bitmap sample vector = furthest sample position pixel -the position of the current pixel
Wherein the corresponding point position and the corresponding point direction are the position and the direction of the current pixel in the bitmap, and the furthest sampling position world Coordinates representing the furthest sampling position in the world coordinate system, the furthest sampling position pixel And the position of the current pixel represents the coordinate of the current pixel in the bitmap coordinate system.
25. The system of claim 23, wherein the means for taking the found primitive pixel as an origin, sampling the bitmap over a range along the primitive direction of the primitive pixel and averaging the pixel colors of the obtained sampling points, the range being determined by a bitmap sampling vector calculated as:
furthest sampling position world Corresponding point position + corresponding point Fang Xiang sample radius
Furthest sampling position pixel =coordinate system transformation (furthest sampling position) world )
Bitmap sample vector = furthest sample position pixel -the position of the found primitive pixel wherein the corresponding point position and corresponding point direction are the position and direction of the found primitive pixel in the bitmap, the furthest sampled position world Coordinates representing the furthest sampling position in the world coordinate system, the furthest sampling position pixel And the position of the searched primitive pixel represents the coordinates of the primitive pixel in the bitmap coordinate system.
26. The system according to claim 24, wherein said means for sampling a bitmap over a range along a primitive direction of the current pixel with the current pixel as an origin and averaging pixel colors of the obtained sampling points, as the color of the current pixel, is capable of performing said sampling and averaging operations according to the following formula:
the said
Wherein m is the preset sampling times; i is the sequence number of the bitmap sample point, which is opened from 0Starting from m-1 to m; "bit map sampling point position i "represents the coordinates of the position of the i-th bitmap sampling point in the bitmap coordinate system; "sampling color bitmap (bitmap sampling point position) i ) "means from the" bitmap sampling point location of the bitmap i "fetch the color corresponding to the bitmap sample points".
27. The system of claim 25, wherein the means for taking the found primitive pixel as an origin, sampling the bitmap over a range along the primitive direction of the primitive pixel and averaging the pixel color of each sample point obtained, the sampling and averaging operation being performed as the color of the current pixel according to the following formula:
the said
Wherein m is the preset sampling times; i is the sequence number of the bitmap sampling points, which starts from 0 to m-1 and ends, m in total; "bit map sampling point position i "represents the coordinates of the position of the i-th bitmap sampling point in the bitmap coordinate system; "sampling color bitmap (bitmap sampling point position) i ) "means from the" bitmap sampling point location of the bitmap i "fetch the color corresponding to the bitmap sample points".
28. A computer readable medium having stored thereon computer readable instructions which, when executed by a computer, are capable of performing the method of any of claims 1-14.
CN201910665902.XA 2019-07-23 2019-07-23 Method and system for antialiasing of primitives Active CN110648386B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910665902.XA CN110648386B (en) 2019-07-23 2019-07-23 Method and system for antialiasing of primitives

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910665902.XA CN110648386B (en) 2019-07-23 2019-07-23 Method and system for antialiasing of primitives

Publications (2)

Publication Number Publication Date
CN110648386A CN110648386A (en) 2020-01-03
CN110648386B true CN110648386B (en) 2024-01-09

Family

ID=69009459

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910665902.XA Active CN110648386B (en) 2019-07-23 2019-07-23 Method and system for antialiasing of primitives

Country Status (1)

Country Link
CN (1) CN110648386B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111784795A (en) * 2020-06-01 2020-10-16 北京像素软件科技股份有限公司 Processing method and device for line segment aliasing, electronic equipment and storage medium
CN111862290B (en) * 2020-07-03 2021-05-11 完美世界(北京)软件科技发展有限公司 Radial fuzzy-based fluff rendering method and device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104952102A (en) * 2015-06-12 2015-09-30 浙江大学 Deferred shading-orientated uniform anti-aliasing method
CN108416729A (en) * 2018-03-27 2018-08-17 长沙景嘉微电子股份有限公司 A kind of realization device and method of line segment anti-aliasing in GPU
CN108519867A (en) * 2018-04-12 2018-09-11 长沙景美集成电路设计有限公司 A kind of device and method for realizing triangle anti-aliasing in GPU
CN108537718A (en) * 2018-04-12 2018-09-14 长沙景美集成电路设计有限公司 A kind of device and method for realizing some pel anti-aliasings in GPU

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104952102A (en) * 2015-06-12 2015-09-30 浙江大学 Deferred shading-orientated uniform anti-aliasing method
CN108416729A (en) * 2018-03-27 2018-08-17 长沙景嘉微电子股份有限公司 A kind of realization device and method of line segment anti-aliasing in GPU
CN108519867A (en) * 2018-04-12 2018-09-11 长沙景美集成电路设计有限公司 A kind of device and method for realizing triangle anti-aliasing in GPU
CN108537718A (en) * 2018-04-12 2018-09-14 长沙景美集成电路设计有限公司 A kind of device and method for realizing some pel anti-aliasings in GPU

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种支持多线宽直线反走样算法;骆朝亮等;《软件导刊》;20100530(第05期);全文 *
任意宽度直线的绘制与反走样;李震霄等;《武汉大学学报(工学版)》;20060830(第04期);全文 *

Also Published As

Publication number Publication date
CN110648386A (en) 2020-01-03

Similar Documents

Publication Publication Date Title
KR101916341B1 (en) Gradient adjustment for texture mapping for multiple render targets with resolution that varies by screen location
US8035641B1 (en) Fast depth of field simulation
US8044955B1 (en) Dynamic tessellation spreading for resolution-independent GPU anti-aliasing and rendering
US6038031A (en) 3D graphics object copying with reduced edge artifacts
US7742060B2 (en) Sampling methods suited for graphics hardware acceleration
US8217962B2 (en) Single-pass bounding box calculation
JP4121717B2 (en) Apparatus for performing H-space bump mapping suitable for implementation with H-space illumination in a graphics pipeline of a computer graphics display system
EP1958162B1 (en) Vector graphics anti-aliasing
US8269770B1 (en) Tessellation of trimmed parametric surfaces by walking the surface
CN106408635B (en) Graphic processing system, method of operating the same, and computer-readable storage medium
US20120075310A1 (en) Arc spline gpu rasterization for cubic bezier drawing
JP6863693B2 (en) Graphics processing system and method
CN110648386B (en) Method and system for antialiasing of primitives
US10332290B2 (en) Fast, coverage-optimized, resolution-independent and anti-aliased graphics processing
JP2009301284A (en) Drawing device and method
US20150325022A1 (en) Technique for processing a character string for graphical representation on a man/machine interface
US20030043148A1 (en) Method for accelerated triangle occlusion culling
KR101030825B1 (en) Low-cost supersampling rasterization
US7643702B1 (en) Object detection in images using a graphics processor
US20130093784A1 (en) Pixel-Aligned Drawing to Avoid Anti-Aliasing
KR100705188B1 (en) A character font display method
US11776179B2 (en) Rendering scalable multicolored vector content
US20230298212A1 (en) Locking mechanism for image classification
US20230298133A1 (en) Super resolution upscaling
US20230082839A1 (en) Rendering scalable raster content

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant