CN102752515A - 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 PDF

Info

Publication number
CN102752515A
CN102752515A CN2011101218931A CN201110121893A CN102752515A CN 102752515 A CN102752515 A CN 102752515A CN 2011101218931 A CN2011101218931 A CN 2011101218931A CN 201110121893 A CN201110121893 A CN 201110121893A CN 102752515 A CN102752515 A CN 102752515A
Authority
CN
China
Prior art keywords
flame
stage
implementation method
color
programme
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
Application number
CN2011101218931A
Other languages
Chinese (zh)
Other versions
CN102752515B (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.)
Beijing Jinsong Chuangyi Technology Co.,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 CN201110121893.1A priority Critical patent/CN102752515B/en
Publication of CN102752515A publication Critical patent/CN102752515A/en
Application granted granted Critical
Publication of CN102752515B publication Critical patent/CN102752515B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Generation (AREA)
  • Image Processing (AREA)

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

The implementation method of stage flame effect able to programme in a kind of graph rendering
Technical field
The present invention relates to the captions manufacture technology field in broadcasting and TV field, relate in particular to the implementation method of stage flame effect able to programme in a kind of graph rendering.
Background technology
Continuous development along with computer graphical, image, video technique; Add that domestic radio, TV and film industries were in from the period of single-definition pattern to the high-definition mode transition, record and broadcast has proposed requirement higher, that upgrade to teletext in TV record and broadcast units such as TV station.Require greatly to strengthen, enrich picture and text and broadcast effect, represent visual impact.
Meeting needs to make the dynamic broadcast that a lot of stunts realize pel in video caption manufacturing process, comprises the wave inverted image, radial blur, and motion blur, phantom, butterfly, flame etc., the realization main body of flame stunt and the mixing of flame color obtain.
Realization for flame effect in the prior art mainly contains two kinds of methods, a kind ofly is based on that pixel realizes, another kind of method just is based on that particIe system realizes, and two kinds of methods all are based on, and CPU realizes.
For above-mentioned two kinds of implementation methods that realize flame effect, the inventor finds to exist following technical problem in the embodiment of the present invention process:
(1) based on the implementation method of pixel, back one frame is based on former frame, the effect that navigates to each frame on the timeline that can not be definite.
(2) method that realizes based on particIe system because of each frame all receives the influence of random number, can not navigate to each frame on the timeline.
(3) above-mentioned two kinds of methods realize on CPU that all can not make full use of the concurrency that GPU plays up, efficient is lower.
Summary of the invention
In order to solve the shortcoming of above-mentioned prior art; Main purpose of the present invention provides the implementation method of a kind of graph rendering stage flame effect able to programme; Be based on that GPU (Graphic Processing Unit, graphic process unit) realizes, can navigate to each frame; Front and back two frames do not have relevance, and implementation efficiency is high.
In order to achieve the above object, the invention provides the implementation method of a kind of graph rendering stage flame effect able to programme, specifically comprise:
The processing stage of programmable vertex, vertex position and vertex texture coordinate are handled;
Every frame is calculated the main body color and the flame color of fragment in the programmable fragment processor stage;
Said main body color is mixed the formation flame effect with said flame color result.
The implementation method of graph rendering provided by the invention stage flame effect able to programme can navigate to each frame and front and back two frames do not have relevance.Implementation method of the present invention on the other hand is based on the GPU realization, has made full use of the concurrency of GPU, and implementation efficiency is high.
Description of drawings
Technical scheme for the clearer explanation embodiment of the invention; The accompanying drawing of required use is done simple the introduction in will describing embodiment below; Conspicuous, the accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills; Under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the implementation method block diagram of stage flame effect able to programme in a kind of graph rendering of the embodiment of the invention;
The method flow diagram that Fig. 2 handled summit and texture coordinate for the embodiment of the invention programmable vertex processor stage;
Fig. 3 is four vertex information sketch mapes of embodiment of the invention two-dimensional bodies.
Fig. 4 handles the sampling sketch map for the embodiment of the invention programmable fragment processor stage to texture;
Fig. 5 calculates the method sketch map of fragment color for the embodiment of the invention.
Embodiment
To combine the accompanying drawing in the embodiment of the invention below; Technical scheme in the embodiment of the invention is carried out clear, complete description; Obvious described embodiment only is a part of embodiment of the present invention, is not whole embodiment, based on the embodiment among the present invention; Those of ordinary skills are not paying the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
Flame is upwards burning, above the object with about the zone need the effect of flame.Therefore will form flame effect mixes with regard to needs calculating fragment main body color and flame color.The embodiment of the invention one provides the implementation method of stage flame effect able to programme in a kind of graph rendering, and flow process as shown in Figure 1 is specially:
Step S1: the processing stage of programmable vertex, vertex position and vertex texture coordinate are handled.The upwards combustion efficiency of considering flame needs the largest contours at budget stunt effect whole story the object coordinates on summit to be amplified and amplified synchronously the texture coordinate of object.
As shown in Figure 2, specific as follows in the programmable vertex processor stage to the method step that summit and texture coordinate process:
Step S11: the coordinate to the summit amplifies, and because of in object coordinates system, the center is (0,0), therefore only need apex coordinate be multiply by a multiplication factor and just can realize amplifying.Fig. 3 is four vertex information sketch mapes of two-dimensional bodies, and establishing apex coordinate is Pos, and the x coordinate with Pos among the present invention amplifies 1.1 times.Whether the y value of judging Pos is greater than 0; If greater than 0 being summit 0 and summit 3, the y direction is amplified, y direction amplification multiple and flame combustion degree have relation; Summit y value becomes Posy* (1+fBurnFactor); Wherein, Posy representes the y component of position Pos, and fBurnFactor is the burning degree coefficient.
Step S12: according to the amplification on the summit of step S11, again because the coordinate of texture not at the center and in the upper left corner, so texture coordinate UV is operated as follows:
Texture x direction coordinate is (UVx-0.5) * 1.1+0.5;
When the y on summit direction was amplified, corresponding texture y direction coordinate was (UVy-0.5) * (1+fBurnFactor)+0.5;
Step S2: in body region, texture is sampled, obtain the color of main body.For example, texture is handled, sampled in the zone of texture coordinate between (0,0)~(1,1), obtain the color of main body in the programmable fragment processor stage.It is the zone 1 of innermost layer shown in Figure 4.
Step S3: according to present frame the noise texture of relevant position is sampled, obtains its color component rgba color value, color component rgba by 1.5,1.1,0.9,0 ratio phase adduction with the result as random number.
Flame is a kind of upwards effect of combustion, needs the effect that random number influences flame.Therefore in this effect, added a layer texture as the noise texture to obtain random number.The computational methods of random number can for: in the process of progress 0 to 1, by certain rule, such as u=0.2; V=u_progress etc.; Texture is the texture of two dimension, needs u, and two values of v could be sampled to the relevant position; Obtain the color at noise texture uv place, its color component rgba value can multiply by a coefficient respectively as random number.
Step S4: calculate the color of current fragment, get the color of some the main body fragment in certain zone, institute selected episode below, handle the flame color that obtains current fragment.Concrete processing method can be referring to shown in Figure 5: the fragment values of 8*3 position, Chooser below respectively with S3 in the random number effect, addition obtains the flame color of current fragment.
Step S5: main body rendering result among the step S1 is mixed with the flame rendering result of step S4, obtain the effect of flame combustion.
The implementation method of graph rendering provided by the invention stage flame effect able to programme can navigate to each frame and front and back two frames do not have relevance.Implementation method of the present invention on the other hand is based on the GPU realization, has made full use of the concurrency of GPU, and implementation efficiency is high.
Through the description of above execution mode, those skilled in the art can be well understood to the present invention and can realize through software, also can realize by the mode that software adds necessary general hardware platform.Based on such understanding; Technical scheme of the present invention can be come out with the embodied of software product, this software product can be stored in a non-volatile memory medium (can be CD-ROM, USB flash disk; Portable hard drive etc.) in; Comprise some instructions with so that computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the described method of each embodiment of the present invention.
The above; Be merely a best specific embodiment of the present invention, but characteristic of the present invention is not limited thereto, any people who is familiar with this technology is in field of the present invention; The variation that can expect easily or modification all should be encompassed in the following claim of the present invention.

Claims (9)

1. the implementation method of a graph rendering stage flame effect able to programme is characterized in that, comprising:
The processing stage of programmable vertex, vertex position and vertex texture coordinate are handled;
Every frame is calculated the main body color and the flame color of fragment in the programmable fragment processor stage;
Said main body color is mixed the formation flame effect with said flame color result.
2. the implementation method of graph rendering as claimed in claim 1 stage flame effect able to programme; It is characterized in that, said vertex position and vertex texture coordinate are handled the largest contours that needs budget stunt effect whole story amplifies and amplify synchronously object to the object coordinates on summit texture coordinate.
3. the implementation method of graph rendering as claimed in claim 2 stage flame effect able to programme is characterized in that, the said object vertex coordinate is amplified comprises to the amplification of x direction with to the amplification of y direction.
4. the implementation method of graph rendering as claimed in claim 3 stage flame effect able to programme is characterized in that, said amplification to the y direction is that the y value is amplified according to the flame combustion degree greater than 0 summit.
5. the implementation method of graph rendering as claimed in claim 1 stage flame effect able to programme is characterized in that, before calculating flame color, also is included in the body region texture is sampled, and obtains the color of main body.
6. the implementation method of graph rendering as claimed in claim 1 stage flame effect able to programme is characterized in that, adds a layer texture as the noise texture in the process of calculating flame color.
7. the implementation method of graph rendering as claimed in claim 6 stage flame effect able to programme is characterized in that the noise texture of interpolation is in order to obtain random number.
8. the implementation method of graph rendering as claimed in claim 7 stage flame effect able to programme is characterized in that, said random number be the color value that obtains after according to present frame the noise texture being sampled in proportion addition obtain.
9. the implementation method of graph rendering as claimed in claim 1 stage flame effect able to programme is characterized in that, said flame color is that horizontal direction and a plurality of fragments that influence flame color of vertical direction of the fragment calculated are as required handled and obtained.
CN201110121893.1A 2011-05-11 2011-05-11 Implementation method of flame effect at programmable stage in graphics rendering Active CN102752515B (en)

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 true CN102752515A (en) 2012-10-24
CN102752515B 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)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103327260A (en) * 2013-05-30 2013-09-25 新奥特(北京)视频技术有限公司 Method and device for editing particles
CN103617594A (en) * 2013-12-16 2014-03-05 中国民航大学 Noise isopleth-surface drawing-oriented multi-GPU (Graphics Processing Unit) rendering parallel-processing device and method thereof
CN111768480A (en) * 2020-07-03 2020-10-13 网易(杭州)网络有限公司 Flame animation generation method and device, computer storage medium and electronic equipment
CN111951156A (en) * 2020-08-24 2020-11-17 杭州趣维科技有限公司 Method for drawing photoelectric special effect of graph
CN113750536A (en) * 2020-06-04 2021-12-07 福建天晴数码有限公司 2D pixel flame method and system based on shader

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101377896A (en) * 2007-08-31 2009-03-04 王志潮 Method and apparatus for simulating flame combustion image

Patent Citations (1)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
王栋栋等: "CPU与GPU并行计算的火焰模拟", 《计算机应用》 *
陈志伟等: "基于粒子***和纹理绘制的火焰模拟", 《计算机工程与科学》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103327260A (en) * 2013-05-30 2013-09-25 新奥特(北京)视频技术有限公司 Method and device for editing particles
CN103617594A (en) * 2013-12-16 2014-03-05 中国民航大学 Noise isopleth-surface drawing-oriented multi-GPU (Graphics Processing Unit) rendering parallel-processing device and method thereof
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
CN113750536A (en) * 2020-06-04 2021-12-07 福建天晴数码有限公司 2D pixel flame method and system based on shader
CN113750536B (en) * 2020-06-04 2023-09-01 福建天晴数码有限公司 2D pixel flame method and system based on coloring device
CN111768480A (en) * 2020-07-03 2020-10-13 网易(杭州)网络有限公司 Flame animation generation method and device, computer storage medium and electronic equipment
CN111768480B (en) * 2020-07-03 2024-04-09 网易(杭州)网络有限公司 Flame animation generation method and device, computer storage medium and electronic equipment
CN111951156A (en) * 2020-08-24 2020-11-17 杭州趣维科技有限公司 Method for drawing photoelectric special effect of graph
CN111951156B (en) * 2020-08-24 2021-08-03 杭州小影创新科技股份有限公司 Method for drawing photoelectric special effect of graph

Also Published As

Publication number Publication date
CN102752515B (en) 2017-04-12

Similar Documents

Publication Publication Date Title
US9776086B2 (en) Method of transforming an image file
CN1022351C (en) Image processing apparatus
CN102752515A (en) Implementation method of flame effect at programmable stage in graphics rendering
CN102208171B (en) Local detail playing method on portable high-definition video player
CN102722861A (en) CPU-based graphic rendering engine and realization method
US6504537B1 (en) System, method and article of manufacture for fractional tessellation during graphics processing
CN104661077A (en) Advertisement loading method and device
CN111192190B (en) Method and device for eliminating image watermark and electronic equipment
US7768516B1 (en) Image splitting to use multiple execution channels of a graphics processor to perform an operation on single-channel input
CN110782387B (en) Image processing method and device, image processor and electronic equipment
CN101656037B (en) Method for displaying large-format picture on small screen equipment and small screen equipment
CN102722902A (en) Method for anti-aliasing improvement at rasterization phase in graphic rendering pipeline
CN110166798A (en) A kind of down conversion method and device edited based on 4K HDR
CN103236042A (en) Self-adaptive picture processing method and device
CN117611703A (en) Barrage character rendering method, barrage character rendering device, barrage character rendering equipment, storage medium and program product
CN101615298A (en) The method and apparatus that a kind of animation is play
US8063916B2 (en) Graphics layer reduction for video composition
CN115190263B (en) Video scaling method, device, equipment and storage medium
CN104113704A (en) Game image processing method and device
CN110121032B (en) Method, device and equipment for displaying animation special effect and storage medium
CN102142134A (en) Image detail enhancement method based on three-dimensional grid smoothing model
CN109302617B (en) Multi-element-designated video microphone connecting method, device, equipment and storage medium
CN110858389B (en) Method, device, terminal and transcoding equipment for enhancing video image quality
CN102739973B (en) A kind of method for realizing subtitle van gogh's oil painting special efficacy
CN102737402A (en) Method for multilayer rendering in programmable phase in graphic rendering

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.