CN108447015B - Device and method for realizing user-defined clipping function in GPU - Google Patents
Device and method for realizing user-defined clipping function in GPU Download PDFInfo
- Publication number
- CN108447015B CN108447015B CN201810261074.9A CN201810261074A CN108447015B CN 108447015 B CN108447015 B CN 108447015B CN 201810261074 A CN201810261074 A CN 201810261074A CN 108447015 B CN108447015 B CN 108447015B
- Authority
- CN
- China
- Prior art keywords
- clipping
- primitive
- triangle
- vertex
- line segment
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active - Reinstated
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 238000005520 cutting process Methods 0.000 claims description 25
- 238000004364 calculation method Methods 0.000 claims description 15
- 230000006870 function Effects 0.000 claims description 13
- 230000000007 visual effect Effects 0.000 claims description 6
- 238000005215 recombination Methods 0.000 abstract 1
- 230000006798 recombination Effects 0.000 abstract 1
- FZRPRRCXGGAZEW-HSZRJFAPSA-N (2r)-n-(6-aminohexyl)-1-tridecanoylpiperidine-2-carboxamide Chemical compound CCCCCCCCCCCCC(=O)N1CCCC[C@@H]1C(=O)NCCCCCCN FZRPRRCXGGAZEW-HSZRJFAPSA-N 0.000 description 2
- 230000008521 reorganization Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/20—Processor architectures; Processor configuration, e.g. pipelining
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/60—Memory management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4007—Scaling of whole images or parts thereof, e.g. expanding or contracting based on interpolation, e.g. bilinear interpolation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2200/00—Indexing scheme for image data processing or generation, in general
- G06T2200/28—Indexing scheme for image data processing or generation, in general involving image processing hardware
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Generation (AREA)
Abstract
The invention discloses a device and a method for realizing user-defined clipping function in a GPU, which execute clipping on a graphic element according to a plurality of clipping planes defined by a user, remove parts outside the clipping planes, adopt a face-to-face clipping mode, judge the position relationship between a vertex and the clipping planes by bringing vertex coordinates of the graphic element into equations of the clipping planes for a single clipping plane, and finish clipping on the graphic element with an intersecting part with the clipping planes by calculating intersection points and vertex recombination.
Description
Technical Field
The invention mainly relates to the field of GPU design, in particular to the field of user-defined clipping function realization in a GPU.
Background
In GPU design, in addition to requiring the implementation of the clipping of 6 clipping planes (left, right, bottom, top, near, far) specified by the view volume, the user is allowed to additionally specify clipping planes, imposing further constraints on the view Jing Ti, the final clipping region being the intersection of the view volume with all half-spaces defined by all custom clipping planes. The method comprises the steps of comparing more visual body cutting researches, comparing a well-known Cohen-Sutherland cutting algorithm, judging which area each vertex of a triangle is positioned in by encoding different areas, directly outputting the triangle in the area, directly deleting the triangle outside the area, and calculating intersection points in the area; the Cyrus-Beck algorithm mainly aims at expressing line segments by using line segment equations so as to reduce the times of judging and viewing boundaries, but has higher complexity of calculating parameters; liang-Barsky algorithm, which is an improved Cyrus-Beck algorithm, and is used for detecting whether the processed line segment is completely out of the visible range or not earlier than the Cyrus-Beck algorithm, so that unnecessary operation is reduced; the Sutherland-Hodgman algorithm is an algorithm applied to polygon clipping, adopts the concept of divide-and-conquer, sequentially judges a single visual boundary for the polygons to be processed, and obtains intersection points if the single visual boundary is exceeded.
The Chinese patent 201410416264.5 discloses a graphic primitive clipping device and clipping method in the graphic processing process of a GPU, which comprehensively adopts a Cohen-Sutherland coding line clipping algorithm and a Sutherland-Hodgman polygon clipping algorithm; the realization of hierarchical clipping strategies in graphic chip design is disclosed in Chinese patent 201010557424.4, which adopts a hierarchical clipping strategy to realize the clipping function of graphic elements, and the devices and the realization methods are used for solving the problem of fixed view body clipping in a GPU, and are not applicable to clipping surfaces which are uncertain and custom-defined by users.
Disclosure of Invention
The invention aims to solve the problems that: the utility model provides a realization method of user-defined clipping function in GPU, carry out the clipping to the primitive according to a plurality of clipping planes of user definition, reject the part outside the clipping plane, adopt the mode of clipping by face, through bringing the equation of each clipping plane into to the primitive vertex coordinate to single clipping plane, judge the positional relationship of summit and clipping plane, through calculating intersection point and summit reorganization to the primitive that has crossing part with clipping plane, and write new primitive into FIFO, the primitive that has been clipped at every turn still is unanimous with former primitive type, repeat clipping process, until all user-defined clipping planes are tailor and are accomplished.
The invention comprises the following steps:
The invention discloses a device for realizing a user-defined cutting function in a GPU, which is characterized in that: executing cutting operation of n custom cutting surfaces, wherein n is a natural number, each cutting surface is sequentially executed, FIFO buffer memory is utilized between two cutting surfaces, when the next cutting surface executes cutting, the graphic element is read from the FIFO of the previous cutting surface, and each cutting surface comprises the following modules:
(1) And a position judging module: finishing the position relation judgment of each vertex of the input primitive and the current clipping surface, and determining which sides of the primitive need to calculate the intersection point with the clipping surface;
(2) And the intersection point calculating module is used for: completing parameter calculation of intersection points of the edges and the cutting surfaces, and then calculating coordinates and attributes of the intersection points;
(3) And (3) a primitive reassembly module: reassembling the primitive according to the position relation between the primitive vertex and the clipping surface and the calculated intersection point, and writing the assembled new primitive into the FIFO;
For further limitation of the implementation device of the invention, the custom clipping plane is a clipping plane equation A ix+Biy+Ciz+Di w=0 custom-defined by a user, wherein i epsilon [0, n-1], n is the number of custom clipping planes of the user supported at maximum; the position judging module functions are determined according to symbols by bringing coordinates of the vertexes of the primitives into a custom clipping plane equation; the intersection point calculating module calculates by adopting a linear interpolation algorithm; the graphic element reassembly is performed on the basis of not damaging the directivity of the original graphic element vertex according to the position relation between the graphic element vertex and the clipping surface;
The invention also discloses a method for realizing the user-defined clipping function in the GPU, which is characterized in that: the vertex coordinates of the input module under visual coordinates are A(x0,y0,z0,w0)、B(x1,y1,z1,w1)、C(x2,y2,z2,w2),, the corresponding coordinates and attributes of each vertex are respectively represented as P 0、P1、P2, the data are stored in a buffer FIFO, basic primitives in the GPU are points, line segments and triangles, if the primitive which is currently input is a triangle, the vertex ABC forms the triangle, if the primitive which is currently input is the line segment, the vertex AB forms the line segment, and if the primitive which is currently input is the point, the vertex A forms the point; the implementation method of the invention comprises the following steps: repeating the following steps from the 0 th clipping surface until the n-1 th clipping surface is executed:
Step 1: reading the primitive data from the previous stage buffer FIFO and bringing the three vertices into the ith clipping plane equation Wherein i starts from 0, and i is added with 1 every time cutting of one cutting surface is executed;
Step 2: according to the calculation result of the step1, respectively judging three basic primitives, and determining which vertexes of the current processed primitive are outside the clipping plane and which vertexes are inside the clipping plane;
Step 3: according to the judgment result of the step 2, only the triangle and the line segment have the condition of needing to calculate the intersection point, and the intersection point calculation is executed for the conditions, so that at most two intersection points I 0 and I 1 are calculated;
step 4: reassembling the primitives according to the intersection points of the judgment in the step 2 and the calculation in the step3, wherein the assembling process cannot destroy the direction of the original triangle;
Step 5: the newly assembled primitive data is written into the FIFO in primitive units.
For further limitation of the implementation method of the present invention, the judgment in the step 2 adopts the following method, and three graphic elements are respectively judged:
(1) If the current triangle is:
a) If DP 0 is less than 0, DP 1 is less than 0 and DP 2 is less than 0, the triangle is directly discarded outside the clipping plane, and the recording variable position=0;
b) If DP 0 is greater than or equal to 0 and DP 1 is greater than or equal to 0 and DP 2 is less than 0, letting DPA0=DP0,DPB0=DP2,PA0=P0,PB0=P2,DPA1=DP1,DPB1=DP2,PA1=P1,PB2=P2, record the variable position=1;
c) If DP 0 is less than 0, DP 1 is greater than or equal to 0, and DP 2 is greater than or equal to 0, letting DPA0=DP0,DPB0=DP1,PA0=P0,PB0=P1,DPA1=DP0,DPB1=DP2,PA1=P0,PB2=P2, record the variable position=2;
d) If DP 0 is greater than or equal to 0 and DP 1 is less than 0 and DP 2 is greater than or equal to 0, letting DPA0=DP0,DPB0=DP1,PA0=P0,PB0=P1,DPA1=DP1,DPB1=DP2,PA1=P1,PB2=P2, record the variable position=3;
e) If DP 0 is less than 0 and DP 1 is less than 0 and DP 2 is greater than or equal to 0, let DPA0=DP0,DPB0=DP2,PA0=P0,PB0=P2,DPA1=DP1,DPB1=DP2,PA1=P1,PB2=P2, record the variable position=4;
f) If DP 0 is greater than or equal to 0 and DP 1 is less than 0 and DP 2 is less than 0, let DPA0=DP0,DPB0=DP1,PA0=P0,PB0=P1,DPA1=DP0,DPB1=DP2,PA1=P0,PB2=P2, record the variable position=5;
g) If DP 0 is less than 0 and DP 1 is greater than or equal to 0 and DP 2 is less than 0, let DPA0=DP0,DPB0=DP1,PA0=P0,PB0=P1,DPA1=DP1,DPBI=DP2,PA1=P1,PB2=P2, record the variable position=6;
h) If DP 0 is more than or equal to 0, DP 1 is more than or equal to 0, and DP 2 is more than or equal to 0, the triangles are all in the clipping plane, and the variable position=7 is recorded;
(2) If the current line segment is:
a) If DP 0 is less than 0 and DP 1 is less than 0, the line segment is directly discarded outside the clipping plane, and the recording variable position=0;
b) If DP 0 is greater than or equal to 0 and DP 1 is less than 0, letting DP A0=DP0,DPB0=DP1,PA0=P0,PB0=P1 record variable position=1;
c) If DP 0 is less than 0 and DP 1 is greater than or equal to 0, letting DP A0=DP0,DPB0=DP1,PA0=P0,PB0=P1 record variable position=2;
d) If DP 0 is more than or equal to 0 and DP 1 is more than or equal to 0, the line segments are all in the clipping plane, and the recording variable position=7;
(3) If the dot element is the dot pattern element, if the inequality DP 0 is smaller than 0, directly discarding the record variable position=0 outside the clipping plane, otherwise, recording the variable position=7 inside the clipping plane;
For further limitation of the implementation method of the present invention, the calculation of the intersection points I 0 and I 1 in the step 3 is performed by the following method: first calculate parameters Then according to linear interpolation algorithm, respectively calculating the intersection point coordinates of the edge to be cut and the cutting surface and the corresponding attributes as PAB0=tAB0·PB0+(1-tAB0)·PA0,PAB1=tAB1·PB1+(1-tAB1)·PA1;
For further limitation of the implementation method of the present invention, the primitive assembly method in the step 4 is as follows:
(1) If the current primitive is a triangle, if position=0, no primitive is generated; if position=1, newly fitting triangle ABI 1 and triangle AI 1I0; if position=2, newly fitting triangle I 0BI1 and triangle BCI 1; if position=3, newly assemble triangle AI 0I1 and triangle AI 1 C; if position=4, newly fitting into triangle I 0I1 C; if position=5, newly fitting into triangle AI 0I1; if position=6, newly fitting into triangle I 0BI1; if position=7, outputting the original triangle ABC;
(2) If the current primitive is a line segment, if position=0, no primitive is generated; if position=1, the new assembly is line segment AI 0; if position=2, the new assembly is line segment I 0 B; if position=7, outputting the original line segment AB;
(3) If the current point element is the point element, if position=0, no primitive is generated; outputting an origin a if position=7;
The invention has the advantages that: 1. the method realizes the function of user-defined cutting; 2. any number of custom clipping surfaces can be conveniently expanded.
Drawings
FIG. 1 is a device and method for implementing a user-defined clipping function in a GPU implemented in accordance with the present invention;
fig. 2 is a positional relationship of triangles and line segments with a clipping plane.
Detailed Description
The invention will be described in further detail below with reference to the drawings and the specific examples.
As shown in fig. 1, an implementation apparatus of a user-defined clipping function in a GPU may perform clipping operations of n custom clipping planes, where n is a natural number, and the custom clipping planes are clipping plane equations a ix+Biy+Ciz+Di w=0 customized by a user, where i e [0, n-1], n is a number of user-defined clipping planes supported maximally, each clipping plane is performed sequentially, a FIFO buffer is used between two clipping planes clipping, and when a clipping plane performs clipping, a primitive is read from a FIFO of a previous clipping plane, and clipping of each clipping plane includes the following modules:
(1) And a position judging module: the method is that the coordinates of the vertexes of the primitive are brought into a custom clipping plane equation, and the determination is carried out according to the symbols, so as to determine which sides of the primitive need to calculate the intersection point with the clipping plane;
(2) And the intersection point calculating module is used for: completing parameter calculation of intersection points of edges and cutting surfaces, and then calculating coordinates and attributes of the intersection points by adopting a linear interpolation algorithm;
(3) And (3) a primitive reassembly module: according to the position relation between the primitive vertex and the clipping surface and the calculated intersection point, reassembling the primitive on the basis of not damaging the directivity of the original primitive vertex, and writing the assembled new primitive into the FIFO;
As shown in fig. 1, in a method for implementing a user-defined clipping function in a GPU, it is set that coordinates of vertices of a module inputted under visual coordinates are P 0、P1、P2 corresponding to coordinates and attributes of vertices of A(x0,y0,z0,w0)、B(x1,y1,z1,w1)、C(x2,y2,z2,w2),, respectively, these data are stored in a buffer FIFO, basic primitives in the GPU are points, line segments and triangles, if a primitive inputted at present is a triangle, vertex ABC forms a triangle, if a primitive inputted at present is a line segment, vertex AB forms a line segment, and if a primitive inputted at present is a point, vertex a forms a point; the implementation method of the invention comprises the following steps: repeating the following steps from the 0 th clipping surface until the n-1 th clipping surface is executed:
Step 1: reading the primitive data from the previous stage buffer FIFO and bringing the three vertices into the ith clipping plane equation Wherein i starts from 0, and i is added with 1 every time cutting of one cutting surface is executed;
Step 2: according to the calculation result of the step 1, three basic primitives are respectively judged, which vertexes of the current processed primitive are outside a clipping plane and which vertexes are inside the clipping plane are determined, and the three primitives are respectively judged by adopting the following method:
(1) If the current triangle is a triangle, the positional relationship is as shown in fig. 2 (a):
a) If DP 0 <0 and DP 1 <0 and DP 2 <0, then the triangle is discarded directly out of clipping plane, record variable position=0:
b) If DP 0 is greater than or equal to 0 and DP 1 is greater than or equal to 0 and DP 2 is less than 0, letting DPA0=DP0,DPB0=DP2,PA0=P0,PB0=P2,DPA1=DP1,DPB1=DP2,PA1=P1,PB2=P2, record the variable position=1;
c) If DP 0 is less than 0, DP 1 is greater than or equal to 0, and DP 2 is greater than or equal to 0, letting DPA0=DP0,DPB0=DP1,PA0=P0,PB0=P1,DPA1=DP0,DPB1=DP2,PA1=P0,PB2=P2, record the variable position=2;
d) If DP 0 is greater than or equal to 0 and DP 1 is less than 0 and DP 2 is greater than or equal to 0, letting DPA0=DP0,DPB0=DP1,PA0=P0,PB0=P1,DPA1=DP1,DPB1=DP2,PA1=P1,PB2=P2, record the variable position=3;
e) If DP 0 is less than 0 and DP 1 is less than 0 and DP 2 is greater than or equal to 0, let DPA0=DP0,DPB0=DP2,PA0=P0,PB0=P2,DPA1=DP1,DPB1=DP2,PA1=P1,PB2=P2, record the variable position=4;
f) If DP 0 is greater than or equal to 0 and DP 1 is less than 0 and DP 2 is less than 0, let DPA0=DP0,DPB0=DP1,PA0=P0,PB0=P1,DPA1=DP0,DPB1=DP2,PA1=P0,PB2=P2, record the variable position=5;
g) If DP 0 is less than 0 and DP 1 is greater than or equal to 0 and DP 2 is less than 0, let DPA0=DP0,DPB0=DP1,PA0=P0,PB0=P1,DPA1=DP1,DPB1=DP2,PA1=P1,PB2=P2, record the variable position=6;
h) If DP 0 is greater than or equal to 0 and DP 1 is greater than or equal to 0 and DP 2 is greater than or equal to 0, then the triangles are all in the clipping plane, record variable position=7:
(2) If the current line segment is a line segment, the positional relationship shown in fig. 2 (b):
a) If DP 0 is less than 0 and DP 1 is less than 0, the line segment is directly discarded outside the clipping plane, and the recording variable position=0;
b) If DP 0 is greater than or equal to 0 and DP 1 is less than 0, letting DP A0=DP0,DPB0=DP1,PA0=P0,PB0=P1 record variable position=1;
c) If DP 0 is less than 0 and DP 1 is greater than or equal to 0, letting DP A0=DP0,DPB0=DP1,PA0=P0,PB0=P1 record variable position=2;
d) If DP 0 is more than or equal to 0 and DP 1 is more than or equal to 0, the line segments are all in the clipping plane, and the recording variable position=7;
(3) If the dot element is the dot pattern element, if the inequality DP 0 is smaller than 0, directly discarding the record variable position=0 outside the clipping plane, otherwise, recording the variable position=7 inside the clipping plane; ;
Step 3: according to the judgment result in the step 2, only the triangle and the line segment have the condition that the intersection point needs to be calculated, the intersection point calculation is executed for the conditions, and at most, two intersection points I 0 and I 1 are calculated, and the calculation method comprises the following steps: first calculate parameters Then according to linear interpolation algorithm, respectively calculating the intersection point coordinates of the edge to be cut and the cutting surface and the corresponding attributes as PAB0=tAB0·PB0+(1-tAB0)·PA0,PAB1=tAB1·PB1+(1-tAB1)·PA1;
Step 4: reassembling the primitive according to the intersection point of the judgment in the step 2 and the calculation in the step 3, wherein the direction of the original triangle cannot be destroyed in the assembling process, and the primitive assembling method comprises the following steps: (1) If the current primitive is a triangle, if position=0, no primitive is generated; if position=1, newly fitting triangle ABI 1 and triangle AI 1I0; if position=2, newly fitting triangle I 0BI1 and triangle BCI 1; if position=3, newly assemble triangle AI 0I1 and triangle AI 1 C; if position=4, newly fitting into triangle I 0I1 C; if position=5, newly fitting into triangle AI 0I1; if position=6, newly fitting into triangle I 0BI1; if position=7, outputting the original triangle ABC;
(2) If the current primitive is a line segment, if position=0, no primitive is generated; if position=1, the new assembly is line segment AI 0; if position=2, the new assembly is line segment I 0 B; if position=7, outputting the original line segment AB;
(3) If the current point element is the point element, if position=0, no primitive is generated; outputting an origin a if position=7;
Step 5: the newly assembled primitive data is written into the FIFO in primitive units.
Claims (2)
- A device for realizing user-defined cutting function in GPU is characterized in that: a clipping operation for executing n custom clipping planes, a custom clipping plane equation custom-defined by a userDesignating, wherein i epsilon [0, n-1], n is the number of the maximum supported user-defined clipping planes, each clipping plane is sequentially executed, FIFO buffer memory is utilized between clipping of two clipping planes, when the clipping is executed by the latter clipping plane, the graphic element is read from the FIFO of the former clipping plane, and clipping of each clipping plane comprises the following modules:(1) And a position judging module: finishing the position relation judgment of each vertex of the input primitive and the current clipping surface, determining which sides of the primitive need to calculate the intersection point with the clipping surface, wherein the judgment method is to bring the coordinates of the vertex of the primitive into a custom clipping surface equation and determine according to the symbol;(2) And the intersection point calculating module is used for: completing parameter calculation of intersection points of edges and cutting surfaces, then calculating coordinates and attributes of the intersection points, and calculating by adopting a linear interpolation algorithm;(3) And (3) a primitive reassembly module: and (3) according to the position relation between the primitive vertex and the clipping surface and the calculated intersection point, reassembling on the basis of not damaging the directivity of the original primitive vertex according to the position relation between the primitive vertex and the clipping surface, and writing the assembled new primitive into the FIFO.
- A method for implementing a user-defined clipping function in a gpu, comprising: set the vertex coordinates of the input module under the visual coordinates as、、The corresponding coordinates and attributes of each vertex are respectively expressed as、、Storing the data into a buffer FIFO, wherein the basic primitives in the GPU are points, line segments and triangles, if the primitive which is currently input is a triangle, the vertex ABC forms the triangle, if the primitive which is currently input is a line segment, the vertex AB forms the line segment, and if the primitive which is currently input is a point, the vertex A forms the point; the implementation method of the invention comprises the following steps: repeating the following steps from the 0 th clipping surface until the n-1 th clipping surface is executed:step 1: reading the primitive data from the previous stage buffer FIFO and bringing the three vertices into the ith clipping plane equation Wherein i starts from 0, and i is increased by 1 every time cutting of one cutting surface is performed;Step 2: according to the calculation result in the step 1, three basic primitives are respectively judged, and the vertexes of the current processed primitive are determined to be outside the clipping plane and the vertexes of the current processed primitive are determined to be inside the clipping plane, wherein the specific judging method is as follows:1) If the current triangle is:a) If it is And is also provided withAnd is also provided withThe triangle is directly discarded outside the clipping plane, and the recording variable position=0;b) If it is And is also provided withAnd is also provided withOrder in principle,,,,,,,Recording variable position=1;c) If it is And is also provided withAnd is also provided withOrder in principle,,,,,,,Recording variable position=2;d) If it is And is also provided withAnd is also provided withOrder in principle,,,,,,,Recording variable position=3;e) If it is And is also provided withAnd is also provided withOrder in principle,,,,,,,Recording variable position=4;f) If it is And is also provided withAnd is also provided withOrder in principle,,,,,,,Recording variable position=5;g) If it is And is also provided withAnd is also provided withOrder in principle,,,,,,,Recording variable position=6;h) If it is And is also provided withAnd is also provided withThe triangle is all in the clipping plane, and the variable position=7 is recorded;2) If the current line segment is:a) If it is And is also provided withThe line segment is directly discarded outside the clipping plane, and the variable position=0 is recorded;b) If it is And is also provided withOrder in principle,,,Recording variable position=1;c) If it is And is also provided withOrder in principle,,,Recording variable position=2;d) If it is And is also provided withThe line segment is all in the clipping plane, and the variable position=7 is recorded;3) If it is a dot pattern element, if it is an inequality If so, directly discarding the record variable position=0 outside the clipping plane, otherwise, in the clipping plane, recording the record variable position=7;step 3: according to the judgment result of the step 2, only the triangle and the line segment have the condition that the intersection point needs to be calculated, the intersection point calculation is carried out on the conditions, and at most two intersection points are calculated AndThe calculation method comprises the following steps:First calculate parameters ,Then according to linear interpolation algorithm, respectively calculating the intersection point coordinates of the edge to be cut and the cutting surface and the corresponding attributes as,;Step 4: reassembling the primitive according to the intersection point of the judgment in the step 2 and the calculation in the step 3, wherein the assembling process cannot destroy the direction of the original triangle, and the specific assembling method comprises the following steps:1) If the current primitive is a triangle, if position=0, no primitive is generated; if position=1, the triangle is newly assembled And triangle shape; If position=2, the triangle is newly assembledAnd triangle shape; If position=3, the new triangle is assembledAnd triangle shape; If position=4, the new triangle is assembled; If position=5, the triangle is newly assembled; If position=6, the new triangle is assembled; If position=7, the original triangle is output;2) If the current primitive is a line segment, if position=0, no primitive is generated; if position=1, the new assembly is a line segment; If position=2, the new assembly is a line segment; If position=7, the original line segment is output;3) If the current point element is the point element, if position=0, no primitive is generated; if position=7, the origin is output;Step 5: the newly assembled primitive data is written into the FIFO in primitive units.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810261074.9A CN108447015B (en) | 2018-03-27 | 2018-03-27 | Device and method for realizing user-defined clipping function in GPU |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810261074.9A CN108447015B (en) | 2018-03-27 | 2018-03-27 | Device and method for realizing user-defined clipping function in GPU |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108447015A CN108447015A (en) | 2018-08-24 |
CN108447015B true CN108447015B (en) | 2024-08-13 |
Family
ID=63197493
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810261074.9A Active - Reinstated CN108447015B (en) | 2018-03-27 | 2018-03-27 | Device and method for realizing user-defined clipping function in GPU |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108447015B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109727184B (en) * | 2018-12-12 | 2023-05-23 | 中国航空工业集团公司西安航空计算技术研究所 | Three-dimensional clipping circuit of graphic processor |
CN111241776B (en) * | 2019-12-31 | 2023-10-20 | 西安翔腾微电子科技有限公司 | TLM device for GPU geometric primitive start mark management in SystemC-based plane clipping |
CN116977604A (en) * | 2022-04-22 | 2023-10-31 | 北京字跳网络技术有限公司 | Grid model processing method, device, electronic equipment and medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101976432A (en) * | 2010-11-22 | 2011-02-16 | 长沙景嘉微电子有限公司 | Implementation of hierarchical cutting strategy in graphic chip design |
CN104200425A (en) * | 2014-08-22 | 2014-12-10 | 济南大学 | Device and method for entity clipping during graphic processing unit (GPU) graphic processing |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7928990B2 (en) * | 2006-09-27 | 2011-04-19 | Qualcomm Incorporated | Graphics processing unit with unified vertex cache and shader register file |
US7696993B2 (en) * | 2007-02-08 | 2010-04-13 | Via Technologies, Inc. | Geometry primitive type conversion in a GPU pipeline |
US9648325B2 (en) * | 2007-06-30 | 2017-05-09 | Microsoft Technology Licensing, Llc | Video decoding implementations for a graphics processing unit |
KR102116708B1 (en) * | 2013-05-24 | 2020-05-29 | 삼성전자 주식회사 | Graphics processing unit |
CN103400338A (en) * | 2013-07-25 | 2013-11-20 | 天津大学 | Clipping method and clipping module with effective area and multiplex function in embedded GPU (Graphics Processing Unit) |
-
2018
- 2018-03-27 CN CN201810261074.9A patent/CN108447015B/en active Active - Reinstated
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101976432A (en) * | 2010-11-22 | 2011-02-16 | 长沙景嘉微电子有限公司 | Implementation of hierarchical cutting strategy in graphic chip design |
CN104200425A (en) * | 2014-08-22 | 2014-12-10 | 济南大学 | Device and method for entity clipping during graphic processing unit (GPU) graphic processing |
Also Published As
Publication number | Publication date |
---|---|
CN108447015A (en) | 2018-08-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108447015B (en) | Device and method for realizing user-defined clipping function in GPU | |
US11830143B2 (en) | Tessellation method using recursive sub-division of triangles | |
Delingette | Simplex meshes: a general representation for 3D shape reconstruction | |
US6600485B1 (en) | Polygon data generation method and image display apparatus using same | |
US6587104B1 (en) | Progressive hulls | |
US7643026B2 (en) | NURBS surface deformation apparatus and the method using 3D target curve | |
US11263802B2 (en) | Method and apparatus for splitting three-dimensional volumes | |
US8743135B2 (en) | Graphics processing systems | |
US20110158555A1 (en) | Curved surface area calculation device and method | |
CN110689492B (en) | Image edge smoothing method and device | |
CN103714575A (en) | Fluid simulation method for combining SPH and dynamic surface mesh | |
CN111581776A (en) | Geometric reconstruction model-based isogeometric analysis method | |
CN109727184B (en) | Three-dimensional clipping circuit of graphic processor | |
US7330182B2 (en) | 3D graphics processing method | |
US8698800B2 (en) | Method and apparatus for non-shrinking mesh smoothing using local fitting | |
Rahim et al. | Evaluation of adaptive subdivision method on mobile device | |
Makhlouf et al. | Reconstruction of the cad model using tps surface | |
US6828965B2 (en) | Regularization of implicial fields representing objects and models | |
CN117893655B (en) | Method for improving search speed of clipping points and GPU speed | |
JP4005352B2 (en) | 3D shape processing apparatus and curved surface interpolation program | |
CN110908338B (en) | Blade profile spline reverse curvature correction method and system for turbine blade | |
Masood et al. | Optimal curve fitting approach to represent outlines of 2D shapes | |
WO2014181598A1 (en) | Curved-surface drawing device and curved-surface drawing program | |
CN115393157A (en) | Circuit and method for quickly judging position relation between graphic primitive and visual scene | |
EP2050077A1 (en) | Visual file representation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
AD01 | Patent right deemed abandoned |
Effective date of abandoning: 20231117 |
|
AD01 | Patent right deemed abandoned | ||
RR01 | Reinstatement of patent right |
Former decision: Deemed abandonment of patent rights Former decision publication date: 20231117 |
|
RR01 | Reinstatement of patent right | ||
GR01 | Patent grant | ||
GR01 | Patent grant |