Surface subdivision method, device, equipment and storage medium

By using the first-in-first-out caching mechanism during the surface subdivision process, special cache space is allocated to cache and update the coordinates of subdivision points, which solves the problems of repeated calculation of coordinates and low cache hit rate in surface subdivision, and improves efficiency. efficiency and processor performance.

CN118262067BActive Publication Date: 2024-09-03MOORE THREADS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410693156.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-03
Estimated Expiration
2044-05-30

Smart Images

  • Figure CN118262067B
    Figure CN118262067B
Patent Text Reader

Abstract

The embodiments of the present application disclose a surface subdivision method, device, equipment and storage medium. The surface subdivision method includes: obtaining a to-be-processed graphic and corresponding subdivision parameters; based on the subdivision parameters, determining a subdivision area and corresponding multiple subdivision points in the to-be-processed graphic, wherein the multiple subdivision points include: an initial subdivision point and other subdivision points; based on a cache space, generating subdivision point information corresponding to the multiple subdivision points, and updating the subdivision point information to the cache space. The initial subdivision point information corresponding to the initial subdivision point is cached in the first cache space; the other subdivision point information corresponding to the other subdivision points is cached in the second cache space; the first cache space and the second cache space are updated respectively according to the first-in-first-out principle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to but is not limited to the field of digital image processing, and in particular to a surface subdivision method, device, equipment and storage medium. Background Art

[0002] In graphics processing, tessellation has become an important step in expressing the surface details of objects. Tessellation is the process of subdividing geometric figures or geometric surfaces into smaller topological figures, enriching the mesh details by increasing the number of figures, thereby increasing the realism of the figures.

[0003] In the process of surface subdivision, the coordinates of the vertices (i.e., subdivision points) of the subdivided topological figures need to be calculated in order to shade each topological figure. However, in the related art, no cache and deduplication mechanism for the vertex coordinates of the topological figures has been established, resulting in repeated calculations and a low cache hit rate. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a surface subdivision method, apparatus, device and storage medium, which can avoid repeated calculation of coordinates and improve cache hit rate.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] An embodiment of the present application provides a surface subdivision method, which includes: obtaining a to-be-processed graphic and corresponding subdivision parameters; based on the subdivision parameters, determining a subdivision area and corresponding multiple subdivision points in the to-be-processed graphic; wherein the multiple subdivision points include: an initial subdivision point and other subdivision points; based on a cache space, generating subdivision point information corresponding to the multiple subdivision points respectively, and updating the subdivision point information to the cache space; wherein the initial subdivision point information corresponding to the initial subdivision point is cached in a first cache space; the other subdivision point information corresponding to the other subdivision points is cached in a second cache space; the first cache space and the second cache space are updated respectively according to a first-in-first-out principle.

[0007] In the above scheme, a plurality of subdivision points are determined in the to-be-processed graph, including: numbering the plurality of subdivision points in sequence along a circulation direction; and determining the initial subdivision point and the other subdivision points based on the numbers of the plurality of subdivision points.

[0008] In the above scheme, the subdivision point information is updated to the cache space, including: prioritizing the subdivision points based on the numbers of the multiple subdivision points; wherein the initial subdivision point is classified as a first priority, and the other subdivision points except the initial subdivision point are classified as a second priority; according to the priority of the subdivision point, the initial subdivision point information is cached in the first cache space, and the other subdivision point information is cached in the second cache space.

[0009] In the above scheme, the cached subdivision point information includes: the number and coordinates of the subdivision point; generating the subdivision point information includes: determining whether the coordinates of the subdivision point have been cached based on the cached number of the subdivision point; if the coordinates of the subdivision point have not been cached, calculating the coordinates of the subdivision point; or, if the coordinates of the subdivision point have been cached, reading the coordinates of the subdivision point.

[0010] In the above scheme, based on the subdivision parameters, subdivision areas are determined in the graphics to be processed, including: based on the subdivision parameters, n circles of stratification lines and n-1 layers of subdivision areas are determined in the graphics to be processed; n is an integer greater than 1; wherein the n circles of stratification lines and the n-1 layers of subdivision areas are arranged from the outside to the inside, and each layer of subdivision areas is located between two corresponding adjacent circles of stratification lines.

[0011] In the above scheme, subdivision point information corresponding to the plurality of subdivision points is generated, and the subdivision point information is updated to the cache space, including: based on the subdivision area of ​​the i-1 layer, the i-th layer of subdivision area is determined from the outside to the inside; i is less than or equal to n-1; the i-th layer of subdivision point information corresponding to the i-th layer of subdivision area is generated, and the i-th layer of subdivision point information is updated to the cache space; until the update of the subdivision point information of the n-1 layer of subdivision area is completed.

[0012] In the above solution, after the subdivision point information is updated to the cache space, the method further includes: subdividing the subdivision area into a plurality of topological graphs based on the subdivision point information.

[0013] In the above scheme, the first cache space includes two address spaces; the second cache space includes m address spaces, where m is greater than or equal to the number of vertices of each topological graph; the coordinates of a corresponding subdivision point are cached in each address space.

[0014] An embodiment of the present application also provides a surface subdivision device, which includes: a preprocessing module, configured to obtain a to-be-processed graphic and corresponding subdivision parameters; and, based on the subdivision parameters, determining a subdivision area and corresponding multiple subdivision points in the to-be-processed graphic; wherein the multiple subdivision points include: an initial subdivision point and other subdivision points; a calculation module, configured to generate subdivision point information corresponding to the multiple subdivision points respectively based on a cache space, and update the subdivision point information to the cache space; a cache module, including a first cache space and a second cache space; wherein the first cache space is configured to cache the initial subdivision point information corresponding to the initial subdivision point; the second cache space is configured to cache other subdivision point information corresponding to the other subdivision points; the first cache space and the second cache space are updated respectively according to the first-in-first-out principle.

[0015] In the above solution, the surface subdivision device further includes: a subdivision module configured to subdivide the subdivision area into a plurality of topological graphs based on the subdivision point information.

[0016] An embodiment of the present application also provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in an electronic device, a processor in the electronic device executes the steps in the above method.

[0017] An embodiment of the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor implements the steps in the above method when executing the program.

[0018] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method are implemented.

[0019] It can be seen that in the embodiment of the present application, the coordinates of the initial subdivision point are cached separately in the first cache space, so that in one cycle of determining the coordinates of the subdivision point, the coordinates of the initial subdivision point can be prevented from being eliminated. Therefore, the embodiment of the present application can ensure that when returning to the initial subdivision point again, the coordinates of the initial subdivision point in the first cache space can be directly read, avoiding repeated calculations of the coordinates of the initial subdivision point, reducing the amount of calculation, that is, reducing the power consumption of the processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 Schematic diagram of the implementation process of the surface subdivision method provided in the embodiment of the present application Figure 1 ;

[0021] Figure 2Schematic diagram of the implementation process of the surface subdivision method provided in the embodiment of the present application Figure 2 ;

[0022] Figure 3 Schematic diagram of the effect of the surface subdivision method provided in the embodiment of the present application Figure 1 ;

[0023] Figure 4 Schematic diagram of the effect of the surface subdivision method provided in the embodiment of the present application Figure 2 ;

[0024] Figure 5 Schematic diagram of the effect of the surface subdivision method provided in the embodiment of the present application Figure 3 ;

[0025] Figure 6 Schematic diagram of the implementation process of the surface subdivision method provided in the embodiment of the present application Figure 3 ;

[0026] Figure 7 Schematic diagram of the implementation process of the surface subdivision method provided in the embodiment of the present application Figure 4 ;

[0027] Figure 8 A schematic diagram of the composition structure of a surface subdivision device provided in an embodiment of the present application;

[0028] Fig. 9 A schematic diagram of the hardware entity of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0030] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. The terms "first / second / third" involved are merely used to distinguish similar objects and do not represent a specific order for the objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing this application and are not intended to limit this application.

[0032] It should be noted that in the related technology, when calculating the coordinates of the subdivision points, the CAM (computer-aided manufacturing) mechanism is used, and only the subdivision point number (ie, idx value) is cached. In this way, it is only in DS (Domain Shader) only mode that the subdivision points that appear repeatedly within a certain range do not need to repeatedly calculate the UV coordinates.

[0033] On the one hand, under the CAM mechanism, since the UV coordinates of the subdivision points are not cached and the UV coordinates are not deduplicated during GS, a large number of UV coordinates are calculated repeatedly. On the other hand, under the CAM mechanism, since the cache allocation and data evict mechanism are not considered in combination with the characteristics of the idx value of the subdivision point, the cache hit rate is low.

[0034] The embodiment of the present application provides a surface subdivision method, which can be executed by a processor of a computer device. The computer device may refer to a server, a laptop, a tablet computer, a desktop computer, a smart TV, a set-top box, a mobile device (such as a mobile phone, a portable video player, a personal digital assistant, a dedicated messaging device, a portable gaming device), or other device with data processing capabilities.

[0035] It should be noted that the surface subdivision method provided in the embodiment of the present application can be applicable to a virtualized environment, wherein the virtualized environment includes a virtualized GPU and / or a virtualized display. In other words, the surface subdivision method provided in the embodiment of the present application can be run without a real hardware display, or can be run without a real hardware GPU. On the other hand, the surface subdivision method provided in the embodiment of the present application can also be applicable to a real hardware display and a real hardware GPU. This is not limited here.

[0036] Figure 1 A schematic diagram of the implementation process of a surface subdivision method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes steps S101 to S105.

[0037] S101, obtaining a graphic to be processed and corresponding subdivision parameters.

[0038] In the embodiment of the present application, the graphics to be processed are graphics that need to be subdivided. The graphics to be processed can be regular graphics or irregular graphics, which is not limited here. Figure 3In the example, the graphic to be processed is a rectangle, wherein the rectangle located in the outermost circle is the outline of the graphic to be processed.

[0039] S102, based on the subdivision parameters, determining a subdivision area and a corresponding plurality of subdivision points in the graphics to be processed; wherein the plurality of subdivision points include: an initial subdivision point and other subdivision points.

[0040] In some embodiments of the present application, reference Figure 3 , based on the subdivision parameters, n circles of stratification lines and n-1 layers of subdivision areas can be determined in the graphics to be processed; n is an integer greater than 1. The n circles of stratification lines and n-1 layers of subdivision areas are arranged from outside to inside, and each layer of subdivision area is located between two corresponding adjacent circles of stratification lines.

[0041] Continue to refer Figure 3 , the first circle of stratification lines is the contour line of the figure to be processed. From the contour line of the figure to be processed, n circles of stratification lines can be determined in turn, so that the area separated by n circles of stratification lines forms n-1 layers of subdivided areas. For example, the area between the contour line of the figure to be processed (i.e., the first circle of stratification lines) and the second circle of stratification lines is the first layer of subdivided areas; the area between the second circle of stratification lines and the third circle of stratification lines is the second layer of subdivided areas.

[0042] In the embodiment of the present application, the total number of turns n of the layering line can be determined according to the size of the graphics to be processed and the size of the subdivided topological graphics. The larger the size of the graphics to be processed and the smaller the size of the subdivided topological graphics, the greater the total number of turns n of the layering line.

[0043] In the embodiment of the present application, the subdivision parameter (TF) may characterize the number of subdivision points on the n-circle layering line, that is, the subdivision parameter determines the degree of subdivision. Based on the subdivision parameter, multiple subdivision points may be determined on each circle layering line.

[0044] refer to Figure 3 , the subdivision parameters may include the number of line segments (32, 5, 5, 16) of the four sides of the contour line of the to-be-processed figure (i.e., the first circle of layering lines) that are subdivided. Furthermore, based on the subdivision parameters, 58 subdivision points are determined in sequence on the contour line of the to-be-processed figure (i.e., subdivision points 0 to 57, which are arranged in a clockwise direction). Thus, the four sides of the contour line of the to-be-processed figure are divided into 32 line segments, 5 line segments, 5 line segments, and 16 line segments, respectively, wherein subdivision points 0 to 32 divide 32 line segments, subdivision points 32 to 37 divide 5 line segments, subdivision points 37 to 42 divide 5 line segments, and subdivision points 42 to 57 and subdivision point 0 divide 32 line segments.

[0045] Continue to refer Figure 3, the subdivision parameters may also include the number of line segments (14, 30, 14, 30) of the four sides of the second circle of layering lines that are subdivided. Furthermore, based on the subdivision parameters, 88 subdivision points are determined in sequence on the second circle of layering lines (i.e., subdivision points 58 to 145, which are arranged in a clockwise direction). Thus, the four sides of the second circle of layering lines are divided into 14 line segments, 30 line segments, 14 line segments, and 30 line segments, respectively, among which subdivision points 58 to 72 divide 14 line segments, subdivision points 72 to 102 divide 30 line segments, subdivision points 102 to 116 divide 14 line segments, and subdivision points 116 to 145 and subdivision point 58 divide 30 line segments. The same is true for the remaining layering lines.

[0046] In the embodiment of the present application, the initial subdivision point is the starting point for subdividing the subdivided area; at the same time, since the process of subdividing the subdivided area is performed in a cyclic direction, the initial subdivision point is also the end point for subdividing the subdivided area.

[0047] In some embodiments of the present application, reference Figure 3 For the first-level subdivision area, if subdivision point 0 is used as the initial subdivision point and the subdivision is completed along the cyclic direction, it returns to subdivision point 0 again, that is, subdivision point 0 is also used as the end point of the subdivision.

[0048] In other embodiments of the present application, continue to refer to Figure 3 For the first-level subdivision area, if subdivision point 0 and subdivision point 37 are respectively used as the initial subdivision points and the subdivision is completed in parallel along the cycle direction, subdivision point 37 and subdivision point 0 are reached respectively; among which, the end point of the half-circle cycle starting from subdivision point 0 is subdivision point 37, and the end point of the half-circle cycle starting from subdivision point 37 is subdivision point 0.

[0049] S103, based on the cache space, generate subdivision point information corresponding to multiple subdivision points respectively, and update the subdivision point information to the cache space; wherein, the initial subdivision point information corresponding to the initial subdivision point is cached in the first cache space; the other subdivision point information corresponding to the other subdivision points is cached in the second cache space; the first cache space and the second cache space are updated respectively according to the first-in-first-out principle.

[0050] In the embodiment of the present application, the UV coordinates of the subdivision points are cached in a cache module, which may be a cache. Furthermore, a first cache space and a second cache space may be allocated in the cache module. The first cache space is configured to cache the coordinates of the initial subdivision points, for example, Figure 3 The coordinates of subdivision point 0, subdivision point 58 and subdivision point 146 in the first subdivision point; the second cache space is configured to cache the coordinates of subdivision points other than the initial subdivision point.

[0051] Furthermore, the first cache space and the second cache space will be updated according to the First-In First-Out (FIFO) principle. That is, when the cache space is full, the coordinates cached first in the cache space will be removed first, and new coordinates will be cached in.

[0052] In the embodiment of the present application, since the first cache space and the second cache space are allocated in the cache module, the coordinates of the initial subdivision point are cached in the first cache space, and the coordinates of the subdivision points other than the initial subdivision point are cached in the second cache space, the process of updating the coordinates in the first cache space and the coordinates in the second cache space is performed separately. That is, in the case that no more coordinates of the initial subdivision point are stored in the first cache space, the coordinates of the cached initial subdivision point will be continuously retained; while the coordinates in the second cache space will be continuously updated.

[0053] In the embodiment of the present application, the process of generating subdivision point information is also performed along the cyclic direction. Figure 4 , starting from the initial subdivision point on the contour line of the figure to be processed (i.e., subdivision point 0) and the initial subdivision point on the second circle layering line (i.e., subdivision point 58), the topological figure (0, 1, 58) is subdivided, and at the same time, the UV coordinates of subdivision point 0, subdivision point 1 and subdivision point 58 are calculated and cached. Then, the topological figure (1, 2, 58) is subdivided, and at the same time, the UV coordinates of the subdivision points of the topological figure (1, 2, 58) are calculated and cached, and so on.

[0054] In the embodiment of the present application, subdivision point information corresponding to multiple subdivision points can be generated based on the storage status of the subdivision point information in the cache space. That is, if the subdivision point information has been cached, the subdivision point information can be directly read; correspondingly, if the subdivision point information has not been cached, the subdivision point information needs to be calculated and generated; in this way, repeated calculations can be avoided.

[0055] It can be understood that since the process of generating subdivision point information is carried out in a circular direction, the initial subdivision point is both the starting point and the end point; therefore, in the embodiment of the present application, the initial subdivision point information is cached separately in the first cache space, so that the initial subdivision point information can be avoided from being eliminated during the process of generating subdivision point information. Therefore, the embodiment of the present application can ensure that when returning to the initial subdivision point again, the initial subdivision point information in the first cache space can be directly read, avoiding repeated calculations of the initial subdivision point information, reducing the amount of calculation, that is, reducing the power consumption of the processor.

[0056] For example, refer to Figure 4, the subdivision of the first-level subdivision area starts from the initial subdivision point (including subdivision point 0 and subdivision point 58). After completing the subdivision in the loop direction, it will return to the initial subdivision point (including subdivision point 0 and subdivision point 58) again; furthermore, in this loop, the coordinates of subdivision point 0 and the coordinates of subdivision point 58 can be continuously cached in the first cache space without being eliminated.

[0057] On the other hand, in the embodiment of the present application, the coordinates of the subdivision points other than the initial subdivision points are cached in the second cache space; thus, in the process of dividing the continuous topological graph, the cached coordinates can be directly read, and only the uncached coordinates are calculated; thereby, the cache hit rate is improved, and the amount of calculation is reduced, and the power consumption of the processor is reduced. At the same time, the coordinates that are first cached in the second cache space are promptly removed after they are no longer needed to be read, thus reducing the cache depth and saving cache space.

[0058] In some embodiments of the present application, the cached subdivision point information includes: the number and coordinates of the subdivision point; the process of generating the subdivision point information may include: Figure 2 Steps S201 to S203 are shown and will be described in conjunction with each step.

[0059] S201 : Determine whether the coordinates of the subdivision point have been cached based on the cached subdivision point serial number.

[0060] S202: If the coordinates of the subdivision points are not cached, calculate the coordinates of the subdivision points.

[0061] S203: If the coordinates of the subdivision points have been cached, read the coordinates of the subdivision points.

[0062] In the embodiment of the present application, it is possible to first determine whether the UV coordinates of the subdivision points have been cached, and then, if the UV coordinates of the subdivision points have not been cached (i.e., cache miss), calculate the UV coordinates of the subdivision points, or, if the UV coordinates of the subdivision points have been cached (i.e., cache hit), do not calculate, but directly read the UV coordinates of the subdivision points. For example, referring to Figure 4 After calculating and caching the coordinates of the subdivision points of the topological figure (0, 1, 58), that is, after calculating and caching the coordinates of subdivision point 0, subdivision point 1 and subdivision point 58, for the subdivision points of the topological figure (1, 2, 58), only the coordinates of subdivision point 2 need to be calculated, and the cached coordinates of subdivision point 1 and subdivision point 58 can be directly read.

[0063] In some embodiments of the present application, the process of determining a plurality of subdivision points in the graphics to be processed may include steps S1021 to S1022, which will be described in conjunction with each step.

[0064] S1021. Number the multiple subdivision points in sequence along the circulation direction.

[0065] S1022: Determine an initial subdivision point and other subdivision points based on the serial numbers of the multiple subdivision points.

[0066] In the present application examples, reference Figure 3 , starting from the contour line of the graphics to be processed (i.e., the first circle of layering lines), the subdivision points can be numbered along the cyclic direction, that is, the subdivision points are numbered from 0 to 57. Therefore, based on the numbering of the subdivision points on the first circle of layering lines, the subdivision point numbered 0 can be determined as the initial subdivision point, and the subdivision points with other numbers can be determined as other subdivision points.

[0067] Continue to refer Figure 3 After the subdivision points on the first lap of the layering line are numbered, the subdivision points on the second lap of the layering line can be numbered along the cyclic direction, that is, the subdivision points 58 to 145 can be numbered. Therefore, based on the numbering of the subdivision points on the second lap of the layering line, the subdivision point numbered 58 can be determined as the initial subdivision point, and the subdivision points with other numbers can be determined as other subdivision points.

[0068] Similarly, all subdivision points on the n-circle layering line can be numbered, and the initial subdivision point and other subdivision points can be determined.

[0069] It should be noted that Figure 3 Taking the clockwise circulation direction as an example, in some embodiments, the circulation direction may also be counterclockwise, which is not limited here.

[0070] In some embodiments of the present application, Figure 1 After step S103 shown, step S104 is also included, and each step will be described in combination.

[0071] S104: Based on the subdivision point information, subdivide the subdivision area into a plurality of topological graphs.

[0072] Figure 4 FIG. 1 shows a partial topological graph of the subdivided area of ​​the first layer. Figure 4 , the first-level subdivision area is the area enclosed by the contour line of the figure to be processed and the second circle of delamination lines. Starting from the initial subdivision point on the contour line of the figure to be processed (i.e., subdivision point 0) and the initial subdivision point on the second circle of delamination lines (i.e., subdivision point 58), the first-level subdivision area can be subdivided to obtain multiple topological figures; each topological figure is a triangle, that is, Figure 4 The triangle divided by the dotted line is the topological figure.

[0073] In the embodiment of the present application, each layer of subdivision area can be subdivided according to the numbering order of the subdivision points. That is, since the subdivision points are numbered according to the cyclic direction, the order of generating the topological graph is also in the cyclic direction. Figure 4 , we can first subdivide the topological figure (0, 1, 58), and then subdivide the topological figure (1, 2, 58), and continue along the cycle direction (i.e. clockwise), such as Figure 4 As shown by the arrow in the middle, until it returns to the initial subdivision point again. The numbers in the brackets represent the numbers of the subdivision points, that is, the vertices of the topological figure (0, 1, 58) are subdivision point 0, subdivision point 1 and subdivision point 58, and so on.

[0074] In the embodiment of the present application, while the topological figure is being subdivided, the UV coordinates of the subdivision points are calculated and the calculated UV coordinates are cached. The process of calculating the UV coordinates of the subdivision points is performed simultaneously with the process of subdividing the topological figure. Therefore, the calculation of the UV coordinates of the subdivision points is also performed along the cyclic direction. Figure 4 , starting from the initial subdivision point on the contour line of the figure to be processed (i.e., subdivision point 0) and the initial subdivision point on the second circle layering line (i.e., subdivision point 58), the topological figure (0, 1, 58) is subdivided, and at the same time, the UV coordinates of subdivision point 0, subdivision point 1 and subdivision point 58 are calculated and cached. Then, the topological figure (1, 2, 58) is subdivided, and at the same time, the UV coordinates of the subdivision points of the topological figure (1, 2, 58) are calculated and cached, and so on.

[0075] Figure 5 FIG. 2 shows a partial topological graph of the subdivided area of ​​the second layer. In the embodiment of the present application, after the subdivided area of ​​the first layer is sequentially subdivided into a plurality of topological graphs, the subdivided area of ​​the second layer can be subdivided. Figure 5 , the second-level subdivision area is the area enclosed by the second-circle stratification line and the third-circle stratification line. Starting from the initial subdivision point on the second-circle stratification line (i.e., subdivision point 58) and the initial subdivision point on the third-circle stratification line (i.e., subdivision point 146), the second-level subdivision area can be subdivided to obtain multiple topological figures; similarly, each topological figure is a triangle, that is, Figure 5 The triangle divided by the dotted line is the topological figure.

[0076] Continue to refer Figure 5 , we can first subdivide the topological figure (58, 59, 146), and then subdivide the topological figure (59, 146, 147), and continue in the clockwise direction (i.e., the direction of the cycle), such as Figure 5As shown by the arrow in the middle, until it returns to the initial subdivision point again. Correspondingly, while subdividing the topological figure, the UV coordinates of the subdivision points will be calculated and the calculated UV coordinates will be cached. In other words, the calculation and caching of the UV coordinates of the subdivision points in the second layer of subdivision area are also carried out in the loop direction.

[0077] In some embodiments of the present application, the first cache space includes two address spaces. The second cache space includes m address spaces, where m is greater than or equal to the number of vertices of each topological graph. The coordinates of a corresponding subdivision point are cached in each address space.

[0078] In the embodiment of the present application, the two address spaces in the first cache space can be used to cache the coordinates of the initial subdivision points on the outer circle and the inner circle of each subdivision area. Figure 4 In the process of subdividing the first-level subdivision area and calculating the coordinates of the subdivision points, the two address spaces in the first cache space are used to cache the coordinates of subdivision point 0 and subdivision point 58, respectively. Subdivision point 0 is the initial subdivision point on the outer circle of the first-level subdivision area (i.e., the contour line of the graphics to be processed), and subdivision point 58 is the initial subdivision point on the outer circle of the first-level subdivision area (i.e., the second circle of the layered line).

[0079] For further reference, Figure 5 After the first-layer subdivision area is subdivided, the second-layer subdivision area is subdivided and the coordinates of the subdivision points are calculated. At this time, the coordinates of the subdivision point 0 in the first cache space can be eliminated, and the coordinates of the subdivision point 146 can be cached. In this way, the two address spaces in the first cache space are used to cache the coordinates of the subdivision point 58 and the subdivision point 146. Among them, the subdivision point 58 is the initial subdivision point on the outer circle of the second-layer subdivision area (i.e., the second circle of layering lines), and the subdivision point 146 is the initial subdivision point on the outer circle of the second-layer subdivision area (i.e., the third circle of layering lines).

[0080] It is understandable that two address spaces are set in the first cache space, which are used to cache the coordinates of the initial subdivision points of the inner circle and the outer circle of each layer of subdivision area. In this way, on the one hand, it can be ensured that the coordinates in the first cache space can be continuously cached during the subdivision process of each layer of subdivision area, thereby ensuring that when returning to the initial subdivision point again, the coordinates of the initial subdivision point in the first cache space can be directly read, avoiding repeated calculations of the coordinates of the initial subdivision point, reducing the amount of calculation, that is, reducing the power consumption of the processor. On the other hand, in the process of subdividing the next layer of subdivision area, one coordinate in the first cache space can be eliminated according to the first-in-first-out principle, and the coordinates in the first cache space can be updated to the coordinates of the initial subdivision points of the inner circle and the outer circle of the next layer of subdivision area, thereby reducing the cache depth and saving cache space.

[0081] In the embodiment of the present application, the second cache space includes m address spaces, where m is greater than or equal to the number of vertices of each topological graph. In this way, it can be ensured that the coordinates of at least one vertex of a topological graph can be cached in the second cache space, ensuring that the information of the topological graph can be completely output.

[0082] In some embodiments of the present application, the step of caching the coordinates of the subdivision points of each topological figure may include: Figure 6 S301~S302 shown will be explained in combination with each step.

[0083] S301. Prioritize the subdivision points based on the numbers of the subdivision points; wherein the initial subdivision point is classified as a first priority, and the other subdivision points except the initial subdivision point are classified as a second priority.

[0084] S302 : Cache initial subdivision point information in a first cache space according to the priority of the subdivision point, and cache other subdivision point information in a second cache space.

[0085] In the embodiment of the present application, the initial subdivision point with the smallest number on each circle of the layered line can be classified as the first priority based on the number of the subdivision point, and the other subdivision points except the initial subdivision point can be classified as the second priority. The priority information is bound to the number of the subdivision point, that is, when the number idx of the subdivision point is input into the cache module, it carries the priority information; then, the cache module can allocate address space based on the priority information and perform data elimination processing. In this way, the cache hit rate can be improved, the cache depth can be reduced, the cache space can be saved, and the power consumption of the processor can be reduced.

[0086] In some embodiments of the present application, Figure 7 Steps S401 to S403 are shown to achieve Figure 1 S103 shown will be described in conjunction with each step.

[0087] S401. Based on the i-1th layer of subdivided regions, determine the i-th layer of subdivided regions from outside to inside; i is less than or equal to n-1.

[0088] S402 : Generate i-th level subdivision point information corresponding to the i-th level subdivision area, and update the i-th level subdivision point information to the cache space.

[0089] S403, until the updating of the subdivision point information of the n-1th layer of subdivision area is completed.

[0090] In the present application examples, reference Figure 4 and Figure 5In the case where the subdivision area has multiple layers, that is, when n-1 is greater than or equal to 2, the inner i-th subdivision area can be determined based on the outer i-th subdivision area, and then the subdivision point information of the i-th subdivision area is generated, and the i-th subdivision point information is updated to the cache space. For example, after completing the subdivision of the first-layer subdivision area and updating the subdivision point information of the first-layer subdivision area, the second-layer subdivision area can be determined based on the first-layer subdivision area, and the subdivision of the second-layer subdivision area can be completed, and the subdivision point information of the second-layer subdivision area is updated. This process is repeated until the update of the subdivision point information of the n-1-th layer subdivision area is completed, that is, the update of the subdivision point information of all subdivision areas is completed.

[0091] Figure 8 The following is a schematic diagram of the composition structure of a surface subdivision device provided in an embodiment of the present application. Figure 8 As shown, the surface subdivision device 800 includes: a pre-processing module 810 , a calculation module 830 and a cache module 840 .

[0092] The preprocessing module 810 is configured to obtain the graphics to be processed and the corresponding subdivision parameter TF; and, based on the subdivision parameter TF, determine the subdivision area and the corresponding multiple subdivision points in the graphics to be processed; wherein the multiple subdivision points include: initial subdivision points and other subdivision points.

[0093] The calculation module 830 is configured to generate subdivision point information (including number idx and coordinate UV) corresponding to a plurality of subdivision points respectively based on the cache space, and update the subdivision point information to the cache space.

[0094] The cache module 840 includes a first cache space and a second cache space. The first cache space is configured to cache initial subdivision point information corresponding to the initial subdivision point; the second cache space is configured to cache other subdivision point information corresponding to other subdivision points. The first cache space and the second cache space are updated respectively according to the first-in-first-out principle.

[0095] In some embodiments of the present application, the surface subdivision device 800 further includes: a subdivision module 820 .

[0096] The subdivision module 820 is configured to subdivide the subdivision area into a plurality of topological graphs (TOPOs) based on the subdivision point information, wherein the vertex coordinates (TOPO UV) of the topological graphs are output by the surface subdivision device 800 .

[0097] In some embodiments of the present application, reference Figure 8 The preprocessing module 810 is also configured to sequentially number the multiple subdivision points along the cyclic direction; and determine the initial subdivision point and other subdivision points based on the numbers idx of the multiple subdivision points.

[0098] In some embodiments of the present application, reference Figure 8 The calculation module 830 is also configured to prioritize the subdivision points based on the numbers idx of the multiple subdivision points; wherein the initial subdivision point is classified as the first priority, and the other subdivision points except the initial subdivision point are classified as the second priority; and, according to the priority of the subdivision point, the initial subdivision point information is cached in the first cache space, and the other subdivision point information is cached in the second cache space.

[0099] In some embodiments of the present application, reference Figure 8 The cached subdivision point information includes: the subdivision point number idx and the coordinate UV. The calculation module 830 is further configured to determine whether the coordinate UV of the subdivision point has been cached based on the cached subdivision point number idx; if the coordinate UV of the subdivision point has not been cached, calculate the coordinate UV of the subdivision point; or, if the coordinate UV of the subdivision point has been cached, read the coordinate UV of the subdivision point.

[0100] In some embodiments of the present application, reference Figure 8 The preprocessing module 810 is further configured to determine n circles of stratification lines and n-1 layers of stratification areas in the graphics to be processed based on the stratification parameters; n is an integer greater than 1; wherein the n circles of stratification lines and the n-1 layers of stratification areas are arranged from the outside to the inside, and each layer of stratification areas is located between two corresponding adjacent circles of stratification lines.

[0101] In some embodiments of the present application, reference Figure 8 The calculation module 830 is also configured to determine the i-th layer subdivision area based on the i-1-th layer subdivision area in a direction from outside to inside, where i is less than or equal to n-1; and generate the i-th layer subdivision point information corresponding to the i-th layer subdivision area, and update the i-th layer subdivision point information to the cache space; until the update of the subdivision point information of the n-1-th layer subdivision area is completed.

[0102] In some embodiments of the present application, the first cache space includes two address spaces. The second cache space includes m address spaces, where m is greater than or equal to the number of vertices of each topological graph. The coordinates of a corresponding subdivision point are cached in each address space.

[0103] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided in the embodiment of the present application can be used to execute the method described in the above method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.

[0104] It should be noted that in the embodiments of the present application, if the above-mentioned surface subdivision method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly reflected in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiments of the present application are not limited to any specific hardware, software or firmware, or any combination of hardware, software, and firmware.

[0105] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.

[0106] The embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, some or all of the steps in the above method are implemented. The computer-readable storage medium can be transient or non-transient.

[0107] An embodiment of the present application provides a computer program, including a computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.

[0108] The embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, some or all of the steps in the above method are implemented. The computer program product can be implemented in hardware, software, or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium, and in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.

[0109] It should be noted here that the description of the various embodiments above tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. The description of the above device, storage medium, computer program and computer program product embodiments is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the embodiments of the device, storage medium, computer program and computer program product of this application, please refer to the description of the method embodiment of this application for understanding.

[0110] Fig. 9 A hardware entity diagram of a computer device provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, the hardware entity of the computer device 1100 includes: a processor 1101 and a memory 1102, wherein the memory 1102 stores a computer program that can be run on the processor 1101, and the processor 1101 implements the steps in the method of any of the above embodiments when executing the program.

[0111] The memory 1102 stores computer programs that can be run on the processor. The memory 1102 is configured to store instructions and applications executable by the processor 1101. It can also cache data to be processed or processed by the processor 1101 and various modules in the computer device 1100 (for example, image data, audio data, voice communication data, and video communication data). It can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0112] When the processor 1101 executes the program, the steps of any of the above-mentioned surface subdivision methods are implemented. The processor 1101 generally controls the overall operation of the computer device 1100.

[0113] An embodiment of the present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the surface subdivision method of any of the above embodiments.

[0114] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0115] The processor may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is understandable that the electronic device that implements the functions of the processor may also be other, and the embodiments of the present application do not specifically limit this.

[0116] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and the like; it can also be various terminals including one or any combination of the above-mentioned memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc.

[0117] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the serial number of each step / process mentioned above does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The serial numbers of the embodiments of the present application mentioned above are for description only and do not represent the advantages and disadvantages of the embodiments.

[0118] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0119] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0120] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0121] In addition, all functional units in the embodiments of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units. A person of ordinary skill in the art can understand that all or part of the steps of the above method embodiments can be completed by hardware related to program instructions, and the above program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above method embodiments are executed; and the above storage medium includes: mobile storage devices, read-only memory (ROM), disks or optical disks, etc. Various media that can store program codes.

[0122] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0123] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A surface subdivision method, characterized in that: The surface subdivision method comprises: Get the graphics to be processed and the corresponding subdivision parameters; Based on the subdivision parameters, a subdivision area and a corresponding plurality of subdivision points are determined in the to-be-processed graph; wherein the plurality of subdivision points include: an initial subdivision point and other subdivision points; the initial subdivision point is a starting point and an end point for subdividing the subdivision area; Based on the cache space, subdivision point information corresponding to the multiple subdivision points is generated, and the subdivision point information is updated to the cache space; wherein, the initial subdivision point information corresponding to the initial subdivision point is cached in the first cache space; the other subdivision point information corresponding to the other subdivision points is cached in the second cache space; the first cache space and the second cache space are updated respectively according to the first-in-first-out principle.

2. The surface subdivision method according to claim 1, characterized in that: Determining a plurality of subdivision points in the to-be-processed graph includes: Numbering the plurality of subdivision points in sequence along the circulation direction; The initial subdivision point and the other subdivision points are determined based on the serial numbers of the plurality of subdivision points.

3. The surface subdivision method according to claim 2, characterized in that: Updating the subdivision point information to the cache space includes: Based on the serial numbers of the plurality of subdivision points, the subdivision points are prioritized; wherein the initial subdivision point is prioritized as a first priority, and the other subdivision points except the initial subdivision point are prioritized as a second priority; According to the priority of the subdivision points, the initial subdivision point information is cached in the first cache space, and the other subdivision point information is cached in the second cache space.

4. The surface subdivision method according to claim 1, characterized in that: The cached subdivision point information includes: the number and coordinates of the subdivision point; Generating the subdivision point information includes: Based on the cached serial number of the subdivision point, determining whether the coordinates of the subdivision point have been cached; If the coordinates of the subdivision point are not cached, then calculating the coordinates of the subdivision point; or, If the coordinates of the subdivision point have been cached, the coordinates of the subdivision point are read.

5. The surface subdivision method according to claim 1, characterized in that: Determining a subdivision area in the to-be-processed graph based on the subdivision parameter includes: Based on the subdivision parameters, n circles of layering lines and n-1 layers of subdivision areas are determined in the graphics to be processed; n is an integer greater than 1; wherein the n circles of layering lines and n-1 layers of subdivision areas are arranged from outside to inside, and each layer of subdivision areas is located between two corresponding adjacent circles of layering lines.

6. The surface subdivision method according to claim 5, characterized in that: Generating subdivision point information corresponding to the plurality of subdivision points respectively, and updating the subdivision point information to the cache space, comprising: Based on the subdivided areas of the i-1th layer, determine the subdivided areas of the i-th layer in a direction from outside to inside; i is less than or equal to n-1; Generate i-th layer subdivision point information corresponding to the i-th layer of the subdivision area, and update the i-th layer subdivision point information to the cache space; Until the updating of the subdivision point information of the subdivision area of ​​the n-1th layer is completed.

7. The surface subdivision method according to claim 1, characterized in that: After updating the subdivision point information to the cache space, the method further includes: Based on the subdivision point information, the subdivision area is subdivided into a plurality of topological graphs.

8. The surface subdivision method according to claim 7, characterized in that: The first cache space includes two address spaces; The second cache space includes m address spaces, wherein m is greater than or equal to the number of vertices of each topological graph; The coordinates of a corresponding subdivision point are cached in each of the address spaces.

9. A surface subdivision device, characterized in that: The surface subdivision device comprises: The preprocessing module is configured to obtain a to-be-processed graphic and corresponding subdivision parameters; and, based on the subdivision parameters, determine a subdivision area and a plurality of corresponding subdivision points in the to-be-processed graphic; wherein the plurality of subdivision points include: an initial subdivision point and other subdivision points; the initial subdivision point is the starting point and the end point of subdividing the subdivision area; A calculation module is configured to generate subdivision point information corresponding to the plurality of subdivision points respectively based on the cache space, and update the subdivision point information to the cache space; The cache module includes a first cache space and a second cache space; wherein the first cache space is configured to cache initial subdivision point information corresponding to the initial subdivision point; the second cache space is configured to cache other subdivision point information corresponding to the other subdivision points; the first cache space and the second cache space are updated respectively according to the first-in-first-out principle.

10. The surface subdivision device according to claim 9, characterized in that: The surface subdivision device also includes: The subdivision module is configured to subdivide the subdivision area into a plurality of topological graphs based on the subdivision point information.

11. A computer program product, characterized in that The invention comprises a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code is executed in an electronic device, a processor in the electronic device executes the steps in the method according to any one of claims 1 to 8.

12. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein: When the processor executes the program, the steps in the method according to any one of claims 1 to 8 are implemented.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 8 are implemented.