CN102722902B - Anti-aliasing the improving one's methods of rasterization stage in a kind of graph rendering streamline - Google Patents

Anti-aliasing the improving one's methods of rasterization stage in a kind of graph rendering streamline Download PDF

Info

Publication number
CN102722902B
CN102722902B CN201110116359.1A CN201110116359A CN102722902B CN 102722902 B CN102722902 B CN 102722902B CN 201110116359 A CN201110116359 A CN 201110116359A CN 102722902 B CN102722902 B CN 102722902B
Authority
CN
China
Prior art keywords
aliasing
color
value
depth
rasterization stage
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.)
Expired - Fee Related
Application number
CN201110116359.1A
Other languages
Chinese (zh)
Other versions
CN102722902A (en
Inventor
蔡欢
张君琦
郑培枫
孙季川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Digital Video Beijing Ltd
Original Assignee
China Digital Video Beijing Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by China Digital Video Beijing Ltd filed Critical China Digital Video Beijing Ltd
Priority to CN201110116359.1A priority Critical patent/CN102722902B/en
Publication of CN102722902A publication Critical patent/CN102722902A/en
Application granted granted Critical
Publication of CN102722902B publication Critical patent/CN102722902B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Generation (AREA)

Abstract

The invention discloses anti-aliasing the improving one's methods of rasterization stage in a kind of graph rendering streamline, comprising: before rasterization stage, according to anti-aliasing rank, prepare color buffer district and the depth buffer of amplifying and initialize; The triangular plate that forms object is carried out to rasterization process successively; After all triangular plates are all handled, color buffer district is narrowed down to original size, obtain anti-aliasing rendering result. By embodiments of the present invention, can effectively improve in the computational efficiency having in texture situation.

Description

Anti-aliasing the improving one's methods of rasterization stage in a kind of graph rendering streamline
Technical field
The present invention relates to the captions process field in television program designing field, relate in particular to a kind of figure wash with watercoloursDye anti-aliasing the improving one's methods of rasterization stage in streamline.
Background technology
Caption system is widely used in video production field, is also the important composition of application video techniquePart, and TV subtitling is as a kind of TV programme key element of indispensability is a kind of important teletextRepresent form.
From the angle of broad sense, the final purpose that the handled caption object of TV subtitling is played up is basisPatterned Vector Message and image texture, the related algorithm of employing Digital Image Processing, obtains by 32One two field picture of the pixel composition that RGBA represents. In order to obtain stable image clearly, it is right conventionally to needCaption object is carried out anti-aliasing processing. Anti-aliasing Technology is mainly used for eliminating the display device that dot matrix formsImage continuity on rounded coordinate is destroyed, and figure shows the jagged situation of not round and smooth appearance.
In prior art, graph rendering is mainly realized based on PaintShop GPU, the work of GPUCarry out with streamline form, streamline is a series ofly can walk abreast and carry out in a fixed orderStage, each stage from previous stage receives input, then output is sent to follow-up phase.What general tri-dimensional application program was passed to GPU is summit, color, the second color (reflection), texture, textureThe data such as coordinate, normal vector, light, pel assembly information, even anti-aliasing processing method can be directBe applied in the rasterization stage at graph rendering streamline, but normally in need whole region to be processedThe color of all sampled points is calculated, and then whole sampled point colors is averaged that to obtain pixel anti-aliasingColor value, thereby obtain stable image clearly.
Inventor, in enforcement process of the present invention, finds that prior art exists following technical problem:
(1) rendering speed is slow, when particularly having multilayer texture;
(2) render process complexity, need to calculate all sampled points;
Summary of the invention
In order to solve the shortcoming of above-mentioned prior art, main purpose of the present invention is to provide a kind of graph renderingWhat in streamline, rasterization stage was anti-aliasing improves one's methods, to improve in the computational efficiency having in texture situation,And the edge to object and intersect boundary have good treatment effect.
In order to achieve the above object, the invention provides in a kind of graph rendering streamline rasterization stage anti-What lose shape improves one's methods, and specifically comprises:
Before rasterization stage, according to anti-aliasing rank, color buffer district and the degree of depth preparing to amplify are delayedRush district and initialize;
The triangular plate that forms object is carried out to rasterization process successively;
After all triangular plates are all handled, color buffer district is narrowed down to original size, counter walkedThe rendering result of sample.
Embodiments of the present invention by first preparing anti-aliasing required color buffer before anti-aliasing processingThen district carries out rasterization process to triangular plate and after rasterization process completes, is contracted in color buffer districtLittle anti-aliasing the improving one's methods to original size can be improved the computational efficiency having in texture situation, betterThe anti-aliasing effect that realizes 3 d rendering engine.
Brief description of the drawings
For the technical scheme of the clearer explanation embodiment of the present invention, required in describing embodiment belowThe accompanying drawing using is briefly described, apparent, and the accompanying drawing in the following describes is only the present inventionSome embodiment, for those of ordinary skill in the art, in the prerequisite of not paying creative workUnder, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the anti-aliasing improvement of rasterization stage in a kind of graph rendering streamline of the embodiment of the present inventionThe flow chart of method;
Fig. 2 is anti-aliasing the changing of rasterization stage 8X in a kind of graph rendering streamline of the embodiment of the present inventionEnter the block diagram of method;
Fig. 3 is the scan line schematic diagram of the anti-aliasing zonule taking 2*4 of embodiment of the present invention 8X as unit.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried outClear, complete description, obvious described embodiment is only a part of embodiment of the present invention, is notWhole embodiment, based on the embodiment in the present invention, those of ordinary skill in the art are not paying woundThe every other embodiment obtaining under the property made work prerequisite, belongs to the scope of protection of the invention.
Anti-aliasing improving one's methods of the present invention is the rasterization stage that is applied in graph rendering streamline, isCan not rely on GPU, the independent render engine that can realize. In addition, because rasterization stage adopts scanningLine algorithm, thus to realize the anti-aliasing of rasterization stage, X, Y-direction sampled point adopts regular m*nMode. Sampled point mode comprises 2X (1*2) as required at present, 4X (2*2), and 8X (2*4),16X (4*4), the sample modes such as 32X (4*8). As taking 8X as example, directions X adopts two samplingsPoint, Y-direction adopts 4 sampled points.
The embodiment of the present invention provides on the one hand in a kind of graph rendering streamline rasterization stage anti-aliasingImprove one's methods, implementing procedure as shown in Figure 1, is specially:
Step S1: prepare color buffer district and the depth buffer of anti-aliasing needs and initialize. Obtain and work asThe data on first three three summit of gusset plate, the position vPos in screen space, depth value fDepth, summit lightAccording to color vColor, the uv coordinate vUV[8 of every layer texture] (maximum eight layer texture). Realize anti-aliasing,The X of vertex position vPos, Y component are multiplied by respectively to X, the anti-aliasing multiple m of Y-direction, n orBe called sample mode, be designated as m*n.
Step S2: calculate the bounding box of triangular plate, and the directions X border of this bounding box is the integer of mDoubly, Y-direction border is the integral multiple of n.
Step S3: calculate the starting and terminal point position of the scan line in bounding box region and the degree of depth of starting and terminal pointValue, the depth value of above-mentioned starting and terminal point position and starting and terminal point be position by three summits of triangular plate andDepth value interpolation obtains.
Step S4: taking the zonule of m*n as unit, in triangular plate inside and depth value to be greater than the degree of depth slowRush the x of the pixel of the depth value in district, the weighted value (relative position in region) of y direction is added respectivelyBe designated as fSumX, fSumY, and total number iCount is added to 1, and this pixel of mark is TRUE.Wherein fSumX, fSumY, iCount initial value is all designated as 0. If iCount is 0, continue to repeatStep S4, otherwise carry out step S5.
Step S5: by fSumX, fSumY is divided by total iCount according to the weighted value obtaining in step S4Obtain x, the value of y direction, and calculate with respect to a position in sampled point zonule, this position conductNeed to calculate the position of color.
Step S6: obtain current summit according to the position of the color of triangular plate vertex position and above-mentioned calculatingAfter illumination color and texture coordinate value, calculate the color of current location.
Step S7: the color of the current location calculating is assigned to and is positioned at triangular plate and depth value in S4Be greater than the pixel of the depth value in depth buffer.
Step S8: after according to the method described above all triangular plates all being handled, color buffer district is dwindledTo original size, obtain anti-aliasing rendering result.
Embodiments of the present invention by first preparing anti-aliasing required color buffer before anti-aliasing processingDistrict, then the color of an assigned address in calculating sampling point regional extent gives region by this color valueSub-pixel in scope, then carries out rasterization process to triangular plate and after rasterization process completesColor buffer district is narrowed down to original size anti-aliasing improve one's methods to improve having in texture situationComputational efficiency, better realizes the anti-aliasing effect of 3 d rendering engine.
Below taking sampled point as 8X as example and in conjunction with Fig. 2 the graph rendering streamline to the embodiment of the present invention oneWhat middle rasterization stage was anti-aliasing improve one's methods carries out more detailed elaboration, is specially:
Step S1: by the X of vPos, it is that directions X is multiplied by 2, Y that Y-direction is multiplied by respectively anti-aliasing multipleDirection is multiplied by 4, and to make color buffer district and depth buffer canned data amount be 8 need not be anti-aliasing timeDoubly. Before rasterization stage, prepare color buffer district and the depth buffer initial of anti-aliasing needsChange.
Step S2: calculate the minimum bounding box of triangular plate, directions X border is 2 multiple, and Y-direction is4 multiple.
Step S3: according to 8X sampled point calculate the scan line in bounding box region starting and terminal point position andThe depth value of starting and terminal point, and be to obtain by position and the depth value interpolation on three summits.
Step S4: note fSumX, fSumY is 0, iCount=0; The 8X of the present embodiment anti-aliasing withThe zonule of 2*4 is unit, by position and the depth value of 3 scan lines, and specifically can be shown in Figure 3.Judge in this region that each pixel is whether in triangular plate, and calculate the depth value of each pixel, enterRow depth detection (namely with depth buffer in depth value compare, as be greater than this value, representClose to observer, be not blocked). In this way, use the depth value of this pixel is replaced to the phase in depth bufferAnswer the depth value of position, and by the X of this pixel, the weight of Y-direction (with respect to whole 2*4 region)Add fSumX, fSumY, and iCount adds 1, and this pixel of mark bFlag is TRUE.
Step S5: if iCount=0 continues to calculate next 2*4 zonule; Otherwise carry out step S6.
Step S6: by fSumX, fSumY, divided by iCount, obtains X, the value of Y-direction, and beWith respect to the positional value of zonule, according to the position of zonule, calculate the absolute value of this position, be designated asvTempPos。
Step S7: the color of calculating current location. According to position and the vTempPos on three summits of triangular plateValue, determine the weight on three summits of triangular plate, be multiplied by phase by color and the texture coordinate value on three summitsAnswer the weight on summit and be added, obtaining illumination color and the texture coordinate value at current location vTempPos place(if any texture). Illumination color is mixed with texture color, ground floor texture and illumination blend of colors meterCalculation obtains color value color, if there is second layer texture, does mixed juice with color value color above againCalculate, the rest may be inferred, until obtain final color value.
Step S8: the color that step 7 is calculated be assigned in 2*4 lattice and at triangular plate inner andBe that the pixel that is labeled as TRUE in step S4 is carried out filling out of color buffer district by the sub-pixel of depth testFill.
Step S9: after all triangular plates are all handled, it is 8 that color buffer district is narrowed down to original sizeIndividual sampled point color is synthesized a color, obtains anti-aliasing rendering effect.
Embodiments of the present invention by first preparing anti-aliasing required color buffer before anti-aliasing processingDistrict, then the color of an assigned address in calculating sampling point regional extent gives region by this color valueSub-pixel in scope, then carries out rasterization process to triangular plate and after rasterization process completesColor buffer district is narrowed down to original size anti-aliasing improve one's methods to improve having in texture situationComputational efficiency, and edge and intersect boundary to object have good treatment effect, better realizes threeThe anti-aliasing effect of dimension render engine.
Through the above description of the embodiments, those skilled in the art can be well understood to thisBright can realization by software, the mode that also can add necessary general hardware platform by software realizes.Based on such understanding, technical scheme of the present invention can embody with the form of software product, and this is softPart product can be stored in a non-volatile memory medium, and (can be CD-ROM, USB flash disk, moves hardDish etc.) in, comprise that some instructions are in order to make a computer equipment (can be personal computer, takeBusiness device, or the network equipment etc.) carry out the method described in each embodiment of the present invention.
The above, be only a best specific embodiment of the present invention, but not office of feature of the present inventionBe limited to this, any people who is familiar with this technology in field of the present invention, the variation that can expect easily or modification,All should be encompassed in following claim of the present invention.

Claims (12)

1. anti-aliasing the improving one's methods of rasterization stage in a graph rendering streamline, is characterized in that,Comprise:
Step 1, before rasterization stage, according to anti-aliasing rank, prepare amplify color buffer district andDepth buffer also initializes;
Step 2, carries out rasterization process successively to the triangular plate that forms object, and concrete grammar is:
Calculate the bounding box of triangular plate;
Calculate the starting and terminal point position of the scan line in bounding box region and the depth value of starting and terminal point;
To in triangular plate inside and the depth value pixel that is greater than the depth value of depth buffer carry out x, y directionWeighted value calculates and carries out element marking;
Obtain the position that need to calculate color;
Calculate the color of current location;
The described color that calculates current location is assigned to the pixel of mark;
Step 3, after all triangular plates are all handled, narrows down to original size by color buffer district,To anti-aliasing rendering result.
2. anti-aliasing the improving one's methods of rasterization stage in graph rendering streamline as claimed in claim 1,It is characterized in that, color buffer district and depth buffer that described preparation is amplified are specially:
By the X of the position in plane space, Y component is multiplied by respectively X, and the anti-aliasing multiple of Y-direction obtainsColor buffer district and the depth buffer of anti-aliasing needs.
3. anti-aliasing the improving one's methods of rasterization stage in graph rendering streamline as claimed in claim 1,It is characterized in that, also before initialization, go back in color buffer district and the depth buffer of preparing anti-aliasing needsComprise position, depth value, summit light in data, the screen space that obtains three summits of current triangular plateAccording to the coordinate of color and every layer texture.
4. anti-aliasing the improving one's methods of rasterization stage in graph rendering streamline as claimed in claim 1,It is characterized in that, the bounding box of described calculating object is triangular plate x, and the border of y direction is respectively x, yDirection hits m, the integral multiple of n.
5. anti-aliasing the improving one's methods of rasterization stage in graph rendering streamline as claimed in claim 1,It is characterized in that, the starting and terminal point position of the scan line in described calculating bounding box region and starting and terminal pointDepth value is to obtain by the position on three summits of triangular plate and depth value interpolation.
6. anti-aliasing the improving one's methods of rasterization stage in graph rendering streamline as claimed in claim 1,It is characterized in that, described in triangular plate inside and depth value be greater than the pixel of the depth value of depth bufferCarry out x, y direction weighted value before calculating, also need judge with in sample mode m*n zonule unit oftenWhether individual pixel is in triangular plate inside.
7. anti-aliasing the improving one's methods of rasterization stage in graph rendering streamline as claimed in claim 6,It is characterized in that, whether the each pixel in the described m*n of judgement zonule unit is logical in triangular plate insideThe position of overscanning line and depth value judge.
8. anti-aliasing the improving one's methods of rasterization stage in graph rendering streamline as claimed in claim 7,It is characterized in that, describedly judge whether in triangular plate inside afterwards also each pixel in m*n zonule unitNeed to carry out depth detection to depth value, describedly depth value is carried out to depth detection be specially: calculate m*nIn the unit of zonule and at the depth value of each pixel of triangular plate inside, with the degree of depth in depth bufferValue compares, if be greater than this value, the depth value of this pixel is replaced to the corresponding positions in depth bufferThe depth value of putting.
9. anti-aliasing the improving one's methods of rasterization stage in graph rendering streamline as claimed in claim 1,It is characterized in that, described in obtain the position concrete grammar that need to calculate color and be: inner and dark at triangular plateDegree value is greater than the x of the pixel of the depth value of depth buffer, y direction weighted value be added after value divided by sum,Obtain X, the value of Y-direction, and be the positional value with respect to m*n zonule, according to the position of zonulePut, calculate the absolute value of this position.
10. the anti-aliasing improvement side of rasterization stage in graph rendering streamline as claimed in claim 1Method, is characterized in that, the color of described calculating current location is according to triangular plate vertex position and described meterThe position of color of calculating obtains after the illumination color and texture coordinate value of current location, and by illumination color andTexture color is mixed to get.
The anti-aliasing improvement side of rasterization stage in 11. graph rendering streamlines as claimed in claim 10Method, is characterized in that, the color that described illumination color and texture color are mixed to get current location is specially:Ground floor texture and illumination blend of colors calculate color value, if there is second layer texture, with aboveColor value do again mix calculate, the rest may be inferred, until obtain final color value.
The anti-aliasing improvement side of rasterization stage in 12. graph rendering streamlines as claimed in claim 1Method, is characterized in that, describedly color buffer district is narrowed down to original size is specially m*n sampled pointBlend of colors becomes a color.
CN201110116359.1A 2011-05-06 2011-05-06 Anti-aliasing the improving one's methods of rasterization stage in a kind of graph rendering streamline Expired - Fee Related CN102722902B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110116359.1A CN102722902B (en) 2011-05-06 2011-05-06 Anti-aliasing the improving one's methods of rasterization stage in a kind of graph rendering streamline

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110116359.1A CN102722902B (en) 2011-05-06 2011-05-06 Anti-aliasing the improving one's methods of rasterization stage in a kind of graph rendering streamline

Publications (2)

Publication Number Publication Date
CN102722902A CN102722902A (en) 2012-10-10
CN102722902B true CN102722902B (en) 2016-05-04

Family

ID=46948648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110116359.1A Expired - Fee Related CN102722902B (en) 2011-05-06 2011-05-06 Anti-aliasing the improving one's methods of rasterization stage in a kind of graph rendering streamline

Country Status (1)

Country Link
CN (1) CN102722902B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107481307B (en) * 2017-07-05 2023-04-07 国网山东省电力公司泰安供电公司 Method for rapidly rendering three-dimensional scene
CN108022201B (en) * 2017-11-24 2021-09-14 中国航空工业集团公司西安航空计算技术研究所 Parallel rasterization sequencing method for triangle primitives
CN108009978B (en) * 2017-11-24 2021-04-20 中国航空工业集团公司西安航空计算技术研究所 Non-blocking parallel triangular rasterization unit structure
CN108519867B (en) * 2018-04-12 2022-08-19 长沙景美集成电路设计有限公司 Device and method for realizing triangle anti-aliasing in GPU
CN109102456B (en) * 2018-08-07 2023-05-23 南京军微半导体科技有限公司 Triangle rasterization accelerator for correcting 3D graphics rendering by line scanning perspective
CN111798372B (en) * 2020-06-10 2021-07-13 完美世界(北京)软件科技发展有限公司 Image rendering method, device, equipment and readable medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101114380A (en) * 2006-03-10 2008-01-30 株式会社东芝 Image processing apparatus and image processing method
CN101620725A (en) * 2008-07-03 2010-01-06 辉达公司 Hybrid multisample/supersample antialiasing
CN101901590A (en) * 2009-05-25 2010-12-01 富士通株式会社 Method and system for anti-aliased polygonal rasterization

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101114380A (en) * 2006-03-10 2008-01-30 株式会社东芝 Image processing apparatus and image processing method
CN101620725A (en) * 2008-07-03 2010-01-06 辉达公司 Hybrid multisample/supersample antialiasing
CN101901590A (en) * 2009-05-25 2010-12-01 富士通株式会社 Method and system for anti-aliased polygonal rasterization

Also Published As

Publication number Publication date
CN102722902A (en) 2012-10-10

Similar Documents

Publication Publication Date Title
JP6678209B2 (en) Gradient adjustment for texture mapping to non-orthonormal grid
CN102722902B (en) Anti-aliasing the improving one's methods of rasterization stage in a kind of graph rendering streamline
JP6293923B2 (en) Tilt adjustment of texture mapping for multiple rendering targets with different resolutions depending on screen position
KR101922482B1 (en) Varying effective resolution by screen location by changing active color sample count within multiple render targets
EP2705501B1 (en) Texturing in graphics hardware
JP2010102713A (en) Method of and apparatus for processing computer graphics
CN104318605B (en) Parallel lamination rendering method of vector solid line and three-dimensional terrain
CN102737401A (en) Triangular plate filling method in rasterization phase in graphic rendering
EP1480171B1 (en) Method and system for supersampling rasterization of image data
US7733354B1 (en) Anti-aliased rendering
EP2804149B1 (en) Water representation by color gradients on a digital map
JP2003109031A (en) Device and method for processing image rendering, recording medium recorded with image rendering processing program and image rendering processing program
US7495672B2 (en) Low-cost supersampling rasterization
JP4801088B2 (en) Pixel sampling method and apparatus
CN101930340B (en) Method for generating lighting effect by simulating real page turning for electronic book
EP1431920B1 (en) Low-cost supersampling rasterization
EP2992512A1 (en) Anti-aliasing for geometries
JP3872056B2 (en) Drawing method
KR100927131B1 (en) Method and system of anti-aliasing
CN115761100A (en) Scene rendering method and device, electronic equipment and storage medium
SE534866C2 (en) Method for creating high-resolution display systems with multiple projectors

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent for invention or patent application
CB03 Change of inventor or designer information

Inventor after: Cai Huan

Inventor after: Zhang Junqi

Inventor after: Zheng Peifeng

Inventor after: Sun Jichuan

Inventor before: Cai Huan

Inventor before: Zhang Junqi

Inventor before: Zheng Peifeng

COR Change of bibliographic data

Free format text: CORRECT: INVENTOR; FROM: CAI HUAN ZHANG JUNQI ZHENG PEIFENG TO: CAI HUAN ZHANG JUNQI ZHENG PEIFENG SUN JICHUAN

C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160504

Termination date: 20180506