Rasterization method and rasterization system for graphic data
Through ray tracing technology and acceleration structure, the problem of slow rasterization processing of graphics data in the existing technology is solved, and more efficient graphic data processing is achieved, meeting the need for improving processing efficiency.
Patent Information
- Application Number
- CN202411621376.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-14
AI Technical Summary
In the prior art, the rasterization processing speed of graphical data is difficult to improve, and it is difficult to meet the needs of improving processing efficiency.
Ray tracing technology is used to start from pixel points or single rays, and by emitting parallel rays, accelerating structures (such as tree structures) are used to find whether the current pixel point or ray intersects with the graphics unit, and the values of all pixel points of the output image are obtained, thereby obtaining rasterized data of the graphics data.
The rasterized processing speed of graph data is improved, and the graph data can be processed more efficiently, meeting the needs for improving processing efficiency. At the same time, the GPU hardware structure can be further accelerated.
Smart Images

Figure CN119131221B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of direct writing lithography, in particular to a rasterization method and a rasterization system for graphic data. Background Art
[0002] In the field of laser direct writing technology, laser direct writing exposure equipment needs to rasterize the graphic data input by the user to obtain dot matrix graphic data, and control the spatial modulation device according to the dot matrix graphic data to obtain the direct writing image. At present, the rasterization of graphic data mostly adopts the method of filling the inside of the graphic from a single graphic, and the processing speed is difficult to improve. As the requirements for processing efficiency are getting higher and higher, the processing speed of rasterization needs to be improved urgently. Summary of the invention
[0003] In order to solve the above problems, the present invention provides a rasterization method and a rasterization system for graphic data to improve the speed of rasterization.
[0004] In order to achieve the above-mentioned purpose, the present invention provides a rasterization method for graphic data, firstly, preprocessing the graphic data to obtain preprocessed data, the graphic data is polygonal graphic data, and the preprocessed data is graphic unit grid data in the output image coordinate system; the graphic unit grid data is obtained by segmenting the polygonal graphic data; an acceleration structure of the preprocessed data is constructed; an array with the same length as the output image size is allocated, the elements in the array correspond to the output image pixels one by one, the number of emitted rays is the same as the length of the array, and each ray corresponds to the output image pixels one by one; a ray perpendicular to the image plane of the preprocessed data is emitted from the plane coordinates of each pixel of the output image, and it is calculated whether the current ray intersects with the graphic unit in the acceleration structure, the values of all the pixels of the output image are obtained, and the rasterized data of the graphic data is obtained based on the values of all the pixels.
[0005] In one embodiment, the acceleration structure adopts a tree structure, the root node of the tree structure is the bounding box formed by all graphic units, and the preprocessed data is gradually differentiated to obtain corresponding child nodes until the last leaf node corresponds to the bounding box formed by each graphic unit, and the leaf node stores the data information of the graphic unit.
[0006] In one embodiment, when calculating whether the current light ray intersects with the graphics unit in the acceleration structure, if it intersects, the pixel value of the pixel point corresponding to the intersecting light ray is set to 1; if it does not intersect, the pixel value of the pixel point corresponding to the intersecting light ray is set to 0, and the rasterized data of the graphics data is obtained based on the pixel values of all the pixels.
[0007] In one embodiment, when preprocessing graphic data, the graphic data is first triangulated to obtain triangular mesh data. If the coordinate systems of the polygonal graphic data and the graphic unit mesh data are different, the coordinates of the triangular mesh data are transformed to obtain preprocessed data. In the case where the graphic data contains arcs, the arcs are discretized into line segments to obtain discretized graphic data, and the discretized graphic data are triangulated to obtain triangular mesh data.
[0008] In one embodiment, coordinate transformation of the triangular mesh data is performed in parallel.
[0009] In one embodiment, when preprocessing the graphic data, if the triangular mesh data obtained after triangulation has poor uniformity, the graphic data is first cut with a w×h rectangle, and then the cut graphic data is triangulated to obtain triangular mesh data; according to the maximum bounding box size of the desired triangle after segmentation and the span of the entire graphic data in the x and y directions, the N and M values are set to obtain the width w=wall / N of the rectangle used for segmentation and the length h=hall / M of the rectangle used for segmentation, where wall is the absolute width of the entire graphic data in the x direction, hall is the absolute height of the entire graphic data in the y direction, N is the number of bounding boxes arranged in the x direction, and M is the number of bounding boxes arranged in the y direction.
[0010] In one embodiment, when preprocessing the graphic data, if the uniformity of the triangular mesh data obtained after triangulation is poor, the graphic data is first triangulated, and the triangulated data is cut with a w×h rectangle to obtain cut polygonal graphic data, and the cut polygonal graphic data is triangulated again to obtain triangular mesh data; according to the maximum bounding box size of the triangle expected after segmentation and the span of the entire graphic data in the x and y directions, the N and M values are set to obtain the width w=wall / N of the rectangle used for segmentation and the length h=hall / M of the rectangle used for segmentation, where wall is the absolute width of the entire graphic data in the x direction, hall is the absolute height of the entire graphic data in the y direction, N is the number of bounding boxes arranged in the x direction, and M is the number of bounding boxes arranged in the y direction.
[0011] In one embodiment, according to the requirement of outputting data, the rasterized data is compressed to obtain the required data format.
[0012] A graphics data rasterization system used to execute the above-mentioned graphics data rasterization method includes a preprocessing unit and a rasterization unit. The preprocessing unit is used to perform graphic unit gridding on the graphics data, and when the input coordinate system where the graphics data is located and the output image coordinate system where the preprocessed graphics unit grid data is located are different coordinate systems, coordinate conversion is performed to obtain the preprocessed data in the output image coordinate system; the rasterization unit obtains the rasterized data of the graphics data by rasterizing the preprocessed data.
[0013] In one embodiment, the preprocessing unit includes a triangulation module, a quality optimization module and a coordinate conversion module, the triangulation module performs triangulation processing on the graphic data or the quality-optimized polygonal graphic data, and the quality optimization module is used to optimize the graphic data or the triangulated triangular mesh data.
[0014] In one embodiment, the rasterization unit includes an acceleration structure building module and a ray tracing module, the acceleration structure building module builds an acceleration structure based on the preprocessed data, the ray tracing module allocates an array based on the pixel size of the output image, emits light from each pixel of the output image, calculates whether the current light intersects with the graphics unit in the acceleration structure, records the result to the array element, and obtains rasterized data of the graphics data based on the value of the array element.
[0015] In one embodiment, the graphic data rasterization system further includes a compression unit, which compresses the rasterized pixels to obtain a required data format.
[0016] In one embodiment, the graphics data rasterization system is accelerated in parallel by a GPU.
[0017] Compared with the prior art, the present invention adopts ray tracing starting from pixel points / single ray, and by emitting parallel rays, based on the acceleration structure, searches whether the current pixel point / single ray intersects with the graphic unit of the acceleration structure, obtains the values of all pixel points of the output image, and obtains rasterized data of the graphic data based on the values of all pixel points, thereby improving efficiency. At the same time, the hardware structure characteristics of the GPU can be used to further accelerate and improve efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic diagram of the flow of the method for rasterizing graphic data of the present invention.
[0019] Figure 2 It is a schematic diagram of the process of obtaining rasterized data by ray tracing according to the present invention.
[0020] Figure 3 is an exemplary flow chart of the method for rasterizing graphic data of the present invention.
[0021] Figure 4 It is a schematic diagram of decomposing a polygon containing an internal hole or an internal angle greater than 180 degrees into a convex polygon without an internal hole.
[0022] Figure 5 It is a schematic diagram of the tree structure of the present invention.
[0023] Figure 6 This is a schematic diagram of the bounding box corresponding to node A.
[0024] Figure 7 This is a schematic diagram of the bounding boxes corresponding to node B and node C.
[0025] Figure 8 It is a schematic diagram of the bounding box corresponding to node D and node E.
[0026] Fig. 9 It is a schematic diagram of the bounding box corresponding to node H and node I.
[0027] Fig.10 It is a schematic diagram of the intersection of parallel light rays and graphic units.
[0028] Fig.11 It is a schematic diagram of an embodiment of a system for rasterizing graphic data according to the present invention.
[0029] Fig.12 It is a schematic diagram of another embodiment of the system for rasterizing graphic data of the present invention.
[0030] Fig.13 It is a workflow diagram of the graphic data rasterization system of the present invention. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is described below by means of specific embodiments shown in the accompanying drawings.
[0032] like Figure 1-Figure 10 As shown, the method for rasterizing graphic data includes the following steps: S1, preprocessing the graphic data to obtain preprocessed data; S2, processing the preprocessed data by ray tracing to obtain rasterized data of the graphic data.
[0033] The following is a detailed description of each step of the graphic data rasterization method.
[0034] S1. Preprocessing the graphic data to obtain preprocessed data. The graphic data is polygonal graphic data, and the preprocessed data is graphic unit grid data in the output image coordinate system, and the graphic unit grid data is obtained by segmenting the polygonal graphic data. The graphic unit grid data refers to a grid composed of uniform graphic units, and the graphic unit can be a triangle, a rectangle, or other graphics, and the shape of the graphic unit is selected according to actual needs.
[0035] The coordinate system of the input graphic data is the input coordinate system, and the coordinate system of the preprocessed graphic unit grid data is the output image coordinate system.
[0036] When the input coordinate system and the output image coordinate system are the same coordinate system, the graphic unit grid data is obtained by segmenting the polygonal graphic data.
[0037] When the input coordinate system and the output image coordinate system are different coordinate systems, obtaining the estimated processing data includes a step of converting polygonal graphic data into graphic unit grid data and a coordinate conversion step.
[0038] The following implementations are included:
[0039] Implementation method 1
[0040] S11, converting the graphic data in the input coordinate system into graphic unit grid data in the input coordinate system.
[0041] S12, converting the graphic unit grid data in the input coordinate system into the graphic unit grid data in the output image coordinate system to obtain pre-processed data.
[0042] Implementation method 2
[0043] S11', converting the graphic data in the input coordinate system into the graphic data in the output image coordinate system.
[0044] S12', converting the graphic data in the output image coordinate system into graphic unit grid data in the output image coordinate system to obtain pre-processed data.
[0045] The following is an example in which the graphic unit adopts a triangle and the input coordinate system and the output image coordinates are different. The graphic unit adopts a triangle for easy processing and high processing efficiency. When the graphic unit adopts a triangle, the pre-processed data is triangular mesh data, and the smallest triangular unit in the triangular mesh data is a graphic unit.
[0046] First, the graphic data is triangulated to obtain triangular mesh data, and then the triangular mesh data is subjected to coordinate transformation to obtain pre-processed data. The triangulation refers to cutting the polygons in the graphic data into triangles, and the coordinate transformation refers to calculating the position coordinates of the triangles in the output image coordinate system based on the position coordinates of the graphic data in the input coordinate system. The triangular mesh data has a simple data structure and is easier to operate.
[0047] In the case where the graphic data contains circular arcs, the circular arcs are discretized into line segments to obtain discretized graphic data, and the discretized graphic data are triangulated to obtain triangular mesh data.
[0048] There are many methods for triangulating graphic data to obtain triangular mesh data, such as earcut or Delaunay triangulation. When the three angles of any triangle in the triangular mesh data obtained by triangulation are close to 60 degrees and the triangle is close to an equilateral triangle, the uniformity of the triangular mesh data is good. With the triangular mesh data with good uniformity, a better quality acceleration structure can be obtained to increase the speed of ray tracing. On the contrary, if the triangular mesh data contains more triangles with at least one small angle and the triangle is long and narrow, the uniformity of the triangular mesh data is poor.
[0049] The Earcut method performs triangle segmentation by sequentially searching for convex vertices in a polygon that can serve as ears. The convex vertices that serve as ears must satisfy the requirement that the triangle formed by the convex vertex and its two adjacent vertices does not contain other vertices of the polygon. The Earcut method is highly efficient, but the generated triangular mesh data has poor uniformity and is prone to contain triangles that are too narrow and long, affecting the quality of the generated acceleration structure, thereby reducing the speed of ray tracing. In order to solve the problem of triangles that are too narrow and long obtained by the Earcut method, better triangular mesh data is obtained through data quality optimization to avoid triangles in the triangular mesh data being too narrow and long.
[0050] For the problem that the triangles obtained by the ear cutting method are too narrow and long, the data quality optimization method can process the data by cutting with rectangles (w×h). The uniformity and size of the optimized triangles can be controlled by setting appropriate rectangle length values h and width values w. According to the maximum bounding box size of the expected triangle after segmentation and the span of the full graphic of the graphic data in the x and y directions, set appropriate N and M values to obtain the required cutting rectangle. The width of the rectangle used for segmentation is w=wall / N, h=hall / M, wall is the absolute width of the full graphic of the graphic data in the x direction, hall is the absolute height of the full graphic of the graphic data in the y direction, N is the number of bounding boxes arranged in the x direction, and M is the number of bounding boxes arranged in the y direction.
[0051] Implementation example 1 of the data quality optimization method: firstly, the graphic data is cut with a w×h rectangle, and then the cut graphic data is triangulated to obtain triangular mesh data.
[0052] Implementation example 2 of the data quality optimization method: firstly triangulate the graphic data, cut the triangulated data with a w×h rectangle to obtain cut polygon graphic data, and triangulate the cut polygon graphic data again to obtain triangular mesh data. Rectangular cutting of the triangulated data can simplify the algorithm to a certain extent and improve efficiency.
[0053] By using a w×h rectangle for cutting, we can avoid the triangulated triangles being long and narrow, thus ensuring the quality of the generated acceleration structure bounding box tree.
[0054] Delaunay triangulation divides the triangles by ensuring that there is a circle on each edge of the polygon after it is cut into triangles. The circle passes through the two endpoints of the edge, and no vertices of any polygon exist within the circle. At most three vertices of the polygon on the circle coexist in the circle. Delaunay triangulation will try to make each triangle as symmetrical and balanced as possible. However, the traditional Delaunay triangulation algorithm can only triangulate convex polygons composed of a point set that do not contain internal holes. It is not applicable when our input is a polygon with internal holes or an internal angle greater than 180 degrees. Therefore, if the Delaunay triangulation method is used, the graphic data must first be decomposed into a set of convex polygons without internal holes, and then the set of convex polygons without internal holes must be Delaunay triangulated. Figure 4 In the example shown, a polygon containing an inner hole or an inner angle greater than 180 degrees is decomposed into convex polygons such as rectangles and trapezoids without inner holes, and then the convex polygons without inner holes are subjected to Delaunay triangulation to obtain a more uniform triangular mesh.
[0055] The triangulation method can be selected based on whether it contains inner holes, arcs, and concavity, and is not limited to ear cutting or Delaunay triangulation. You can also use the regularization algorithm of the triangular mesh, the Delaunay triangulation algorithm based on the constraint edge, etc. to generate a more uniform triangular mesh and obtain a better triangular mesh quality effect.
[0056] The coordinate transformation parallel calculation of the graphic data or the graphic unit grid data can be implemented in parallel on a CPU (Central Processing Unit) or a GPU (Graphics Processing Unit) in a matrix operation manner.
[0057] S2, obtaining rasterized data of the graphics data by ray tracing the preprocessed data. The steps include:
[0058] S21. Construct an acceleration structure based on the preprocessed data. The acceleration structure may adopt a tree structure, wherein the root node of the tree corresponds to the bounding box formed by all graphic units, and the preprocessed data is gradually differentiated to obtain corresponding child nodes, until the last child node (leaf node) corresponds to the bounding box formed by each graphic unit, and stores the data information of the graphic unit.
[0059] The tree structure may adopt a BVH (Bounding Volume Hierarchy) tree, a KD (K-Dimensional) tree, or a BSP (Binary Space Partitioning) tree.
[0060] The following uses a BVH (Bounding Volume Hierarchy) tree in a tree structure, and uses an AABB bounding box (rectangular) as an example for explanation. Figure 5-Figure 10 As shown, the bounding box of all graphic units containing the preprocessed data is the root node A of the BVH tree, and the graphic units contained in the root node A are divided into two parts, and the bounding boxes of the graphic units in each part are obtained respectively, which are the two child nodes B and C of the root node. The two child nodes are further differentiated to obtain the child nodes D and E of node B, and the child nodes F and G of node C. The graphic units contained in node D, node E, node F, and node G are divided respectively to obtain the corresponding bounding boxes, and leaf nodes H, leaf node I, leaf node J, leaf node K, leaf node L, leaf node M, leaf node N and leaf node O are obtained, and the leaf nodes contain graphic unit data.
[0061] It is simpler to use the AABB bounding box and the light to intersect; at the same time, such a tree structure can speed up the light to find the bounding box that may intersect. In this embodiment, the setting of the tree structure speeds up the efficiency of the intersection of the light and the triangle mesh by reducing unnecessary intersection tests.
[0062] S22, allocating an array for storing output image information. The elements in the array correspond to the pixels of the output image one by one, the number of emitted rays is the same as the length of the array, and each ray corresponds to a pixel of the output image one by one.
[0063] S23. Emit light from the plane coordinates of each pixel point of the output image to form a surface light source that emits parallel light. At the same time, the light is perpendicular to the image plane of the preprocessed data. Calculate whether the current light intersects with the unit graphics in the acceleration structure, record the result to the array element, and obtain rasterized data of the graphic data based on the value of the array element.
[0064] When the acceleration structure adopts a tree structure, first calculate whether a single ray intersects with the bounding box corresponding to the root node of the acceleration structure. If so, continue to calculate whether the bounding box corresponding to the child node of the root node (parent node) intersects with the ray. If the bounding box corresponding to the child node intersects with the ray, continue to use the current child node as the parent node to calculate whether the bounding box corresponding to its child node intersects with the ray. When the child node is a leaf node, calculate whether the ray intersects with the graphic unit in the leaf node. If the point where the ray intersects with the graphic unit is located within the graphic unit or on the edge of the graphic unit, it is considered that the ray intersects with the graphic unit, and the pixel value of the pixel corresponding to the ray is set to 1, and it is considered that the array element corresponding to the current ray has a value; if the point where the ray intersects with the graphic unit is located outside the graphic unit, it is considered that the ray does not intersect with the graphic unit, and the pixel value of the pixel corresponding to the ray is set to 0.
[0065] According to the above-mentioned method of obtaining the pixel value of the pixel point corresponding to a single light ray, the pixel value of the pixel point corresponding to the light ray emitted from the plane coordinates of each pixel point of the output image is calculated, and the pixel value of each pixel point of the output image is obtained based on the pixel value of the pixel point corresponding to the light ray emitted from the plane coordinates of each pixel point of the output image. The output image data containing the pixel value of each pixel point is the rasterized data of the graphic data. The pixel point with a pixel value of 1 is the location of the polygon, and the pixel point with a pixel value of 0 is the location without a polygon.
[0066] The pixel values of the pixel points corresponding to all rays can be obtained by emitting multiple rays at the same time, calculating the intersection result of each ray with the acceleration structure at the same time, and improving efficiency through parallel calculation.
[0067] like Figure 4-8 The example shown is an example of a method for calculating the result of the intersection of a single ray and an acceleration structure. First, calculate whether a ray intersects with the bounding box corresponding to the root node A. If so, continue to calculate whether the child nodes B and C of the root node A intersect with the ray. If child node B intersects with the ray and child node C does not intersect with the ray, then no longer calculate the child nodes F and G of node C. Continue to calculate whether the bounding boxes corresponding to the child nodes D and E of node B intersect with the ray. For the nodes that intersect with the ray, continue to calculate whether the bounding boxes corresponding to their child nodes intersect with the ray. For example, if the bounding box corresponding to node D intersects with the ray, continue to calculate the child nodes H and I of node D. Child nodes H and I are leaf nodes of the tree structure. Calculate the intersection points of the graphic units in child nodes H and I with the ray. Fig. 9 As shown, when the light intersects with the graphic unit, the pixel value of the pixel point corresponding to the intersecting light is set to 1, and when the light does not intersect with the graphic unit, the pixel value of the pixel point corresponding to the light is set to 0.
[0068] Different from the idea of filling the interior of a graphic from a single graphic, ray tracing starts from a pixel point / a single ray, and by emitting a specified number of parallel rays perpendicular to the output image plane, an acceleration structure is constructed through the bounding box of the graphic unit, and nodes that can intersect with the parallel rays are screened out, thereby accelerating the search for whether the current pixel point / a single ray intersects with the graphic unit, thereby improving efficiency.
[0069] According to the requirements of output data, the rasterized data can be compressed to obtain the required data format. There are many methods to compress the rasterized data, such as run-length encoding method.
[0070] The method for rasterizing graphic data can obtain rasterized data of graphic data by constructing an acceleration structure on the GPU and calculating the intersection result of each ray with the graphic unit in the acceleration structure in parallel. The hardware architecture of GPU synchronous operation is used to improve efficiency and the process is accelerated by the powerful computing power of the GPU.
[0071] like Figure 11-13 The graphic data rasterization system used to perform the graphic data rasterization method is shown as follows: Fig.11 In the illustrated embodiment, the graphics rasterization system includes a preprocessing unit and a rasterization unit. The preprocessing unit is used to perform graphic unit gridding on the graphics data, and to perform coordinate conversion when the input coordinate system and the output image coordinate system are different coordinate systems to obtain preprocessed data in the output image coordinate system; the rasterization unit rasterizes the preprocessed data by a ray tracing method to obtain rasterized data of the graphics data.
[0072] The preprocessing unit includes a triangulation module, a quality optimization module and a coordinate conversion module. The triangulation module performs triangulation processing on the graphic data or the polygonal graphic data after quality optimization. The quality optimization module is used to optimize the graphic data or the triangulated triangular mesh data, and the data processing can be performed in a rectangular (w×h) cutting manner. The coordinate conversion module is used to convert the coordinates of the initial coordinate system into the coordinates of the output coordinate system. The preprocessed data is obtained through the triangulation module, the quality optimization module and the coordinate conversion module.
[0073] The rasterization unit includes an acceleration structure building module and a ray tracing module. The acceleration structure building module builds an acceleration structure based on the preprocessed data. The ray tracing module allocates an array based on the size of the output image pixels, and emits parallel light perpendicular to the output image plane from the plane coordinates of each pixel point of the output image, and calculates whether the light intersects with the graphics unit in the acceleration structure, records the result to the array element, and obtains the rasterized data of the graphics data based on the value of the array element.
[0074] like Fig.12 As shown, the graphic data rasterization system further includes a compression unit, which compresses pixel data in the rasterized data to obtain a required data format.
[0075] The preprocessing unit, the rasterization unit and the compression unit are implemented in a CPU, or in a GPU, or in both a CPU and a CPU.
[0076] When the graphics data rasterization system is implemented through the GPU, it is possible to build an acceleration structure on the GPU, parallelly calculate the intersection results of each ray and the graphics unit in the acceleration structure, obtain the rasterized data of the graphics data, and use the GPU synchronous computing hardware architecture to further improve efficiency, thereby achieving process acceleration through the powerful computing power of the GPU.
[0077] Leverage the hardware advantages of the CPU and GPU to accelerate the rasterization process.
Claims
1. A method for rasterizing graphic data, characterized in that: First, the graphic data is preprocessed to obtain preprocessed data, wherein the graphic data is polygonal graphic data, and the preprocessed data is graphic unit grid data in the output image coordinate system, and the graphic unit grid data is obtained by segmenting the polygonal graphic data; an acceleration structure of the preprocessed data is constructed; an array with the same length as the output image size is allocated, the elements in the array correspond to the output image pixels one by one, the number of emitted rays is the same as the length of the array, and each ray corresponds to the output image pixels one by one; a ray perpendicular to the image plane of the preprocessed data is emitted from the plane coordinates of each pixel of the output image, and it is calculated whether the current ray intersects with the graphic unit in the acceleration structure, the values of all the pixels of the output image are obtained, and the rasterized data of the graphic data is obtained based on the values of all the pixels.
2. The rasterization method according to claim 1, characterized in that: The acceleration structure adopts a tree structure, the root node of which is the bounding box formed by all graphic units, and the preprocessed data is gradually differentiated to obtain corresponding child nodes until the last leaf node corresponds to the bounding box formed by each graphic unit, and the leaf node stores the data information of the graphic unit.
3. The rasterization method according to claim 1, characterized in that: When calculating whether the current light ray intersects with the graphics unit in the acceleration structure, if it intersects, the pixel value of the pixel point corresponding to the intersecting light ray is set to 1; if it does not intersect, the pixel value of the pixel point corresponding to the intersecting light ray is set to 0, and the rasterized data of the graphics data is obtained based on the pixel values of all pixels.
4. The rasterization method according to claim 1, wherein: When preprocessing the graphic data, the graphic data is triangulated to obtain triangular mesh data. If the coordinate systems of the graphic data and the graphic unit mesh data are different, the coordinates of the triangular mesh data are transformed to obtain preprocessed data. In the case where the graphic data contains arcs, the arcs are discretized into line segments to obtain discretized graphic data, and the discretized graphic data are triangulated to obtain triangular mesh data.
5. The rasterization method according to claim 4, characterized in that: Perform coordinate transformations of triangular mesh data in parallel.
6. The rasterization method according to claim 4, characterized in that: When preprocessing the graphic data, if the triangular mesh data obtained after triangulation has poor uniformity, the graphic data is first cut with a w×h rectangle, and then the cut graphic data is triangulated to obtain triangular mesh data, wherein w is the rectangle width value and h is the rectangle length value; according to the maximum bounding box size of the expected triangle after segmentation and the span of the entire graphic data in the x and y directions, the N and M values are set to obtain the width w=wall / N and the length h=hall / M of the rectangle used for segmentation, wherein wall is the absolute width of the entire graphic data in the x direction, hall is the absolute height of the entire graphic data in the y direction, N is the number of bounding boxes arranged in the x direction, and M is the number of bounding boxes arranged in the y direction.
7. The rasterization method according to claim 4, characterized in that: When preprocessing the graphic data, if the triangulated mesh data obtained after triangulation has poor uniformity, the graphic data is first triangulated, and the triangulated data is cut with a w×h rectangle to obtain cut polygonal graphic data, and the cut polygonal graphic data is triangulated again to obtain triangulated mesh data, wherein w is the rectangle width value, and h is the rectangle length value; according to the maximum bounding box size of the expected triangle after segmentation and the span of the entire graphic data in the x and y directions, the N and M values are set to obtain the width w=wall / N and the length h=hall / M of the rectangle used for segmentation, where wall is the absolute width of the entire graphic data in the x direction, hall is the absolute height of the entire graphic data in the y direction, N is the number of bounding boxes arranged in the x direction, and M is the number of bounding boxes arranged in the y direction.
8. The rasterization method according to claim 1, characterized in that: According to the requirements of output data, the rasterized data is compressed to obtain the required data format.
9. A graphics data rasterization system used to execute the graphics data rasterization method according to any one of claims 1 to 8, characterized in that: It includes a preprocessing unit and a rasterization unit. The preprocessing unit is used to perform graphic unit gridding on the graphic data, and when the input coordinate system where the graphic data is located and the output image coordinate system where the preprocessed graphic unit grid data is located are different coordinate systems, coordinate conversion is performed to obtain the preprocessed data in the output image coordinate system; The rasterization unit obtains rasterized data of the graphic data by rasterizing the preprocessed data.
10. The graphic data rasterization system according to claim 9, characterized in that: The preprocessing unit includes a triangulation module, a quality optimization module and a coordinate conversion module. The triangulation module performs triangulation processing on the graphic data or the quality-optimized polygonal graphic data, and the quality optimization module is used to optimize the graphic data or the triangulated triangular mesh data.
11. The graphic data rasterization system according to claim 9, characterized in that: The rasterization unit includes an acceleration structure building module and a ray tracing module. The acceleration structure building module builds an acceleration structure based on the preprocessed data. The ray tracing module allocates an array based on the pixel size of the output image, emits light from each pixel of the output image, calculates whether the current light intersects with the graphics unit in the acceleration structure, records the result to the array element, and obtains the rasterized data of the graphics data based on the value of the array element.
12. The graphic data rasterization system according to claim 9, characterized in that: The graphic data rasterization system further includes a compression unit, which compresses pixels in the rasterized data to obtain a required data format.
13. The graphic data rasterization system according to claim 9, characterized in that: The graphics data rasterization system is accelerated in parallel by a GPU.
Citation Information
Patent Citations
Vector polygon rasterization algorithm and system
CN105184837A
CPU and GPU mixture based rendering method
CN106469463A