CN106408639A - Curvature flow-based screen space fluid rendering method - Google Patents

Curvature flow-based screen space fluid rendering method Download PDF

Info

Publication number
CN106408639A
CN106408639A CN201610789716.3A CN201610789716A CN106408639A CN 106408639 A CN106408639 A CN 106408639A CN 201610789716 A CN201610789716 A CN 201610789716A CN 106408639 A CN106408639 A CN 106408639A
Authority
CN
China
Prior art keywords
point
fluid
particle
screen space
nearest surface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610789716.3A
Other languages
Chinese (zh)
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.)
Shanghai Jiaotong University
Original Assignee
Shanghai Jiaotong University
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 Shanghai Jiaotong University filed Critical Shanghai Jiaotong University
Priority to CN201610789716.3A priority Critical patent/CN106408639A/en
Publication of CN106408639A publication Critical patent/CN106408639A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures

Abstract

The invention relates to a curvature flow-based screen space fluid rendering method comprising the following steps: in step S1, a smooth particle fluid model of a three dimensional object in a screen space is obtained, the model comprises positions and speed of particles, a depth image of particles of fluid surfaces is generated, and a nearest surface of the three dimensional object is determined; a method for determining the nearest surface of the three dimensional object comprises the following steps: if an object intersects with the same straight line in a direction of an optical axis at two or more intersection points, an intersection point which is a minimum distance away from a camera is used as a point on the nearest surface; in step S2, the nearest surface is smoothed via curvature flow filtering operation; in step S3, the number of fluids between each point and the nearest surface is calculated as thickness of the point; in step S4, noise is added to the nearest surface; in step S5, color and transparency of each point are weakened according to the thickness of the point and the speed of the particles, and a fluid rendering graph can be obtained. Compared with technologies of the prior art, the curvature flow-based screen space fluid rendering method is advantaged by high speed, and all processing can be directly finished via graphic hardware.

Description

A kind of screen space fluid rendering intent based on curvature flow
Technical field
The present invention relates to a kind of image rendering method, especially relate to a kind of render based on the screen space fluid of curvature flow Method.
Background technology
For interactively application program, such as play, the fluid simulation method based on particle such as smooth particle fluid force Learn (Smoothed Particle Hydrodynamics, SPH) generally preference Euler's fluid meter and show form.This is due to fluid Arbitrarily can flow under the scene not needing to define fluid grid, under generally this scene, internal memory and the consumption calculating are very Expensive.SPH simulation is a kind of powerful instrument of simulation fluid, however it is necessary that advanced technology is realizing the real wash with watercolours of result Dye.
Scene geometric figure can be collided with particle as other strict objects, particle method is also more easily It is integrated in existing physical system, become grid without by scene geometric figure voxel.Its shortcoming is to extract a table Face becomes more difficult to carry out rendering.In existing method, most of all inapplicable for the method for rendered particle fluid Real-time use in game.Generally, the surface of fluid is to create in world space, directly as a network, or As the surface of implicit expression, then carry out polygonization using marching cube or a similar algorithm.After this, relax and Optimize operation to be used in whole network to increase the smoothness on surface, smoothness is to calculate and memory-intensive.
Implicit surfaces polygonization method also suffers from the problem in frame grid discretization workpiece in frame continuity, because net Lattice are static, and do not need to move with fluid.This phenomenon is outstanding when real-time rendering length uses the grid of low resolution It is obvious.Zhang[1]One rendering intent based on point was proposed, it is to calculate on GPU completely that light ball intersects, and uses One two stage rendering intent.This method removes the requirement of grid discretization.
If fluid is mobile, then render each frame and only need to only one or at most several viewpoint, one more Many internal memories and the effective method of calculating need only to construction surface representated by visible particle to camera in visible space.
Content of the invention
The purpose of the present invention is exactly to provide to overcome the defect that above-mentioned prior art exists that a kind of speed is fast, effect is good The screen space fluid rendering intent based on curvature flow.
The purpose of the present invention can be achieved through the following technical solutions:
A kind of screen space fluid rendering intent based on curvature flow, comprises the following steps:
S1, obtains the smooth particle fluid model of three-dimensional body in screen space, and model includes position and the speed of particle, Generate the depth map of the particle of flow surface, determine the nearest surface of three-dimensional body, the nearest surface of three-dimensional body determines method It is specially:If object has two or more intersection points with the same straight line of camera light direction of principal axis, take nearest from video camera Intersection point, as the point on nearest surface;
S2, by curvature flow filter, smooths nearest surface;
S3, calculates the amount of fluid between each point and nearest surface, as the thickness of this point;
S4, adds noise for nearest surface;
S5, the thickness according to point and the speed of particle, weaken color a little and transparency, obtain fluid and render figure.
In described step S1, particle renders are become spheroid, calculate on each spheroid from the point that video camera is nearest.
In described step S2, nearest surface is smoothed using average curvature.
In described step S4, noise is Berlin noise.
In described step S5, the thickness of point is bigger it is seen that degree is lower, and the color of point and reduced transparency are more.
Compared with prior art, the present invention has fireballing advantage, directly can complete all process on graphic hardware; By smooth surface, it is to avoid fluid produces speckle or jelly effect.
Brief description
Fig. 1 is the graph of a relation between flow surface of the present invention and camera angle;
Fig. 2 is the schematic diagram that particle is seen globulate;
Fig. 3 (a), (b) are the spherical schematic diagram of particle at two visual angles;
Fig. 4 (a), (b) are respectively and carry out smooth effect with screen space curvature flow to NVIDIA using bilateral the obscuring of Gauss Fruit is schemed;
Fig. 5 (a), (b) are the contrast effect figure before and after being added noise to a pipeline;
Fig. 6 is to render sand fluid design sketch using the present embodiment method;
Fig. 7 is the flow chart of the inventive method.
Specific embodiment
The present invention is described in detail with specific embodiment below in conjunction with the accompanying drawings.The present embodiment is with technical solution of the present invention Premised on implemented, give detailed embodiment and specific operating process, but protection scope of the present invention be not limited to Following embodiments.
Embodiment
As shown in fig. 7, a kind of screen space fluid rendering intent based on curvature flow, comprise the following steps:
S1, obtains the smooth particle fluid model of three-dimensional body in screen space, and model includes position and the speed of particle, Generate the depth map of the particle of flow surface, determine the nearest surface of three-dimensional body, the nearest surface of three-dimensional body determines method It is specially:If object has two or more intersection points with the same straight line of camera light direction of principal axis, take nearest from video camera Intersection point, as the point on nearest surface;
S2, by curvature flow filter, smooths nearest surface;
S3, calculates the amount of fluid between each point and nearest surface, as the thickness of this point;
S4, adds noise for nearest surface;
S5, the thickness according to point and the speed of particle, weaken color a little and transparency, obtain fluid and render figure.
The following is this method to illustrate.
The first step, the depth map of the particle of generation flow surface.
Assume that a kind of smoothed particle method particle simulation exists.Input data comprises the particle pi of n out-of-order (i=1 ..., position n).Optionally, particle has density and the speed from simulation of correlation.Before being rendered, video camera The surface of the fluid foremost paid has set.
As shown in figure 1, screen space fluid renders only generating apart from the nearest surface of video camera.By by particle renders Become spheroid, retain the nearest value in each pixel using hardware depth test, as shown in Figure 2 and Figure 3.
In order to obtain the surface of the fluid obtaining from the visual angle of observer, using the point of the replacement of depth in fragment shader Particle renders are become spheroid by block texture.This avoid the use of complex geometry.Depth value will be used in following smoothing step Arrive.Render process can be tended to abandon some particles, because they do not constitute any part on surface, by from simulation During to density add a threshold value, can be easily carried out.So that transitional processes more smooth out, low-density grain Son individually can be rendered as spraying.
Second step, smoothing method.
Although the first step is to be spheroid by particle renders, particle looks like the result that spheroid is not intended to, because For a untrue, appearance as fruit jelly so can be led to.One smooth and even curface, is similar to the position needs of particle Realized by the surface in smooth screen space.
Existing method is using a Gaussian Blur or the such as bilateral Gauss filter of its variant.But direct Gauss Obscure and will obscure contour edge, lead to the steady statue of equal depth when using big kernel function.Bilateral filter is permissible Protect edge information, but it is unseparated.Efficiently realize one using the core that a width changes on graphic hardware to obscure Equally highly difficult.
Alternative as a kind of Gaussian smoothing, this problem can be treated from another kind of different mode:For one kind The suddenly change of curvature between the particle at place can be smoothed, form a surface smoothly and continuously.Consider a kind of this mode It is to minimize curvature.This is similar to the surface tension of the rational fluid of the formation of water droplet in nature and water whirlpool.This Individual process is called curvature flow.
The surface of curvature flow depends on the symbol of the average curvature on size and surface along normal direction speed.Surface can only Moved on the z direction of visual plane, be continuous it is still desirable to pass through mobile and curvature yet with vision point Proportional z value, to realize the ideal effect that surface smooths, so defines
Wherein, t is a smooth time step, and H is average curvature.Start to this step, this method is called screen Curvature of space stream.Average curvature is defined as the deviation of the unit vector on a surface,
By transposition Mapping and Converting, one of depth buffer is worth one of mapped meeting visual space Vx and Vy point P, Fx and Fy be after x and y direction focal length,
Normal is to take advantage of to calculate by the difference taking the derivative in x and y direction for the P,
Wherein,Ignore the derivative term of the P depending on visual position Wx and Wy, because so Simplify many calculating, and difference is negligible when its contribution very little.Unit vector is defined as follows:
Wherein
Substituted in the formula of average curvature, therefore H can be exported.The value of the z part of derivative always 0, because z It is a function with regard to x and y, therefore all without change when they all remain constant.Thus obtain
Wherein,
The simple Euler's integral of of equation (1) is used to change the value of z in each iteration.The local derviation of z is to use to have Limit difference calculates.
Because the surface profile in screen space is possibly discontinuous.In order to prevent that the different masses on surface are blended in one Rise, on the edge of these borders and screen, partial derivative is forced to 0 to prevent any smooth generation.
The quantity of iteration is that smoothness as needed carrys out selection.Iterationses are more, and surface is more smooth, but this The individual cost that will lead to the incremental calculating time.
3rd step, calculated thickness.
One object determines its visible level according to the number of the fluid before it.It is thus desirable to calculating in video camera The quantity of the fluid and the nearest opaque article of each pixel between, this is named as thickness.When rendering, thickness is used To weaken color and the transparency of fluid.
Particle is considered the spheroid having the fluid of fixed dimension in world space.The process rendering is with the process of depth It is the same, difference is fragment shading, it exports the thickness of particle rather than depth.Extra mixing is used as fluid Quantity on screen be each position accumulation.It is possible during depth test, therefore only before screen set Particle is just rendered,
Wherein, d is depth kernel function, xiAnd yiIt is the mapping position of particle, x and y is screen coordinate, σiIt is the rule of mapping Mould.
Strictly, only when particle is not covered with, the measurement of thickness is correct, but this is a conjunction in SPH Reason it is assumed that because particle between repulsion.
4th step, avoid too manually smoothing, and add noise.
Although this method helps conceal the essence based on particle of fluid, this result still seems too people Work smooths.Surface details and foam are important visual elements in real fluid.One is directly improved this defect Method is to upset surface using a noise texture, then adds small-scale details, just as Johanson realizes. However, the noise generating the fixation in world space or visual-field space can make noise show must seem to be absorbed in place.This Challenge is to convey to produce noise by fluid advection, but only than simulation based on the fluid of particle have less scale and Higher frequency.Therefore, this method proposes each mapping by the octave rank of noise is distributed to the index value based on it Particle come using Berlin noise, therefore, the type of noise of a determination is kept together with other particles.By using volume Outer mixing, this will lead to Berlin noise, and octave rank moves relative to each other with stream.
For each particle, a point block texture is rendered using gaussian kernel.The value obtaining and a base under the surface In an index decreased of depth, therefore particle contribution when they are from merging is less,
Wherein, p is the visual space position of this pixel, and d is the sample depth from case depth texture, x and y is -1 And change between 1.Noise texture noise is change to prevent pattern from becoming obvious between each particle.
Then this noise core sum up for each particle on screen, in order to obtain can obtaining at each pixel To be used for sheltering from heat or light to a noise figure,
When fluid is very violence, fluid should become more multilated, when speed viThere is great variety When, realized by marked fluid particle,
|vi(t)-vi(t-1) | > τ (12)
Wherein τ is a threshold value.For these particles, noise amplitude will be higher.Soon after, under particle calmness Come, change into normal state.
5th step, render.
In the final step, all of intermediate result all will be synthesized last figure by rendering a full frame four-tuple Piece.The optical property of fluid is based on Fresnel equation, has a reflection and the part reflecting and a Feng Shi bloom, calculates defeated Go out color
Cout=a (1-F (n v))+bF (n v)+ks(n·h)α(13)
Wherein F is Fresnel equation, and a is the fluid color of refraction, and b is the scene color of reflection, ksIt is Specular Highlight with α Constant, n is surface normal, and h is the half-angle between video camera and optical fiber, v be video camera vector.When rendering fluid, Depth test is possible, and the depth being returned by fragment shader replicates from case depth.For gradual change fluid Surface, the normal n of visual space uses the finite difference of case depth d (x, y) to calculate, as shown in equation (4).Simply make Calculate discovery with the finite difference in a direction and will lead to the manual of edge.When discontinuity is detected, by comparing Depth, to the difference of threshold value, selects minimum absolute finite difference.In addition, Noise texture N (x, y) is to be used to upset find, By the partial derivative of Noise texture being added to the surface details that little picture ripple to be added on the normal of calculating to fluid.Additionally, one The color of individual gray scale can add one surfactant foam effect of simulation by the series of noise.
Thickness T (x, y) is used to weaken the refraction color of fluid a,
A=lerp (Cfluid,S(x+βnx,y+βny),e-T(x,y)) (14)
Fluid is thicker, and it is more that it weakens background colour.The region of fluid is crossed background scene and is shown.When gradual change fluid Wait, a slightly different index decreased is used to each color channel, such color will be interesting with one kind with thickness Mode change.For transparency, the scene not having fluid is to be rendered by background texture S (x, y) at first.It is used to take The texture coordinate of sample background scene texture be based on normal to a surface n multilated be given fluid behind refractor unreal Feel.β with thickness linear increment,
β=T (x, y) γ (15)
Wherein, γ is to rely on the constant of a certain fluid, determines the degree that background is refracted.The color b quilt of reflection The cube texture of the environment based on the direction of the launch for the sampling, come determine, is to calculate from surface normal and line of sight 's.
Because realize curvature to minimize using PDE is that comparison is stiff, therefore using a kind of extra synthetic schemes, surely Qualitative question can propose to lead to system to be shaken.For this reason, in high-resolution, take substantial amounts of iteration at one Stability is kept on little time step.One compromise can be used, and sacrifices some performance qualities, in a relatively low resolution Do the step after fluid renders and processes under rate simultaneously.This scaling is difficult, because the representing of edge.In a fluid In vivo, depth is linear insertion, but edge be come as special circumstances processed.These should not seem sharp or Person is uneven, if it appear that fuzzy or smooth also more more receptive.For this reason, we be mixed with last Graduated colors, calculate rather than at normal or depth value at a low resolution.Thus there is the effect of smoothed profile.
It is inserted with the result that altofrequency also just will lost due to sampling.Because flatness, half or a quarter Resolution fluid can seem good than full resolution.
The method of the present invention is realized comprising using several critical points such as fragment shader and middle post-processing object, according to above-mentioned Step, for existing test video and be analyzed, this test set have chosen NVIDIA trade mark, in the scene such as pipeline, corridor Fluid carried out partial simulation.All tests are realized all on PC computer, and the major parameter of this PC computer is:Centre Reason device Intel (R) Core (TM) 2Quad CPU Q8400@2.66GHz, internal memory 4GB.
Shown in some comparative simulation effects such as Fig. 4 (a), 4 (b), Fig. 5 (a), 5 (b).

Claims (5)

1. a kind of screen space fluid rendering intent based on curvature flow is it is characterised in that comprise the following steps:
S1, obtains the smooth particle fluid model of three-dimensional body in screen space, and model includes position and the speed of particle, generates The depth map of the particle of flow surface, determines the nearest surface of three-dimensional body, and the nearest surface of three-dimensional body determines that method is concrete For:If object has two or more intersection points with the same straight line of camera light direction of principal axis, take from the nearest intersection point of video camera, As the point on nearest surface;
S2, by curvature flow filter, smooths nearest surface;
S3, calculates the amount of fluid between each point and nearest surface, as the thickness of this point;
S4, adds noise for nearest surface;
S5, the thickness according to point and the speed of particle, weaken color a little and transparency, obtain fluid and render figure.
2. a kind of screen space fluid rendering intent based on curvature flow according to claim 1 is it is characterised in that described Step S1 in, particle renders are become spheroid, calculate on each spheroid from the point that video camera is nearest.
3. a kind of screen space fluid rendering intent based on curvature flow according to claim 1 is it is characterised in that described Step S2 in, nearest surface is smoothed using average curvature.
4. a kind of screen space fluid rendering intent based on curvature flow according to claim 1 is it is characterised in that described Step S4 in, noise be Berlin noise.
5. a kind of screen space fluid rendering intent based on curvature flow according to claim 1 is it is characterised in that described Step S5 in, the thickness of point is bigger it is seen that degree is lower, and the color of point and reduced transparency are more.
CN201610789716.3A 2016-08-31 2016-08-31 Curvature flow-based screen space fluid rendering method Pending CN106408639A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610789716.3A CN106408639A (en) 2016-08-31 2016-08-31 Curvature flow-based screen space fluid rendering method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610789716.3A CN106408639A (en) 2016-08-31 2016-08-31 Curvature flow-based screen space fluid rendering method

Publications (1)

Publication Number Publication Date
CN106408639A true CN106408639A (en) 2017-02-15

Family

ID=58001631

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610789716.3A Pending CN106408639A (en) 2016-08-31 2016-08-31 Curvature flow-based screen space fluid rendering method

Country Status (1)

Country Link
CN (1) CN106408639A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110827391A (en) * 2019-11-12 2020-02-21 腾讯科技(深圳)有限公司 Image rendering method, device and equipment and storage medium
CN111986303A (en) * 2020-09-09 2020-11-24 网易(杭州)网络有限公司 Fluid rendering method and device, storage medium and terminal equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102298794A (en) * 2011-09-14 2011-12-28 浙江大学 Real-time water drop simulation method based on surface grids
CN102402791A (en) * 2011-10-24 2012-04-04 克拉玛依红有软件有限责任公司 Three-dimensional fluid simulation method based on graphic processing unit (GPU)
CN102930583A (en) * 2012-10-17 2013-02-13 中国科学院自动化研究所 Method for interactively generating droplet effect
CN103679802A (en) * 2013-12-01 2014-03-26 北京航空航天大学 Method for drawing surface of SPH (smoothed particle hydrodynamics) fluid in real time on basis of screen spaces
CN105678835A (en) * 2015-11-23 2016-06-15 温州大学 Modeling, drawing and rendering method for digital three-dimensional freehand Chinese brush landscape painting

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102298794A (en) * 2011-09-14 2011-12-28 浙江大学 Real-time water drop simulation method based on surface grids
CN102402791A (en) * 2011-10-24 2012-04-04 克拉玛依红有软件有限责任公司 Three-dimensional fluid simulation method based on graphic processing unit (GPU)
CN102930583A (en) * 2012-10-17 2013-02-13 中国科学院自动化研究所 Method for interactively generating droplet effect
CN103679802A (en) * 2013-12-01 2014-03-26 北京航空航天大学 Method for drawing surface of SPH (smoothed particle hydrodynamics) fluid in real time on basis of screen spaces
CN105678835A (en) * 2015-11-23 2016-06-15 温州大学 Modeling, drawing and rendering method for digital three-dimensional freehand Chinese brush landscape painting

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WLADIMIR J.VAN DER LAAN等: "Screen Space Fluid Rendering with Curvature Flow", 《I3D "09 PROCEEDINGS OF THE 2009 SYMPOSIUM ON INTERACTIVE 3D GRAPHICS AND GAMES》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110827391A (en) * 2019-11-12 2020-02-21 腾讯科技(深圳)有限公司 Image rendering method, device and equipment and storage medium
CN111986303A (en) * 2020-09-09 2020-11-24 网易(杭州)网络有限公司 Fluid rendering method and device, storage medium and terminal equipment

Similar Documents

Publication Publication Date Title
US8947430B1 (en) System and method for rendering a particle-based fluid surface
Bénard et al. State‐of‐the‐art report on temporal coherence for stylized animations
JP2006506744A (en) Visible surface determination system and method for computer graphics using interval analysis
Guo et al. Foggy scene rendering based on transmission map estimation
Sergey et al. Fast ray casting of function-based surfaces
Keselman et al. Approximate differentiable rendering with algebraic surfaces
US20120229463A1 (en) 3d image visual effect processing method
US9905045B1 (en) Statistical hair scattering model
Kenwright Dual-quaternion julia fractals
Vyatkin Method of binary search for image elements of functionally defined objects using graphics processing units
CN106408639A (en) Curvature flow-based screen space fluid rendering method
Eden et al. A method for cartoon-style rendering of liquid animations
Adams et al. Particle splatting: Interactive rendering of particle-based simulation data
US8766985B1 (en) Generating animation using image analogies to animate according to particular styles
Romanyuk et al. Blending functionally defined surfaces
CN113240785A (en) Multi-camera combined rapid ray tracing method, system and application
Cords et al. Interactive screen-space surface rendering of dynamic particle clouds
Akinci Interface handling in smoothed particle hydrodynamics
Zhang et al. Integrated image and graphics technologies
Khalid et al. Clip-mesh: Generating textured meshes from text using pretrained image-text models
El Hajjar et al. A model for real-time on-surface flows
Dutreve et al. Real-time dynamic wrinkles of face for animated skinned mesh
Halli et al. Extrusion and revolution mapping.
Feng et al. Real-time rendering of raining animation based on the graphics hardware acceleration
Xu et al. View-space meta-ball approximation by depth-independent accumulative fields

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170215

RJ01 Rejection of invention patent application after publication