WO2022062254A1 - Method and apparatus for rendering rain and snow special effects in real time - Google Patents

Method and apparatus for rendering rain and snow special effects in real time Download PDF

Info

Publication number
WO2022062254A1
WO2022062254A1 PCT/CN2020/141345 CN2020141345W WO2022062254A1 WO 2022062254 A1 WO2022062254 A1 WO 2022062254A1 CN 2020141345 W CN2020141345 W CN 2020141345W WO 2022062254 A1 WO2022062254 A1 WO 2022062254A1
Authority
WO
WIPO (PCT)
Prior art keywords
layer area
upper layer
area
raindrops
snowflakes
Prior art date
Application number
PCT/CN2020/141345
Other languages
French (fr)
Chinese (zh)
Inventor
杨永康
Original Assignee
威创集团股份有限公司
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 威创集团股份有限公司 filed Critical 威创集团股份有限公司
Publication of WO2022062254A1 publication Critical patent/WO2022062254A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • G06T13/603D [Three Dimensional] animation of natural phenomena, e.g. rain, snow, water or plants
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/56Particle system, point based geometry or rendering

Definitions

  • the present application relates to the technical field of computer simulation, and in particular, to a real-time rain and snow special effect rendering method and device.
  • the simulation of natural scenes such as rain and snow has a wide range of applications in the field of computer simulation, which can improve the fidelity of three-dimensional scenes.
  • a particle system is usually used to simulate raindrops and snowflakes to represent the weather in the scene.
  • the particle system is centered on the camera, and the camera field of view distance is the radius to generate a picture with raindrops or snowflakes to simulate rain and snow weather.
  • the visual distance between the scene and the camera is very large, such as more than 1 kilometer, if you continue to use the above method for filling, a large number of particles will be required, and as the visual range increases, the required number of particles will increase. And the requirements for computer performance will increase exponentially, which will seriously consume computer performance, resulting in program freezes and even downtime.
  • the existing technology reduces the number of particles and the visual distance covered by particle special effects to reduce the performance consumption caused by the sharp increase in the number of particles, resulting in a thin, layered and fidelity final rendered picture.
  • the present application provides a real-time rain and snow special effect rendering method and device, which are used to solve the problem of reducing the number of particles and reducing the visual distance covered by particle special effects in the prior art in the face of large scenes and large visual distances.
  • the performance consumption brought about by the increase leads to the technical problems that the final rendered picture is thin, lacks layers and fidelity.
  • a first aspect of the present application provides a real-time rain and snow special effect rendering method, including:
  • a circular particle generation area is established with the camera position as the center, the bottom layer area is obtained, and after configuring at least one image of a single raindrop or snowflake for each particle in the bottom layer area, the normal map is superimposed;
  • the bottom layer area and the upper layer area are simultaneously rendered according to the configuration result of the bottom layer area and the upper layer area.
  • the bottom layer area and the upper layer area are respectively configured, including:
  • the number, particle size, particle movement speed and direction in the bottom layer area and the upper layer area are configured.
  • the shape of the particle generation area includes at least a circle or a rectangle.
  • the bottom layer area and the upper layer area are respectively configured, including:
  • the real-time rain condition information or snow condition information configure the number of particles, particle size, particle movement speed and direction in the bottom layer area, as well as the movement speed and movement direction of the pictures of raindrops or snowflakes in the upper layer area and the number of pictures to configure.
  • the upper layer area includes a one-layer area, a two-layer area or a multi-layer area.
  • the upper layer area when the upper layer area is a two-layer area, the upper layer area includes a first upper layer area and a second upper layer area;
  • the picture of raindrops or snowflakes in the upper layer area is a picture of multiple parallel raindrops and rain fog with transparent channels or a picture of multiple parallel snowflakes with transparent channels, and the raindrops or snowflakes in the second upper layer area.
  • the number of raindrops or snowflakes in the picture of the first upper layer area is more than the number of raindrops or snowflakes in the picture of the first upper layer area.
  • a second aspect of the present application provides a real-time rain and snow special effect rendering device, including:
  • the first establishment unit is used to establish a circular particle generation area with the camera position as the center, obtain the bottom layer area, and configure at least one image of a single raindrop or snowflake for each particle in the bottom layer area, and then superimpose the normal map ;
  • a second establishment unit configured to establish an upper layer area in front of the bottom layer area along the camera line of sight, and paste a picture of raindrops or snowflakes on the upper layer area;
  • a configuration unit configured to separately configure the bottom layer area and the upper layer area according to real-time rain condition information or snow condition information
  • a rendering unit configured to render the bottom layer region and the upper layer region simultaneously according to the configuration result of the bottom layer region and the upper layer region.
  • the second establishment unit is specifically used for:
  • configuration unit is specifically used for:
  • the number, particle size, particle movement speed and direction in the bottom layer area and the upper layer area are configured.
  • the second establishment unit is further used for:
  • configuration unit is specifically used for:
  • the real-time rain condition information or snow condition information configure the number of particles, particle size, particle movement speed and direction in the bottom layer area, as well as the movement speed and movement direction of the pictures of raindrops or snowflakes in the upper layer area and the number of pictures to configure.
  • the present application has the following advantages:
  • the present application provides a real-time rain and snow special effect rendering method, including: establishing a circular particle generation area with a camera position as the center, obtaining a bottom layer area, and configuring at least one picture of a single raindrop or snowflake for each particle in the bottom layer area Then, superimpose the normal map; along the camera line of sight, establish an upper area in front of the bottom area, and paste a picture of raindrops or snowflakes on the upper area; Configuration; according to the configuration results of the bottom layer area and the upper layer area, the bottom layer area and the upper layer area are rendered at the same time.
  • the real-time rain and snow special effects rendering method in this application designs a new rendering structure, and adds an upper layer area on the basis of the existing rendering structure that only has the bottom layer area.
  • the number of simulated particles under the visible distance enables the computer to achieve realistic, dynamic and real-time rain and snow special effects in large scenes and large viewing distances with less performance overhead, thus solving the problem of the existing technology in the face of large scenes.
  • Under the viewing distance by reducing the number of particles and reducing the field of view covered by particle effects, the performance consumption caused by the sharp increase in the number of particles is reduced, resulting in technical problems of thin, layered and realistic final rendered images.
  • Embodiment 1 is a schematic flowchart of Embodiment 1 of a real-time rain and snow special effect rendering method provided by the present application;
  • Embodiment 2 is a schematic flowchart of Embodiment 2 of a real-time rain and snow special effect rendering method provided by the present application;
  • Embodiment 3 is a schematic flowchart of Embodiment 3 of a real-time rain and snow special effect rendering method provided by the present application;
  • FIG. 4 is a schematic diagram of a first rendering structure provided by the application.
  • FIG. 5 is a schematic diagram of a second rendering structure provided by the application.
  • FIG. 6 is a schematic diagram of a third rendering structure provided by the present application.
  • FIG. 7 is a schematic structural diagram of a real-time rain and snow special effect rendering apparatus provided by the present application.
  • the present application provides a real-time rain and snow special effect rendering method and device, which are used to solve the problem of reducing the number of particles and reducing the visual distance covered by particle special effects in the prior art in the face of large scenes and large visual distances.
  • the performance consumption brought about by the increase leads to the technical problems that the final rendered picture is thin, lacks layers and fidelity.
  • the existing method When the existing method is applied to a large scene with a large visual distance, for example, to simulate a city with special effects of rain and snow, the existing method establishes a circular particle generation area centered on the camera position, and the particle generation area covers the entire area. Urban area, and then generate a large number of particles in the particle generation area for rain and snow special effects rendering. For a large scene such as a city with a large visual distance, using this method to generate a large number of particles will seriously consume computer performance and cause the program to freeze. , or even downtime.
  • the present application provides a real-time rain and snow special effect rendering method.
  • Embodiment 1 of a real-time rain and snow special effect rendering method includes:
  • Step 101 establishing a circular particle generation area with the camera position as the center to obtain a bottom layer area, and after configuring at least one image of a single raindrop or snowflake for each particle in the bottom layer area, superimpose a normal map.
  • a circular particle generation area is established with the camera position as the center, and the bottom layer area is obtained.
  • the radius of the circular particle generation area can be the distance of the camera's field of view, or it can be set according to the actual situation.
  • the bottom layer is the layer closest to the camera, the particles are simulated using separate raindrop images.
  • the image of raindrops or snowflakes is the material of particle rendering. When a same image material is used, repeated effects will inevitably occur when generated in large quantities. To avoid this situation, each particle can be configured with multiple images of raindrops or snowflakes. , to eliminate repetitive effects and make the simulation picture more natural and realistic. Therefore, in the embodiment of the present application, each particle in the bottom layer is configured with at least one image of a single raindrop or snowflake, and a normal map is superimposed. The use of a normal map belongs to the prior art, which will not be repeated here.
  • Step 102 along the line of sight of the camera, establish an upper layer area in front of the bottom layer area, and paste a picture of raindrops or snowflakes on the upper layer area.
  • the circle at the bottom of the figure represents the range of the bottom layer
  • the symbol in the middle of the circle is the camera
  • the triangular wire frame above the camera represents the viewing angle range of the camera.
  • To the direction of the viewing angle range establish an upper layer area in front of the bottom layer area, and paste a picture of raindrops or snowflakes on the upper layer area, wherein the shape of the upper layer area can be any shape such as a circle or a matrix.
  • the distance between the upper layer area and the bottom layer area can be adjusted according to the performance of the computer and the effect of the scene. The higher the number of particles to be rendered, the higher the performance requirements of the computer.
  • Step 103 Configure the bottom layer area and the upper layer area respectively according to the real-time rain condition information or snow condition information.
  • the bottom layer area and the upper layer area respectively, for example, configure the number of instances, particle size, particle movement speed and direction, etc.
  • Step 104 Render the bottom layer area and the upper layer area at the same time according to the configuration results of the bottom layer area and the upper layer area.
  • the corresponding bottom layer area and the upper layer area are simultaneously rendered according to the configuration result, and the rain and snow effects are simulated, and the obtained rendering effect can be seen on the display.
  • a new rendering structure is designed, and an upper layer area is added on the basis that the existing rendering structure only has the bottom layer area.
  • the number of simulated particles in the large visual distance of the scene enables the computer to achieve realistic, dynamic and real-time rain and snow special effects in the large scene and large visual distance with less performance overhead, thus solving the problem of the existing technology in the face of large scenes.
  • the performance consumption caused by the sharp increase in the number of particles is reduced, resulting in technical problems of thin, layered and fidelity final rendered images.
  • Embodiment 1 of a real-time rain and snow special effect rendering method provided by the present application
  • Embodiment 2 of a real-time rain and snow special effect rendering method provided by the present application.
  • the second embodiment of a real-time rain and snow special effect rendering method includes:
  • Step 201 establishing a circular particle generation area with the camera position as the center to obtain a bottom layer area, and after configuring at least one image of a single raindrop or snowflake for each particle in the bottom layer area, superimpose a normal map.
  • Step 202 along the line of sight of the camera, establish a particle generation area in front of the bottom layer area to obtain the upper layer area.
  • a particle generation area is established in front of the bottom layer area to obtain an upper layer area, wherein the shape of the particle generation area can be a circle, a rectangle or other shapes.
  • one layer, two layers or multiple layers of particle generation regions can be established in front of the bottom layer region, and correspondingly, the obtained upper layer region includes one layer region, two layer regions or multi-layer regions.
  • the obtained upper layer area includes a first upper layer area and a second upper layer area, that is, the rendering structure constructed in the embodiment of the present application is preferably three layers of particles, that is, along the In the direction of the camera's line of sight, a layer of particle generation area is established in front of the bottom layer area to obtain the first upper layer area, and a layer of particle generation area is established in front of the first upper layer area to obtain the second upper layer area.
  • the shape of the particle generation area is a circle
  • the second layer is equivalent to the first upper layer area
  • the shape of the particle generation area is a rectangle, or a circle or other shapes
  • the third layer is equivalent to the second upper layer area
  • the shape of the particle generation area is a matrix, and may also be a circle or other shapes.
  • Step 203 After configuring at least one image of raindrops or snowflakes for each particle in the upper layer area, superimpose a normal map.
  • the upper layer area After the upper layer area is established, configure at least one image of raindrops or snowflakes for each particle in the upper layer area, and then superimpose the normal map.
  • the upper area is a two-layer area, paste pictures of raindrops or snowflakes on the first upper area and the second upper area.
  • At least one picture of multiple parallel raindrops and fine rain fog with transparent channels or pictures of multiple parallel snowflakes with transparent channels is configured for each particle in the first upper layer area, and a normal map is superimposed;
  • Each particle in the second upper layer area is configured with at least one picture of multiple parallel raindrops and fine rain fog with transparent channels or pictures of multiple parallel snowflakes with transparent channels, and superimposed normal maps, wherein the second upper layer area
  • the number of raindrops or snowflakes in the picture of raindrops or snowflakes is much greater than the number of raindrops or snowflakes in the picture of raindrops or snowflakes in the first upper region.
  • the first upper layer area is located behind the bottom layer area and is farther from the camera than the bottom layer area.
  • the purpose of designing this layer is to contrast with the bottom layer to form a sense of spatial hierarchy, and to visually increase the visual distance of the rain and snow effects. Due to the increased rendering range, rendering a raindrop image with each particle in the first layer will also result in a huge performance cost. Therefore, each particle image in the first upper layer region contains multiple parallel raindrops or multiple parallel snowflakes, so as to achieve the effect of simulating a large number of raindrops with a smaller number of particles.
  • the second upper layer area is located after the first upper layer area and is the farthest from the camera.
  • the purpose of designing this layer is to provide a dynamic and layered background for the first two layers.
  • the processing method of particle elements in this layer is similar to that in the first upper layer area, the difference is that each particle image in this layer contains more raindrop elements or snowflake elements, and the number and density of raindrops or snowflakes can be the same as those in the first upper layer area. dozens of times or more.
  • Step 204 according to the real-time rain condition information or snow condition information, configure the particle number, particle size, particle movement speed and direction in the bottom layer area and the upper layer area.
  • the particles are simulated using separate raindrop images. Therefore, by setting the size, movement direction and speed of each particle in this layer, the size, direction and speed of each raindrop or snowflake can be simulated.
  • the number of particles can be set according to the real-time rain or snow condition information, the particle size can be approximated according to the rainfall or snowfall, the particle movement direction can be approximated or calculated through the current wind and wind direction, and the particle movement speed can be approximated according to the raindrop or snowfall.
  • the size of snowflakes can be obtained by approximate simulation or calculation, so that the changes of raindrops or snowflakes by wind speed, resistance and other factors can be realized.
  • the configuration process of the upper layer area is similar to the configuration process of the bottom layer area. According to the real-time rain condition information or snow condition information, the number of particles, particle size, particle movement speed and direction in the bottom layer area and the upper layer area are configured to obtain the bottom layer area and the upper layer area, respectively. The configuration result of the zone.
  • Step 205 Render the bottom layer area and the upper layer area at the same time according to the configuration results of the bottom layer area and the upper layer area.
  • the particles in the three-layer particle area are rendered at the same time, and the rain and snow special effects are simulated, and the obtained rendering effect can be displayed on the monitor.
  • a three-layer particle structure for rain and snow special effects rendering, and the particles in the layer closest to the camera are simulated by using separate pictures of raindrops or snowflakes. It can simulate the size, direction and speed of each raindrop or snowflake, and can realize the changes of raindrops or snowflakes by wind speed, resistance and other factors.
  • the contrast between the second layer and the first layer forms a spatial layering, which visually increases the visual distance of the rain and snow effects.
  • Each particle image in the second layer includes multiple parallel raindrops or snowflakes.
  • each particle image in the third layer contains more raindrops or snowflake elements, and the number and density of raindrops or snowflakes can be the same as that of the second layer. dozens of times or more.
  • a new rendering structure is designed, a three-layer particle generation area is constructed, the number of particles in the first layer is reduced by layering, and the sense of layering is increased to make the picture more deep; through the cooperation between the three layers, the computer Realistic, dynamic, real-time rain and snow effects in large scenes and large viewing distances are realized with low performance overhead.
  • the third embodiment of a real-time rain and snow special effect rendering method includes:
  • Step 301 establishing a circular particle generation area with the camera position as the center to obtain a bottom layer area, and after configuring at least one image of a single raindrop or snowflake for each particle in the bottom layer area, superimpose a normal map.
  • step 301 The specific content of step 301 is the same as that of step 201, and details are not repeated here.
  • Step 302 establishing an upper layer area in front of the bottom layer area along the direction of the camera's sight line, wherein the upper layer area is a cylindrical model.
  • the upper layer area is the particle generation area, and particles are generated in this area, and there is no actual vertex model.
  • a cylindrical model is used, which is realized based on a real vertex mesh model, and no particles are generated.
  • the first layer is the bottom layer area, that is, the circular particle generation area.
  • the second floor is the upper area, that is, the cylindrical model.
  • the upper layer area is not limited to the form of particles, mainly through layering to reduce the number of particles in the bottom layer area, and increase the layering to give the picture depth.
  • Step 303 paste a picture of raindrops or snowflakes on the cylindrical model.
  • Step 304 according to the real-time rain condition information or snow condition information, configure the number of particles, particle size, particle movement speed and direction in the bottom layer area, and the movement speed, movement direction and direction of the pictures of raindrops or snowflakes in the upper layer area. Configure the number of pictures.
  • the real-time rain or snow condition information configure the number of particles, particle size, particle movement speed and direction in the bottom layer, as well as the movement speed, movement direction and number of pictures of raindrops or snowflakes in the upper layer area. configuration.
  • the particle size, movement direction and speed in the bottom layer area, and configuring the movement speed, movement direction and number of pictures of the raindrop or snowflake in the upper layer area you can simulate the size, direction and number of each raindrop or snowflake.
  • the speed can realize the change of raindrops or snowflakes by wind speed, resistance and other factors.
  • Step 305 Render the bottom layer area and the upper layer area at the same time according to the configuration results of the bottom layer area and the upper layer area.
  • the bottom layer area and the upper layer area are rendered at the same time, and the rain and snow special effects are simulated, and the obtained rendering effect can be displayed on the monitor.
  • a layer of particle generation area and a layer of cylindrical model are constructed, and pictures of raindrops or snowflakes are pasted on the cylindrical model, and the pictures are moved to cause the effect of raindrops or snowflakes falling.
  • the number of particles in the first layer is reduced, and the sense of layering is increased to make the picture more deep; through the cooperation between the two layers, the computer can achieve realistic and dynamic large scenes and large viewing distances with low performance overhead. , Real-time rain and snow effects.
  • Embodiment 3 of a real-time rain and snow special effect rendering method provided by the present application
  • Embodiment 1 of a real-time rain and snow special effect rendering apparatus provided by the present application.
  • Embodiment 1 of a real-time rain and snow special effect rendering apparatus includes:
  • the first establishment unit 401 is used to establish a circular particle generation area with the camera position as the center to obtain a bottom layer area, and after configuring at least one image of a single raindrop or snowflake for each particle in the bottom layer area, superimpose a normal map.
  • the second establishing unit 402 is configured to establish an upper layer area in front of the bottom layer area along the line of sight of the camera, and paste a picture of raindrops or snowflakes on the upper layer area.
  • the configuration unit 403 is configured to separately configure the bottom layer area and the upper layer area according to the real-time rain condition information or snow condition information.
  • the rendering unit 404 is configured to render the bottom layer area and the upper layer area at the same time according to the configuration result of the bottom layer area and the upper layer area.
  • the above is the first embodiment of a real-time rain and snow special effect rendering device provided by the application, and the following is the second embodiment of a real-time rain and snow special effect rendering device provided by the application.
  • the first establishment unit 401 is used to establish a circular particle generation area with the camera position as the center to obtain a bottom layer area, and after configuring at least one image of a single raindrop or snowflake for each particle in the bottom layer area, superimpose a normal map.
  • the second establishment unit 402 is configured to establish an upper layer area in front of the bottom layer area along the line of sight of the camera, and paste a picture of raindrops or snowflakes on the upper layer area.
  • the configuration unit 403 is configured to separately configure the bottom layer area and the upper layer area according to the real-time rain condition information or snow condition information.
  • the rendering unit 404 is configured to render the bottom layer area and the upper layer area at the same time according to the configuration result of the bottom layer area and the upper layer area.
  • the second establishing unit 402 is specifically used for:
  • configuration unit 403 is specifically used for:
  • the second establishing unit 402 is also used for:
  • configuration unit 403 is specifically used for:
  • the real-time rain or snow condition information configure the number of particles, particle size, particle movement speed and direction in the bottom layer, as well as the movement speed, movement direction and number of pictures of raindrops or snowflakes in the upper layer area. configuration.
  • the upper layer area includes a one-layer area, a two-layer area or a multi-layer area.
  • the upper layer area when the upper layer area is a two-layer area, the upper layer area includes a first upper layer area and a second upper layer area;
  • the second establishing unit 402 is specifically configured to:
  • a first upper layer area is established in front of the bottom layer area, and a second upper layer area is established in front of the first upper layer area;
  • the picture of raindrops or snowflakes in the upper layer area is a picture of multiple parallel raindrops and rain fog with transparent channels or a picture of multiple parallel snowflakes with transparent channels, and the raindrops or snowflakes in the second upper layer area are in the picture.
  • the number of raindrops or snowflakes is greater than the number of raindrops or snowflakes in the image of the first upper region.
  • the disclosed apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

A method and apparatus for rendering rain and snow special effects in real time, the method comprising: establishing a circular particle generation area by taking the position of a camera as the center, so as to obtain a bottom-layer area, configuring at least one picture of a single raindrop or snowflake for each particle in the bottom-layer area, and superposing a normal map (101); establishing an upper-layer area in front of the bottom-layer area along a line-of-sight direction of the camera, and pasting a picture of raindrops or snowflakes on the upper-layer area (102); respectively configuring the bottom-layer area and the upper-layer area according to real-time rain condition information or snow condition information (103); and simultaneously rendering the bottom-layer area and the upper-layer area according to the configuration results of the bottom-layer area and the upper-layer area (104). By means of the method, the technical problem in the prior art of when faced with a large scene and a large visual distance, a finally presented image being insubstantial and lacking dimension and realism as a result of performance consumption, which is brought about by a sharp increase in the number of particles, being reduced by means of reducing the number of particles and reducing a field-of-view distance covered by particle special effects is solved.

Description

一种实时雨雪特效渲染方法和装置A kind of real-time rain and snow special effect rendering method and device
本申请要求于2020年09月22日提交中国专利局、申请号为202011001256.6、发明名称为“一种实时雨雪特效渲染方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202011001256.6 and the invention titled "A real-time rain and snow special effect rendering method and device", which was filed with the China Patent Office on September 22, 2020, the entire contents of which are incorporated by reference in in this application.
技术领域technical field
本申请涉及计算机仿真技术领域,尤其涉及一种实时雨雪特效渲染方法和装置。The present application relates to the technical field of computer simulation, and in particular, to a real-time rain and snow special effect rendering method and device.
背景技术Background technique
关于雨、雪等自然景物的模拟在计算机仿真领域中有着广泛的应用,其可以提高三维场景的逼真度。在一下城市级模拟仿真方案中,需要通过实时获取现实环境中的天气参数(降雨量、降雨范围、风向、风速等参数),动态调整三维场景中雨雪特效的相关参数,通过雨雪特效尽可能还原现实环境的天气情况。The simulation of natural scenes such as rain and snow has a wide range of applications in the field of computer simulation, which can improve the fidelity of three-dimensional scenes. In the following city-level simulation scheme, it is necessary to obtain the weather parameters (rainfall, rainfall range, wind direction, wind speed and other parameters) in the real environment in real time, and dynamically adjust the relevant parameters of the rain and snow effects in the 3D scene. It is possible to restore the weather conditions of the real environment.
现有技术中,通常采用粒子系统模拟雨滴、雪花来表现场景内的天气,通常粒子系统以相机为中心,相机视野距离为半径生成带有雨滴或雪花的图片,以模拟雨雪天气。但是,当场景和相机的可视距离非常大,例如1千米以上时,若继续采用前述方法进行填充,则需要大量的粒子,并且会随着可视范围的增大,所需的粒子数量以及对计算机性能的要求会呈指数增加,会严重消耗计算机性能,导致程序卡顿,甚至宕机。在大场景大可视距离下,现有技术通过减少粒子数量并降低粒子特效覆盖的视野距离,以降低粒子数量剧增带来的性能消耗,导致最终呈现的画面单薄、缺乏层次和逼真度。In the prior art, a particle system is usually used to simulate raindrops and snowflakes to represent the weather in the scene. Usually, the particle system is centered on the camera, and the camera field of view distance is the radius to generate a picture with raindrops or snowflakes to simulate rain and snow weather. However, when the visual distance between the scene and the camera is very large, such as more than 1 kilometer, if you continue to use the above method for filling, a large number of particles will be required, and as the visual range increases, the required number of particles will increase. And the requirements for computer performance will increase exponentially, which will seriously consume computer performance, resulting in program freezes and even downtime. In a large scene with a large viewing distance, the existing technology reduces the number of particles and the visual distance covered by particle special effects to reduce the performance consumption caused by the sharp increase in the number of particles, resulting in a thin, layered and fidelity final rendered picture.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种实时雨雪特效渲染方法和装置,用于解决现有技术在面对大场景大可视距离下,通过减少粒子数量并降低粒子特效覆盖的视野距离,以降低粒子数量剧增带来的性能消耗,导致最终呈现的画面单薄、 缺乏层次和逼真度的技术问题。The present application provides a real-time rain and snow special effect rendering method and device, which are used to solve the problem of reducing the number of particles and reducing the visual distance covered by particle special effects in the prior art in the face of large scenes and large visual distances. The performance consumption brought about by the increase, leads to the technical problems that the final rendered picture is thin, lacks layers and fidelity.
有鉴于此,本申请第一方面提供了一种实时雨雪特效渲染方法,包括:In view of this, a first aspect of the present application provides a real-time rain and snow special effect rendering method, including:
以相机位置为中心建立圆形粒子生成区域,得到底层区域,并对所述底层区域中的每个粒子配置至少一张单个雨滴或雪花的图片后,叠加法线贴图;A circular particle generation area is established with the camera position as the center, the bottom layer area is obtained, and after configuring at least one image of a single raindrop or snowflake for each particle in the bottom layer area, the normal map is superimposed;
沿相机视线方向,在所述底层区域前方建立上层区域,并在所述上层区域贴上雨滴或雪花的图片;Along the direction of the camera's sight line, establish an upper layer area in front of the lower layer area, and paste a picture of raindrops or snowflakes on the upper layer area;
根据实时雨况信息或雪况信息,对所述底层区域和所述上层区域分别进行配置;According to real-time rain condition information or snow condition information, configure the bottom layer area and the upper layer area respectively;
根据所述底层区域和所述上层区域的配置结果对所述底层区域和所述上层区域同时进行渲染。The bottom layer area and the upper layer area are simultaneously rendered according to the configuration result of the bottom layer area and the upper layer area.
可选的,所述沿相机视线方向,在所述底层区域前方建立上层区域,并在所述上层区域贴上雨滴或雪花的图片,包括:Optionally, along the line of sight of the camera, establish an upper layer area in front of the bottom layer area, and paste a picture of raindrops or snowflakes on the upper layer area, including:
沿相机视线方向,在所述底层区域前方建立粒子生成区域,得到上层区域;along the direction of the camera's line of sight, establish a particle generation area in front of the bottom layer area to obtain an upper layer area;
对所述上层区域中的每个粒子配置至少一张雨滴或雪花的图片后,叠加法线贴图;After configuring at least one image of raindrops or snowflakes for each particle in the upper layer area, superimpose a normal map;
相应的,所述根据实时雨况信息或雪况信息,对所述底层区域和所述上层区域分别进行配置,包括:Correspondingly, according to the real-time rain condition information or snow condition information, the bottom layer area and the upper layer area are respectively configured, including:
根据实时雨况信息或雪况信息,对所述底层区域和所述上层区域中的粒子数量、粒子大小、粒子运动速度和方向进行配置。According to real-time rain condition information or snow condition information, the number, particle size, particle movement speed and direction in the bottom layer area and the upper layer area are configured.
可选的,所述粒子生成区域的形状至少包括圆形或矩形。Optionally, the shape of the particle generation area includes at least a circle or a rectangle.
可选的,所述沿相机视线方向,在所述底层区域前方建立上层区域,并在所述上层区域贴上雨滴或雪花的图片,包括:Optionally, along the line of sight of the camera, establish an upper layer area in front of the bottom layer area, and paste a picture of raindrops or snowflakes on the upper layer area, including:
沿相机视线方向,在所述底层区域前方建立上层区域,其中,所述上层区域为圆柱形的模型;along the line of sight of the camera, establish an upper layer area in front of the bottom layer area, wherein the upper layer area is a cylindrical model;
在所述圆柱形的模型上贴上雨滴或雪花的图片;Posting pictures of raindrops or snowflakes on the cylindrical model;
相应的,所述根据实时雨况信息或雪况信息,对所述底层区域和所述上层区域分别进行配置,包括:Correspondingly, according to the real-time rain condition information or snow condition information, the bottom layer area and the upper layer area are respectively configured, including:
根据实时雨况信息或雪况信息,对所述底层区域中的粒子数量、粒子 大小、粒子运动速度和方向进行配置,以及对所述上层区域中的雨滴或雪花的图片的运动速度、运动方向和图片数量进行配置。According to the real-time rain condition information or snow condition information, configure the number of particles, particle size, particle movement speed and direction in the bottom layer area, as well as the movement speed and movement direction of the pictures of raindrops or snowflakes in the upper layer area and the number of pictures to configure.
可选的,所述上层区域包括一层区域、两层区域或多层区域。Optionally, the upper layer area includes a one-layer area, a two-layer area or a multi-layer area.
可选的,当所述上层区域为两层区域时,所述上层区域包括第一上层区域和第二上层区域;Optionally, when the upper layer area is a two-layer area, the upper layer area includes a first upper layer area and a second upper layer area;
相应的,所述沿相机视线方向,在所述底层区域前方建立上层区域,并在所述上层区域贴上雨滴或雪花的图片,包括:Correspondingly, establishing an upper layer area in front of the bottom layer area along the camera line of sight, and pasting a picture of raindrops or snowflakes on the upper layer area, including:
沿相机视线方向,在所述底层区域前方建立所述第一上层区域,并在所述第一上层区域前方建立所述第二上层区域;along the line of sight of the camera, establish the first upper layer area in front of the bottom layer area, and establish the second upper layer area in front of the first upper layer area;
在所述第一上层区域和所述第二上层区域贴上雨滴或雪花的图片。Paste pictures of raindrops or snowflakes on the first upper layer area and the second upper layer area.
可选的,所述上层区域的雨滴或雪花的图片为具有透明通道的多个平行雨滴和雨雾的图片或具有透明通道的多个平行雪花的图片,且所述第二上层区域的雨滴或雪花的图片中雨滴数量或雪花数量多于所述第一上层区域的雨滴或雪花的图片中雨滴数量或雪花数量。Optionally, the picture of raindrops or snowflakes in the upper layer area is a picture of multiple parallel raindrops and rain fog with transparent channels or a picture of multiple parallel snowflakes with transparent channels, and the raindrops or snowflakes in the second upper layer area. The number of raindrops or snowflakes in the picture of the first upper layer area is more than the number of raindrops or snowflakes in the picture of the first upper layer area.
本申请第二方面提供了一种实时雨雪特效渲染装置,包括:A second aspect of the present application provides a real-time rain and snow special effect rendering device, including:
第一建立单元,用于以相机位置为中心建立圆形粒子生成区域,得到底层区域,并对所述底层区域中的每个粒子配置至少一张单个雨滴或雪花的图片后,叠加法线贴图;The first establishment unit is used to establish a circular particle generation area with the camera position as the center, obtain the bottom layer area, and configure at least one image of a single raindrop or snowflake for each particle in the bottom layer area, and then superimpose the normal map ;
第二建立单元,用于沿相机视线方向,在所述底层区域前方建立上层区域,并在所述上层区域贴上雨滴或雪花的图片;a second establishment unit, configured to establish an upper layer area in front of the bottom layer area along the camera line of sight, and paste a picture of raindrops or snowflakes on the upper layer area;
配置单元,用于根据实时雨况信息或雪况信息,对所述底层区域和所述上层区域分别进行配置;a configuration unit, configured to separately configure the bottom layer area and the upper layer area according to real-time rain condition information or snow condition information;
渲染单元,用于根据所述底层区域和所述上层区域的配置结果对所述底层区域和所述上层区域同时进行渲染。A rendering unit, configured to render the bottom layer region and the upper layer region simultaneously according to the configuration result of the bottom layer region and the upper layer region.
可选的,所述第二建立单元具体用于:Optionally, the second establishment unit is specifically used for:
沿相机视线方向,在所述底层区域前方建立粒子生成区域,得到上层区域;along the direction of the camera's line of sight, establish a particle generation area in front of the bottom layer area to obtain an upper layer area;
对所述上层区域中的每个粒子配置至少一张雨滴或雪花的图片后,叠加法线贴图;After configuring at least one image of raindrops or snowflakes for each particle in the upper layer area, superimpose a normal map;
相应的,所述配置单元具体用于:Correspondingly, the configuration unit is specifically used for:
根据实时雨况信息或雪况信息,对所述底层区域和所述上层区域中的粒子数量、粒子大小、粒子运动速度和方向进行配置。According to real-time rain condition information or snow condition information, the number, particle size, particle movement speed and direction in the bottom layer area and the upper layer area are configured.
可选的,所述第二建立单元还用于:Optionally, the second establishment unit is further used for:
沿相机视线方向,在所述底层区域前方建立上层区域,其中,所述上层区域为圆柱形的模型;along the line of sight of the camera, establish an upper layer area in front of the bottom layer area, wherein the upper layer area is a cylindrical model;
在所述圆柱形的模型上贴上雨滴或雪花的图片;Posting pictures of raindrops or snowflakes on the cylindrical model;
相应的,所述配置单元具体用于:Correspondingly, the configuration unit is specifically used for:
根据实时雨况信息或雪况信息,对所述底层区域中的粒子数量、粒子大小、粒子运动速度和方向进行配置,以及对所述上层区域中的雨滴或雪花的图片的运动速度、运动方向和图片数量进行配置。According to the real-time rain condition information or snow condition information, configure the number of particles, particle size, particle movement speed and direction in the bottom layer area, as well as the movement speed and movement direction of the pictures of raindrops or snowflakes in the upper layer area and the number of pictures to configure.
从以上技术方案可以看出,本申请具有以下优点:As can be seen from the above technical solutions, the present application has the following advantages:
本申请提供了一种实时雨雪特效渲染方法,包括:以相机位置为中心建立圆形粒子生成区域,得到底层区域,并对底层区域中的每个粒子配置至少一张单个雨滴或雪花的图片后,叠加法线贴图;沿相机视线方向,在底层区域前方建立上层区域,并在上层区域贴上雨滴或雪花的图片;根据实时雨况信息或雪况信息,对底层区域和上层区域分别进行配置;根据底层区域和上层区域的配置结果对底层区域和上层区域同时进行渲染。The present application provides a real-time rain and snow special effect rendering method, including: establishing a circular particle generation area with a camera position as the center, obtaining a bottom layer area, and configuring at least one picture of a single raindrop or snowflake for each particle in the bottom layer area Then, superimpose the normal map; along the camera line of sight, establish an upper area in front of the bottom area, and paste a picture of raindrops or snowflakes on the upper area; Configuration; according to the configuration results of the bottom layer area and the upper layer area, the bottom layer area and the upper layer area are rendered at the same time.
本申请中的实时雨雪特效渲染方法,设计了新的渲染结构,在现有的渲染结构只有底层区域的基础上增加了上层区域,通过两层区域之间的配合,降低了在大场景大可视距离下的仿真粒子数量,使得计算机能以较少的性能开销实现大场景大可视距离下的逼真、动态、实时的雨雪特效,从而解决了现有技术在面对大场景大可视距离下,通过减少粒子数量并降低粒子特效覆盖的视野距离,以降低粒子数量剧增带来的性能消耗,导致最终呈现的画面单薄、缺乏层次和逼真度的技术问题。The real-time rain and snow special effects rendering method in this application designs a new rendering structure, and adds an upper layer area on the basis of the existing rendering structure that only has the bottom layer area. The number of simulated particles under the visible distance enables the computer to achieve realistic, dynamic and real-time rain and snow special effects in large scenes and large viewing distances with less performance overhead, thus solving the problem of the existing technology in the face of large scenes. Under the viewing distance, by reducing the number of particles and reducing the field of view covered by particle effects, the performance consumption caused by the sharp increase in the number of particles is reduced, resulting in technical problems of thin, layered and realistic final rendered images.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员 来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present application, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.
图1为本申请提供的一种实时雨雪特效渲染方法的实施例一的流程示意图;1 is a schematic flowchart of Embodiment 1 of a real-time rain and snow special effect rendering method provided by the present application;
图2为本申请提供的一种实时雨雪特效渲染方法的实施例二的流程示意图;2 is a schematic flowchart of Embodiment 2 of a real-time rain and snow special effect rendering method provided by the present application;
图3为本申请提供的一种实时雨雪特效渲染方法的实施例三的流程示意图;3 is a schematic flowchart of Embodiment 3 of a real-time rain and snow special effect rendering method provided by the present application;
图4为本申请提供的第一种渲染结构的一个示意图;4 is a schematic diagram of a first rendering structure provided by the application;
图5为本申请提供的第二种渲染结构的一个示意图;5 is a schematic diagram of a second rendering structure provided by the application;
图6为本申请提供的第三种渲染结构的一个示意图;6 is a schematic diagram of a third rendering structure provided by the present application;
图7为本申请提供的一种实时雨雪特效渲染装置的一个结构示意图。FIG. 7 is a schematic structural diagram of a real-time rain and snow special effect rendering apparatus provided by the present application.
具体实施方式detailed description
本申请提供了一种实时雨雪特效渲染方法和装置,用于解决现有技术在面对大场景大可视距离下,通过减少粒子数量并降低粒子特效覆盖的视野距离,以降低粒子数量剧增带来的性能消耗,导致最终呈现的画面单薄、缺乏层次和逼真度的技术问题。The present application provides a real-time rain and snow special effect rendering method and device, which are used to solve the problem of reducing the number of particles and reducing the visual distance covered by particle special effects in the prior art in the face of large scenes and large visual distances. The performance consumption brought about by the increase, leads to the technical problems that the final rendered picture is thin, lacks layers and fidelity.
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make those skilled in the art better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only It is a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
现有方法在应用到大场景大可视距离情况下时,例如,对一个城市进行雨雪特效仿真,现有方法以相机位置为中心建立一个圆形粒子生成区域,该粒子生成区域覆盖了整个城市区域,然后在该粒子生成区域生成大量的粒子进行雨雪特效渲染,对于城市这种大场景大可视距离来说,采用该方法生成大量的粒子,会严重消耗计算机性能,导致程序卡顿,甚至宕机。在面对这种情况时,通常的做法是通过减少粒子数量并降低粒子特效覆盖的视野距离,以降低粒子数量剧增带来的性能消耗,但会导致最终呈现的 画面单薄、缺乏层次和逼真度的技术问题。为了解决该问题,本申请提供一种实时雨雪特效渲染方法。When the existing method is applied to a large scene with a large visual distance, for example, to simulate a city with special effects of rain and snow, the existing method establishes a circular particle generation area centered on the camera position, and the particle generation area covers the entire area. Urban area, and then generate a large number of particles in the particle generation area for rain and snow special effects rendering. For a large scene such as a city with a large visual distance, using this method to generate a large number of particles will seriously consume computer performance and cause the program to freeze. , or even downtime. When faced with this situation, the usual practice is to reduce the number of particles and reduce the field of view distance covered by particle effects to reduce the performance consumption caused by the sharp increase in the number of particles, but it will result in a thin, layered and realistic final picture. degree of technical issues. In order to solve this problem, the present application provides a real-time rain and snow special effect rendering method.
为了便于理解,请参阅图1,本申请提供的一种实时雨雪特效渲染方法的实施例一,包括:For ease of understanding, please refer to FIG. 1. Embodiment 1 of a real-time rain and snow special effect rendering method provided by the present application includes:
步骤101、以相机位置为中心建立圆形粒子生成区域,得到底层区域,并对底层区域中的每个粒子配置至少一张单个雨滴或雪花的图片后,叠加法线贴图。 Step 101 , establishing a circular particle generation area with the camera position as the center to obtain a bottom layer area, and after configuring at least one image of a single raindrop or snowflake for each particle in the bottom layer area, superimpose a normal map.
以相机位置为中心建立一个圆形粒子生成区域,得到底层区域,其中,圆形粒子生成区域的半径可以为相机视野距离,也可以根据实际情况进行设置。由于底层区域为距离相机最近的一层,粒子采用单独的雨滴图片进行仿真模拟。雨滴或雪花的图片是粒子渲染的素材,当采用一张相同的图片素材,在大量生成时,难免会出现重复的效果,为了避免这种情况,每个粒子可以配置多张雨滴或雪花的图片,以消除重复效果,让仿真画面更加自然真实。因此,本申请实施例中对底层区域中的每个粒子配置至少一张单个雨滴或雪花的图片,并叠加法线贴图,采用法线贴图属于现有技术,在此不再对其进行赘述。A circular particle generation area is established with the camera position as the center, and the bottom layer area is obtained. The radius of the circular particle generation area can be the distance of the camera's field of view, or it can be set according to the actual situation. Since the bottom layer is the layer closest to the camera, the particles are simulated using separate raindrop images. The image of raindrops or snowflakes is the material of particle rendering. When a same image material is used, repeated effects will inevitably occur when generated in large quantities. To avoid this situation, each particle can be configured with multiple images of raindrops or snowflakes. , to eliminate repetitive effects and make the simulation picture more natural and realistic. Therefore, in the embodiment of the present application, each particle in the bottom layer is configured with at least one image of a single raindrop or snowflake, and a normal map is superimposed. The use of a normal map belongs to the prior art, which will not be repeated here.
步骤102、沿相机视线方向,在底层区域前方建立上层区域,并在上层区域贴上雨滴或雪花的图片。 Step 102 , along the line of sight of the camera, establish an upper layer area in front of the bottom layer area, and paste a picture of raindrops or snowflakes on the upper layer area.
请参考图4提供的一种渲染结构的示意图,图中底部圆圈代表底层区域的范围,圆圈中间的标志为相机,相机上方的三角形线框代表相机的视角范围,沿相机视线方向,即从相机到视角范围的方向,在底层区域前方建立上层区域,并在上层区域贴上雨滴或雪花的图片,其中,上层区域的形状可以为圆形或矩阵等任意形状。上层区域与底层区域之间的距离可以根据计算机的性能和场景效果进行调整,距离越大,上层区域的范围就越大,当上层区域也是粒子生成区域时,上层区域范围越大,通常该区域要渲染的粒子数量就会越多,对计算机的性能要求就越高。Please refer to the schematic diagram of a rendering structure provided in Figure 4. The circle at the bottom of the figure represents the range of the bottom layer, the symbol in the middle of the circle is the camera, and the triangular wire frame above the camera represents the viewing angle range of the camera. To the direction of the viewing angle range, establish an upper layer area in front of the bottom layer area, and paste a picture of raindrops or snowflakes on the upper layer area, wherein the shape of the upper layer area can be any shape such as a circle or a matrix. The distance between the upper layer area and the bottom layer area can be adjusted according to the performance of the computer and the effect of the scene. The higher the number of particles to be rendered, the higher the performance requirements of the computer.
步骤103、根据实时雨况信息或雪况信息,对底层区域和上层区域分别进行配置。Step 103: Configure the bottom layer area and the upper layer area respectively according to the real-time rain condition information or snow condition information.
根据实际大场景下的实时雨况信息或雪况信息,对底层区域和上层区域分别进行配置,例如,配置例子数量、粒子大小、粒子运动速度和方向 等。According to the real-time rain condition information or snow condition information in the actual large scene, configure the bottom layer area and the upper layer area respectively, for example, configure the number of instances, particle size, particle movement speed and direction, etc.
步骤104、根据底层区域和上层区域的配置结果对底层区域和上层区域同时进行渲染。Step 104: Render the bottom layer area and the upper layer area at the same time according to the configuration results of the bottom layer area and the upper layer area.
在配置好底层区域和上层区域后,根据配置结果对对应的底层区域和上层区域同时进行渲染,进行雨雪特效仿真,得到的渲染效果可以在显示器上看到渲染效果图。After configuring the bottom layer area and the upper layer area, the corresponding bottom layer area and the upper layer area are simultaneously rendered according to the configuration result, and the rain and snow effects are simulated, and the obtained rendering effect can be seen on the display.
本申请实施例中的实时雨雪特效渲染方法,设计了新的渲染结构,在现有的渲染结构只有底层区域的基础上增加了上层区域,通过两层区域之间的配合,降低了在大场景大可视距离下的仿真粒子数量,使得计算机能以较少的性能开销实现大场景大可视距离下的逼真、动态、实时的雨雪特效,从而解决了现有技术在面对大场景大可视距离下,通过减少粒子数量并降低粒子特效覆盖的视野距离,以降低粒子数量剧增带来的性能消耗,导致最终呈现的画面单薄、缺乏层次和逼真度的技术问题。In the real-time rain and snow special effects rendering method in the embodiment of the present application, a new rendering structure is designed, and an upper layer area is added on the basis that the existing rendering structure only has the bottom layer area. The number of simulated particles in the large visual distance of the scene enables the computer to achieve realistic, dynamic and real-time rain and snow special effects in the large scene and large visual distance with less performance overhead, thus solving the problem of the existing technology in the face of large scenes. At a large viewing distance, by reducing the number of particles and reducing the visual distance covered by particle effects, the performance consumption caused by the sharp increase in the number of particles is reduced, resulting in technical problems of thin, layered and fidelity final rendered images.
以上为本申请提供的一种实时雨雪特效渲染方法的实施例一,以下为本申请提供的一种实时雨雪特效渲染方法的实施例二。The above is Embodiment 1 of a real-time rain and snow special effect rendering method provided by the present application, and the following is Embodiment 2 of a real-time rain and snow special effect rendering method provided by the present application.
为了便于理解,请参阅图2,本申请提供的一种实时雨雪特效渲染方法的实施例二,包括:For ease of understanding, please refer to FIG. 2 , the second embodiment of a real-time rain and snow special effect rendering method provided by the present application includes:
步骤201、以相机位置为中心建立圆形粒子生成区域,得到底层区域,并对底层区域中的每个粒子配置至少一张单个雨滴或雪花的图片后,叠加法线贴图。 Step 201 , establishing a circular particle generation area with the camera position as the center to obtain a bottom layer area, and after configuring at least one image of a single raindrop or snowflake for each particle in the bottom layer area, superimpose a normal map.
优选对底层区域中的每个粒子配置至少一张具有透明通道的单个雨滴或雪花的图片,方便雨雪特效叠加,使得呈现画面更加逼真。It is preferable to configure at least one picture of a single raindrop or snowflake with a transparent channel for each particle in the bottom layer area, so as to facilitate the superposition of rain and snow effects and make the presented picture more realistic.
步骤202、沿相机视线方向,在底层区域前方建立粒子生成区域,得到上层区域。 Step 202 , along the line of sight of the camera, establish a particle generation area in front of the bottom layer area to obtain the upper layer area.
沿相机视线方向,在底层区域前方建立粒子生成区域,得到上层区域,其中,粒子生成区域的形状可以为圆形、矩形或其他形状。Along the line of sight of the camera, a particle generation area is established in front of the bottom layer area to obtain an upper layer area, wherein the shape of the particle generation area can be a circle, a rectangle or other shapes.
进一步,沿相机视线方向,可以在底层区域前方建立一层、两层或多层粒子生成区域,相应的,得到的上层区域包括一层区域、两层区域或多层区域。本申请实施例中优选在底层区域前方建立两层粒子生成区域,得到的上层区域包括第一上层区域和第二上层区域,即本申请实施例中构建 的渲染结构优选为三层粒子,即沿相机视线方向,在底层区域前方建立一层粒子生成区域,得到第一上层区域,并在第一上层区域前方建立一层粒子生成区域,得到第二上层区域。请参考图5,其中,第一层相当于底层区域,粒子生成区域的形状为圆形,第二层相当于第一上层区域,粒子生成区域的形状为矩形,也可以为圆形或者其他形状,第三层相当于第二上层区域,粒子生成区域的形状为矩阵,也可以为圆形或其他形状。Further, along the line of sight of the camera, one layer, two layers or multiple layers of particle generation regions can be established in front of the bottom layer region, and correspondingly, the obtained upper layer region includes one layer region, two layer regions or multi-layer regions. In the embodiment of the present application, it is preferable to establish two layers of particle generation areas in front of the bottom layer area, and the obtained upper layer area includes a first upper layer area and a second upper layer area, that is, the rendering structure constructed in the embodiment of the present application is preferably three layers of particles, that is, along the In the direction of the camera's line of sight, a layer of particle generation area is established in front of the bottom layer area to obtain the first upper layer area, and a layer of particle generation area is established in front of the first upper layer area to obtain the second upper layer area. Please refer to Figure 5, where the first layer is equivalent to the bottom layer area, the shape of the particle generation area is a circle, the second layer is equivalent to the first upper layer area, the shape of the particle generation area is a rectangle, or a circle or other shapes , the third layer is equivalent to the second upper layer area, and the shape of the particle generation area is a matrix, and may also be a circle or other shapes.
步骤203、对上层区域中的每个粒子配置至少一张雨滴或雪花的图片后,叠加法线贴图。Step 203: After configuring at least one image of raindrops or snowflakes for each particle in the upper layer area, superimpose a normal map.
在建立得到上层区域后,对上层区域中的每个粒子配置至少一张雨滴或雪花的图片后,叠加法线贴图。当上层区域为两层区域时,在第一上层区域和第二上层区域贴上雨滴或雪花的图片。具体的,为第一上层区域中的每个粒子配置至少一张具有透明通道的多个平行雨滴和细小雨雾的图片或具有透明通道的多个平行雪花的图片,并叠加法线贴图;为第二上层区域中的每个粒子配置至少一张具有透明通道的多个平行雨滴和细小雨雾的图片或具有透明通道的多个平行雪花的图片,并叠加法线贴图,其中,第二上层区域的雨滴或雪花的图片中的雨滴数量或雪花数量远远多于第一上层区域的雨滴或雪花的图片中的雨滴数量或雪花数量。After the upper layer area is established, configure at least one image of raindrops or snowflakes for each particle in the upper layer area, and then superimpose the normal map. When the upper area is a two-layer area, paste pictures of raindrops or snowflakes on the first upper area and the second upper area. Specifically, at least one picture of multiple parallel raindrops and fine rain fog with transparent channels or pictures of multiple parallel snowflakes with transparent channels is configured for each particle in the first upper layer area, and a normal map is superimposed; Each particle in the second upper layer area is configured with at least one picture of multiple parallel raindrops and fine rain fog with transparent channels or pictures of multiple parallel snowflakes with transparent channels, and superimposed normal maps, wherein the second upper layer area The number of raindrops or snowflakes in the picture of raindrops or snowflakes is much greater than the number of raindrops or snowflakes in the picture of raindrops or snowflakes in the first upper region.
第一上层区域位于底层区域之后,距离相机比底层区域远。设计此层的目的在于与底层区域对比形成空间上的层次感,在视觉上增大雨雪特效的视野距离。由于渲染范围增加,若仍旧采用第一层的每个粒子渲染一个雨滴图片同样会导致巨大的性能消耗。因此,第一上层区域中的每个粒子图片内包含多个平行雨滴或多个平行雪花,以实现以较少的粒子数量模拟大量雨滴的效果。The first upper layer area is located behind the bottom layer area and is farther from the camera than the bottom layer area. The purpose of designing this layer is to contrast with the bottom layer to form a sense of spatial hierarchy, and to visually increase the visual distance of the rain and snow effects. Due to the increased rendering range, rendering a raindrop image with each particle in the first layer will also result in a huge performance cost. Therefore, each particle image in the first upper layer region contains multiple parallel raindrops or multiple parallel snowflakes, so as to achieve the effect of simulating a large number of raindrops with a smaller number of particles.
第二上层区域位于第一上层区域之后,距离相机最远。设计此层的目的在于为前两层提供一个动态的且有层次感的背景。本层中粒子元素的处理方式与第一上层区域相似,不同的是本层的每个粒子图片内包含更多的雨滴元素或雪花元素,其雨滴或雪花数量、密度可以是第一上层区域中的几十倍甚至更多。The second upper layer area is located after the first upper layer area and is the farthest from the camera. The purpose of designing this layer is to provide a dynamic and layered background for the first two layers. The processing method of particle elements in this layer is similar to that in the first upper layer area, the difference is that each particle image in this layer contains more raindrop elements or snowflake elements, and the number and density of raindrops or snowflakes can be the same as those in the first upper layer area. dozens of times or more.
步骤204、根据实时雨况信息或雪况信息,对底层区域和上层区域中的粒子数量、粒子大小、粒子运动速度和方向进行配置。 Step 204 , according to the real-time rain condition information or snow condition information, configure the particle number, particle size, particle movement speed and direction in the bottom layer area and the upper layer area.
由于底层区域为距离相机最近的一层,粒子采用单独的雨滴图片进行仿真模拟。因此通过设置该层内每一个粒子的大小、运动方向和速度,就能模拟表现每个雨滴或雪花的大小方向和速度。其中,可以根据实时雨况信息或雪况信息设置粒子数量,粒子大小可以根据降雨量或降雪量近似模拟,粒子运动方向可以通过当前的风力风向近似模拟或计算得到,粒子运动速度可以根据雨滴或雪花大小近似模拟或计算得到,从而可以实现雨滴或雪花受风速、阻力等因素的变化,在这一层中,主要表现近距离下的雨雪视效,可以细腻地表现出实时参数的变化和影响。上层区域的配置与底层区域的配置过程相似,根据实时雨况信息或雪况信息,对底层区域和上层区域中的粒子数量、粒子大小、粒子运动速度和方向进行配置,分别得到底层区域和上层区域的配置结果。Since the bottom layer is the layer closest to the camera, the particles are simulated using separate raindrop images. Therefore, by setting the size, movement direction and speed of each particle in this layer, the size, direction and speed of each raindrop or snowflake can be simulated. Among them, the number of particles can be set according to the real-time rain or snow condition information, the particle size can be approximated according to the rainfall or snowfall, the particle movement direction can be approximated or calculated through the current wind and wind direction, and the particle movement speed can be approximated according to the raindrop or snowfall. The size of snowflakes can be obtained by approximate simulation or calculation, so that the changes of raindrops or snowflakes by wind speed, resistance and other factors can be realized. In this layer, the visual effects of rain and snow at close range are mainly displayed, and the changes and influence. The configuration process of the upper layer area is similar to the configuration process of the bottom layer area. According to the real-time rain condition information or snow condition information, the number of particles, particle size, particle movement speed and direction in the bottom layer area and the upper layer area are configured to obtain the bottom layer area and the upper layer area, respectively. The configuration result of the zone.
步骤205、根据底层区域和上层区域的配置结果对底层区域和上层区域同时进行渲染。Step 205: Render the bottom layer area and the upper layer area at the same time according to the configuration results of the bottom layer area and the upper layer area.
根据底层区域和上层区域对粒子的配置结果,对三层粒子区域内的粒子同时进行渲染,进行雨雪特效仿真,得到的渲染效果可以通过显示器进行显示。According to the configuration results of the particles in the bottom layer area and the upper layer area, the particles in the three-layer particle area are rendered at the same time, and the rain and snow special effects are simulated, and the obtained rendering effect can be displayed on the monitor.
本申请实施例中,优选采用三层粒子结构进行雨雪特效渲染,在距离相机最近的一层的粒子采用单独的雨滴或雪花的图片进行仿真模拟,通过设置粒子大小、运动方向和速度,就能模拟表现出每个雨滴或雪花的大小、方向和速度,可以实现雨滴或雪花受风速、阻力等因素的变化,该层可以实现近距离下的雨雪视效,可以细腻地表现出实时参数的变化和影响;第二层与第一层对比形成空间上的层次感,在视觉上增大雨雪特效的视野距离,在第二层中的每个粒子图片内包括多个平行雨滴或雪花,可以实现以较少的粒子数量模拟大量雨滴或雪花的效果,增强呈现画面的逼真度;第三层为前两层提供一个动态的且有层次感的背景,由于第三层的渲染范围相比于前两层进一步增大了范围,为了不增大计算机的性能消耗,第三层中的每个粒子图片包含更多的雨滴或雪花元素,其雨滴或雪花数量、密度可以是第二层的几十倍甚至更多。In the embodiment of the present application, it is preferable to use a three-layer particle structure for rain and snow special effects rendering, and the particles in the layer closest to the camera are simulated by using separate pictures of raindrops or snowflakes. It can simulate the size, direction and speed of each raindrop or snowflake, and can realize the changes of raindrops or snowflakes by wind speed, resistance and other factors. The contrast between the second layer and the first layer forms a spatial layering, which visually increases the visual distance of the rain and snow effects. Each particle image in the second layer includes multiple parallel raindrops or snowflakes. , can achieve the effect of simulating a large number of raindrops or snowflakes with a small number of particles, and enhance the fidelity of the rendered picture; the third layer provides a dynamic and layered background for the first two layers, because the rendering range of the third layer is different. Compared with the first two layers, the range is further increased. In order not to increase the performance consumption of the computer, each particle image in the third layer contains more raindrops or snowflake elements, and the number and density of raindrops or snowflakes can be the same as that of the second layer. dozens of times or more.
本申请实施例通过设计新的渲染结构,构建三层粒子生成区域,通过分层实现减少第一层的粒子数量,增加层次感让画面更具有深度;通过三 个层级之间的配合,使得计算机以较低的性能开销实现大场景大可视距离下的逼真、动态、实时的雨雪特效。In the embodiment of the present application, a new rendering structure is designed, a three-layer particle generation area is constructed, the number of particles in the first layer is reduced by layering, and the sense of layering is increased to make the picture more deep; through the cooperation between the three layers, the computer Realistic, dynamic, real-time rain and snow effects in large scenes and large viewing distances are realized with low performance overhead.
以上为本申请提供的一种实时雨雪特效渲染方法的实施例二,以下为本申请提供的一种实时雨雪特效渲染方法的实施例三。The above is the second embodiment of a real-time rain and snow special effect rendering method provided by the present application, and the following is the third embodiment of a real-time rain and snow special effect rendering method provided by the present application.
为了便于理解,请参阅图3,本申请提供的一种实时雨雪特效渲染方法的实施例三,包括:For ease of understanding, please refer to FIG. 3 , the third embodiment of a real-time rain and snow special effect rendering method provided by the present application includes:
步骤301、以相机位置为中心建立圆形粒子生成区域,得到底层区域,并对底层区域中的每个粒子配置至少一张单个雨滴或雪花的图片后,叠加法线贴图。 Step 301 , establishing a circular particle generation area with the camera position as the center to obtain a bottom layer area, and after configuring at least one image of a single raindrop or snowflake for each particle in the bottom layer area, superimpose a normal map.
步骤301与步骤201的具体内容一致,在此不再进行赘述。The specific content of step 301 is the same as that of step 201, and details are not repeated here.
步骤302、沿相机视线方向,在底层区域前方建立上层区域,其中,上层区域为圆柱形的模型。 Step 302 , establishing an upper layer area in front of the bottom layer area along the direction of the camera's sight line, wherein the upper layer area is a cylindrical model.
在实施例二中,上层区域是粒子生成区域,在这个区域中生成粒子,没有实际的顶点模型。在本申请实施例中,采用一个圆柱形的模型,基于真实的顶点网格模型来实现,不生成粒子,请参考图6,其中第一层为底层区域,即圆形的粒子生成区域,第二层为上层区域,即圆柱形的模型。上层区域不局限于粒子的形式,主要通过分层实现减少底层区域的粒子数量,并增加层次感让画面具有深度。In the second embodiment, the upper layer area is the particle generation area, and particles are generated in this area, and there is no actual vertex model. In the embodiment of the present application, a cylindrical model is used, which is realized based on a real vertex mesh model, and no particles are generated. Please refer to FIG. 6 , in which the first layer is the bottom layer area, that is, the circular particle generation area. The second floor is the upper area, that is, the cylindrical model. The upper layer area is not limited to the form of particles, mainly through layering to reduce the number of particles in the bottom layer area, and increase the layering to give the picture depth.
步骤303、在圆柱形的模型上贴上雨滴或雪花的图片。 Step 303, paste a picture of raindrops or snowflakes on the cylindrical model.
在圆柱形的模型上贴上具有透明通道的多个平行雨滴和细小雨雾的图片或具有透明通道的多个平行雪花的图片,通过让图片运动,造成雨滴或雪花下落的效果。Paste pictures of multiple parallel raindrops and fine rain and fog with transparent channels or pictures of multiple parallel snowflakes with transparent channels on the cylindrical model, and by moving the picture, the effect of raindrops or snowflakes falling.
步骤304、根据实时雨况信息或雪况信息,对底层区域中的粒子数量、粒子大小、粒子运动速度和方向进行配置,以及对上层区域中的雨滴或雪花的图片的运动速度、运动方向和图片数量进行配置。 Step 304, according to the real-time rain condition information or snow condition information, configure the number of particles, particle size, particle movement speed and direction in the bottom layer area, and the movement speed, movement direction and direction of the pictures of raindrops or snowflakes in the upper layer area. Configure the number of pictures.
根据实时雨况信息或雪况信息,对底层区域中的粒子数量、粒子大小、粒子运动速度和方向进行配置,以及对上层区域中的雨滴或雪花的图片的运动速度、运动方向和图片数量进行配置。通过配置底层区域中的粒子大小、运动方向和速度,以及配置上层区域中的雨滴或雪花的图片的运动速度、运动方向和图片数量,就能模拟表现出每个雨滴或雪花的大小、方向 和速度,可以实现雨滴或雪花受风速、阻力等因素的变化。According to the real-time rain or snow condition information, configure the number of particles, particle size, particle movement speed and direction in the bottom layer, as well as the movement speed, movement direction and number of pictures of raindrops or snowflakes in the upper layer area. configuration. By configuring the particle size, movement direction and speed in the bottom layer area, and configuring the movement speed, movement direction and number of pictures of the raindrop or snowflake in the upper layer area, you can simulate the size, direction and number of each raindrop or snowflake. The speed can realize the change of raindrops or snowflakes by wind speed, resistance and other factors.
步骤305、根据底层区域和上层区域的配置结果对底层区域和上层区域同时进行渲染。Step 305: Render the bottom layer area and the upper layer area at the same time according to the configuration results of the bottom layer area and the upper layer area.
根据底层区域和上层区域的配置结果,对底层区域和上层区域同时进行渲染,进行雨雪特效仿真,得到的渲染效果可以通过显示器进行显示。According to the configuration results of the bottom layer area and the upper layer area, the bottom layer area and the upper layer area are rendered at the same time, and the rain and snow special effects are simulated, and the obtained rendering effect can be displayed on the monitor.
本申请实施例通过设计新的渲染结构,构建一层粒子生成区域和一层圆柱形的模型,在圆柱形的模型上贴雨滴或雪花的图片,让图片运动,造成雨滴或雪花下落的效果,通过分层实现减少第一层的粒子数量,增加层次感让画面更具有深度;通过两个层级之间的配合,使得计算机以较低的性能开销实现大场景大可视距离下的逼真、动态、实时的雨雪特效。In the embodiment of the present application, by designing a new rendering structure, a layer of particle generation area and a layer of cylindrical model are constructed, and pictures of raindrops or snowflakes are pasted on the cylindrical model, and the pictures are moved to cause the effect of raindrops or snowflakes falling. Through layering, the number of particles in the first layer is reduced, and the sense of layering is increased to make the picture more deep; through the cooperation between the two layers, the computer can achieve realistic and dynamic large scenes and large viewing distances with low performance overhead. , Real-time rain and snow effects.
以上为本申请提供的一种实时雨雪特效渲染方法的实施例三,以下为本申请提供的一种实时雨雪特效渲染装置的实施例一。The above is Embodiment 3 of a real-time rain and snow special effect rendering method provided by the present application, and the following is Embodiment 1 of a real-time rain and snow special effect rendering apparatus provided by the present application.
为了便于理解,请参阅图7,本申请提供的一种实时雨雪特效渲染装置的实施例一,包括:For ease of understanding, please refer to FIG. 7 . Embodiment 1 of a real-time rain and snow special effect rendering apparatus provided by the present application includes:
第一建立单元401,用于以相机位置为中心建立圆形粒子生成区域,得到底层区域,并对底层区域中的每个粒子配置至少一张单个雨滴或雪花的图片后,叠加法线贴图。The first establishment unit 401 is used to establish a circular particle generation area with the camera position as the center to obtain a bottom layer area, and after configuring at least one image of a single raindrop or snowflake for each particle in the bottom layer area, superimpose a normal map.
第二建立单元402,用于沿相机视线方向,在底层区域前方建立上层区域,并在上层区域贴上雨滴或雪花的图片。The second establishing unit 402 is configured to establish an upper layer area in front of the bottom layer area along the line of sight of the camera, and paste a picture of raindrops or snowflakes on the upper layer area.
配置单元403,用于根据实时雨况信息或雪况信息,对底层区域和上层区域分别进行配置。The configuration unit 403 is configured to separately configure the bottom layer area and the upper layer area according to the real-time rain condition information or snow condition information.
渲染单元404,用于根据底层区域和上层区域的配置结果对底层区域和上层区域同时进行渲染。The rendering unit 404 is configured to render the bottom layer area and the upper layer area at the same time according to the configuration result of the bottom layer area and the upper layer area.
以上为本申请提供的一种实时雨雪特效渲染装置的实施例一,以下为本申请提供的一种实时雨雪特效渲染装置的实施例二。The above is the first embodiment of a real-time rain and snow special effect rendering device provided by the application, and the following is the second embodiment of a real-time rain and snow special effect rendering device provided by the application.
本申请提供的一种实时雨雪特效渲染装置的实施例二,包括:The second embodiment of a real-time rain and snow special effect rendering device provided by this application includes:
第一建立单元401,用于以相机位置为中心建立圆形粒子生成区域,得到底层区域,并对底层区域中的每个粒子配置至少一张单个雨滴或雪花的图片后,叠加法线贴图。The first establishment unit 401 is used to establish a circular particle generation area with the camera position as the center to obtain a bottom layer area, and after configuring at least one image of a single raindrop or snowflake for each particle in the bottom layer area, superimpose a normal map.
第二建立单元402,用于沿相机视线方向,在底层区域前方建立上层 区域,并在上层区域贴上雨滴或雪花的图片。The second establishment unit 402 is configured to establish an upper layer area in front of the bottom layer area along the line of sight of the camera, and paste a picture of raindrops or snowflakes on the upper layer area.
配置单元403,用于根据实时雨况信息或雪况信息,对底层区域和上层区域分别进行配置。The configuration unit 403 is configured to separately configure the bottom layer area and the upper layer area according to the real-time rain condition information or snow condition information.
渲染单元404,用于根据底层区域和上层区域的配置结果对底层区域和上层区域同时进行渲染。The rendering unit 404 is configured to render the bottom layer area and the upper layer area at the same time according to the configuration result of the bottom layer area and the upper layer area.
作为进一步地改进,第二建立单元402具体用于:As a further improvement, the second establishing unit 402 is specifically used for:
沿相机视线方向,在底层区域前方建立粒子生成区域,得到上层区域;Along the line of sight of the camera, establish a particle generation area in front of the bottom layer area to obtain the upper layer area;
对上层区域中的每个粒子配置至少一张雨滴或雪花的图片后,叠加法线贴图;After configuring at least one image of raindrops or snowflakes for each particle in the upper area, overlay the normal map;
相应的,配置单元403具体用于:Correspondingly, the configuration unit 403 is specifically used for:
根据实时雨况信息或雪况信息,对底层区域和上层区域中的粒子数量、粒子大小、粒子运动速度和方向进行配置。Configure the number of particles, particle size, particle movement speed and direction in the bottom and upper areas based on real-time rain or snow conditions.
作为进一步地改进,第二建立单元402还用于:As a further improvement, the second establishing unit 402 is also used for:
沿相机视线方向,在底层区域前方建立上层区域,其中,上层区域为圆柱形的模型;Along the direction of the camera's sight line, establish an upper layer area in front of the bottom layer area, wherein the upper layer area is a cylindrical model;
在圆柱形的模型上贴上雨滴或雪花的图片;Paste pictures of raindrops or snowflakes on the cylindrical model;
相应的,配置单元403具体用于:Correspondingly, the configuration unit 403 is specifically used for:
根据实时雨况信息或雪况信息,对底层区域中的粒子数量、粒子大小、粒子运动速度和方向进行配置,以及对上层区域中的雨滴或雪花的图片的运动速度、运动方向和图片数量进行配置。According to the real-time rain or snow condition information, configure the number of particles, particle size, particle movement speed and direction in the bottom layer, as well as the movement speed, movement direction and number of pictures of raindrops or snowflakes in the upper layer area. configuration.
作为进一步地改进,上层区域包括一层区域、两层区域或多层区域。As a further improvement, the upper layer area includes a one-layer area, a two-layer area or a multi-layer area.
作为进一步地改进,当上层区域为两层区域时,上层区域包括第一上层区域和第二上层区域;As a further improvement, when the upper layer area is a two-layer area, the upper layer area includes a first upper layer area and a second upper layer area;
相应的,第二建立单元402具体用于:Correspondingly, the second establishing unit 402 is specifically configured to:
沿相机视线方向,在底层区域前方建立第一上层区域,并在第一上层区域前方建立第二上层区域;Along the line of sight of the camera, a first upper layer area is established in front of the bottom layer area, and a second upper layer area is established in front of the first upper layer area;
在第一上层区域和第二上层区域贴上雨滴或雪花的图片。Paste pictures of raindrops or snowflakes on the first upper area and the second upper area.
作为进一步地改进,上层区域的雨滴或雪花的图片为具有透明通道的多个平行雨滴和雨雾的图片或具有透明通道的多个平行雪花的图片,且第二上层区域的雨滴或雪花的图片中雨滴数量或雪花数量多于第一上层区域 的雨滴或雪花的图片中雨滴数量或雪花数量。As a further improvement, the picture of raindrops or snowflakes in the upper layer area is a picture of multiple parallel raindrops and rain fog with transparent channels or a picture of multiple parallel snowflakes with transparent channels, and the raindrops or snowflakes in the second upper layer area are in the picture. The number of raindrops or snowflakes is greater than the number of raindrops or snowflakes in the image of the first upper region.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, for the specific working process of the above-described devices and units, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: The technical solutions described in the embodiments are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions in the embodiments of the present application.

Claims (10)

  1. 一种实时雨雪特效渲染方法,其特征在于,包括:A real-time rain and snow special effect rendering method, comprising:
    以相机位置为中心建立圆形粒子生成区域,得到底层区域,并对所述底层区域中的每个粒子配置至少一张单个雨滴或雪花的图片后,叠加法线贴图;A circular particle generation area is established with the camera position as the center, the bottom layer area is obtained, and after configuring at least one image of a single raindrop or snowflake for each particle in the bottom layer area, the normal map is superimposed;
    沿相机视线方向,在所述底层区域前方建立上层区域,并在所述上层区域贴上雨滴或雪花的图片;Along the direction of the camera's sight line, establish an upper layer area in front of the lower layer area, and paste a picture of raindrops or snowflakes on the upper layer area;
    根据实时雨况信息或雪况信息,对所述底层区域和所述上层区域分别进行配置;According to real-time rain condition information or snow condition information, configure the bottom layer area and the upper layer area respectively;
    根据所述底层区域和所述上层区域的配置结果对所述底层区域和所述上层区域同时进行渲染。The bottom layer area and the upper layer area are simultaneously rendered according to the configuration result of the bottom layer area and the upper layer area.
  2. 根据权利要求1所述的实时雨雪特效渲染方法,其特征在于,所述沿相机视线方向,在所述底层区域前方建立上层区域,并在所述上层区域贴上雨滴或雪花的图片,包括:The real-time rain and snow special effect rendering method according to claim 1, wherein, along the line of sight of the camera, establishing an upper layer area in front of the bottom layer area, and pasting a picture of raindrops or snowflakes on the upper layer area, comprising: :
    沿相机视线方向,在所述底层区域前方建立粒子生成区域,得到上层区域;along the direction of the camera's line of sight, establish a particle generation area in front of the bottom layer area to obtain an upper layer area;
    对所述上层区域中的每个粒子配置至少一张雨滴或雪花的图片后,叠加法线贴图;After configuring at least one image of raindrops or snowflakes for each particle in the upper layer area, superimpose a normal map;
    相应的,所述根据实时雨况信息或雪况信息,对所述底层区域和所述上层区域分别进行配置,包括:Correspondingly, according to the real-time rain condition information or snow condition information, the bottom layer area and the upper layer area are respectively configured, including:
    根据实时雨况信息或雪况信息,对所述底层区域和所述上层区域中的粒子数量、粒子大小、粒子运动速度和方向进行配置。According to the real-time rain condition information or snow condition information, the particle quantity, particle size, particle movement speed and direction in the bottom layer area and the upper layer area are configured.
  3. 根据权利要求2所述的实时雨雪特效渲染方法,其特征在于,所述粒子生成区域的形状至少包括圆形或矩形。The real-time rain and snow special effect rendering method according to claim 2, wherein the shape of the particle generation area includes at least a circle or a rectangle.
  4. 根据权利要求1所述的实时雨雪特效渲染方法,其特征在于,所述沿相机视线方向,在所述底层区域前方建立上层区域,并在所述上层区域贴上雨滴或雪花的图片,包括:The real-time rain and snow special effect rendering method according to claim 1, wherein, along the line of sight of the camera, establishing an upper layer area in front of the bottom layer area, and pasting a picture of raindrops or snowflakes on the upper layer area, comprising: :
    沿相机视线方向,在所述底层区域前方建立上层区域,其中,所述上层区域为圆柱形的模型;along the line of sight of the camera, establish an upper layer area in front of the bottom layer area, wherein the upper layer area is a cylindrical model;
    在所述圆柱形的模型上贴上雨滴或雪花的图片;Posting pictures of raindrops or snowflakes on the cylindrical model;
    相应的,所述根据实时雨况信息或雪况信息,对所述底层区域和所述上层区域分别进行配置,包括:Correspondingly, according to the real-time rain condition information or snow condition information, the bottom layer area and the upper layer area are respectively configured, including:
    根据实时雨况信息或雪况信息,对所述底层区域中的粒子数量、粒子大小、粒子运动速度和方向进行配置,以及对所述上层区域中的雨滴或雪花的图片的运动速度、运动方向和图片数量进行配置。According to the real-time rain condition information or snow condition information, configure the number of particles, particle size, particle movement speed and direction in the bottom layer area, as well as the movement speed and movement direction of the pictures of raindrops or snowflakes in the upper layer area and the number of pictures to configure.
  5. 根据权利要求1所述的实时雨雪特效渲染方法,其特征在于,所述上层区域包括一层区域、两层区域或多层区域。The real-time rain and snow special effect rendering method according to claim 1, wherein the upper layer area comprises a one-layer area, a two-layer area or a multi-layer area.
  6. 根据权利要求5所述的实时雨雪特效渲染方法,其特征在于,当所述上层区域为两层区域时,所述上层区域包括第一上层区域和第二上层区域;The real-time rain and snow special effect rendering method according to claim 5, wherein when the upper layer area is a two-layer area, the upper layer area includes a first upper layer area and a second upper layer area;
    相应的,所述沿相机视线方向,在所述底层区域前方建立上层区域,并在所述上层区域贴上雨滴或雪花的图片,包括:Correspondingly, along the line of sight of the camera, establish an upper layer area in front of the bottom layer area, and paste a picture of raindrops or snowflakes on the upper layer area, including:
    沿相机视线方向,在所述底层区域前方建立所述第一上层区域,并在所述第一上层区域前方建立所述第二上层区域;along the line of sight of the camera, establish the first upper layer area in front of the bottom layer area, and establish the second upper layer area in front of the first upper layer area;
    在所述第一上层区域和所述第二上层区域贴上雨滴或雪花的图片。Paste pictures of raindrops or snowflakes on the first upper layer area and the second upper layer area.
  7. 根据权利要求6所述的实时雨雪特效渲染方法,其特征在于,所述上层区域的雨滴或雪花的图片为具有透明通道的多个平行雨滴和雨雾的图片或具有透明通道的多个平行雪花的图片,且所述第二上层区域的雨滴或雪花的图片中雨滴数量或雪花数量多于所述第一上层区域的雨滴或雪花的图片中雨滴数量或雪花数量。The real-time rain and snow special effect rendering method according to claim 6, wherein the pictures of raindrops or snowflakes in the upper area are pictures of multiple parallel raindrops and rain fog with transparent channels or multiple parallel snowflakes with transparent channels and the number of raindrops or snowflakes in the picture of raindrops or snowflakes in the second upper layer area is greater than the number of raindrops or snowflakes in the picture of raindrops or snowflakes in the first upper layer area.
  8. 一种实时雨雪特效渲染装置,其特征在于,包括:A real-time rain and snow special effect rendering device, comprising:
    第一建立单元,用于以相机位置为中心建立圆形粒子生成区域,得到底层区域,并对所述底层区域中的每个粒子配置至少一张单个雨滴或雪花的图片后,叠加法线贴图;The first establishment unit is used to establish a circular particle generation area with the camera position as the center, obtain the bottom layer area, and configure at least one image of a single raindrop or snowflake for each particle in the bottom layer area, and then superimpose the normal map ;
    第二建立单元,用于沿相机视线方向,在所述底层区域前方建立上层区域,并在所述上层区域贴上雨滴或雪花的图片;A second establishment unit, configured to establish an upper layer area in front of the bottom layer area along the camera line of sight, and paste a picture of raindrops or snowflakes on the upper layer area;
    配置单元,用于根据实时雨况信息或雪况信息,对所述底层区域和所述上层区域分别进行配置;a configuration unit, configured to separately configure the bottom layer area and the upper layer area according to real-time rain condition information or snow condition information;
    渲染单元,用于根据所述底层区域和所述上层区域的配置结果对所述 底层区域和所述上层区域同时进行渲染。A rendering unit, configured to render the bottom layer region and the upper layer region simultaneously according to the configuration result of the bottom layer region and the upper layer region.
  9. 根据权利要求8所述的实时雨雪特效渲染装置,其特征在于,所述第二建立单元具体用于:The real-time rain and snow special effect rendering device according to claim 8, wherein the second establishment unit is specifically used for:
    沿相机视线方向,在所述底层区域前方建立粒子生成区域,得到上层区域;along the direction of the camera's line of sight, establish a particle generation area in front of the bottom layer area to obtain an upper layer area;
    对所述上层区域中的每个粒子配置至少一张雨滴或雪花的图片后,叠加法线贴图;After configuring at least one image of raindrops or snowflakes for each particle in the upper layer area, superimpose a normal map;
    相应的,所述配置单元具体用于:Correspondingly, the configuration unit is specifically used for:
    根据实时雨况信息或雪况信息,对所述底层区域和所述上层区域中的粒子数量、粒子大小、粒子运动速度和方向进行配置。According to the real-time rain condition information or snow condition information, the particle quantity, particle size, particle movement speed and direction in the bottom layer area and the upper layer area are configured.
  10. 根据权利要求8所述的实时雨雪特效渲染装置,其特征在于,所述第二建立单元还用于:The real-time rain and snow special effect rendering device according to claim 8, wherein the second establishment unit is further used for:
    沿相机视线方向,在所述底层区域前方建立上层区域,其中,所述上层区域为圆柱形的模型;along the line of sight of the camera, establish an upper layer area in front of the bottom layer area, wherein the upper layer area is a cylindrical model;
    在所述圆柱形的模型上贴上雨滴或雪花的图片;Posting pictures of raindrops or snowflakes on the cylindrical model;
    相应的,所述配置单元具体用于:Correspondingly, the configuration unit is specifically used for:
    根据实时雨况信息或雪况信息,对所述底层区域中的粒子数量、粒子大小、粒子运动速度和方向进行配置,以及对所述上层区域中的雨滴或雪花的图片的运动速度、运动方向和图片数量进行配置。According to the real-time rain condition information or snow condition information, configure the number of particles, particle size, particle movement speed and direction in the bottom layer area, as well as the movement speed and movement direction of the pictures of raindrops or snowflakes in the upper layer area and the number of pictures to configure.
PCT/CN2020/141345 2020-09-22 2020-12-30 Method and apparatus for rendering rain and snow special effects in real time WO2022062254A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011001256.6A CN112116689B (en) 2020-09-22 2020-09-22 Real-time rain and snow special effect rendering method and device
CN202011001256.6 2020-09-22

Publications (1)

Publication Number Publication Date
WO2022062254A1 true WO2022062254A1 (en) 2022-03-31

Family

ID=73801461

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/141345 WO2022062254A1 (en) 2020-09-22 2020-12-30 Method and apparatus for rendering rain and snow special effects in real time

Country Status (2)

Country Link
CN (1) CN112116689B (en)
WO (1) WO2022062254A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116109800A (en) * 2022-10-26 2023-05-12 润芯微科技(江苏)有限公司 Real-time 3D weather system based on illusion engine and implementation method thereof

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112116689B (en) * 2020-09-22 2024-05-14 威创集团股份有限公司 Real-time rain and snow special effect rendering method and device
CN117875147A (en) * 2024-03-11 2024-04-12 杭州经纬信息技术股份有限公司 Method and system for simulating rain and fog phenomena in real time and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473802A (en) * 2013-08-30 2013-12-25 福建天晴数码有限公司 Global weather simulation method based on particle system
CN107886574A (en) * 2017-09-19 2018-04-06 浙江科澜信息技术有限公司 A kind of global rain effect emulation mode based on particIe system
US20190304158A1 (en) * 2018-03-28 2019-10-03 Robert Bosch Gmbh Method and system for efficient rendering of 3d particle systems for weather effects
CN112116689A (en) * 2020-09-22 2020-12-22 威创集团股份有限公司 Real-time rain and snow special effect rendering method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473802A (en) * 2013-08-30 2013-12-25 福建天晴数码有限公司 Global weather simulation method based on particle system
CN107886574A (en) * 2017-09-19 2018-04-06 浙江科澜信息技术有限公司 A kind of global rain effect emulation mode based on particIe system
US20190304158A1 (en) * 2018-03-28 2019-10-03 Robert Bosch Gmbh Method and system for efficient rendering of 3d particle systems for weather effects
CN112116689A (en) * 2020-09-22 2020-12-22 威创集团股份有限公司 Real-time rain and snow special effect rendering method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YU, CHUN-XUAN ET AL.: "Real-time Simulation of Rain and Snow Based on Driving Simulator", COMPUTER ENGINEERING AND DESIGN, vol. 32, no. 1, 31 December 2011 (2011-12-31), pages 324 - 327, XP055914972 *
ZHOU, KAI-BO ET AL.: "Real-time Simulation of Rain and Snow Based on Particle Systems and Texture Scrolling", MICROCOMPUTER INFORMATION, vol. 25, no. 12-3, 31 December 2009 (2009-12-31), pages 177 - 179, XP055914989 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116109800A (en) * 2022-10-26 2023-05-12 润芯微科技(江苏)有限公司 Real-time 3D weather system based on illusion engine and implementation method thereof

Also Published As

Publication number Publication date
CN112116689A (en) 2020-12-22
CN112116689B (en) 2024-05-14

Similar Documents

Publication Publication Date Title
WO2022062254A1 (en) Method and apparatus for rendering rain and snow special effects in real time
US20200219323A1 (en) Interactive mixed reality platform utilizing geotagged social media
CN111415416B (en) Method and system for fusing monitoring real-time video and scene three-dimensional model
CN103226830B (en) The Auto-matching bearing calibration of video texture projection in three-dimensional virtual reality fusion environment
CN112560137A (en) Multi-model fusion method and system based on smart city
CN110827391B (en) Image rendering method, device and equipment and storage medium
CN110659385B (en) Fusion method of multi-channel video and three-dimensional GIS scene
CN111915726B (en) Construction method of three-dimensional scene of overhead transmission line
US11893081B2 (en) Map display method and apparatus
CN116012557B (en) Weather natural scene data docking system and docking method based on three-dimensional system
Beck Real-time visualization of big 3D city models
CN105205861A (en) Tree three-dimensional visualization model realization method based on Sphere-Board
CN106570926B (en) Efficient particle cloud layer method for drafting in a kind of Flight Scene Simulation
CN111210521A (en) Ship giant data model lightweight method, system, terminal and medium for VR
CN103426199A (en) Low-noise real-time global illumination drawing method for three-dimensional geometric scene
CN109889785A (en) A kind of dummy emulation method that the POI label based on unity is shown
CN114138265B (en) Visualization method based on digital twinning
GB2622666A (en) Three-dimensional virtual ecological environmental visualization integration and optimization system for large region
CN106846474A (en) WebGIS spatio temporal process simulation methods based on temporal aspect and particIe system
WO2020207458A1 (en) Flight path construction and display method and apparatus, computer storage medium, and electronic device
CN112184922A (en) Fusion method, device and equipment of two-dimensional video and three-dimensional scene and storage medium
CN115690344A (en) Sponge city sand table and weather simulation system
CN115937482A (en) Holographic scene dynamic construction method and system capable of adapting to screen size
CN205793049U (en) Augmented reality scene news conference system
US20170228926A1 (en) Determining Two-Dimensional Images Using Three-Dimensional Models

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20955095

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 14.08.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20955095

Country of ref document: EP

Kind code of ref document: A1