CN110322540A - Ink analogy method is interacted with what GPU optimization rendered based on hydrodynamics - Google Patents
Ink analogy method is interacted with what GPU optimization rendered based on hydrodynamics Download PDFInfo
- Publication number
- CN110322540A CN110322540A CN201910613199.8A CN201910613199A CN110322540A CN 110322540 A CN110322540 A CN 110322540A CN 201910613199 A CN201910613199 A CN 201910613199A CN 110322540 A CN110322540 A CN 110322540A
- Authority
- CN
- China
- Prior art keywords
- fluid
- gpu
- ink
- simulation
- interaction
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000005457 optimization Methods 0.000 title claims abstract description 9
- 239000012530 fluid Substances 0.000 claims abstract description 96
- 230000033001 locomotion Effects 0.000 claims abstract description 64
- 239000002245 particle Substances 0.000 claims abstract description 60
- 238000004088 simulation Methods 0.000 claims abstract description 60
- 238000009877 rendering Methods 0.000 claims abstract description 40
- 230000003993 interaction Effects 0.000 claims abstract description 39
- 230000002452 interceptive effect Effects 0.000 claims abstract description 21
- 239000007787 solid Substances 0.000 claims abstract description 20
- 230000000007 visual effect Effects 0.000 claims abstract description 8
- 238000004364 calculation method Methods 0.000 claims description 31
- 239000007788 liquid Substances 0.000 claims description 19
- 238000005516 engineering process Methods 0.000 claims description 16
- 230000001133 acceleration Effects 0.000 claims description 13
- 238000004422 calculation algorithm Methods 0.000 claims description 12
- 230000004044 response Effects 0.000 claims description 5
- 239000000463 material Substances 0.000 claims description 4
- 239000013598 vector Substances 0.000 claims description 4
- 241000764238 Isis Species 0.000 claims description 3
- 230000005540 biological transmission Effects 0.000 claims description 3
- 230000001186 cumulative effect Effects 0.000 claims description 3
- 230000008859 change Effects 0.000 claims description 2
- 230000000903 blocking effect Effects 0.000 claims 2
- 238000012482 interaction analysis Methods 0.000 claims 2
- 238000013500 data storage Methods 0.000 claims 1
- 230000005484 gravity Effects 0.000 claims 1
- 238000010008 shearing Methods 0.000 claims 1
- 230000008569 process Effects 0.000 abstract description 4
- 230000003068 static effect Effects 0.000 abstract description 4
- 239000000976 ink Substances 0.000 description 42
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 23
- 230000000694 effects Effects 0.000 description 6
- 238000011161 development Methods 0.000 description 5
- 230000006399 behavior Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000004519 manufacturing process Methods 0.000 description 4
- 238000011160 research Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 239000003814 drug Substances 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000003384 imaging method Methods 0.000 description 2
- VNWKTOKETHGBQD-UHFFFAOYSA-N methane Chemical compound C VNWKTOKETHGBQD-UHFFFAOYSA-N 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 239000003643 water by type Substances 0.000 description 2
- 241000251468 Actinopterygii Species 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000003912 environmental pollution Methods 0.000 description 1
- 230000003628 erosive effect Effects 0.000 description 1
- 239000002360 explosive Substances 0.000 description 1
- 239000007789 gas Substances 0.000 description 1
- 238000013178 mathematical model Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 239000003345 natural gas Substances 0.000 description 1
- 239000011664 nicotinic acid Substances 0.000 description 1
- 238000010422 painting Methods 0.000 description 1
- 239000003209 petroleum derivative Substances 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 238000009991 scouring Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000009182 swimming Effects 0.000 description 1
- 239000002912 waste gas Substances 0.000 description 1
- 239000002351 wastewater Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/005—General purpose rendering architectures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/02—Non-photorealistic rendering
Landscapes
- Engineering & Computer Science (AREA)
- Computer Graphics (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
It is a kind of that ink analogy method is interacted with what GPU optimization rendered based on hydrodynamics, existing ink analogy method can be solved and do not have the technical issues of real-time, diversity and unpredictability of true ink fluid motion simulation process.Execute following steps by computer equipment: the stress rule based on particle individual realizes fluid motion simulation;It is introduced interactive information as external force, realizes the simulation to ink fluid flowing law;Operation is optimized using GPU Compute Shader;Scene drawing is carried out using GPU Programmable Pipeline, calculated result is directly acquired using GPU Shader tinter, while rendering the content of virtual scene.The present invention realizes that ink fluid is static, interaction when having relative motion between motion state and fluid and solid circle wall and flowing law, and introduce a variety of interactive elements, a kind of completely new deduction form is provided for traditional wash culture and arts works, provides a kind of completely new visual experience for ordinary people.
Description
Technical Field
The invention relates to the technical field of computer graphics, in particular to an interactive ink simulation method based on hydrodynamics and GPU (graphics processing unit) optimized rendering.
Background
Hydrodynamics is a branch of mechanics, and mainly studies the interaction and flow law of fluid in a static state and a moving state and when the fluid and a solid boundary wall move relatively under various forces. Fluids are a generic term for gases and liquids, and are encountered at all times and places in human life and production activities. Fluid mechanics is therefore closely related to human daily life and production. The movement of water in pipelines, channels and rivers is the object of research from old to present. People also use water to do work, such as an ancient water dump and a water turbine highly developed recently. Ships are transportation means of people, and various resistances, ship stability and cavitation phenomena caused by a ship body and a propeller in water when the ships move in water are research subjects of ship hydrodynamics. These studies are related to the discipline of water movement in branches which are said to be closely related to hydrodynamics. Since the first aircraft in the world appeared in the early 20 th century, aircraft and various other aircraft were rapidly developed. The start of space flight in the 50's of the 20 th century extended the range of human activities to other celestial and galaxy systems. The explosive development of aerospace industry is closely linked to the development of aerodynamic and aerodynamic, which are branch subjects of fluid mechanics. These disciplines are the most active, fruitier areas of hydrodynamics. In addition, hydrodynamics is widely applied in the fields of exploitation of petroleum and natural gas, development and utilization of underground water, bearing load and exciting vibration by the action of wind on buildings, bridges, cables and the like, environmental pollution caused by discharge of waste gas and waste water, scouring and migration of riverbeds, erosion of coasts and the like.
Meanwhile, with the development of computer graphics imaging technology and computer hardware technology, computer graphics imaging technology is widely applied to the fields of military affairs, education, simulation, entertainment and the like. The wonderful film special effect, the immersive virtual reality experience, the vivid game animation scene and the exquisite product model design do not reflect the powerful capability of the modern graphic and image technology, the development of the computer hardware technology provides material guarantee for the computer graphic and image technology, but how to fully utilize the computer hardware resources to calculate efficiently is also an important subject. Therefore, how to fully exert the advantages of computer graphics and computer hardware technology and realize high simulation of ink and water fluid motion has very important significance.
At present, in the field of ink simulation, researchers often build mathematical models through MATLAB and other professional software to perform simulation calculation and research. This approach is not intuitive and is dull. Some researchers adopt professional animation rendering software such as Maya and the like to render the fluid so as to enable the simulation to be more real and intuitive, but the motion state of the ink fluid object rendered based on the animation software is fixed, the rendering time required by a high-quality image is too long, and the real-time performance, the diversity and the unpredictability of the real ink fluid motion simulation process are not achieved.
Disclosure of Invention
Technical problem to be solved
The interactive ink simulation method based on hydrodynamics and GPU optimized rendering can solve the technical problems that an existing ink simulation method does not have real-time performance, diversity and unpredictability of a real ink fluid motion simulation process.
(II) technical scheme
In order to achieve the purpose, the invention adopts the following technical scheme:
an interactive ink simulation method based on hydrodynamics and GPU optimized rendering comprises the following steps:
step 1, realizing a smooth particle-based fluid mechanics algorithm, and realizing the simulation of the integral fluid motion by describing the individual interaction of particles, including the bearing of various physical quantities including mass, speed and the like on each particle group, solving the kinetic equation of the particle group and tracking the motion orbit of each particle;
step 2, introducing the interaction information as an external force, and combining the interaction of the solid and the liquid to obtain the influence of the mechanical behavior of the whole system on the movement of the individual, thereby realizing the simulation of the flow rule of the ink fluid;
and 3, fully utilizing the hardware advantages of the computer, performing optimization operation by using a GPU computer Shader, transplanting the operation to a GPU, and greatly improving the operation efficiency.
As described aboveIn the step 1, a smooth particle-based fluid mechanics algorithm is designed and realized, continuous fluid is described by using an interaction particle group, various physical quantities including mass, speed and the like are borne on each particle, and a kinetic equation of the particle group is solved and a motion track of each particle is tracked. Force on a particleThe medicine consists of three parts: external force term, pressure term, viscosity term.
Item of external forceThe calculation formula is as follows:
wherein ρ represents a density
Representing the gravitational acceleration vector.
Formula for calculating pressure termComprises the following steps:
wherein:
p represents a pressure field;
representing the gradient of the pressure field.
WhereinRepresenting the Hamiltonian (Hamiltonian) operator, which is defined as follows:
will Hamiltonian operatorActing on the pressure field p, a gradient of the pressure field can be obtained.
Viscosity termExpressed as:
wherein:
μ represents a viscosity coefficient, which is constant;
representing the velocity variation field, i.e. the velocity difference between the fluid particles;
whereinRepresents the laplacian (Laplace) operator, which is defined as follows:
a velocity variation field, i.e. a shear force for the part with a fast fluid motion velocity to the part with a slow motion velocity, can be obtained.
Wherein, the external force term of the acting force on one particle, the pressure term and the viscosity term can be expressed as:
the acceleration is in the form:
assume a position in a fluid asCan obtain the acceleration of the pointIs composed of
Wherein:
ρ(ri) Density herein;
p(ri) Is the pressure herein;
here the velocity.
The acceleration is deduced according to the cumulative function of the density, the pressure and the speed of a certain point in the fluid, so that the motion trend of the fluid is simulated.
Step 2 further comprises the following substeps:
2-1 external force item based on the calculation result of step 1And adding more interference factors, and adding other interference factors such as human-computer interaction, virtual environment interaction and the like to realize the mutual influence between the liquid and the external factors. The method comprises the steps of uniformly calculating external interference factors into external force by adopting a calculation formulaWhere f (i) is an external interference factor and k is a control constant.
2-2 based on the calculation result of step 1, the position isAcceleration of a point ofSolid is introduced to the movement of the individual particles as an influence factor, and the influence of the solid on the liquid is simulated, so that the individual can be more truly simulated. The method comprises the following steps of:
wherein, O (r)i) The display position isIs present in the location of (a) so as to simulate the interaction of a liquid with a solid.
And 3, further carrying out GPU computer Shader optimization on the implementation method, designing and implementing an algorithm structure based on a GPU computing unit, distributing the motion calculation of each object to each computing unit, fully utilizing the powerful parallel computing capability of the GPU, and effectively improving the computing efficiency.
The method also comprises a step 4, and the particle-oriented interactive fluid scene rendering method comprises the following steps:
the method adopts the GPU shaders to render fluid ink-water style pictures, adopts the GPU shaders to directly obtain the calculation results of the GPU Computer shaders, and because the Computer shaders are calculated based on GPU equipment and realize fluid mechanics calculation through image texture convolution, the calculation results can also be stored in a texture object, data transmission between GPUs can be directly realized, the calculation results do not need to be transmitted to a memory, but are directly transmitted to the GPUSshaders in a display memory to be modified and rendered, a large number of objects can be rendered in a very efficient mode through the method, and the method has very important significance for high-repeatability rendering work.
Furthermore, virtual characters such as mountains and waters, fishing boats, flying birds and the like are drawn by adopting different ink and wash style material systems, and form the visual effect of the traditional Chinese ink and wash painting together with dynamic fluid ink,
furthermore, an infrared sensing technology is adopted to collect interaction information, dynamic response of a picture and an experiencer is achieved, and interactivity and vividness of a wash scene are effectively improved. And finally, rendering richer ink and water visual effects.
(III) advantageous effects
According to the technical scheme, the interactive ink simulation method based on fluid mechanics and GPU optimized rendering realizes a fluid simulation scheme based on a smooth particle fluid dynamics algorithm through fluid motion simulation and based on the rule of fluid motion in the physical world, establishes a particle system, and can realize the simulation of the integral fluid motion only through motion constraint on individual particles. In addition, solid-liquid interaction is added, so that the change is richer and the performance is more real. And the GPU computer Shader is adopted to carry out optimization operation, so that the operation efficiency is greatly improved. Scene rendering: the method comprises the steps of adopting a GPU programmable production line to draw scenes, adopting a GPU Shader to directly obtain a calculation result, simultaneously rendering the content of a virtual scene, drawing ink and wash style scenes, adopting an infrared sensing technology to collect interaction information, realizing dynamic response of pictures and experiencers, and effectively improving the interactivity and vividness of the ink and wash scenes. And finally, rendering richer ink and water visual effects.
The invention simulates the motion behavior of the ink fluid by realizing a fluid motion algorithm, simultaneously gives full play to the advantages of a computer graphic image technology and a computer hardware technology, realizes the static and motion states of the ink fluid and the interaction and flow rules when the fluid and the solid boundary wall move relatively, and introduces a plurality of interactive elements to provide a novel bionic simulation form and provide a brand new visual experience for ordinary people.
Drawings
FIG. 1 is a basic flow diagram of the process of the present invention.
FIG. 2 is a basic flow diagram of the ink-water fluid motion simulation of the present invention;
FIG. 3 is a basic flow diagram for scene rendering according to the present invention;
FIG. 4 is a rendering effect diagram according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention.
As shown in fig. 1, the interactive ink simulation method based on hydrodynamics and GPU optimized rendering according to this embodiment mainly includes two steps:
s10, fluid motion simulation: the method realizes a smooth particle-based fluid mechanics algorithm, and can realize the simulation of the integral fluid motion by describing the individual interaction of particles, including carrying various physical quantities, including mass, velocity and the like, on each particle, solving the kinetic equation of the particle group and tracking the motion orbit of each particle. In addition, interaction information is introduced as an external force, and the influence of the mechanical behavior of the whole system on the movement of the individual is obtained by combining the interaction of the solid and the liquid, so that the simulation of the flow law of the ink fluid is realized. And the GPU computer Shader is adopted to carry out optimization operation, and the operation is transplanted to the GPU, so that the operation efficiency is greatly improved.
S20, scene rendering: the method comprises the steps of adopting a GPU programmable production line to draw scenes, adopting a GPUShaler shader to directly obtain a calculation result, simultaneously rendering the content of a virtual scene, drawing a water and ink style scene, adopting an infrared sensing technology to collect interaction information, realizing the dynamic response of pictures and experiencers, and effectively improving the interactivity and the vividness of the water and ink scene. And finally, rendering richer ink and water visual effects.
Each step is described in detail below.
Wherein the S10 fluid motion simulation means that: the simulation of the motion mode of the ink fluid is realized by a computer algorithm, the principle of basic fluid mechanics is met, the interaction and the flow rule of the ink fluid in the static state and the motion state and the relative motion between the fluid and a solid boundary wall can be simulated, the efficient calculation is ensured, and the simulation is implemented.
As shown in fig. 2, the exercise simulation of the present invention is performed in three steps:
s11, realizing a smooth particle-based fluid mechanics algorithm, and realizing the simulation of the integral fluid motion by describing the individual interaction of the particles, including carrying various physical quantities including mass, velocity and the like on each particle group, solving the kinetic equation of the particle group and tracking the motion orbit of each particle.
And S12, printing interference factors, taking the interaction information as an external force, and combining the interaction of the solid and the liquid to obtain the influence of the mechanical behavior of the whole system on the movement of the individual, thereby realizing the simulation of the flow law of the ink fluid.
S13, GPU computer Shader optimization is carried out on the implementation method, an algorithm structure based on a GPU computing unit is designed and implemented, the strong computing capacity of the GPU is fully utilized, and the computing efficiency is effectively improved.
In S11, the continuous fluid is described by using a particle group with interaction, each particle carries various physical quantities including mass, velocity, etc., and the kinetic equation of the particle group is solved and the motion orbit of each particle is tracked; force on a particleThe medicine consists of three parts: external force term, pressure term, viscosity term.
Item of external forceThe calculation formula is as follows:
wherein ρ represents a density
Representing the gravitational acceleration vector.
Formula for calculating pressure termComprises the following steps:
wherein:
p represents a pressure field;
representing the gradient of the pressure field.
WhereinRepresenting the Hamiltonian (Hamiltonian) operator, which is defined as follows:
will Hamiltonian operatorActing on the pressure field p, a gradient of the pressure field can be obtained.
Viscosity termExpressed as:
wherein:
μ represents a viscosity coefficient, which is constant;
representing the velocity variation field, i.e. the velocity difference between the fluid particles;
whereinRepresents the laplacian (Laplace) operator, which is defined as follows:
a velocity variation field, i.e. a shear force for the part with a fast fluid motion velocity to the part with a slow motion velocity, can be obtained.
The external force term, pressure term, and viscosity term applied to a particle can be expressed as:
the acceleration is in the form:
assume a position in a fluid asCan obtain the acceleration of the pointIs composed of
Wherein:
ρ(ri) Density herein;
p(ri) Is the pressure herein;
here the velocity.
The acceleration is deduced according to the cumulative function of the density, the pressure and the speed of a certain point in the fluid, so that the motion trend of the fluid is simulated.
Step S12 is to achieve increased motion diversity: based on the calculation result of step S11, the position isAcceleration of a point ofSolid is introduced to the movement of the individual particles as an influence factor, and the influence of the solid on the liquid is simulated, so that the individual can be more truly simulated. The step S12 specifically includes the following steps:
wherein, O (r)i) The display position isIs present in the location of (a) so as to simulate the interaction of a liquid with a solid.
Step S13 is to further perform GPU computer Shader optimization on the implementation method, design and implement an algorithm structure based on GPU computing units, distribute motion computation of each object to each computing unit, fully utilize the powerful parallel computing capability of the GPU, and effectively improve the computation efficiency.
Step S20, scene rendering, which realizes a particle object-oriented scene rendering method: as shown in fig. 3, firstly, the fluid ink-water style picture is rendered by using the GPU Shader, the calculation result of the GPU Computer Shader can be directly obtained by using the GPU Shader, and since the Computer Shader performs calculation based on the GPU device and implements hydrodynamics calculation by image texture convolution, the calculation result can also be stored in a texture object, data transmission between GPUs can be directly implemented without transferring the calculation result to a memory, but directly transferring the calculation result to the GPU Shader for modification and rendering, and a large number of objects can be rendered in a very efficient manner by using this form, which has a very important meaning for highly repetitive rendering work. Furthermore, virtual characters such as mountains and waters, fishing boats, flying birds and the like are drawn by adopting different ink and wash style material systems, the virtual characters and dynamic fluid ink form a complete Chinese traditional ink and wash picture, further, interactive information is collected by adopting an infrared sensing technology, dynamic response of the picture and an experiencer is realized, and the interactivity and vividness of an ink and wash scene are effectively improved. And finally, rendering richer ink and water visual effects. The final rendering effect is shown in fig. 4.
In conclusion, the interactive ink simulation method based on hydrodynamics and GPU optimized rendering in this embodiment not only meets the simulation requirements of real-time, diversity and unpredictability of ink fluid motion in the real world, but also can fully exert the advantages of computer graphic image technology and computer hardware technology, and has a very important meaning in realizing an efficient and real rendering method. Through the interactive digital ink and water interaction system of this embodiment, the experience person not only can view and admire real-time dynamic ink and water red green, can also interact with the ink and water landscape, when experience person touching device, the flow of ink and water can be influenced, each ink line is all changing according to the direction and the speed that flow, and the fish of swimming in the picture also can timid hide, collocate guqin and guang simultaneously to the wind of thousand years ink and water is demonstrateed to virtual image and human-computer interaction's mode.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. An interactive ink simulation method based on hydrodynamics and GPU optimized rendering is characterized in that: performing, by a computer device, the steps of:
s101, establishing a fluid mechanics model, analyzing the stress rule of the particles, and realizing fluid motion simulation based on the stress rule of the particle individuals;
s102, based on fluid motion simulation operation, acquiring interaction information by adopting sensor equipment, and performing solid-liquid interaction analysis to realize interactive fluid simulation;
step S103, optimizing interactive fluid simulation operation by using a GPU computer Shader, and transplanting the optimized operation to a GPU;
and S104, based on the operation result after the fluid simulation optimization, performing scene drawing by adopting a GPU programmable pipeline, directly acquiring the calculation result by adopting a GPU Shader, simultaneously rendering the content of the virtual scene, and finally rendering the fluid motion structure, the fluid interaction and the virtual scene to a display medium by adopting the GPU Shader.
2. The interactable ink simulation method based upon hydrodynamics and GPU optimized rendering of claim 1, wherein: step S101, establishing a fluid mechanics model, analyzing the stress rule of the particles, and realizing fluid motion simulation based on the stress rule of the particle individuals;
specifically, based on a smooth particle hydrodynamics algorithm, by describing the interaction of individual particles, a kinetic equation of a particle group is solved, the motion orbit of each particle is tracked, and fluid motion simulation is realized based on the stress rule of the individual particles.
3. The interactable ink simulation method based upon hydrodynamics and GPU optimized rendering of claim 2, wherein: the fluid motion simulation method based on the smooth particle hydrodynamics algorithm solves a kinetic equation of a particle group and tracks a motion orbit of each particle through description of interaction of particle individuals, and achieves fluid motion simulation based on a stress rule of the particle individuals;
the method comprises the following steps:
the method comprises the following steps: for each individual fluid particle, following the most basic Newton's second law, the particle is forcedComprises the following steps:
wherein,acceleration vectors representing particle motion, m representing fluid mass, and fluid mass being determined by fluid cell density, so that mass is replaced by density p, the particles being subjected to forcesExpressed as:
force on a particleThe method comprises three parts: external force term, pressure term, viscosity term;
item of external forceThe calculation formula is as follows:
wherein, p represents the density,represents a gravity acceleration vector;
formula for calculating pressure termComprises the following steps:
wherein: p represents a pressure field;representing the gradient of the pressure field;
whereinRepresenting the Hamiltonian (Hamiltonian) operator, which is defined as follows:
will Hamiltonian operatorActing on the pressure field p to obtain the gradient of the pressure field;
viscosity termExpressed as:
wherein:
μ represents a viscosity coefficient, which is constant;
representing the velocity variation field, i.e. the velocity difference between the fluid particles;
whereinRepresents the laplacian (Laplace) operator, which is defined as follows:
the laplacian is a second order differential operator, cannot exist alone, must be used together with other symbols, and is obtained when a ═ f (x, y, z) is acted on
The operation is to solve the divergence of the scalar function gradient field and apply it to the velocity fieldWhen it is obtained
Obtaining a speed change field, namely shearing force of a part with a high fluid moving speed to a part with a low fluid moving speed; the external force term of the force on the particle, the pressure term, and the viscosity term are specifically expressed as:
the acceleration is in the form:
assume a position in a fluid asObtaining the acceleration of the pointIs composed of
Wherein:
ρ(ri) Density herein;
p(ri) Is the pressure herein;
the speed here;
the acceleration is deduced according to the cumulative function of the density, the pressure and the speed of a certain point in the fluid, so that the motion trend of the fluid is simulated.
4. The interactable ink simulation method based upon hydrodynamics and GPU optimized rendering of claim 3, wherein: the step S102 is based on fluid motion simulation operation, adopts sensor equipment to collect interaction information, carries out solid-liquid interaction analysis and realizes interactive fluid simulation;
the method specifically comprises the steps of collecting interactive information by adopting sensor equipment, introducing the interactive information as an external force, obtaining the influence of mechanical behavior on the movement of an individual by combining the interaction of solid and liquid, simulating the state of fluid blocking, and realizing the simulation of the flow rule of the ink fluid.
5. The interactable ink simulation method based upon hydrodynamics and GPU optimized rendering of claim 4, wherein: the method comprises the steps that sensor equipment is adopted to collect interaction information, the interaction information is introduced as an external force, the influence of mechanical behavior on the movement of an individual is obtained by combining the interaction of solid and liquid, the state of fluid blocking is simulated, and the simulation of the flow rule of the ink fluid is realized; the method comprises the following specific steps:
the method comprises the following steps:
s1021, external force item based on calculation result of step S101Human-computer interaction and virtual environment interaction interference factors are added to realize the mutual influence between the liquid and external factors;
s1022, calculating the result position based on the step S101Acceleration of a point ofSolid is introduced to the movement of the individual particles as an influence factor, and the influence of the solid on the liquid is simulated, so that the individual can be more truly simulated.
6. The interactable ink simulation method based upon hydrodynamics and GPU optimized rendering of claim 5, wherein: the S1021 external force item based on the calculation result of the step S101Human-computer interaction and virtual environment interaction interference factors are added to realize the mutual influence between the liquid and external factors;
the method comprises the following specific steps:
uniformly calculating external interference factors into external force by adopting a calculation formulaWhere f (i) is an external interference factor and k is a control constant.
7. The interactable ink simulation method based upon hydrodynamics and GPU optimized rendering of claim 5, wherein: the step S1022 is based on the calculation result of the step S101, the position isAcceleration of a point ofSolid is introduced into the movement of the individual particles as an influence factor to simulate the influence of the solid on the liquid, thereby realizing more real simulation of the individual;
The method specifically comprises the following steps:
setting the fluid speed and the motion trend of the interference area to be 0, and simulating the state of the fluid when encountering the blockage;
adopting a calculation formula:
wherein, O (r)i) The display position isIs present in the location of (a) so as to simulate the interaction of a liquid with a solid.
8. The interactable ink simulation method based upon hydrodynamics and GPU optimized rendering of claim 1, wherein: step S103, optimizing the interactive fluid simulation operation by using a GPU computer Shader, and transplanting the optimized operation to a GPU;
the method specifically comprises the following steps:
the method comprises the steps that the texture is adopted to store fluid motion data, the physical quantity data of the fluid is stored in a multi-dimensional texture, and the data are transmitted between a CPU and a GPU through the texture, so that a data storage and transmission basis is established for the GPU;
the method adopts GPU convolution to realize fluid mechanics calculation, converts complex Hamiltonian and Laplace operators into convolution operation of image texture, and fully utilizes the parallel structure of the GPU.
9. The interactable ink simulation method based upon hydrodynamics and GPU optimized rendering of claim 8, wherein: in the step S104, a GPU programmable pipeline is adopted for scene drawing, a GPU Shader is adopted for directly obtaining a calculation result, and meanwhile, the content of a virtual scene is rendered;
the method specifically comprises the following steps:
acquiring a convolution calculation result of the GPU computer Shader by using the GPU Shader, and rendering;
drawing the ink visual effect by adopting different ink style material systems;
and the infrared sensing technology is adopted to collect the interactive information, so that the dynamic response of the picture and the experiencer is realized.
10. The interactable ink simulation method based upon hydrodynamics and GPU optimized rendering of claim 1, wherein:
the sensor device in step S102 specifically includes: infrared sensor, body sensor, and laser radar.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910613199.8A CN110322540A (en) | 2019-07-09 | 2019-07-09 | Ink analogy method is interacted with what GPU optimization rendered based on hydrodynamics |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910613199.8A CN110322540A (en) | 2019-07-09 | 2019-07-09 | Ink analogy method is interacted with what GPU optimization rendered based on hydrodynamics |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110322540A true CN110322540A (en) | 2019-10-11 |
Family
ID=68123058
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910613199.8A Pending CN110322540A (en) | 2019-07-09 | 2019-07-09 | Ink analogy method is interacted with what GPU optimization rendered based on hydrodynamics |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110322540A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110930486A (en) * | 2019-11-28 | 2020-03-27 | 网易(杭州)网络有限公司 | Rendering method and device of virtual grass in game and electronic equipment |
CN112100939A (en) * | 2020-09-14 | 2020-12-18 | 福建天晴在线互动科技有限公司 | Real-time fluid simulation method and system based on computer Shader |
CN112598769A (en) * | 2020-12-18 | 2021-04-02 | 北京达佳互联信息技术有限公司 | Special effect rendering method and device, electronic equipment and computer readable storage medium |
CN112652044A (en) * | 2021-01-05 | 2021-04-13 | 网易(杭州)网络有限公司 | Particle special effect rendering method, device and equipment and storage medium |
WO2022135018A1 (en) * | 2020-12-25 | 2022-06-30 | 北京字跳网络技术有限公司 | Dynamic fluid display method and apparatus, electronic device, and readable medium |
CN117036560A (en) * | 2023-10-10 | 2023-11-10 | 福州朱雀网络科技有限公司 | Wind field simulation method, medium and equipment suitable for virtual scene |
CN117409127A (en) * | 2023-12-15 | 2024-01-16 | 中国美术学院 | Real-time ink fluid rendering method and device based on artificial intelligence |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090267951A1 (en) * | 2008-04-28 | 2009-10-29 | Institute For Information Industry | Method for rendering fluid |
CN102496177A (en) * | 2011-12-05 | 2012-06-13 | 中国科学院自动化研究所 | Method for producing three-dimensional water-and-ink animation |
CN105825059A (en) * | 2016-03-17 | 2016-08-03 | 天津大学 | Method for researching SPH (Smoothed Particle Hydrodynamics) multi-phase flow haptic interaction |
WO2017181837A1 (en) * | 2016-04-21 | 2017-10-26 | 浙江大学 | Rendering program online optimisation method |
CN107633123A (en) * | 2017-09-13 | 2018-01-26 | 浙江工业大学 | A kind of method accelerated for smoothed particle method simulation bleeding and processing |
CN108090939A (en) * | 2017-11-23 | 2018-05-29 | 北京中科创视文化传播有限公司 | The benthon trunked analog method rendered based on cluster synergetic and GPU optimizations |
-
2019
- 2019-07-09 CN CN201910613199.8A patent/CN110322540A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090267951A1 (en) * | 2008-04-28 | 2009-10-29 | Institute For Information Industry | Method for rendering fluid |
CN102496177A (en) * | 2011-12-05 | 2012-06-13 | 中国科学院自动化研究所 | Method for producing three-dimensional water-and-ink animation |
CN105825059A (en) * | 2016-03-17 | 2016-08-03 | 天津大学 | Method for researching SPH (Smoothed Particle Hydrodynamics) multi-phase flow haptic interaction |
WO2017181837A1 (en) * | 2016-04-21 | 2017-10-26 | 浙江大学 | Rendering program online optimisation method |
CN107633123A (en) * | 2017-09-13 | 2018-01-26 | 浙江工业大学 | A kind of method accelerated for smoothed particle method simulation bleeding and processing |
CN108090939A (en) * | 2017-11-23 | 2018-05-29 | 北京中科创视文化传播有限公司 | The benthon trunked analog method rendered based on cluster synergetic and GPU optimizations |
Non-Patent Citations (4)
Title |
---|
丘六校: ""Unity Compute Shader 硬件粒子效果"", 《HTTPS://ZHUANLAN.ZHIHU.COM/P/33675797?FROM_VOTERS_PAGE=TRUE》 * |
唐勇等: "SPH扩展方法实现液体与固体交互实时模拟", 《小型微型计算机系统》 * |
赵凡等: "一种基于流体动力学模拟的水墨渲染方法", 《微型电脑应用》 * |
郭琳: "基于SPH方法的液固交互仿真", 《电脑知识与技术》 * |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110930486A (en) * | 2019-11-28 | 2020-03-27 | 网易(杭州)网络有限公司 | Rendering method and device of virtual grass in game and electronic equipment |
CN110930486B (en) * | 2019-11-28 | 2023-11-17 | 网易(杭州)网络有限公司 | Virtual grass rendering method and device in game and electronic equipment |
CN112100939A (en) * | 2020-09-14 | 2020-12-18 | 福建天晴在线互动科技有限公司 | Real-time fluid simulation method and system based on computer Shader |
CN112100939B (en) * | 2020-09-14 | 2023-06-16 | 福建天晴在线互动科技有限公司 | Real-time fluid simulation method and system based on computer loader |
CN112598769A (en) * | 2020-12-18 | 2021-04-02 | 北京达佳互联信息技术有限公司 | Special effect rendering method and device, electronic equipment and computer readable storage medium |
CN112598769B (en) * | 2020-12-18 | 2024-03-12 | 北京达佳互联信息技术有限公司 | Special effect rendering method, device, electronic equipment and computer readable storage medium |
WO2022135018A1 (en) * | 2020-12-25 | 2022-06-30 | 北京字跳网络技术有限公司 | Dynamic fluid display method and apparatus, electronic device, and readable medium |
CN112652044A (en) * | 2021-01-05 | 2021-04-13 | 网易(杭州)网络有限公司 | Particle special effect rendering method, device and equipment and storage medium |
CN117036560A (en) * | 2023-10-10 | 2023-11-10 | 福州朱雀网络科技有限公司 | Wind field simulation method, medium and equipment suitable for virtual scene |
CN117036560B (en) * | 2023-10-10 | 2024-01-02 | 福州朱雀网络科技有限公司 | Wind field simulation method, medium and equipment suitable for virtual scene |
CN117409127A (en) * | 2023-12-15 | 2024-01-16 | 中国美术学院 | Real-time ink fluid rendering method and device based on artificial intelligence |
CN117409127B (en) * | 2023-12-15 | 2024-04-05 | 中国美术学院 | Real-time ink fluid rendering method and device based on artificial intelligence |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110322540A (en) | Ink analogy method is interacted with what GPU optimization rendered based on hydrodynamics | |
Chen et al. | Toward interactive-rate simulation of fluids with moving obstacles using Navier-Stokes equations | |
CN110717269B (en) | Fluid surface detail protection method based on grid and particle coupling | |
CN107633123A (en) | A kind of method accelerated for smoothed particle method simulation bleeding and processing | |
CN106342298B (en) | A kind of Real-time Generation of multiple spot explosive effect | |
Liu et al. | Fast and stable simulation of virtual water scenes with interactions | |
Chiba et al. | Visual simulation of water currents using a particle‐based behavioural model | |
Zhang et al. | Collaborative virtual laboratory environments with hardware in the loop | |
Liu et al. | Fishgym: A high-performance physics-based simulation framework for underwater robot learning | |
Xi et al. | Survey on smoothed particle hydrodynamics and the particle systems | |
Wylie | Application of two-dimensional cellular automaton lattice-gas models to the simulation of hydrodynamics | |
CN116933674A (en) | LBM-based rapid fluid simulation method | |
Du et al. | FluidMLP: A general method for learning Lagrangian fluid simulation | |
Zhu et al. | Animating turbulent water by vortex shedding in PIC/FLIP | |
Shardakov et al. | Development of an effective model of parallel processing of multimedia data on the CPU and GPU in the cloud system | |
Lazo et al. | Real-time physical engine for floating objects with two-way fluid-structure coupling | |
Inengite | A Creator’s Perspective on Technocultural Imagination And The Metaverse Spacetime | |
Qiu et al. | Novel fluid detail enhancement based on multi‐layer depth regression analysis and FLIP fluid simulation | |
Tian et al. | Design and implementation of flight visual simulation system | |
Stock | Flow simulation with vortex elements | |
Zhai et al. | Flow Effect Simulation of River in Inland River Ship Simulator | |
Sun et al. | Animating pictures using procedural 2.5 D water flow simulation | |
Oh et al. | Single-phase trapped air simulation in water flow | |
Onderik | Animation of Particle Based Miscible and Immiscible Fluids with Multiple Interfaces | |
Gharehchopogh et al. | Analysis of the Fractal Koch Method in Computer Games Development |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20191011 |
|
WD01 | Invention patent application deemed withdrawn after publication |