Triangular patch model subdivision method, attribution judgment method and dynamic adjustment method
Through equal-size, layerless spherical segmentation and dynamic adjustment methods, the problem of insufficient memory in large-scale graphics processing of the triangle face model is solved, and more efficient graphics processing and hard disk access reduction is achieved, and the system speed is improved.
Patent Information
- Application Number
- CN202111515733.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2041-12-13
AI Technical Summary
When the prior art deals with large-scale three-dimensional graphic models, insufficient memory leads to frequent hard disk exchanges, resulting in a significant reduction in system speed. Especially in parallel drawing of triangular panel models, the existing segmentation method has a large amount of calculation and low efficiency.
Using the equal-size and layerless spherical division method, the triangular facet model is divided into several spheres. The minimum data unit is stored and judged through the intermediate set, dynamically adjusts the data to be saved in the memory of multiple computers, reduces hard disk exchange, and improves System speed.
It reduces the calculation overhead of parallel drawing, improves system speed, reduces the number of hard disk accesses, and improves graphics processing efficiency.
Smart Images

Figure CN114332436B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer graphics, and in particular to a triangular face model segmentation method, an attribution judgment method and a dynamic adjustment method. Background Art
[0002] With the improvement of computer graphics theory and the development of graphics processing software and hardware technology, graphics rendering technology is increasingly applied to various aspects such as design, entertainment, and scientific research. Applications in various fields continue to challenge graphics rendering technology in terms of rendering speed, realism, display size, and resolution. Parallel rendering technology introduces parallel computing theory and methods into the field of graphics processing and is an important means to achieve high-performance graphics computing.
[0003] According to the organization of multiple pipelines, parallel drawing architecture is divided into three categories: sort-first, sort-middle, and sort-last. The sort-middle structure has the characteristic of a particularly large amount of intermediate transmission data, which is only seen in hardware design. Existing patents are basically related to the technologies under the sort-first structure and sort-last structure, such as:
[0004] CN201880032433.1 Parallel pipeline for vector graphics and image processing, CN201611245219.3 A graphics parallel rendering method based on sort / first load balancing, CN201711202217.0 A multi-GPU large-resolution multi-screen graphics block parallel rendering method, CN200910155356.1 Hybrid adaptive architecture design for parallel graphics rendering, CN201611114202.4 A parallel graphics rendering method for heterogeneous rendering nodes based on sort / first load balancing, CN201510482631.6 An efficient parallel vector data visualization method, CN201811523048.5 A graphics processor parallel shading task scheduling unit system, CN201310720041.3 A three-dimensional graphics rendering method based on parallel rendering technology, CN201410281130.7 Model parallel processing method and device based on multiple graphics processors, CN201280031207.4 Maximizing parallel processing in graphics processors, CN201611114202.4 A heterogeneous rendering node parallel graphics drawing method based on sort-first load balancing, CN201710884020.3 A hybrid parallel drawing system and method based on dynamic drawing groups, CN200910213092.0 A parallel drawing load balancing method suitable for arbitrary division of drawing areas, CN201910091777.6 A massive data parallel volume rendering method based on unequal-sized blocks.
[0005] According to the type of data transmitted on the network, parallel rendering systems can be divided into two types: immediate-mode and retained-mode. In the immediate-mode system, model data is fixedly stored on the client. Every time a frame is drawn, all graphics operation instructions are transmitted on the network. Instructions contain both commands and data, and are discarded after being processed. In the retained-mode system, model data is distributed and stored on the rendering server. Every time a frame is drawn, only the necessary control commands need to be transmitted. All model data does not need to pass through the network, and the server always retains the data.
[0006] Most of the patents listed above are based on the immediate mode. Among them, the patents involving model partitioning (blocking) use a multi-level, unequal-size, tree-shaped, and bounding-box partitioning method.
[0007] The distributed storage of data in the retention mode can be in the following two ways: 1) Redundant storage: Each server has the entire data set, such as Figure 1 2) Unique storage: Each server has a data subset, and the data subsets of all servers constitute the entire data set, such as Figure 2 shown.
[0008] At present, the basic element of triangular patch models is triangles. Each triangle has x, y, z coordinate information and some information related to lighting. Thousands or even millions of triangles fit the shape of an object in three-dimensional space. Triangular patch models are generally drawn in parallel by multiple computers, and are specifically targeted at models with extremely large data volumes. These models are not uncommon, such as data generated by high-resolution three-dimensional scanners, medical data, cosmological simulation data, and experimental data of computer graphics itself. Their characteristics are that the model data volume exceeds the memory size of mainstream graphics servers and cannot be accommodated in the memory of a single computer. Computers certainly need to complete graphics calculation tasks, but the burden caused by insufficient memory is even greater at this time, and the computer must exchange data between memory and hard disk. The working mode of hard disks relies on mechanical movement (rotation of magnetic disks), and the speed is an average of 3 orders of magnitude lower than the CPU, memory, and high-speed network card based on gate circuit movement. Frequent hard disk exchanges cause the system speed to drop sharply. Summary of the invention
[0009] In order to overcome the shortcomings of the above technologies, the present invention provides a triangular face model segmentation method, an attribution judgment method and a dynamic adjustment method. The present invention concentrates the memory of multiple computers to save triangular face data, and uses a high-speed network for dynamic adjustment, while minimizing its own overhead to achieve the purpose of reducing hard disk exchange and increasing system speed.
[0010] The idea of the present invention comes from building Figure 1 This patent can be seen as an innovation under the sort-first architecture, but its focus is on the efficient storage of graph data on multiple nodes before entering the graph pipeline. It includes the use of Figure 2 The key technology that makes the unique storage system work can also be applied to Figure 1 The redundant storage system is used to improve the speed, specifically, to improve the speed of attribution judgment. The data preprocessing method of the patent is spherical segmentation with equal size and no hierarchy.
[0011] The technical solution adopted by the present invention to overcome the technical problems is:
[0012] A triangular patch model segmentation method comprises the following steps:
[0013] S1. Determine an outer bounding box B of the triangular face model M, where the outer bounding box B is a minimum cuboid that contains the triangular face model M in space and has sides parallel to the coordinate axes;
[0014] S2. Suppose the triangular face model M is divided into several spheres, each sphere is the minimum data unit c, and calculate the number of theoretical minimum data units n c ;
[0015] S3, based on the number of minimum data units n c Calculate the number of segments s, and divide the three axial sides of the outer bounding box B into s segments to form several small cuboids;
[0016] S4, generating an intermediate set c′, wherein the intermediate set c′ is an intermediate structure transitioning from the triangular face model M to the final minimum data unit c set, and is used to store the minimum data unit c;
[0017] S5, roughly sectioning the triangular face model M to obtain a number of cuboids;
[0018] S6. Arrange the several cuboids obtained after rough sectioning, delete the empty cuboids and convert the non-empty cuboids into spheres, and obtain the final minimum data unit c set.
[0019] Furthermore, the triangular patch model M is composed of an ordered set of points:
[0020] M=(p1,p2…p i …p n )
[0021] The i-th point is:
[0022] p i =(x i ,y i , zi , L i )
[0023] In the above formula, n is the total number of points in M, x i ,y i , z i is the three-dimensional space coordinate, L i is a set of illumination related information, assuming that L i Processing, click p i A series of triangular patches are formed in groups of three.
[0024] The outer bounding box B is defined by 6 coordinate values:
[0025] B=(x min , x max ,y min ,y max , z min , z max )
[0026] The minimum data unit c contains a subset of M and additional information:
[0027]
[0028] In the above formula, m is the total number of points in c; r is the radius of the smallest data unit and is a positive real number, and p c is the center of mass of c, Three groups of three form triangular patches;
[0029] After the segmentation is completed, the triangular patch model M can also be expressed as a set of c:
[0030] M=(c1,c2…c i …c t )
[0031] In the above formula, t represents the number of the smallest data units actually obtained by segmentation, which is n c Approximate value of .
[0032] Furthermore, in step S1, determining the outer bounding box B of the triangular face model M specifically includes the following steps:
[0033] S11. Assign an initial value to the outer bounding box B:
[0034] x min =x max =x1
[0035] y min =y max =y1
[0036] zmin =z max =z1
[0037] S12, traverse all points p in the triangular patch model M i , by definition p i =(x i ,y i , z i , L i ), for each p i Do the following:
[0038] If x i <x min , then let x min =x i
[0039] If x i >x max , then let x max =x i
[0040] If y i <y min , then let y min =y i
[0041] If y i >y max , then let y max =y i
[0042] If z i <z min , then let z min =z i
[0043] If z i >z max , then let z max =z i .
[0044] Further, in step S2, the final display of the parallel rendering system is spliced by the output of more than one display device, and the line segment shared between the outputs of different display devices is the boundary. The total size of the display area is assumed to be w×h, where w is the width of the display area, h is the height of the display area, the total length of the boundary is l, and the length unit is pixel. The minimum data unit covering the boundary will cause redundancy in transmission and storage. Let R be a predefined redundancy rate, which is the ratio of the number of triangles contained in the minimum unit covering the boundary to the total number of triangles, and the value range is [0, 1]; let the total number of triangles in the triangular face model M be N, where N is one third of the number of points, that is, N=n / 3, and the number of minimum data units n cThe calculation includes the following:
[0045] Assume that the triangular face model M is convex, the light passes through the model twice, and the number of triangles covering the display area is N / 2. Assume that the triangle is an isosceles right triangle with a right-angle side length of u, then:
[0046]
[0047] The boundary l is covered by two layers of patches. Let the number of patches covering the boundary be N. l ,but:
[0048]
[0049] Assuming that covering the boundary is redundancy, then:
[0050]
[0051] The above formula means that under certain screen splicing settings, when the number of model faces is N, the redundancy requirement R can be met;
[0052] Ignoring topological connections, assuming that the result of the subdivision into the minimum data unit is equivalent to a triangle that fills the entire minimum data unit, the number of minimum data units is:
[0053]
[0054] Furthermore, in step S3, the number of segments s is calculated as follows:
[0055]
[0056] Assuming that the triangular patch model M is convex, it can be deformed into a cuboid topologically isomorphically, and the minimum data unit is distributed on the outer surface, then:
[0057] n c =6s 2 -12s-8.
[0058] Furthermore, in step S4, the intermediate set c′ is a cube with a sequence number and the points it contains, which is defined as follows:
[0059]
[0060] Among them, i, j, and k are labels, and their value ranges are from 1 to s. A certain c′ can be written as c′ ijk , (x1,x2,y1,y2,z1,z2) defines a cube, a point sequence of indefinite length is a subset of M, starting from subscript a=1, every three points The triangles are formed sequentially;
[0061] Let the length, width and height of the outer bounding box B be W, H and L respectively; the relationship between the subscripts i, j and k of c′ and (x1, x2, y1, y2, z1, z2) is:
[0062]
[0063]
[0064]
[0065] Furthermore, step S5 specifically includes the following:
[0066] The set C′ of the intermediate set c′ generated from the triangular patch model M is = {c′ ijk};
[0067] In the initial state, C′ has s 3 members, each c′ ijk The coordinates of the outer bounding box of (x1, x2, y1, y2, z1, z2) are calculated according to their serial numbers i, j, k. is empty;
[0068] Traverse each triangle in M, and for the three points with coordinates (p 3v+1 , p 3v+2 , p 3v+3 ) of the patch t v , first calculate the centroid point q of the triangle v =(α v , β v , γ v ):
[0069]
[0070] In the above formula, the value range of v is [0, N-1], and the plus sign "+" represents vector addition;
[0071] t v By a certain c′ ijk Including, i, j, k are determined as follows:
[0072]
[0073]
[0074]
[0075] After determining i, j, and k, the triangle patch t v The three points of c′ are attached to ijk Point sequence The tail of .
[0076] Furthermore, step S6 specifically includes the following:
[0077] From C′={c′ ijk}Generate c set C = {c}, traverse each c′ ijk ,in,
[0078]
[0079] Check whether its point list is empty. If not, create a minimum data unit c and add it to the end of C. The definition of c is as described in claim 2:
[0080]
[0081] The members of c are generated as follows:
[0082] (1) The point sequence of c is c′ ijk The point array of
[0083] (2)
[0084] (3)
[0085] The present invention also discloses a method for determining the attribution of the minimum data unit obtained by the above-mentioned triangular face model segmentation method, comprising the following steps:
[0086] Assume that the drawing work is completed by several servers, the entire display area is divided into several areas, each area is drawn by one or more servers, and an area a consists of 4 values Definition, let
[0087] The steps for determining the ownership of a minimum data unit c include the following:
[0088] (1) The center of mass p of c c After the projection transformation of graphics, we get point p c ′(x′ c , y′ c , z c ′), the radius r is scaled and transformed to obtain the screen length r′;
[0089] (2) If satisfied and Then c belongs to a; otherwise, c does not belong to a.
[0090] The present invention also discloses a method for dynamically adjusting the above-mentioned attribution determination method, comprising the following steps:
[0091] In the parallel rendering system, assume that the output image is divided into d rectangular areas, denoted as a1, a2…a d ; Assume that the system includes e graphics servers; each area a i Responsible for one or more servers. Is a responsible area a v A graph server, where v∈[1,d],u∈[1,e];
[0092] Assume that all data after segmentation according to any one of claims 2-8 is M={c i}Initially all on the server and the user changes the geometric transformation operation input to The process of dynamic data adjustment is as follows:
[0093] (1) Receive input data to generate a new geometric transformation matrix, and broadcast the geometric transformation matrix and drawing commands in the network;
[0094] (2) If it is the first frame, then The data M = {c i} Load into memory; if the amount of data is larger than the memory capacity, virtual memory will be enabled;
[0095] (3) All graphics servers Do the following:
[0096] 1) All data on this machine Traverse each of its c v ;
[0097] 2) For each c v According to claim 9, make an attribution judgment to determine the area to which it belongs a v′ :If v′≠v, broadcast c in the network v Give And c v Delete on this machine;
[0098] 3) Traversal After the end, broadcast the message " Sending End";
[0099] 4) Receive all messages sent to itself data and add it to the local
[0100] 5) If all e " Send "end" message, the data adjustment is completed and the local data set is drawn
[0101] The beneficial effects of the present invention are:
[0102] 1. When dividing a triangular face model, the prior art divides it into several rectangular blocks. This is a very natural division method and is very easy to generate, but the disadvantage is that the calculation of its attribution judgment includes the projection transformation of eight vertices and several comparisons, and the amount of calculation is very large. In the present invention, the triangular face model is divided into several spheres. Although its generation is slightly complicated, it only needs to be calculated once and can be reused. By making attribution judgment on a minimum data unit (i.e., the outer bounding sphere), only one geometric transformation of the center of the circle, one length scaling of the radius, and several additions and subtractions are required. Theoretically, the optimal calculation overhead is a little more than 1 / 8 of that of using the outer bounding box, which reduces the cost of parallel drawing.
[0103] 2. In the present invention, all graphics servers globally save a copy of the segmented model data, and dynamically adjust the data during drawing to maximize the use of memory space, avoid hard disk access, and greatly improve system speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0104] Figure 1 This is a storage schematic diagram of redundant storage described in the prior art.
[0105] Figure 2 This is a schematic diagram of the unique storage described in the prior art.
[0106] Figure 3 This is a schematic diagram of a model of a triangle arrangement when deriving the number of minimum data units described in Example 1 of the present invention.
[0107] Figure 4 It is a schematic structural diagram of a roughly cut rectangular parallelepiped according to Example 1 of the present invention.
[0108] Figure 5 This is a schematic diagram of a model after rough sectioning of Example 1 of the present invention, wherein: Figure 5 (a) is a schematic diagram of the model of a roughly dissected rabbit. Figure 5 (b) is a schematic diagram of the hand model after rough sectioning.
[0109] Figure 6 This is a schematic diagram of the structure of a minimum data unit in Example 1 of the present invention.
[0110] Figure 7 This is a schematic diagram of the model after segmentation in Example 1 of the present invention, wherein: Figure 7 (a) is a schematic diagram of the rabbit model after dissection. Figure 7 (b) is a schematic diagram of the hand model after dissection.
[0111] Figure 8 It is a schematic diagram showing that the display area is divided into several areas in Embodiment 2 of the present invention.
[0112] Fig. 9 A schematic diagram of a prototype system for distributed parallel drawing using unique storage in a retention mode according to the present invention is provided.
[0113] Fig.10 The present invention shows a schematic diagram of the splicing output of multiple servers, wherein: Fig.10 (a) is a schematic diagram of the splicing output of four servers. Fig.10 (b) is a schematic diagram of the splicing output of 6 servers.
[0114] Fig.11 It is a curve diagram of the acceleration ratio and adjustment rate of the multi-machine server in the present invention, wherein the left figure is a curve diagram of the acceleration ratio of the multi-machine server, and the right figure is a curve diagram of the adjustment rate of the multi-machine server. DETAILED DESCRIPTION
[0115] In order to facilitate those skilled in the art to better understand the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The following is only exemplary and does not limit the protection scope of the present invention.
[0116] Embodiment 1,
[0117] The triangular patch model segmentation method described in this embodiment includes the following steps:
[0118] Step S1, determining an outer bounding box B of a triangular face model M, wherein the outer bounding box B is a minimum cuboid that contains the triangular face model M in space and has sides parallel to the coordinate axes.
[0119] First, some symbols related to the triangular face model M and its outer bounding box B are defined as follows:
[0120] The triangular patch model M is composed of an ordered set of points:
[0121] M=(p1,p2…p i …p n )
[0122] The i-th point is:
[0123] p i =(x i ,y i , z i , L i )
[0124] In the above formula, n is the total number of points in M, x i ,y i , z i is the three-dimensional space coordinate, L i is a set of lighting related information, such as color and texture, etc. In this embodiment, L is ignored i Processing, click pi A series of triangular patches are formed in groups of three, such as (p1, p2, p3), (p4, p5, p6), (p 3k+1 , p 3k+2 , p 3k+3 ) are all triangular faces.
[0125] The outer bounding box B is defined by 6 coordinate values:
[0126] B=(x mi n,x max ,y min ,y max , z min , z max )
[0127] The minimum data unit c contains a subset of M and additional information:
[0128]
[0129] In the above formula, m is the total number of points in c; r is the radius of the smallest data unit and is a positive real number, and p c is the center of mass of c, To form a triangular patch, Three groups of three form triangular patches, for example Construct a triangular patch, the value of k ranges from 0 to
[0130] After the segmentation is completed, the triangular patch model M can also be expressed as a set of c:
[0131] M=(c1,c2…c i …c t )
[0132] In the above formula, t represents the number of the smallest data units actually obtained by segmentation, which is n c Approximate value of .
[0133] In step S1 of this embodiment, determining the outer bounding box B of the triangular face model M specifically includes the following steps:
[0134] S11. Assign an initial value to the outer bounding box B:
[0135] x min =x max =x1
[0136] y min =y max =y1
[0137] z min =z max =z1
[0138] S12, traverse all points p in the triangular patch model M i , by definition p i =(x i ,y i , z i , L i ), for each p i Do the following:
[0139] If x i <x min , then let x min =x i
[0140] If x i >x max , then let x max =x i
[0141] If y i <y min , then let y min =y i
[0142] If y i >y max , then let y max =y i
[0143] If z i <z min , then let z min =z i
[0144] If z i >z max , then let z max =z i .
[0145] Step S2: Suppose the triangular face model M is divided into several spheres, each sphere is a minimum data unit c, and the number of theoretically minimum data units n is calculated. c .
[0146] The final display of the parallel rendering system is composed of the outputs of more than one display device (such as a display, a projector), and the line segments shared between the outputs of different display devices are boundaries. Let the total size of the display area be w×h, where w is the width of the display area, h is the height of the display area, and the total length of the boundary is l, with the length unit being pixels. The minimum data unit covering the boundary will lead to redundancy in transmission and storage. Let R be the predefined redundancy rate, which is the ratio of the number of triangles contained in the minimum unit covering the boundary to the total number of triangles, and the value range is [0, 1]; let the total number of triangles in the triangular face model M be N, where N is one-third of the number of points, that is, N=n / 3, and the number of minimum data units n c The calculation includes the following:
[0147] Assume that the triangular face model M is convex, the light passes through the model twice, and the number of triangles covering the display area is N / 2. Assume that the triangle is an isosceles right triangle with a right-angle side length of u, then:
[0148]
[0149] The boundary l is covered by two layers of patches. Let the number of patches covering the boundary be N. l ,but:
[0150]
[0151] Assuming that covering the boundary is redundancy, then:
[0152]
[0153] The above formula means that under certain screen splicing settings, when the number of model faces is N, the redundancy requirement R can be met;
[0154] Ignoring topological connections, assuming that the result of the subdivision into the minimum data unit is equivalent to a triangle that fills the entire minimum data unit, the number of minimum data units is:
[0155]
[0156] Step S3: Based on the number n of minimum data units c Calculate the number of segments s, divide the three axial sides of the outer bounding box B into s segments, and form several small cuboids. The calculation formula for the number of segments s is as follows:
[0157]
[0158] Assuming that the triangular patch model M is convex, it can be deformed into a cuboid topologically isomorphically, and the minimum data unit is distributed on the outer surface, then:
[0159] n c =6s2 -12s-8.
[0160] Step S4: Generate an intermediate set c′, where the intermediate set c′ is an intermediate structure transitioning from the triangular face model M to the final minimum data unit c set, and is used to store the minimum data unit c.
[0161] In this embodiment, the intermediate set c′ is a cube with a sequence number and the points it contains, which is defined as follows:
[0162]
[0163] Among them, i, j, and k are labels, and their value ranges are from 1 to s. A certain c′ can be written as c′ ijk , (x1, x2, y1, y2, z1, z2) defines a cube, a point sequence of indefinite length is a subset of M, starting from subscript a=1, every three points Construct triangles sequentially.
[0164] Let the length, width and height of the outer bounding box B be W, H and L respectively; the relationship between the subscripts i, j and k of c′ and (x1, x2, y1, y2, z1, z2) is:
[0165]
[0166]
[0167]
[0168] Step S5: roughly section the triangular face model M to obtain a number of cuboids, which specifically includes the following:
[0169] The set C′ of the intermediate set c′ generated from the triangular patch model M is = {c′ ijk};
[0170] In the initial state, C′ has s 3 members, each c′ ijk The coordinates of the outer bounding box of (x1, x2, y1, y2, z1, z2) are calculated according to their serial numbers i, j, k. is empty;
[0171] Traverse each triangle in M, and for the three points with coordinates (p 3v+1 , p 3v+2 , p 3v+3 ) of the patch t v , first calculate the centroid point q of the triangle v =(α v , β v , γ v):
[0172]
[0173] In the above formula, the value range of v is [0, N-1], and the plus sign "+" represents vector addition;
[0174] t v By a certain c′ ijk Including, i, j, k are determined as follows:
[0175]
[0176]
[0177]
[0178] After determining i, j, and k, the triangle patch t v The three points of c′ are attached to ijk Point sequence If the centroid q of a triangle is v If a triangle falls within a small cuboid i, j, k, it is considered to belong to the small cuboid i, j, k.
[0179] like Figure 4 As shown in the figure, it is a schematic diagram of the structure of one of the cuboids; Figure 5 As shown, it is a schematic diagram of the model after rough sectioning of the present invention, wherein: Figure 5 (a) is a schematic diagram of the model of a roughly dissected rabbit. Figure 5 (b) Schematic diagram of the hand model after rough sectioning.
[0180] Step S6: sort out the several cuboids obtained after rough sectioning, delete the empty cuboids and convert the non-empty cuboids into spheres, and obtain the final minimum data unit c set. The details are as follows:
[0181] From C′={c′ ijk}Generate c set C = {c}, traverse each c′ ijk ,in,
[0182]
[0183] Check whether its point column is empty. If not, create a minimum data unit c and add it to the end of C. The definition of c is as described above:
[0184]
[0185] The members of c are generated as follows:
[0186] (1) The point sequence of c is c′ijk The point array of
[0187] (2)
[0188] (3)
[0189] At this point, the segmentation step is completed, such as Figure 6 As shown, it is a schematic diagram of the structure of a minimum data unit of the present invention; Figure 7 As shown, it is a schematic diagram of the model after dissection of the present invention, wherein, Figure 7 (a) is a schematic diagram of the rabbit model after dissection. Figure 7 (b) is a schematic diagram of the hand model after dissection.
[0190] Embodiment 2,
[0191] This embodiment discloses a method for determining the attribution of the minimum data unit obtained by the triangular patch model segmentation method described in Embodiment 1.
[0192] In this embodiment, it is assumed that the drawing work is completed by several servers, and the entire display area is divided into several areas, such as Figure 8 As shown, each area is drawn by one or more servers, and an area a consists of 4 values Definition, let
[0193] The steps for determining the ownership of a minimum data unit c include the following:
[0194] (1) The center of mass p of c c After the projection transformation of graphics, we get point p c ′(x′ c , y′ c , z c ′), the radius r is scaled and transformed to obtain the screen length r′;
[0195] (2) If satisfied Head Then c belongs to a; otherwise, c does not belong to a.
[0196] Embodiment 3,
[0197] This embodiment discloses a method for dynamically adjusting the attribution determination method described in Embodiment 2.
[0198] In the sort-first parallel rendering system, assume that the output image is divided into d rectangular areas, denoted as a1, a2, ..., a d ; Assume that the system includes e graphics servers; each area a i Responsible for one or more servers. Is a responsible area a v A graph server, where v∈[1,d],u∈[1,e];
[0199] Assume that all the data after segmentation according to the method described in Example 1 are M = {c i}Initially all on the server and the user changes the geometric transformation operation input to The process of dynamic data adjustment is as follows:
[0200] (1) Receive input data to generate a new geometric transformation matrix, and broadcast the geometric transformation matrix and drawing commands in the network;
[0201] (2) If it is the first frame, then The data M = {c i} Load into memory; if the amount of data is larger than the memory capacity, virtual memory will be enabled;
[0202] (3) All graphics servers Do the following:
[0203] 1) All data on this machine Traverse each of its c v ;
[0204] 2) For each c v According to Example 2, the belonging judgment is performed to determine the region to which it belongs a v ,: If v′≠v, broadcast c in the network v Give And c v Delete on this machine;
[0205] 3) Traversal After the end, broadcast the message " Sending End";
[0206] 4) Receive all messages sent to itself data and add it to the local
[0207] 5) If all e " Send "end" message, the data adjustment is completed and the local data set is drawn
[0208] The following is an example of a specific case:
[0209] Ant Force system is a distributed parallel rendering prototype system that uses the patented retained mode unique storage. It is implemented in Visual C++ under Windows environment. From the application perspective, Ant Force provides a set of retained mode application interfaces and transparently implements distributed parallel rendering. Ant Force application interfaces are divided into two groups:
[0210] Data management interface: define and manage geometric models, and construct spherical subdivision units of the model.
[0211] State management interface: used to set various drawing parameters, such as light, material, geometric transformation matrix, etc. The change of geometric transformation matrix will lead to the redistribution of geometric data among drawing nodes.
[0212] like Fig. 9 The Ant Force system consists of an AF client and an AF server, where AF is the abbreviation of Ant Force. Each AF server is responsible for a rectangular area of the entire output image. The application calls the data management interface to define the geometric model, and the geometric model is immediately divided to generate a minimum set of data units. When the application calls af_draw() for the first time, the AF client makes an attribution judgment and distributes the geometric data to the AF server. When the application calls commands such as af_transform() that cause changes in the attribution relationship, each AF server makes adjustments. If the application calls commands such as af_light() to change attributes such as color, no communication is required between AF servers.
[0213] Each AF server draws the same frame at a different speed, so there is a problem of frame asynchrony. The solution is to track the drawing status of each AF server on the AF client. After the AF server completes the drawing, it does not deliver the frame buffer immediately, but sends a RENDER_FINISHED message to the AF client. After the AF client confirms that all AF servers have completed the drawing, it sends a SWAP_BUFFER command to make all AF servers deliver the frame buffer at the same time. Experiments show that when the drawing state control is not used, the AF server output has obvious jumps, but when the drawing state control is used, the synchronization is very good.
[0214] The TCP protocol is used at the bottom layer of the network. The complex relationships such as data transmission, command response, etc. between AF clients and AF servers, and between AF servers are defined by a set of protocols, the AF system internal protocols. The AF Protocol maintains the internal organization of the system as a whole and is the foundation of the Ant Force system.
[0215] There are three ways to synthesize the final image: 1. Use video synthesis hardware such as Lightening-2. 2. Splice and synthesize multiple CRTs or projectors. 3. Transmit the frame buffer through a gigabit network and synthesize it in software at the display node. As a prototype system, Ant Force currently uses method 2.
[0216] A large number of tests have been conducted on the Ant Force system, and the results show that it can significantly improve the rendering speed for large geometric models. Table 1 lists the running data of some models rotating 360 degrees around the y axis, with a total of 360 frames. The program runs on a single PC and 2, 4, and 6 PCs respectively, and the single PC running time is used as the benchmark to calculate the speedup ratio. Since the parallel overhead increases with the increase in the number of machines, the acceleration effect is not obvious when the model is small. For example, for models 1 and 2, the speedup ratio decreases with the increase in the number of machines, and the speed of model 1 is even slower than that of a single machine when the number of machines is 4 or 6. For larger models, the effect is more obvious, such as models 3-7. It is worth noting that the speedup ratio of models 5 and 6 when running on two machines in parallel exceeds the theoretical upper limit of 2. This is an interesting phenomenon. It shows that when the model data volume is large to a certain extent, the rendering performance of a single machine decreases rapidly with the increase in the model data volume. After the rendering task is shared by two machines, the speed has recovered a lot.
[0217] The method for generating the minimum data unit is to calculate the radius r after the outer bounding box is generated. The minimum data unit structure is generated based on the outer bounding box structure, so its generation operation is slower than that of the outer bounding box, but it is only executed once in the preprocessing stage and then repeatedly used. Since the segmentation operation is only performed once and the attribution judgment will be performed multiple times, the system can tolerate its overhead. This feature is also unique to the retained mode. The minimum data unit structure with efficient attribution judgment is not applicable to the immediate mode system.
[0218] Table 1 Parallel speedup of multiple models
[0219]
[0220]
[0221] Ant Force system supports dividing the output screen and setting the resolution of each AF server through configuration files, so it is very convenient to achieve high-resolution display. Fig.10 The spliced output of 3, 4, and 6 CRTs are shown.
[0222] Table 2 lists the average values of the adjustment rate c in the experiments conducted in Table 1. It can be seen that, first, due to the similarity between frames, Ant Force’s c is smaller than that of the centralized system in the data set (c≡100%); second, c is related to the structure and morphology of the geometric model; third, as the number of AF servers increases, geometric primitives are more likely to cross to adjacent AF servers, which will cause c to increase.
[0223] Fig.11 The changes in the speedup ratio and adjustment rate c are shown. It can be seen that the larger model has a good acceleration effect, and the adjustment rate of the large model is relatively small. The model with a small amount of data has a general acceleration effect and a large adjustment rate, which means that the parallel overhead is large.
[0224] Table 2 Average value of adjustment rate c
[0225]
[0226]
[0227] Table 3 Comparison of the time required to determine the belonging of the dragon model's outer bounding box and the smallest data unit
[0228]
[0229] Table 3 lists the time for attribution judgment calculation of a typical model (dragon) using the outer bounding box and the minimum data unit at different segmentation granularities. It can be seen that due to other computational overheads (such as data traversal), although the attribution judgment time of the minimum data unit has not been reduced to the theoretical optimal value (i.e., about 1 / 8 of the outer bounding box), it is still much shorter than the method of using the outer bounding box, and the effect is better.
[0230] The above only describes the basic principles and preferred embodiments of the present invention. Those skilled in the art may make many changes and improvements based on the above description, and these changes and improvements should fall within the protection scope of the present invention.
Claims
1. A method for dividing a triangular patch model, characterized in that: The steps include: S1. Determine an outer bounding box B of the triangular face model M, where the outer bounding box B is a minimum cuboid that contains the triangular face model M in space and has sides parallel to the coordinate axes; S2. Suppose the triangular face model M is divided into several spheres, each sphere is the minimum data unit c, and calculate the number of theoretical minimum data units n c ; In step S2, the final display of the parallel rendering system is spliced by the output of more than one display device, and the line segment shared between the outputs of different display devices is the boundary. The total size of the display area is set to w×h, where w is the width of the display area, h is the height of the display area, the total length of the boundary is l, and the length unit is pixel. The minimum data unit covering the boundary will cause redundancy in transmission and storage. Let R be a predefined redundancy rate, which is the ratio of the number of triangles contained in the minimum unit covering the boundary to the total number of triangles, and the value range is [0, 1]; let the total number of triangles in the triangular face model M be N, where N is one third of the number of points, that is, N=n / 3, and the number of minimum data units n c The calculation includes the following: Assume that the triangular face model M is convex, the light passes through the model twice, and the number of triangles covering the display area is N / 2. Assume that the triangle is an isosceles right triangle with a right-angle side length of u, then: The boundary l is covered by two layers of patches. Let the number of patches covering the boundary be Nl, then: Assuming that covering the boundary is redundancy, then: The above formula means that under certain screen splicing settings, when the number of model faces is N, the redundancy requirement R can be met; Ignoring topological connections, assuming that the result of the subdivision into the minimum data unit is equivalent to a triangle that fills the entire minimum data unit, the number of minimum data units is: S3, based on the number of minimum data units n c Calculate the number of segments s, and divide the three axial sides of the outer bounding box B into s segments to form several small cuboids; S4, generating an intermediate set c′, wherein the intermediate set c′ is an intermediate structure transitioning from the triangular face model M to the final minimum data unit c set, and is used to store the minimum data unit c; S5, roughly sectioning the triangular face model M to obtain a number of cuboids; S6. Arrange the several cuboids obtained after rough sectioning, delete the empty cuboids and convert the non-empty cuboids into spheres, and obtain the final minimum data unit c set.
2. The triangular patch model segmentation method according to claim 1, characterized in that: The triangular patch model M is composed of an ordered set of points: M=(p1,p2…p i …p n ) The i-th point is: p i =(x i ,y i ,z i ,L i ) In the above formula, n is the total number of points in M, x i ,y i , z i is the three-dimensional space coordinate, L i is a set of illumination related information, assuming that L i Processing, click p i A series of triangular patches are formed in groups of three. The outer bounding box B is defined by 6 coordinate values: B=(x min ,x max ,y min ,y max ,z min ,z max ) The minimum data unit c contains a subset of M and additional information: In the above formula, m is the total number of points in c; r is the radius of the smallest data unit and is a positive real number, and p c is the center of mass of c, Three groups of three form triangular patches; After the segmentation is completed, the triangular patch model M can also be expressed as a set of c: M=(c1,c2…c i …c t ) In the above formula, t represents the number of the smallest data units actually obtained by segmentation.
3. The triangular patch model segmentation method according to claim 2, characterized in that: In step S1, the outer bounding box B of the triangular face model M is determined, which specifically includes the following steps: S11. Assign an initial value to the outer bounding box B: x min =x max =x1 yes min =y max =y1 WITH min =from max =z1 S12, traverse all points p in the triangular patch model M i , by definition p i =(x i ,y i , z i , L i ), for each p i Do the following: If x i <x min , then let x min =x i If x i >x max , then let x max =x i If y i <y min , then let y min =y i If y i >y max , then let y max =y i If z i <z min , then let z min =z i If z i >z max , then let z max =z i .
4. The triangular patch model segmentation method according to claim 3, characterized in that: In step S3, the number of segments s is calculated as follows: Assuming that the triangular patch model M is convex, it can be deformed into a cuboid in a topologically isomorphic manner, and the minimum data unit is distributed on the outer surface, then: n c =6s 2 -12s-8。 5. The triangular patch model segmentation method according to claim 4, characterized in that: In step S4, the intermediate set c is a cube with a sequence number and the points it contains, which is defined as follows: Among them, i, j, and k are labels, and their value ranges are from 1 to s. A certain c′ can be written as c′ ijk , (x1, x2, y1, y2, z1, z2) defines a cube, a point sequence of indefinite length is a subset of M, starting from subscript a=1, every three points The triangles are formed sequentially; Let the length, width and height of the outer bounding box B be W, H and L respectively; the relationship between the subscripts i, j and k of c′ and (x1, x2, y1, y2, z1, z2) is:
6. The triangular patch model segmentation method according to claim 5, characterized in that: Step S5 specifically includes the following: The set C′ of the intermediate set c′ generated from the triangular patch model M is = {c′ ijk }; In the initial state, C′ has s 3 members, each c′ ijk The coordinates of the outer bounding box of (x1, x2, y1, y2, z1, z2) are calculated according to their sequence numbers i, j, k. is empty; Traverse each triangle in M, and for the three points with coordinates (p 3v+1 , p 3v+2 , p 3v+3 ) of the patch t v , first calculate the centroid point q of the triangle v =(α v , β v , γ v ): In the above formula, the value range of v is [0, N-1], and the plus sign "+" represents vector addition; t v By a certain c′ ijk Including, i, j, k are determined as follows: After determining i, j, and k, the triangle patch t v The three points of c′ are attached to ijk Point sequence The tail of .
7. The triangular patch model segmentation method according to claim 6, characterized in that: Step S6 specifically includes the following: From C′={c′ ijk }Generate c set C = {c}, traverse each c′ ijk ,in, Check whether its point list is empty. If not, create a minimum data unit c and add it to the end of C. The definition of c is as described in claim 2: The members of c are generated as follows: (1) The point sequence of c is c′ ijk The point array of (2) (3) 8. A method for determining the attribution of the minimum data unit obtained by the triangular patch model segmentation method according to any one of claims 1 to 7, characterized in that: These include: Assume that the drawing work is completed by several servers, the entire display area is divided into several areas, each area is drawn by one or more servers, and an area a consists of 4 values Definition, let The steps for determining the ownership of a minimum data unit c include the following: (1) The center of mass p of c c After the projection transformation of graphics, we get point p c ′(x′ c , y′ c , z c ′), the radius r is scaled and transformed to obtain the screen length r′; (2) If satisfied and Then c belongs to a; otherwise, c does not belong to a.
9. A method for dynamically adjusting the attribution determination method of claim 8, characterized in that: These include: In the parallel rendering system, assume that the output image is divided into d rectangular areas, denoted as a1, a2…a d ; Assume that the system includes e graphics servers; each area a i Responsible for one or more servers. Is a responsible area a v A graph server, where v∈[1,d],u∈[1,e]; Assume that all data M={ci} after segmentation according to any one of claims 1 to 7 are initially on the server and the user changes the geometric transformation operation input to The process of dynamic data adjustment is as follows: (1) Receive input data to generate a new geometric transformation matrix, and broadcast the geometric transformation matrix and drawing commands in the network; (2) If it is the first frame, then Load data M={ci} into the memory; if the amount of data is larger than the memory capacity, virtual memory will be enabled; (3) All graphics servers Do the following: 1) All data on this machine Traverse each of its c v ; 2) For each c v According to claim 8, make an attribution judgment to determine the area to which it belongs a v′ :If v′≠v, broadcast c in the network v Give And c v Delete on this machine; 3) Traversal After the end, broadcast the message in the network" Sending End"; 4) Receive all messages sent to itself data and add it to the local 5) If all e " Send "end" message, the data adjustment is completed and the local data set is drawn
