CN102752515B - Implementation method of flame effect at programmable stage in graphics rendering - Google Patents
Implementation method of flame effect at programmable stage in graphics rendering Download PDFInfo
- Publication number
- CN102752515B CN102752515B CN201110121893.1A CN201110121893A CN102752515B CN 102752515 B CN102752515 B CN 102752515B CN 201110121893 A CN201110121893 A CN 201110121893A CN 102752515 B CN102752515 B CN 102752515B
- Authority
- CN
- China
- Prior art keywords
- flame
- color
- texture
- programmable
- vertex
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Abstract
The invention discloses an implementation method of a flame effect at a programmable stage in graphics rendering. The method includes processing a vertex position and a vertex texture coordinate at a programmable vertex processing stage; calculating main colors and flame colors of fragments in each frame in a programmable fragment processor stage; and mixing the main colors and the flame colors to form the flame effect. According to the method, each frame can be located, a front frame and a back frame have no relevance, parallelism of graphics processing unit (GPU) is fully used, and the rendering efficiency is high.
Description
Technical field
The present invention relates to the captions manufacture technology field in broadcasting and TV field, more particularly to a kind of figure renders middle programmable phase
The implementation method of flame effect.
Background technology
With computer graphical, image, video technique continuous development, add domestic radio, TV and film industries be in it is clear from standard
The TV record and broadcast units such as period of the clear degree pattern to high-definition mode transition, television station are proposed more to teletext record and broadcast
Requirement that is high, updating.Require greatly to strengthen, enrich picture and text broadcast effect, represent visual impact.
The dynamic broadcast for making that many stunts realize pel is may require that in video caption manufacturing process, is fallen including wave
Shadow, radial blur, motion blur, phantom, butterfly, flame etc., the realization of flame stunt be the mixing of main body and flame color and
Obtain.
For the realization of flame effect mainly has two methods in prior art, a kind of realized based on pixel, another
The method of kind is namely based on particIe system realization, and two methods are all based on CPU realizations.
For above two realizes the implementation method of flame effect, inventor find to exist in process of the present invention is implemented with
Lower technical problem:
(1) implementation method based on pixel, a later frame are based on former frame, it is impossible to which definite navigates to each frame on timeline
Effect.
(2) method realized based on particIe system, because each frame is all affected by random number, can not navigate to timeline
On each frame.
(3) above two method is all realized on CPU, it is impossible to make full use of the concurrency that GPU is rendered, efficiency compared with
It is low.
The content of the invention
In order to solve the shortcoming of above-mentioned prior art, the main object of the present invention is to provide a kind of figure and renders programmable rank
The implementation method of section flame effect, is realized based on GPU (Graphic Processing Unit, graphic process unit), can be with
Each frame is navigated to, two frames do not have relatedness in front and back, realize efficiency high.
In order to achieve the above object, the invention provides a kind of figure renders the realization side of programmable phase flame effect
Method, specifically includes:
Processing stage programmable vertex, opposite vertexes position and vertex texture coordinate are processed;
The body color and flame color of fragment are calculated in the programmable fragment processor stage to every frame;
The body color is mixed to form flame effect with the flame color result.
The present invention provide figure render programmable phase flame effect implementation method can navigate to each frame and
Two frames do not have relatedness in front and back.On the other hand the implementation method of the present invention is realized based on GPU, takes full advantage of GPU's
Concurrency, realizes efficiency high.
Description of the drawings
For the technical scheme of the clearer explanation embodiment of the present invention, below will be to using needed for embodiment description
Accompanying drawing be briefly described, it is clear that, drawings in the following description are only some embodiments of the present invention, for this
For the those of ordinary skill of field, on the premise of not paying creative work, can be with other according to these accompanying drawings acquisitions
Accompanying drawing.
Fig. 1 is the implementation method block diagram that a kind of figure of the embodiment of the present invention renders middle programmable phase flame effect;
Fig. 2 is the method stream processed by embodiment of the present invention programmable vertex processor stage opposite vertexes and texture coordinate
Cheng Tu;
Four vertex information schematic diagrams of the Fig. 3 for embodiment of the present invention two-dimensional bodies.
Fig. 4 is the embodiment of the present invention programmable fragment processor stage texture to be carried out processing sampling schematic diagram;
Fig. 5 is the method schematic diagram that the embodiment of the present invention calculates fragment colors.
Specific embodiment
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 out clear, complete
Whole description, it is clear that described embodiment is only a part of embodiment of the present invention, is not all, of embodiment, based on this
Embodiment in bright, the every other enforcement obtained under the premise of creative work is not paid by those of ordinary skill in the art
Example, belongs to the scope of protection of the invention.
Flame burns upwards, needs the effect of flame in the top of object and left and right region.Therefore fire to be formed
Flame effect is accomplished by calculating segment body color and flame color is mixed.The embodiment of the present invention one provides a kind of figure wash with watercolours
The implementation method of programmable phase flame effect in dye, flow process as shown in Figure 1, specially:
Step S1:Processing stage programmable vertex, opposite vertexes position and vertex texture coordinate are processed.In view of fire
The combustion efficiency upwards of flame needs the object coordinates of the largest contours opposite vertexes of the budget stunt effect whole story to be amplified and synchronous
Amplify the texture coordinate of object.
The method and step processed in programmable vertex processor stage opposite vertexes and texture coordinate is as shown in Fig. 2 concrete
It is as follows:
Step S11:The coordinate of opposite vertexes is amplified, because in object coordinates system, center for (0,0), therefore only need to
Apex coordinate is multiplied by an amplification can just to realize amplifying.Four vertex information schematic diagrams of the Fig. 3 for two-dimensional bodies, if
Apex coordinate is Pos, and the x coordinate of Pos is amplified 1.1 times in the present invention.Judge that the y values of Pos, whether more than 0, if greater than 0 are
Summit 0 and summit 3, are amplified to y directions, and the multiple that y directions are amplified has relation with flame combustion degree, and summit y values are changed into
Posy* (1+fBurnFactor), wherein, Posy represents the y-component of position Pos, and fBurnFactor is burning degree coefficient.
Step S12:According to the amplification on the summit of step S11, and because texture coordinate Bu centers and in the upper left corner, institute
To proceed as follows to texture coordinate UV:
Texture x directions coordinate is (UVx-0.5) * 1.1+0.5;
When the y directions on summit are amplified, corresponding texture y directions coordinate is (UVy-0.5) * (1+
fBurnFactor)+0.5;
Step S2:Texture is sampled in body region, obtain the color of main body.For example, at programmable fragment
Reason device stage is processed to texture, to texture coordinate (0,0)~(1,1) between region sampled, obtain main body
Color.The region 1 of innermost layer i.e. shown in Fig. 4.
Step S3:The Noise texture of relevant position is sampled according to present frame, obtain its color component rgba colors
Value, color component rgba is by 1.5,1.1,0.9,0 ratio phase adduction using result as random number.
Flame is a kind of effect burnt upwards, it is desirable to have random number affects the effect of flame.Therefore in this effect
Add a layer texture as Noise texture to obtain random number.The computational methods of random number can be:In the process of progress 0 to 1
In, by certain rule, such as u=0.2, v=u_progress etc., texture is the texture of two dimension, needs u, two value ability of v
Relevant position is sampled, the color at Noise texture uv is obtained, its color component rgba values can be multiplied by one respectively and be
Number is used as random number.
Step S4:The color of current clip is calculated, the face of some parent moieties below institute's selected episode in certain area is taken
Color, carries out processing the flame color for obtaining current clip.Concrete processing method is can be found in shown in Fig. 5:8*3 position below Chooser
The fragment values put are acted on random number in S3 respectively, and addition obtains the flame color of current clip.
Step S5:Main body rendering result in step S1 is mixed with the flame rendering result of step S4, flame is obtained
The effect of burning.
The present invention provide figure render programmable phase flame effect implementation method can navigate to each frame and
Two frames do not have relatedness in front and back.On the other hand the implementation method of the present invention is realized based on GPU, takes full advantage of GPU's
Concurrency, realizes efficiency high.
Through the above description of the embodiments, those skilled in the art can be understood that the present invention can be led to
Cross software realization, it is also possible to by software plus necessary general hardware platform mode realizing.Based on such understanding, this
Bright technical scheme can be embodied in the form of software product, and the software product can be stored in a non-volatile memories
Medium (can be CD-ROM, USB flash disk, portable hard drive etc.) in, use so that a computer equipment (can be including some instructions
Personal computer, server, or network equipment etc.) perform method described in each embodiment of the invention.
The above, an only optimal specific embodiment of the present invention, but the feature of the present invention is not limited thereto, and appoints
What is familiar with the people of the technology in field of the present invention, the change that can be readily occurred in or modification, all should cover in present invention below
Claim in.
Claims (1)
1. a kind of figure renders the implementation method of programmable phase flame effect, it is characterised in that include:
Processing stage programmable vertex, opposite vertexes position and vertex texture coordinate are processed;
The body color and flame color of fragment are calculated in the programmable fragment processor stage to every frame;
The body color is mixed to form flame effect with the flame color result;
The opposite vertexes position and vertex texture coordinate carry out processing the largest contours opposite vertexes for needing budget stunt to act on the whole story
Object coordinates be amplified and synchronously amplify object texture coordinate;It is described that object vertex coordinate is amplified including to x
The amplification in direction and the amplification to y directions;The amplification to y directions be to y values more than 0 summit according to flame combustion degree
It is amplified;
It is additionally included in body region before flame color is calculated and texture is sampled, obtains the color of main body;Calculate flame
Add a layer texture during color as Noise texture;The Noise texture of addition is to obtain random number;It is described random
Number be Noise texture is sampled according to present frame after the color value that obtains be added what is obtained in proportion;The flame color is
The multiple fragments for affecting flame color of horizontal direction and vertical direction of the fragment for calculating as needed carry out processing what is obtained, locate
Reason process includes:Choose calculative fragment values to act on random number respectively, addition obtains the flame color of current clip.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110121893.1A CN102752515B (en) | 2011-05-11 | 2011-05-11 | Implementation method of flame effect at programmable stage in graphics rendering |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110121893.1A CN102752515B (en) | 2011-05-11 | 2011-05-11 | Implementation method of flame effect at programmable stage in graphics rendering |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102752515A CN102752515A (en) | 2012-10-24 |
CN102752515B true CN102752515B (en) | 2017-04-12 |
Family
ID=47032396
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110121893.1A Active CN102752515B (en) | 2011-05-11 | 2011-05-11 | Implementation method of flame effect at programmable stage in graphics rendering |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102752515B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103327260B (en) * | 2013-05-30 | 2018-12-25 | 新奥特(北京)视频技术有限公司 | A kind of particle editing method and apparatus |
CN103617594B (en) * | 2013-12-16 | 2017-01-11 | 中国民航大学 | Noise isopleth-surface drawing-oriented multi-GPU (Graphics Processing Unit) rendering parallel-processing device and method thereof |
CN113750536B (en) * | 2020-06-04 | 2023-09-01 | 福建天晴数码有限公司 | 2D pixel flame method and system based on coloring device |
CN111768480B (en) * | 2020-07-03 | 2024-04-09 | 网易(杭州)网络有限公司 | Flame animation generation method and device, computer storage medium and electronic equipment |
CN111951156B (en) * | 2020-08-24 | 2021-08-03 | 杭州小影创新科技股份有限公司 | Method for drawing photoelectric special effect of graph |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101377896A (en) * | 2007-08-31 | 2009-03-04 | 王志潮 | Method and apparatus for simulating flame combustion image |
-
2011
- 2011-05-11 CN CN201110121893.1A patent/CN102752515B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101377896A (en) * | 2007-08-31 | 2009-03-04 | 王志潮 | Method and apparatus for simulating flame combustion image |
Non-Patent Citations (2)
Title |
---|
CPU与GPU并行计算的火焰模拟;王栋栋等;《计算机应用》;20090630;第29卷(第6期);全文 * |
基于粒子系统和纹理绘制的火焰模拟;陈志伟等;《计算机工程与科学》;20100131;第32卷(第1期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN102752515A (en) | 2012-10-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210281771A1 (en) | Video processing method, electronic device and non-transitory computer readable medium | |
CN102752515B (en) | Implementation method of flame effect at programmable stage in graphics rendering | |
JP4481166B2 (en) | Method and system enabling real-time mixing of composite and video images by a user | |
US20210225080A1 (en) | Information processing apparatus, information processing method, and storage medium | |
CN102903086B (en) | Brightness adjustment method and device of image to be spliced | |
US8274567B2 (en) | Image processing method, apparatus and system | |
CN103700078B (en) | The defogging method of a small amount of background image containing mist | |
TW201438463A (en) | Techniques for adding interactive features to videos | |
JP5080302B2 (en) | Image processing method | |
TW201822534A (en) | Panoramic video compression method and device | |
CN104217402A (en) | Real-time Gaussian Blur method and device of video on mobile equipment | |
CN101656037B (en) | Method for displaying large-format picture on small screen equipment and small screen equipment | |
US20220335620A1 (en) | Image enhancement system | |
CN111798474A (en) | Image processing apparatus and image processing method thereof | |
CN102722902B (en) | Anti-aliasing the improving one's methods of rasterization stage in a kind of graph rendering streamline | |
CN109544671B (en) | Projection mapping method of video in three-dimensional scene based on screen space | |
CN105096370A (en) | Equivalence-partitioning anti-aliasing method for ray tracing | |
TW201327466A (en) | Image editing system and editing method | |
CN109859303B (en) | Image rendering method and device, terminal equipment and readable storage medium | |
CN110910485A (en) | Immersive cave image manufacturing method | |
CN111292280A (en) | Method and apparatus for outputting information | |
CN102752549A (en) | Method for achieving special effect based on mesh deformation | |
CN205793049U (en) | Augmented reality scene news conference system | |
CN111105484B (en) | Paperless 2D serial frame optimization method | |
CN115103134A (en) | LED virtual shooting cutting synthesis method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20211220 Address after: 100195 room 104, floor 1, building 1, courtyard 131, West Fourth Ring North Road, Haidian District, Beijing Patentee after: Beijing Jinsong Chuangyi Technology Co.,Ltd. Address before: 100195 new technology building, 49 Wukesong Road, Haidian District, Beijing Patentee before: China Digital Video (Beijing) Co.,Ltd. |