CN109584334A - A kind of triangle rasterization Scan Architecture and rasterisation scan method based on UML - Google Patents
A kind of triangle rasterization Scan Architecture and rasterisation scan method based on UML Download PDFInfo
- Publication number
- CN109584334A CN109584334A CN201811355047.4A CN201811355047A CN109584334A CN 109584334 A CN109584334 A CN 109584334A CN 201811355047 A CN201811355047 A CN 201811355047A CN 109584334 A CN109584334 A CN 109584334A
- Authority
- CN
- China
- Prior art keywords
- axis
- triangle
- scan
- stepping
- scanning
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/40—Filling a planar surface by adding surface attributes, e.g. colour or texture
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/005—General purpose rendering architectures
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Abstract
The triangle rasterization Scan Architecture and rasterisation scan method that the present invention relates to a kind of based on UML, comprising: data acquisition module, for obtaining triangle data information;Triangle scan module obtains effective coordinate data for being scanned according to triangle data information to triangle, and according to scanning result;Triangle rasterization module, for being rasterized according to effective coordinate data to the triangle after scanning.Triangle rasterization Scan Architecture provided by the invention based on UML, it is integrated with data capture unit, triangle scan module and triangle rasterization module, it realizes the port that data between data capture unit, triangle scan module and triangle rasterization module are transmitted through UML, X-axis scanning is executed parallel with Y-axis stepping, the complexity for reducing triangle rasterization improves the scan performance and speed of triangle rasterization Scan Architecture.
Description
Technical field
The present invention relates to computer graphical scanning technique fields, and in particular to a kind of triangle rasterization based on UML is swept
Retouch structure and rasterisation scan method.
Background technique
As that graphically applies is continuously increased, CPU (central processing unit, Central Processing are depended merely in early days
Unit the solution for) carrying out graphic plotting has been difficult to meet the graphics process demand of technology growth, thus graphics processor
(Graphic Processing Unit, GPU) comes into being.So far from Nvidia publication first item GPU product in 1999, GPU
The development of technology mainly experienced fixed function flow line stage, separation stainer framework stage and unified stainer framework rank
Section, graphics capability are constantly promoted, and application field also gradually expands to general-purpose computations field from initial graphic plotting.
GPU has assembly line high speed, parallel feature and flexible programmability, provides for graphics process and universal parallel calculating
Good operation platform.
Currently, China GPU chip R&D capability is weak, largely using the quotient of external import in each field display control program
With GPU chip.Especially in military domain, there are the sides such as safety, reliability, protection for external import commercialization GPU chip
The hidden danger in face is unable to satisfy the demand of military environment;Moreover, for reasons such as politics, military affairs, economy, it is external that China is carried out
Technology " block " and product " monopolization ", it is difficult to the Floor layer Technology data for obtaining GPU chip, as register data, detailed inner are micro-
Framework, kernel software source code etc., cause GPU function, performance to be unable to give full play, and transplantability is poor;The above problem is seriously made
The independent development of the China Yue Liao display system and independent development capability, break through graphics processor key technology, development graph processor core
Piece is extremely urgent.
Currently, the structure for the scanning of GPU triangle rasterization is to be realized by Zigzag algorithm, but utilize
The structure for the scanning of GPU triangle rasterization that Zigzag algorithm is realized, the stepping of Y-axis excessively rely on X-axis bilateral scanning
End position, increase the complexity of triangle rasterization, influence the scan performance and speed of triangle rasterization Scan Architecture
Degree.
Summary of the invention
In order to solve the above-mentioned problems in the prior art, the present invention provides a kind of triangular gratings based on UML
Change Scan Architecture and rasterisation scan method.
An embodiment provides a kind of triangle rasterization Scan Architecture based on UML, comprising:
Data acquisition module, for obtaining triangle data information;
Triangle scan module connects the data acquisition module by the first connector, for according to the triangle
Data information is scanned the triangle, and obtains effective coordinate data according to scanning result;
Triangle rasterization module connects the triangle scan module by the second connector, for having according to
Effect coordinate data rasterizes the triangle after scanning.
In one embodiment of the invention, the triangle scan module includes:
Initialization unit connects the data capture unit by the first connector, for according to the triangle data
Acquisition of information X-axis origin coordinates, Y-axis detection range;
Y-axis stepping unit connects the initialization unit, for carrying out enabled mark to X-axis, and is examined according to the Y-axis
Surveying range makes detection elements carry out stepping along first direction;
Several X-axis scanning elements are separately connected the Y-axis stepping unit, for according to the enabled mark and the X-axis
Origin coordinates, the detection elements after making stepping are scanned along X-axis.
In one embodiment of the invention, second connector includes several sub- connectors, each X-axis scanning
Unit is connect by a corresponding sub- connector with the triangle rasterization module.
In one embodiment of the invention, the X-axis scanning element includes:
Second direction scanning element, by connecting the Y-axis stepping unit with door, for according to the enabled mark and
The X-axis origin coordinates, the detection elements after making stepping are scanned in a second direction;
Third direction scanning element, by connecting the Y-axis stepping unit with door, for according to the enabled mark and
The X-axis origin coordinates, the detection elements after making stepping are scanned along third direction.
In one embodiment of the invention, the second direction scanning element is also used to by walking with door to the Y-axis
There is provided the detection elements into unit first completes label.
In one embodiment of the invention, the third direction scanning element is also used to by walking with door to the Y-axis
There is provided the detection elements into unit second completes label.
In one embodiment of the invention, the data acquisition module is FIFO.
In the present invention also provides a kind of triangle rasterization scan method based on UML, comprising:
Obtain triangle data information;
The triangle is scanned according to the triangle data information, and effective coordinate is obtained according to scanning result
Data;
The triangle after scanning is rasterized according to effective coordinate data.
In one embodiment of the invention, the triangle is scanned according to the triangle data information, is wrapped
It includes:
According to the triangle data acquisition of information X-axis origin coordinates, Y-axis detection range;
Enabled mark is carried out to X-axis, and so that detection elements is carried out stepping along first direction according to the Y-axis detection range;
According to the enabled mark and the X-axis origin coordinates, the detection elements after making stepping are scanned along X-axis.
In one embodiment of the invention, according to the enabled mark and the X-axis origin coordinates, make after controlling stepping
Detection elements be scanned along X-axis, comprising:
According to the enabled mark and the X-axis origin coordinates, the detection elements after making stepping carry out in a second direction
Scanning;
According to the enabled mark and the X-axis origin coordinates, the detection elements after making control stepping are along third direction
It is scanned.
Compared with prior art, beneficial effects of the present invention:
Triangle rasterization Scan Architecture provided by the invention based on UML, is integrated with data capture unit, triangle is swept
Module and triangle rasterization module are retouched, between data capture unit, triangle scan module and triangle rasterization module
The port that data are transmitted through UML (Unified Modeling Language, Unified Modeling Language) is realized, so that X-axis scans
It can be executed parallel with Y-axis stepping, reduce the complexity of triangle rasterization, improve triangle rasterization Scan Architecture
Scan performance and speed.
Detailed description of the invention
Fig. 1 is a kind of schematic diagram of the triangle rasterization Scan Architecture based on UML provided in an embodiment of the present invention;
Fig. 2 is a kind of structural schematic diagram of triangle provided in an embodiment of the present invention;
Fig. 3 is the schematic diagram of another triangle rasterization Scan Architecture based on UML provided in an embodiment of the present invention;
Fig. 4 is the schematic diagram of another triangle rasterization Scan Architecture based on UML provided in an embodiment of the present invention;
Fig. 5 is the schematic diagram of the triangle rasterization scan method provided in an embodiment of the present invention based on UML.
Specific embodiment
Further detailed description is done to the present invention combined with specific embodiments below, but embodiments of the present invention are not limited to
This.
Embodiment one
Referring to Figure 1, Fig. 1 is a kind of triangle rasterization Scan Architecture based on UML provided in an embodiment of the present invention
Schematic diagram.A kind of triangle rasterization Scan Architecture based on UML provided in an embodiment of the present invention, the rasterisation Scan Architecture packet
It includes:
Data acquisition module, for obtaining triangle data information.
Specifically, Fig. 2 is referred to, triangle data information is the coordinate of Atria point, can be denoted as V0 respectively
(x0, y0), V1 (x1, y1) and V2 (x2, y2), wherein the triangle for rasterizing scanning can be acute triangle, right angle
Triangle and obtuse triangle.
Preferably, data capture unit is FIFO (First Input First Output, push-up storage),
FIFO may be implemented to cache triangle data information, and can carry out writing data and reading to triangle data information
According to operation, so that triangle data information is transmitted to initialization unit.
Triangle scan module connects data acquisition module by the first connector, for according to triangle data information
Triangle is scanned, and effective coordinate data is obtained according to scanning result;
Specifically, Fig. 3 is referred to, the first connector is for realizing between data acquisition module and triangle scan module
Communication, the first connector includes first interface and first port, wherein first interface is to be designed by UML
Triangle2FifoVertexIf, first port are the Triangle2FifoVertexPort designed by UML, are obtained in data
It takes unit that can obtain the current state of data capture unit by Get_Fifo_Busy_Status () function, passes through later
Read_Fifo_Vertex_Data () reads the triangle data information in data capture unit, passes through
Triangle2FifoVertexAnd if Triangle2FifoVertexPort sends triangle data to triangle scan module
Information can make data acquisition module become data recipient, pass through by Triangle2FifoVertexIf
Triangle2FifoVertexPort can make triangle scan module become active initiators, that is, pass through
Triangle scan module may be implemented actively to number in Triangle2FifoVertexAnd if Triangle2FifoVertexPort
Triangle data information is obtained according to module is obtained.
Further, Fig. 4 is referred to, triangle scan module includes initialization unit, Y-axis stepping unit and several X-axis
Scanning element:
Initialization unit connects data capture unit by the first connector, for according to triangle data acquisition of information X
Axis origin coordinates, Y-axis detection range;
Wherein, initialization unit actively obtains triangle data information to data acquisition module by the first connector, with
Make initialization unit according to triangle data acquisition of information X-axis origin coordinates, Y-axis detection range, is realized by the first connector
Initialization unit actively obtains the effect of triangle data information to data acquisition module, to simplify transmittance process, improves
The rate of triangle data information transmitting.
Specifically, initialization unit is used to read the valid data in triangle data information, and to the significant figure of reading
According to data initiating operations are carried out, so that it is determined that X-axis origin coordinates and Y-axis detection range;
Further, the min coordinates of triangle Y-axis are denoted as Ymin, then Ymin=(y0, y1, y2), i.e. Ymin be y0,
Minimum value in y1 and y2, the maximum coordinates of triangle Y-axis are Ymax, then Ymax=(y0, y1, y2), i.e. Ymax be y0, y1 and
Maximum value in y2, then Y-axis detection range is denoted as [Ymin, Ymax].
Further, X-axis origin coordinates (X-axis origin coordinates is denoted as X_scan_start) is for the X to triangle
Origin coordinates when axis is scanned determines that the X-axis origin coordinates of triangle rasterization is divided into following situations:
Situation 1, as y0 ≠ y1 ≠ y2, if Ymin=y0, X_scan_start=x0 at this time, if Ymin=y1, X_
Scan_start=x1, Ymin=y2, then X_scan_start=x2;
Situation 2, if Ymin=y0=y1 at this time, needs to judge the size of x0 and x1 as y0=y1 ≠ y2, if x1 > x0,
Then X_scan_start=x0, if x1 < x0, X_scan_start=x1, if Ymin=y2, X_scan_start=x2;
Situation 3, if Ymin=y1=y2 at this time, needs to judge the size of x1 and x2 as y0 ≠ y1=y2, if x2 > x1,
Then X_scan_start=x1, if x2 < x1, X_scan_start=x2, if Ymin=y0, X_scan_start=x0;
Situation 4, if Ymin=y0=y2 at this time, needs to judge the size of x0 and x2 as y0=y2 ≠ y1, if x2 > x0,
Then X_scan_start=x0, if x2 < x0, X_scan_start=x2, if Ymin=y1, X_scan_start=x1.
X-axis origin coordinates be detection elements every time in Y-axis along first direction by after set distance stepping, along X-axis scanning
Origin coordinates starts to be scanned triangle.
Y-axis stepping unit connects initialization unit, for carrying out enabled mark to X-axis, and according to Y-axis detection range, makes
Detection elements carry out stepping along first direction;
Wherein, detection elements are pixel.
Specifically, Y-axis stepping unit can control detection elements and carry out stepping, Y-axis along first direction in Y-axis detection range
Stepping unit is also used to receive under some Y-coordinate of X-axis scanning element in Y-axis detection range, and X-axis scanning element is along X-axis
The completion marking signal exported when the end of scan will control inspection after Y-axis stepping unit receives the completion marking signal
Element is surveyed along first direction stepping set distance, to be scanned to X-axis corresponding to next Y-coordinate, until examining beyond Y-axis
Range is surveyed, then the end of scan.Y-axis stepping unit according to the received several X-axis scanning elements of completion marking signal co- controlling of institute,
So that all X-axis scanning elements can be realized parallel execution.Y-axis stepping unit is internally provided with register, which uses
In the enable bit (enable) for identifying every a line X-axis scanning, enable bit is for judging whether every a line X-axis enables, if enabled,
X-axis scanning element starts to be scanned current row, if not enabling, Y-axis stepping unit control detection elements along first direction after
Continuous stepping, wherein if the coordinate of the X-axis of certain a line includes the coordinate data of triangle, illustrate that the X-axis is enabled, if not wrapping
Coordinate data containing triangle then illustrates that the X-axis is enabled.
Further, completing marking signal includes that the first completion label and second complete label.
Preferably, the origin coordinates of Y-axis stepping is set as Ymin, and first direction is that Y-axis is positive, i.e. Y-axis stepping unit control
Detection elements processed since Ymin along first direction stepping, until it exceeds Ymax.
Preferably, Y-axis stepping unit is Y-axis FSM (Finite State Machine, finite state machine) unit,
FSM is made of status register and combinational logic circuit, can carry out state according to preset state according to control signal
Transfer is the control centre coordinated coherent signal movement, complete specific operation.
Several X-axis scanning elements, are separately connected Y-axis stepping unit, sit for being originated according to the enabled mark and X-axis of X-axis
Mark, the detection elements after making stepping are scanned along X-axis.
Wherein, each X-axis scanning element includes a second direction scanning element and a third direction scanning element,
By connecting Y-axis stepping unit with door, second direction scanning element is used for according to X-axis each second direction scanning element
Enabled mark and X-axis origin coordinates, are scanned detection elements in a second direction;Each third direction scanning element passes through
The Y-axis stepping unit is connect with door, for making detection elements along third according to the enabled mark and X-axis origin coordinates to X-axis
Direction is scanned.Second direction scanning element and a third direction scanning element can execute parallel.It is being walked every time along Y-axis
Into rear, X-axis scanning element can detect whether each X-axis enables first, if enabled, second direction scanning element and third direction
Scanning element starts to be scanned, until second direction scanning element can export one first completion label to Y after the end of scan
Axis stepping unit, first, which completes label, indicates the end of scan of the corresponding X-axis of second direction scanning element in a second direction, third
Direction scanning element can export one second completion label to Y-axis stepping unit, and second, which completes label, indicates third direction scanning
The corresponding X-axis of unit along third direction the end of scan so that Y-axis stepping unit obtain every a line X-axis scanning the case where.
Y-axis stepping unit completes label and second according to first and completes flag update enable bit, and it is single to X-axis scanning to redistribute resource
Member continues to the scanning of X-axis, until Y-axis detection range is jumped out in Y-axis stepping, the so far triangle rasterization end of scan.
Y-axis stepping unit distributes resource to several X-axis scanning elements, so that several X-axis scanning elements can execute parallel
Scanning motion, and second direction scanning element in each X-axis scanning element and third direction scanning element may be implemented simultaneously
Row executes scanning motion.Meanwhile the hardware resource that each X-axis scanning element is distributed by Y-axis stepping unit, it may be implemented to examine
It surveys element and belongs to [Ymin, Ymax] along the scanning of X-axis, such as coordinate Y1~YN under different Y-coordinate, then according to Y-axis stepping list
The control of member may be implemented the scanning of X-axis corresponding to coordinate Y1~YN while carry out, so that X-axis scanning walks energy with Y-axis
It is enough parallel to execute, reduce the complexity of triangle rasterization, improve triangle rasterization Scan Architecture scan performance and
Speed.
After the X-axis scan data of every a line, second direction scanning element and third direction scanning element can be exported effectively
Coordinate data, in order to be stored and recorded to the coordinate scanned.Wherein, effective coordinate data is detection elements part position
In triangle or be entirely located in initialization after triangle corresponding to coordinate, this coordinate data is effective number of coordinates
According to.
Preferably, second direction is that X-axis is positive, and the third direction is X-axis negative sense.
For example, the quantity of X-axis scanning element is 4.
Triangle rasterization module (ragment rasterizing process) connects triangle by the second connector
Shape scan module, for being rasterized according to effective coordinate data to the triangle after scanning.
Wherein, the second connector includes several sub- connectors, and each X-axis scanning element passes through a corresponding sub- connector
It is connect with triangle rasterization module.
Specifically, Fig. 3 is referred to, the second connector is for realizing between X-axis scanning element and triangle rasterization module
Communication, every sub- connector includes a second interface and a second port, wherein second port is to be designed by UML
Triangle2Rasterzing [n] prot, triangle scan mould can be made by Triangle2Rasterzing [n] prot
Block becomes active initiators, i.e., so that X-axis scanning element actively transmits effective coordinate data information to triangle rasterization module,
Second interface is the Triangle2RasterzingIF designed by UML, by the interface letter of Triangle2RasterzingIF
Number is Send_Rasterzing_Fragment_Data (), so that triangle rasterization module becomes data recipient, i.e., it is logical
Cross effective seat that Triangle2Rasterzing [n] prot and Triangle2RasterzingIF obtains X-axis scanning element
Data active transmission is marked to triangle rasterization module.
Further, [n] in Triangle2Rasterzing [n] prot represents the sequence of sub- connector, such as son connection
Mouthful quantity be 4, Triangle2Rasterzing [4] prot be then the 4th sub- connector second port, n=1,2,
3 ..., Triangle2Rasterzing [n] prot include Triangle2Rasterzing [1] prot,
Triangle2Rasterzing [2] prot to Triangle2Rasterzing [n] prot, and each second port corresponding one
A first interface.
Wherein, effective coordinate data is actively transmitted to triangle rasterization mould by the second connector by X-axis scanning element
Block, so that triangle rasterization module rasterizes triangle according to effective coordinate data, and the scanning of each X-axis is single
It is independent mutually between member, it does not interfere with each other, and effective coordinate data of all X-axis scanning elements is transmitted to triangle rasterization module
When do not influenced by sequencing, the parallel transmitting of effective coordinate data may be implemented, pass through the second connector realize X-axis scanning
Effective coordinate data is actively transmitted to the effect of triangle rasterization module by unit, to simplify transmittance process, is improved
The rate of triangle data information transmitting.
The triangle rasterization Scan Architecture of the present embodiment is based on UML, and UML is that a kind of definition is good, is easy to express, function
Powerful and blanket modeling language.It has incorporated the new thought of field of software engineering, new method and new technology.Its effect
Domain is not limited to support object oriented analysis and design and design, the software development overall process for also demand analysis being supported to start.UML is proposed
A set of IT professional expects that the unified standard of many years models symbol.By using UML, these personnel can read and exchange
System architecture and design planning.
The triangle rasterization Scan Architecture of the embodiment of the present invention is based on UML, and UML has unified various method reply differences
The different viewpoints of the system of type, different development phases and different internal concepts, to effectively eliminate various modeling languages
Unnecessary difference between speech.UML is actually a kind of general modeling language, can be many Object-oriented Modeling Methods
User is widely used.
The triangle rasterization Scan Architecture of the embodiment of the present invention is based on UML, and UML modeling ability is than other object-orienteds
Modeling method is stronger, and UML is not only suitable for the exploitation of General System, and is especially suitable for parallel, distributed system modeling.
It is provided in an embodiment of the present invention to be based on UML triangle rasterization Scan Architecture, it is integrated with data capture unit, triangle
Shape scan module and triangle rasterization module, data capture unit, triangle scan module and triangle rasterization module it
Between data be transmitted through UML (Unified Modeling Language, Unified Modeling Language) port realize so that X-axis
Scanning can execute parallel with Y-axis stepping, reduce the complexity of triangle rasterization, improve triangle rasterization scanning knot
The scan performance and speed of structure.
It is provided in an embodiment of the present invention to be based on UML triangle rasterization Scan Architecture, realize triangle rasterization process
Middle scanning range define and effectively coordinate data output, solve Zigzag algorithm triangle scan during x-axis scan
The problem of cannot being executed parallel with y-axis stepping.
The Y-axis stepping unit of the embodiment of the present invention realizes the rasterisation stepping of the triangle of GPU, while can be X-axis
Scanning element distributes resource, controls detection elements sweeping along X-axis for second direction scanning element and third direction scanning element
It retouches, meets the requirement of GPU triangle rasterization scanning, while improving the performance of GPU triangle rasterization scanning, accelerate
The speed of triangle rasterization scanning.
It should be noted that first direction is set Y-axis forward direction by the present embodiment, similarly according to the structure of the present embodiment
Y-axis negative sense is set by first direction, GPU triangle rasterization Scan Architecture also may be implemented, do not repeating again, is familiar with this
The personnel of field technology, which are obviously easily envisaged that, sets Y-axis negative sense for first direction, to realize GPU triangular grating
Change Scan Architecture, without having to go through creative labor.Therefore, the present invention is not limited to the above embodiments, those skilled in the art
Announcement according to the present invention, improvement and modification made without departing from the scope of the present invention all should protection scope of the present invention it
It is interior.
Embodiment two
Fig. 5 is referred to, Fig. 5 is the signal of the triangle rasterization scan method provided in an embodiment of the present invention based on UML
Figure.The embodiment of the present invention provides a kind of showing for triangle rasterization scan method based on UML on the basis of the above embodiments
It is intended to, which includes:
Step 1: obtaining triangle data information;
Specifically, Fig. 2 is referred to, triangle data information is the coordinate of Atria point, can be denoted as V0 respectively
(x0, y0), V1 (x1, y1) and V2 (x2, y2), wherein the triangle for rasterizing scanning can be acute triangle, right angle
Triangle and obtuse triangle.
Further, after obtaining triangle data information, the area for judging triangle according to triangle data information is
No is 0, if 0, is not then scanned to triangle, if not 0, then triangle is swept according to triangle data information
It retouches.
Step 2: being scanned according to triangle data information to triangle, and effective coordinate is obtained according to scanning result
Data;
In one embodiment, according to triangle data acquisition of information X-axis origin coordinates, Y-axis detection range;
Specifically, the min coordinates of triangle Y-axis are denoted as Ymin, then Ymin=(y0, y1, y2), i.e. Ymin is y0, y1
With the minimum value in y2, the maximum coordinates of triangle Y-axis are Ymax, then Ymax=(y0, y1, y2), i.e. Ymax is y0, y1 and y2
In maximum value, then Y-axis detection range is denoted as [Ymin, Ymax].
Further, X-axis origin coordinates (X-axis origin coordinates is denoted as X_scan_start) is for the X to triangle
Origin coordinates when axis is scanned determines that the X-axis origin coordinates of triangle rasterization is divided into following situations:
Situation 1, as y0 ≠ y1 ≠ y2, if Ymin=y0, X_scan_start=x0 at this time, if Ymin=y1, X_
Scan_start=x1, Ymin=y2, then X_scan_start=x2;
Situation 2, if Ymin=y0=y1 at this time, needs to judge the size of x0 and x1 as y0=y1 ≠ y2, if x1 > x0,
Then X_scan_start=x0, if x1 < x0, X_scan_start=x1, if Ymin=y2, X_scan_start=x2;
Situation 3, if Ymin=y1=y2 at this time, needs to judge the size of x1 and x2 as y0 ≠ y1=y2, if x2 > x1,
Then X_scan_start=x1, if x2 < x1, X_scan_start=x2, if Ymin=y0, X_scan_start=x0;
Situation 4, if Ymin=y0=y2 at this time, needs to judge the size of x0 and x2 as y0=y2 ≠ y1, if x2 > x0,
Then X_scan_start=x0, if x2 < x0, X_scan_start=x2, if Ymin=y1, X_scan_start=x1.
X-axis origin coordinates be detection elements every time in Y-axis along first direction by after set distance stepping, along X-axis scanning
Origin coordinates starts to be scanned triangle.
In one embodiment, enabled mark carried out to X-axis, and according to the Y-axis detection range, makes detection elements along the
One direction carries out stepping;
Wherein, detection elements can be first (stile) for piece, or pixel.
Specifically, the origin coordinates first by Y-axis stepping is set as Ymin, identifies the enable bit of every a line X-axis scanning
(enable), whether enabling for every a line X-axis is judged by enable bit, if enabled, X-axis scanning element starts to carry out current row
Scanning, if not enabling, detection elements carry out stepping by set distance along first direction stepping, wherein if the X-axis of certain a line
Coordinate includes the coordinate data of triangle, then illustrates that the X-axis is enabled, if not including the coordinate data of triangle, illustrate
The X-axis is enabled.
Preferably, first direction is the forward direction of Y-axis.
Preferably, set distance is a piece member size or a pixel size.
In one embodiment, according to the detection elements after the enabled mark of X-axis and the control stepping of X-axis origin coordinates along X
The scanning of axis;
Specifically, if it is detected that needing the coordinate to the row X-axis to sweep when the enable bit of certain a line X-axis is enabled
It retouches;
Further, according to the enabled mark and X-axis origin coordinates to X-axis, the detection elements after making stepping are in a second direction
It is scanned, according to the enabled mark and X-axis origin coordinates to X-axis, the detection elements after making stepping are swept along third direction
Retouch, that is, when detecting that the enable bit of certain a line X-axis is enabled, then need to the coordinate of the row X-axis in a second direction by setting away from
From being scanned, after the end of scan of second direction, then the coordinate of the row X-axis is swept along third direction by set distance
It retouches, after completing the scanning of coordinate of the row X-axis, then detection elements carry out stepping according to set distance along first direction, carry out
The scanning of the X-axis of next line, and judge whether the Y-coordinate after stepping is in Y-axis detection range, if belonging to Y-axis detection range,
Judge the enable bit of the row X-axis, if enabled, X-axis is scanned according to the method described above, until exceeding Y-axis detection range, then
The end of scan terminates to scan if being not belonging to Y-axis detection range.
Preferably, second direction is that X-axis is positive, and the third direction is X-axis negative sense.
Triangle rasterization scan method provided in an embodiment of the present invention based on UML, X-axis scanning and Y-axis stepping energy
It is enough parallel to execute, reduce the complexity of triangle rasterization, improve triangle rasterization Scan Architecture scan performance and
Speed.
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although
Present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: it still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;
And these are modified or replaceed, technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution spirit and
Range.
Claims (10)
1. a kind of triangle rasterization Scan Architecture based on UML characterized by comprising
Data acquisition module, for obtaining triangle data information;
Triangle scan module connects the data acquisition module by the first connector, for according to the triangle data
Information is scanned the triangle, and obtains effective coordinate data according to scanning result;
Triangle rasterization module connects the triangle scan module by the second connector, for according to effective seat
Mark data rasterize the triangle after scanning.
2. rasterisation Scan Architecture according to claim 1, which is characterized in that the triangle scan module includes:
Initialization unit connects the data capture unit by the first connector, for according to the triangle data information
Obtain X-axis origin coordinates, Y-axis detection range;
Y-axis stepping unit connects the initialization unit, for carrying out enabled mark to X-axis, and detects model according to the Y-axis
Enclosing makes detection elements carry out stepping along first direction;
Several X-axis scanning elements are separately connected the Y-axis stepping unit, for being originated according to the enabled mark and the X-axis
Coordinate, the detection elements after making stepping are scanned along X-axis.
3. rasterisation Scan Architecture according to claim 2, which is characterized in that second connector includes that several sons connect
Interface, each X-axis scanning element are connect by a corresponding sub- connector with the triangle rasterization module.
4. rasterisation Scan Architecture according to claim 2, which is characterized in that the X-axis scanning element includes:
Second direction scanning element, by connecting the Y-axis stepping unit with door, for according to the enabled mark and described
X-axis origin coordinates, the detection elements after making stepping are scanned in a second direction;
Third direction scanning element, by connecting the Y-axis stepping unit with door, for according to the enabled mark and described
X-axis origin coordinates, the detection elements after making stepping are scanned along third direction.
5. rasterisation Scan Architecture according to claim 3, which is characterized in that the second direction scanning element is also used to
It completes to mark by providing the first of the detection elements to the Y-axis stepping unit with door.
6. rasterisation Scan Architecture according to claim 3, which is characterized in that the third direction scanning element is also used to
It completes to mark by providing the second of the detection elements to the Y-axis stepping unit with door.
7. rasterisation Scan Architecture according to claim 1, which is characterized in that the data acquisition module is FIFO.
8. a kind of triangle rasterization scan method based on UML characterized by comprising
Obtain triangle data information;
The triangle is scanned according to the triangle data information, and effective number of coordinates is obtained according to scanning result
According to;
The triangle after scanning is rasterized according to effective coordinate data.
9. rasterisation scan method according to claim 8, which is characterized in that according to the triangle data information to institute
Triangle is stated to be scanned, comprising:
According to the triangle data acquisition of information X-axis origin coordinates, Y-axis detection range;
Enabled mark is carried out to X-axis, and so that detection elements is carried out stepping along first direction according to the Y-axis detection range;
According to the enabled mark and the X-axis origin coordinates, the detection elements after making stepping are scanned along X-axis.
10. rasterisation scan method according to claim 9, which is characterized in that it is characterized in that, according to the enabled mark
Know and the X-axis origin coordinates, the detection elements after making control stepping be scanned along X-axis, comprising:
According to the enabled mark and the X-axis origin coordinates, the detection elements after making stepping are scanned in a second direction;
According to the enabled mark and the X-axis origin coordinates, the detection elements after making control stepping are carried out along third direction
Scanning.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811355047.4A CN109584334B (en) | 2018-11-14 | 2018-11-14 | Triangular rasterization scanning structure and rasterization scanning method based on UML |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811355047.4A CN109584334B (en) | 2018-11-14 | 2018-11-14 | Triangular rasterization scanning structure and rasterization scanning method based on UML |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109584334A true CN109584334A (en) | 2019-04-05 |
CN109584334B CN109584334B (en) | 2023-04-07 |
Family
ID=65922497
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811355047.4A Active CN109584334B (en) | 2018-11-14 | 2018-11-14 | Triangular rasterization scanning structure and rasterization scanning method based on UML |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109584334B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111091487A (en) * | 2019-11-18 | 2020-05-01 | 中国航空工业集团公司西安航空计算技术研究所 | TLM microstructure for GPU hardware line element rasterization scanning algorithm |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060132495A1 (en) * | 2004-12-21 | 2006-06-22 | Anderson Michael H | 2D/3D line rendering using 3D rasterization algorithms |
JP2010055611A (en) * | 2008-08-29 | 2010-03-11 | Fujitsu Ltd | Triangle traversing method and device in graphics rasterization |
CN102004832A (en) * | 2010-11-22 | 2011-04-06 | 长沙景嘉微电子有限公司 | Realization of triangle rasterization based on horizontal line scanning |
CN108009978A (en) * | 2017-11-24 | 2018-05-08 | 中国航空工业集团公司西安航空计算技术研究所 | A kind of non-parallel triangle rasterization cellular construction of obstruction |
CN108022201A (en) * | 2017-11-24 | 2018-05-11 | 中国航空工业集团公司西安航空计算技术研究所 | A kind of triangle primitives rasterize method for sequencing parallel |
-
2018
- 2018-11-14 CN CN201811355047.4A patent/CN109584334B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060132495A1 (en) * | 2004-12-21 | 2006-06-22 | Anderson Michael H | 2D/3D line rendering using 3D rasterization algorithms |
JP2010055611A (en) * | 2008-08-29 | 2010-03-11 | Fujitsu Ltd | Triangle traversing method and device in graphics rasterization |
CN102004832A (en) * | 2010-11-22 | 2011-04-06 | 长沙景嘉微电子有限公司 | Realization of triangle rasterization based on horizontal line scanning |
CN108009978A (en) * | 2017-11-24 | 2018-05-08 | 中国航空工业集团公司西安航空计算技术研究所 | A kind of non-parallel triangle rasterization cellular construction of obstruction |
CN108022201A (en) * | 2017-11-24 | 2018-05-11 | 中国航空工业集团公司西安航空计算技术研究所 | A kind of triangle primitives rasterize method for sequencing parallel |
Non-Patent Citations (2)
Title |
---|
聂等: "一种并行扫描的三角形光栅化算法设计与实现", 《信息通信》 * |
聂等: "基于Zigzag块扫描的光栅化算法设计与实现", 《科技风》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111091487A (en) * | 2019-11-18 | 2020-05-01 | 中国航空工业集团公司西安航空计算技术研究所 | TLM microstructure for GPU hardware line element rasterization scanning algorithm |
CN111091487B (en) * | 2019-11-18 | 2023-10-20 | 中国航空工业集团公司西安航空计算技术研究所 | TLM microstructure for GPU hardware line primitive raster scanning algorithm |
Also Published As
Publication number | Publication date |
---|---|
CN109584334B (en) | 2023-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105556571B (en) | Use and calculates tinter as the front end of vertex shader | |
CN101739357B (en) | Multi-class data cache policies | |
US9299123B2 (en) | Indexed streamout buffers for graphics processing | |
KR101076245B1 (en) | Relative address generation | |
US7408553B1 (en) | Inside testing for paths | |
US20100079457A1 (en) | Fragment Shader for a Hybrid Raytracing System and Method of Operation | |
US20140118351A1 (en) | System, method, and computer program product for inputting modified coverage data into a pixel shader | |
US20040212619A1 (en) | Image rendering device and image rendering method | |
JPH05282458A (en) | Plural extensible image buffers for graphics system | |
KR20080067840A (en) | 3-dimensional graphics accelerator and method of distributing pixel thereof | |
KR100882842B1 (en) | Apparatus to use a fifo as a post-vertex cache and method thereof | |
US7684641B1 (en) | Inside testing for paths using a derivative mask | |
CN101751285A (en) | Centralized device virtualization layer for heterogeneous processing units | |
JPS62271066A (en) | Graphic processor for displaying object | |
US8174524B1 (en) | Ray hit coalescing in a computer rendering program | |
CN107209951B (en) | The sputtering of single pass surface | |
CN105574808B (en) | A kind of pipeline texture textures cellular system | |
CN113012269A (en) | Three-dimensional image data rendering method and equipment based on GPU | |
EP3050605B1 (en) | A method for event detection in real-time graphic applications | |
CN113379886B (en) | Three-dimensional rendering method, device, equipment and storage medium of geographic information system | |
CN109584334A (en) | A kind of triangle rasterization Scan Architecture and rasterisation scan method based on UML | |
CN112614210B (en) | Engineering drawing display method, system and related device | |
CN109346028B (en) | TLM-based triangular raster scanning structure | |
CN111127590B (en) | Second-order Bezier curve drawing method and device | |
CN109598669A (en) | A kind of triangle rasterization Scan Architecture towards GPU |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |