CN1529288A - Method for computing apex attribute in three-dimensional figure - Google Patents
Method for computing apex attribute in three-dimensional figure Download PDFInfo
- Publication number
- CN1529288A CN1529288A CNA2003101010106A CN200310101010A CN1529288A CN 1529288 A CN1529288 A CN 1529288A CN A2003101010106 A CNA2003101010106 A CN A2003101010106A CN 200310101010 A CN200310101010 A CN 200310101010A CN 1529288 A CN1529288 A CN 1529288A
- Authority
- CN
- China
- Prior art keywords
- conversion
- triangle
- attributes
- summit
- summits
- 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.)
- Pending
Links
Images
Abstract
In the invention, the 3D graph includes multiple basic triangles, and each basic triangle comprises three vertexes. Each vertex has multiple attributes. The method including coordinate conversion program written by using part of instructions in vertex coloring program calculates a conversion triangle converted from basic triangle. Discrimination operation is carried out based on position attributes in three vertexes of the conversion triangle in order to determine whether the conversion triangle is in visible state or in invisible state. If the conversion triangle is in visible state, then calculation for other attributes in three vertexes of the conversion triangle is carried out; otherwise, the conversion triangle is in invisible state. Thus, the conversion triangle is discarded, and calculation for other attributes in three vertexes will not be carried out.
Description
Technical field
The invention provides a kind of method of calculating the attribute (attribute) on each summit in the three-dimensional picture, refer to that especially a kind of use vertex coloring program (vertex shader) calculates the method for the attribute on each summit in this three-dimensional picture.
Background technology
In recent years, indispensable basic outfit when the vertex coloring program has become the three-dimensional picture of computer game men in process computer, the vertex coloring program can form of software occur, the DirectX 8 that is produced by software giant Microsoft for example, the example, in hardware that also can be built in graphic chips occurs, for example by GeForce3 chip that NVIDIA released and by Radeon chip that ATI delivered.The major function of vertex coloring program is coordinate conversion and illumination computing (transform ﹠amp; Lighting, T﹠amp; L).
Three-dimensional picture on the computer screen can be regarded as by a plurality of triangles and constitutes, and makes T﹠amp when games send the three-dimensional picture on the computer screen to graphic chips (or vertex coloring software); During the L computing, the data that these games transmitted are corresponding to a plurality of vertex of a triangle data in this three-dimensional picture, that is the attribute on summit.In the standard of vertex coloring program, each summit all comprises 16 kinds of attributes, be used for representing the x of this summit except comprising in residing position, space, outside y and the z position coordinates attribute, also comprise w (weight properties), the shown color attribute in this summit is with r (red) under optically focused source or astigmatic source, g (green), b (blue), and a (alpha, transparency) formatting is in the attribute on this summit, perpendicular to the normal vector on the gore at this place, summit, material texture (texture) coordinate, it comprises the s that represents the relative position of this summit on the material texture respectively, t, four material texture coordinates such as r and q attribute, mist special efficacy coordinate attributes, and the various attributes such as size attribute on this summit.
A plurality of attributes that handled each summit of vertex coloring program is comprised all are 4 * 32 floating number, the compute mode of adding the vertex coloring program is single instruction multiple data (single instructionmultiple data, SIMD), that is the vertex coloring program utilizes 12 built-in SIMD buffers to deposit simultaneously and computing 4 * 4 (is calculated x simultaneously, y, z and w or r, g, b and a) or 3 * 3 (calculate x simultaneously, y and z or r, g and b) data of matrix form, to carry out coordinate conversion and illumination computing, therefore, the formation data volume that each vertex of a triangle included is very big in the three-dimensional picture on the computer screen.
Summary of the invention
As previously mentioned, because each summit all comprises 16 attributes in the three-dimensional picture, and the length of each attribute all is 4 * 32, so the data volume on each summit is all very big.Moreover, the vertex coloring program spend in the illumination computing time be longer than the time that spends in coordinate conversion greatly, because the vertex coloring program only need be considered the coordinate of viewpoint (viewing point) in carrying out the coordinate conversion process, just according to the difference of eye coordinates, see through rotate, amplify/dwindle, apex coordinate that rising, decline, left avertence and mode such as move to right change base triangle shape; Otherwise, the vertex coloring program is considered except need in the process of carrying out the illumination computing the viewpoint when carrying out coordinate conversion, is still needed and consider number, form (a ring light, single light, direction light or projection light etc.) as light source and the form of handling (environment formula, diffuse type or spotlight formula etc.).For instance, the required time span of modal inner product operation is two cycles in the coordinate conversion, and in the illumination computing one 17 road single-point light source required operation time be 126 cycles unexpectedly.
Therefore fundamental purpose of the present invention is to provide a kind of method of using the vertex coloring program to calculate the attribute on each summit in the three-dimensional picture, to solve the shortcoming of prior art.
The present invention discloses a kind of method of using the vertex coloring program to calculate the attribute on each summit in the three-dimensional picture, this three-dimensional picture comprises a plurality of base triangle shapes (triangular primitive), every base triangle shape all comprises three summits, and each summit all comprises a plurality of attributes, this method comprises the following step: calculate the conversion triangle that this base triangle shape is changed with the coordinate conversion program that the instruction of the part in this vertex coloring program constitutes, this coordinate conversion program is changed position attribution in leg-of-mutton three summits according to the position attribution in three summits of this base triangle shape to calculate this, differentiate computing according to this position attribution of changing in leg-of-mutton three summits, to determine whether this conversion triangle serves as visible or invisible mode, and if this conversion triangle is a visible state, then carry out the computing that this changes leg-of-mutton three other attributes of summit, otherwise, if this conversion triangle is an invisible mode, then directly reject this conversion triangle, do not do the computing of three other attributes of summit.
Because leg-of-mutton illumination computation process more than its coordinate conversion process complexity, so method of the present invention can be save appreciable calculated amount, has also increased the travelling speed of processor simultaneously.
Description of drawings
Figure one is in the method for the present invention converting original three-dimensional picture to the synoptic diagram of conversion three-dimensional picture.
Figure two is the process flow diagram of method in the preferred embodiment of the present invention.
Description of symbols among the figure
10. original three-dimensional picture
12. conversion three-dimensional picture
14,16. base triangle shapes
18,20. conversion triangles
22,24,26,28. normal vectors
30. viewpoint
Embodiment
See also figure one, it is for being converted to original three-dimensional picture 10 by the vertex coloring program synoptic diagram of conversion three-dimensional picture 12 in the method for the present invention.Original three-dimensional picture 10 comprises two base triangle shapes (triangular primitive) 14,16, and conversion three-dimensional picture 12 also comprises two conversion triangles (triangular transform) 18,20, wherein base triangle shape 14,16 and the conversion triangle 18 normal vector 22,24,26 is (the outward directing) that refers to outward, that is base triangle shape 14,16 and the conversion triangle 18 be visible (visible), the normal vector 28 of conversion triangle 20 then is (the inward directing) of interior finger, that is conversion triangle 20 is sightless (invisible).That is to say, the base triangle shape 14,16 of viewpoint 30 on can seeing original three-dimensional picture 10, also can see the conversion triangle 18 on the conversion three-dimensional picture 12 fully, yet, viewpoint 30 but can't be seen the conversion triangle 20 on the conversion three-dimensional picture 12, because conversion triangle 20 in the transfer process of original three-dimensional picture 10, has been converted on the conversion three-dimensional picture 12 with respect to the back side of viewpoint 30.Under this situation, color, material texture coordinate and the mist special efficacy coordinate attributes on three summits are just unimportant whatever in the conversion triangle 20.Therefore, the present invention is when carrying out the vertex coloring program, and the normal vector that only needs to calculate on it is all the other attributes except the position coordinates attribute in the conversion triangle that refers to outward.
With regard to program, method of the present invention is when carrying out the vertex coloring program, each base triangle shape converts the coordinate attributes of changing leg-of-mutton three summits in the original three-dimensional picture 10 of calculating earlier, judge in view of the above that again the conversion triangle is visible or invisible, whether follow all the other attributes that calculate corresponding to three summits in this conversion triangle with decision.Just,, thereby can't be seen that the vertex coloring program just need then not calculated all the other attributes corresponding to three summits in this conversion triangle yet by viewpoint 30 if the conversion triangle is invisible; Otherwise, if the leg-of-mutton normal vector of conversion is to refer to outward, that is should the conversion triangle be as seen, thereby can be seen by viewpoint 30, the vertex coloring program is just then calculated all the other attributes corresponding to three summits in this conversion triangle, as attributes such as material texture coordinate s, t, r and q, color r, g, b and a and mist special efficacy coordinates.
See also figure two, be the process flow diagram of method 100 in the preferred embodiment of the present invention, method 100 comprises the following step:
Step 102: beginning;
(original three-dimensional picture 10 will be converted into conversion three-dimensional picture 12)
Step 104:, convert three basic summits of each the base triangle shape in the original three-dimensional picture 10 to conversion leg-of-mutton three conversion summits in regular turn by the part in vertex coloring program instruction;
Step 106: judge that this conversion triangle is visible or invisible,, then carry out step 108 if this conversion triangle is visible, otherwise, reject this conversion triangle, and carry out step 130;
Step 108: calculate leg-of-mutton all the other attributes of this conversion;
Step 130: judge this conversion triangle change from base triangle shape whether be last base triangle shape in the original three-dimensional picture 10, if not, then continue to get back to step 104, if carry out step 200;
(till all the base triangle shapes calculating in the original three-dimensional picture 10 being finished) always
Step 200: finish.
In the step 106 of method 100, judge that this conversion triangle is visible or invisible, can be simply by discriminant
Positive negative value decide (x wherein
0, y
0), (x
1, y
1) and (x
2, y
2) be respectively this and change leg-of-mutton three apex coordinates.So to discriminant on the occasion of or negative value corresponding to visible conversion triangle by application program (application program, AP) decision.Certainly, as figure one with shown in the figure two, but also the outer finger of usage vector judges that with interior finger it is visible or invisible changing triangle.For instance, decision triangle A ' B ' C ' for visible triangle A ' D ' C ' be invisible after, the vertex coloring program just can not need be calculated all the other attributes on three summits among the triangle A ' D ' C ', and and then triangle A ' D ' C ' rejected from conversion three-dimensional picture 12, and only calculate all the other attributes on three summits among the triangle A ' B ' C '.
With respect to existing vertex coloring program, vertex coloring program of the present invention is changed leg-of-mutton three summits according to three summits of base triangle shape to calculate earlier, judge that again this conversion triangle is visible or invisible, if this conversion triangle is visible, then then calculate corresponding to leg-of-mutton all the other attributes of this conversion, otherwise, if this conversion triangle is sightless, because at viewpoint 30 places and can't see this conversion triangle, just can omit so then change leg-of-mutton illumination calculating corresponding to this after the coordinate conversion.Before address, leg-of-mutton illumination computation process is more than this leg-of-mutton coordinate conversion process complexity, so method of the present invention can be save appreciable calculated amount, also increased the travelling speed of processor simultaneously.
The above only is preferred embodiment of the present invention, and variation and the modification done under the prerequisite that does not break away from spirit of the present invention and claims scope all belong to the covering scope of patent of the present invention.
Claims (10)
1. method of using the vertex coloring program to calculate the attribute on each summit in the three-dimensional picture, this three-dimensional picture comprises a plurality of base triangle shapes, and every base triangle shape all comprises three summits, and each summit all comprises a plurality of attributes, this method comprises:
Calculate the conversion triangle that this base triangle shape is changed by the coordinate conversion program of this vertex coloring program, this coordinate conversion program calculates this according to the position attribution in three summits of this base triangle shape and changes position attribution in leg-of-mutton three summits;
Whether differentiate computing according to this position attribution of changing in leg-of-mutton three summits, serve as visible or invisible mode to determine this conversion triangle; And
If this conversion triangle is a visible state, then carry out the computing that this changes leg-of-mutton three other attributes of summit, otherwise, if this conversion triangle is an invisible mode, then directly reject this conversion triangle, do not do the computing that this changes leg-of-mutton three other attributes of summit.
2. as 1 described method of claim the, wherein should differentiate computing is by discriminant
Positive negative value decide visible or invisible mode.
3. as 1 described method of claim the, wherein the outer finger or the interior finger of vector decide visible or invisible mode in order to utilize in accordance with the law in this differentiation computing.
4. as 1 described method of claim the, wherein the computing of three other attributes of summit comprises the illumination operation program.
5. as 4 described methods of claim the, wherein each summit all comprises at least one color attribute in addition, and this illumination operation program is to be used for calculating the color attribute that this changes leg-of-mutton three summits.
6. as 5 described methods of claim the, wherein each summit all comprises four color attributes.
7. as 6 described methods of claim the, wherein these four color attributes are red, green, blue, and transparency in regular turn.
8. as 4 described methods of claim the, wherein each summit all comprises four material coordinate attributes in addition, and this illumination operation program is used for calculating the material coordinate attributes that this changes leg-of-mutton three summits.
9. as 1 described method of claim the, wherein each summit all comprises 16 attributes.
10. as 1 described method of claim the, wherein the data length of the attribute that each summit comprised is 4 * 32.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNA2003101010106A CN1529288A (en) | 2003-10-10 | 2003-10-10 | Method for computing apex attribute in three-dimensional figure |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNA2003101010106A CN1529288A (en) | 2003-10-10 | 2003-10-10 | Method for computing apex attribute in three-dimensional figure |
Publications (1)
Publication Number | Publication Date |
---|---|
CN1529288A true CN1529288A (en) | 2004-09-15 |
Family
ID=34304161
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNA2003101010106A Pending CN1529288A (en) | 2003-10-10 | 2003-10-10 | Method for computing apex attribute in three-dimensional figure |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN1529288A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102708537A (en) * | 2011-03-03 | 2012-10-03 | Arm有限公司 | Graphics processing |
CN104536763A (en) * | 2015-01-08 | 2015-04-22 | 炫彩互动网络科技有限公司 | Method for implementing online game simulating reality |
-
2003
- 2003-10-10 CN CNA2003101010106A patent/CN1529288A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102708537A (en) * | 2011-03-03 | 2012-10-03 | Arm有限公司 | Graphics processing |
CN102708537B (en) * | 2011-03-03 | 2016-09-28 | Arm有限公司 | Graphic system and the method and apparatus of operation graphic system |
US9865084B2 (en) | 2011-03-03 | 2018-01-09 | Arm Limited | Graphics processing using attributes with associated meta information |
CN104536763A (en) * | 2015-01-08 | 2015-04-22 | 炫彩互动网络科技有限公司 | Method for implementing online game simulating reality |
CN104536763B (en) * | 2015-01-08 | 2017-03-08 | 炫彩互动网络科技有限公司 | A kind of network game implementation method of simulating reality |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Bajaj et al. | Texmol: Interactive visual exploration of large flexible multi-component molecular complexes | |
Kolb et al. | Hardware-based simulation and collision detection for large particle systems | |
Lombardo et al. | Real-time collision detection for virtual surgery | |
CN1317666C (en) | System and method suitable for setting up real time shadow of transparent target | |
US6226005B1 (en) | Method and system for determining and/or using illumination maps in rendering images | |
Zhang et al. | Interactive collision detection for deformable models using streaming AABBs | |
US6489955B1 (en) | Ray intersection reduction using directionally classified target lists | |
JPH01163884A (en) | Apparatus and method for picture information processing | |
US11295508B2 (en) | Hardware-based techniques applicable for ray tracing for efficiently representing and processing an arbitrary bounding volume | |
CN108090947B (en) | Ray tracing optimization method for 3D scene | |
EP0933729A3 (en) | Three-dimensional graphics accelerator | |
JPH09326043A (en) | Pixel fragment combining system and its method | |
CA2420390A1 (en) | Computerized image system | |
GB2259432A (en) | Three dimensional graphics processing | |
WO2002045025A9 (en) | Multiple processor visibility search system and method | |
Theoharis et al. | The magic of the z-buffer: A survey | |
US11450057B2 (en) | Hardware acceleration for ray tracing primitives that share vertices | |
US11620786B2 (en) | Systems and methods for texture-space ray tracing of transparent and translucent objects | |
CN101615300A (en) | A kind of screen space micro-structure surface object ambient light occlusion method | |
CA2227502C (en) | Method and system for determining and or using illumination maps in rendering images | |
CN1529288A (en) | Method for computing apex attribute in three-dimensional figure | |
Kuchkuda | An introduction to ray tracing | |
Patidar et al. | Exploiting the shader model 4.0 architecture | |
Jang et al. | Fast collision detection using the A-buffer | |
CN1667652A (en) | Vision convex hull accelerated drafting method based on graph processing chips |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |