Raindrop effect generation method and device, storage medium and computer equipment

By randomly sampling the dynamic effect area of ​​raindrops in the UV expansion diagram of the target virtual object and performing normal calculations, the raindrop flow effect is directly generated in the material, which solves the problems of unreal raindrop effect and large equipment overhead in the existing technology, and realizes the Natural, random raindrop effects and efficient performance balance.

CN119295628APending Publication Date: 2025-01-10PERFECT WORLD INTERACTIVE ENTERTAINMENT (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311353265.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-19
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing raindrop simulation methods cannot effectively balance the raindrop effect and equipment performance, resulting in unreal effects and large equipment overhead.

Method used

The raindrop sampling diagram is determined based on the UV expansion diagram of the target virtual object, randomly sample the raindrop dynamic effect area, generate dynamic raindrop starting point data and perform normal calculations, and directly complete the raindrop flow effect calculation in the material to avoid additional rendering processes.

Benefits of technology

It realizes natural and random raindrop effects, reduces equipment performance requirements, improves the authenticity and simplicity of the effects, and is suitable for electronic devices with lower performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295628A_ABST
    Figure CN119295628A_ABST
Patent Text Reader

Abstract

The invention discloses a raindrop effect generation method and device, a storage medium and computer equipment, and the method comprises the steps: determining a raindrop sampling graph based on a UV expansion graph of a raindrop effect display region of a target virtual object, and randomly sampling a plurality of raindrop dynamic effect regions in the raindrop sampling graph; for any raindrop dynamic effect area, taking a starting point pixel point of the raindrop dynamic effect area in a preset direction as a starting point of a dynamic raindrop, and generating dynamic raindrop starting point data of the raindrop dynamic effect area, generating initial raindrop flowing effect data based on the dynamic raindrop starting point data and the length of a pixel point in a preset direction in the raindrop dynamic effect area, and performing normal calculation on the initial raindrop flowing effect data to obtain target raindrop flowing effect data; and determining dynamic raindrop effect data of the raindrop effect display area according to the target raindrop flowing effect data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method and device for generating raindrop effects, a storage medium, and a computer device. Background Art

[0002] In life, raindrops are a natural phenomenon. Currently, raindrop simulation in games is generally achieved through raindrop images or raindrop particle systems. In the method of using raindrop images to simulate raindrops, raindrop images are used instead of raindrops, and rain is simulated by moving raindrop images. This method is simple to implement, but the disadvantages are also obvious, that is, the effect is poor and unrealistic. In the method of using raindrop particle systems to simulate raindrops, first use the pre-made raindrop particle system to shoot the texture map, then sample the texture map in the material, and finally render the sampled raindrop texture. This method requires an additional rendering process to render and shoot the particle system, which has high equipment overhead and a relatively fixed effect.

[0003] The current raindrop simulation method cannot meet the requirements for raindrop effects and device performance overhead. Summary of the invention

[0004] In view of this, the present application provides a raindrop effect generation method and device, storage medium, and computer equipment, which well balance the equipment performance and raindrop effect, achieve a natural and random raindrop effect, and achieve a good raindrop effect even on electronic devices with lower performance.

[0005] According to one aspect of the present application, a method for generating a raindrop effect is provided, wherein the method comprises:

[0006] Determine a raindrop sampling map based on a UV expansion map of a raindrop effect display area of ​​a target virtual object, and randomly sample a plurality of raindrop dynamic effect areas in the raindrop sampling map, wherein each raindrop dynamic effect area includes a plurality of pixel points that are continuous in a preset direction;

[0007] For any raindrop dynamic effect area, taking the starting point pixel point of the raindrop dynamic effect area in a preset direction as the starting point of the dynamic raindrop, generating dynamic raindrop starting point data of the raindrop dynamic effect area, generating initial raindrop flowing effect data based on the dynamic raindrop starting point data and the length of the pixel point in the preset direction of the raindrop dynamic effect area, and performing normal calculation on the initial raindrop flowing effect data to obtain target raindrop flowing effect data;

[0008] Dynamic raindrop effect data of the raindrop effect display area is determined according to the target raindrop flowing effect data, wherein the dynamic raindrop effect data is used to generate the dynamic raindrop effect in the raindrop effect display area.

[0009] According to another aspect of the present application, a raindrop effect generating device is provided, the device comprising:

[0010] A dynamic raindrop selection module, used to determine a raindrop sampling map based on a UV expansion map of a raindrop effect display area of ​​a target virtual object, and randomly sample a plurality of raindrop dynamic effect areas in the raindrop sampling map, wherein each raindrop dynamic effect area includes a plurality of pixel points that are continuous in a preset direction;

[0011] A flowing effect generating module is used for generating dynamic raindrop starting point data of any raindrop dynamic effect area by taking the starting point pixel point of the raindrop dynamic effect area in a preset direction as the starting point of the dynamic raindrop, generating initial raindrop flowing effect data based on the dynamic raindrop starting point data and the length of the pixel point in the preset direction of the raindrop dynamic effect area, and performing normal calculation on the initial raindrop flowing effect data to obtain target raindrop flowing effect data;

[0012] The dynamic effect generation module is used to determine the dynamic raindrop effect data of the raindrop effect display area according to the target raindrop flow effect data, wherein the dynamic raindrop effect data is used to generate the dynamic raindrop effect in the raindrop effect display area.

[0013] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned raindrop effect generation method is implemented.

[0014] According to another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned raindrop effect generation method when executing the program.

[0015] By means of the above technical scheme, the present application provides a raindrop effect generation method and device, storage medium, and computer equipment, which use the UV expansion map of the raindrop effect display area of ​​the target virtual object to determine the raindrop sampling map, thereby randomly sampling the raindrop dynamic effect area in the raindrop sampling map, determining the dynamic raindrop starting point corresponding to each raindrop dynamic effect area, and further performing a preliminary calculation of the raindrop flowing effect based on the dynamic raindrop starting point position and the length of the dynamic raindrop effect area, and performing normal calculation on the preliminary calculation result to obtain the final target raindrop flowing effect data, so that when the raindrop effect needs to be displayed, the target raindrop flowing effect data can be used to generate the raindrop flowing effect in the raindrop effect display area. The calculation of the raindrop flowing effect in the embodiment of the present application is completed in the material of the raindrop effect display area. No additional rendering process is required. The dynamic raindrop effect rendering can be completed directly by using the process used for character face rendering. It is simple and efficient, and the dynamic raindrop effect data is calculated based on a raindrop sampling map based on the character's facial UV expansion map. The dynamic raindrop effect is more closely aligned with the character's facial effect and more realistic, and a good balance is achieved between performance and effect to achieve a natural and random raindrop effect. A good raindrop effect can also be achieved on electronic devices with lower performance.

[0016] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 A schematic diagram of a process of generating a raindrop effect provided by an embodiment of the present application is shown;

[0019] Figure 2 A schematic diagram of a raindrop sampling diagram provided in an embodiment of the present application is shown;

[0020] Figure 3 A schematic diagram of a processed raindrop sampling diagram provided in an embodiment of the present application is shown;

[0021] Figure 4 A schematic diagram of a processed raindrop sampling diagram provided in an embodiment of the present application is shown;

[0022] Figure 5 A schematic diagram of an initial raindrop provided by an embodiment of the present application is shown;

[0023] Figure 6 A schematic diagram showing a flow chart of another method for generating a raindrop effect provided in an embodiment of the present application is shown;

[0024] Figure 7 A schematic diagram of a raindrop effect provided by an embodiment of the present application is shown;

[0025] Figure 8 A schematic diagram of the structure of a raindrop effect generating device provided in an embodiment of the present application is shown;

[0026] Fig. 9 A schematic diagram showing the structure of another raindrop effect generating device provided in an embodiment of the present application is shown;

[0027] Fig.10 A schematic diagram of the device structure of a computer device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0028] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0029] In this embodiment, a method for generating a raindrop effect is provided. Figure 1 As shown, the method includes:

[0030] Step 101, based on the UV expansion map of the raindrop effect display area of ​​the target virtual object, determine a raindrop sampling map, randomly sample multiple raindrop dynamic effect areas in the raindrop sampling map, wherein each raindrop dynamic effect area includes multiple pixel points continuous in a preset direction.

[0031] The embodiment of the present application generates a random raindrop effect in the raindrop effect display area by performing UV calculation on the raindrop effect display area on the target virtual object where the raindrop effect needs to be generated. The calculation is completed in the material of the raindrop effect display area, and no additional rendering process is required. The raindrop effect is a random effect, which makes the raindrop effect richer and more vivid. In a specific application scenario, the target virtual object can be a virtual person, a virtual animal, a virtual object, etc. The raindrop effect display area corresponding to the virtual person can be the exposed skin part such as the face, the raindrop effect display area corresponding to the virtual animal can be the face, and the hair area with a relatively smooth surface where raindrops can flow, and the raindrop effect display area corresponding to the virtual object can be the relatively smooth surface area where raindrops can flow. The embodiment of the present application only explains the target virtual object as a virtual person and the raindrop effect display area as a face. Other types of target virtual objects and raindrop effect display areas are also within the protection scope of the present application.

[0032] First, the UV expansion map of the face of the target virtual character is obtained, and the raindrop sampling map for selecting the raindrop position is determined based on the UV expansion map. The raindrop sampling map is the same size as the UV expansion map and the positions of each pixel point correspond, so the pixel point selected on the raindrop sampling map can be mapped to the face of the character. One of the effects of raindrops falling on the face of the character is the raindrop flowing effect, that is, after the raindrop falls on a certain point on the face, it flows downward under the action of gravity, and evaporates continuously during the flow until it disappears or flows out of the facial area and disappears. The flow range of the raindrop can be determined by selecting multiple adjacent pixel points in the raindrop sampling map. Specifically, the raindrop dynamic effect area is randomly sampled in the raindrop sampling map. A raindrop dynamic effect area is composed of multiple continuous pixel points in a preset direction. The preset direction is generally the V component direction to simulate the effect of raindrops flowing downward. Of course, if it is necessary to simulate the raindrop effect in windy and rainy weather, the V component direction can also be offset based on the wind direction to obtain the required preset direction.

[0033] In an embodiment of the present application, optionally, determining a raindrop sampling map based on a UV expansion map of a raindrop effect display area of ​​a target virtual object in step 101 includes: adding random noise to the UV expansion map of a raindrop effect display area of ​​a target virtual object to obtain the raindrop sampling map.

[0034] In this embodiment, the UV expansion map can be directly used as the raindrop sampling map, or the raindrop sampling map can be obtained by adding random noise to the UV expansion map of the character's face, such as Figure 2 A raindrop sampling map obtained by adding random noise to increase randomness for subsequent raindrop position selection.

[0035] In an embodiment of the present application, optionally, the randomly sampling of multiple raindrop dynamic effect areas in the raindrop sampling map in step 101 includes: randomly sampling multiple target pixel grids on the raindrop sampling map, and stretching the target pixel grids in the preset direction according to a randomly determined stretching coefficient; determining the raindrop dynamic effect area based on the stretched target pixel grid; or randomly setting the color of each pixel grid on the stretched raindrop sampling map to one of two colors, and determining multiple pixel grids of any color as the raindrop dynamic effect area.

[0036] In this embodiment, when sampling the raindrop dynamic effect area, a plurality of target pixel grids may be randomly selected on the raindrop sampling map, and the selected target pixel grids may be stretched in a preset direction with a randomly determined stretching coefficient, such as Figure 3As shown, the target pixel point that originally occupied one pixel grid becomes a plurality of pixel grids in a preset direction. Afterwards, a portion of the stretched target pixel grid can be directly and randomly selected as the raindrop dynamic effect area; or the randomness can be further increased by randomly assigning one of the two colors to each pixel grid on the stretched raindrop sampling map, and after assigning the color to the pixel grid, the pixel grid of one of the colors is determined as the raindrop dynamic effect area, as shown in FIG. Figure 4 As shown, for example, each pixel grid is randomly set to black or white, and the white grid is selected as the raindrop dynamic effect area.

[0037] Step 102, for any raindrop dynamic effect area, take the starting pixel point of the raindrop dynamic effect area in a preset direction as the starting point of the dynamic raindrop, generate dynamic raindrop starting point data of the raindrop dynamic effect area, based on the dynamic raindrop starting point data and the length of the pixel point in the preset direction of the raindrop dynamic effect area, generate initial raindrop flowing effect data, and perform normal calculation on the initial raindrop flowing effect data to obtain target raindrop flowing effect data.

[0038] Secondly, the target raindrop flow effect data is calculated for each raindrop dynamic effect area. The flow of raindrops starts from a raindrop landing point and flows in a preset direction. The starting pixel point of the raindrop dynamic effect area in the preset direction can be used as the starting point of the dynamic raindrop in this area to generate the dynamic raindrop starting point data of this area. The dynamic raindrop starting point data includes the starting position, shape, size and other data of the dynamic raindrop. Specifically, an initial starting point data can be generated first, such as Figure 5 As shown, the shape and size of the initial starting point data are the initial values ​​(e.g., a circle of fixed size), and then the initial values ​​are randomly adjusted to increase the randomness of the raindrop shape. Next, the initial raindrop flow effect data is calculated based on the pixel length corresponding to the raindrop dynamic effect area and the dynamic raindrop starting point data. Specifically, the length of the raindrop flow is limited to the raindrop dynamic effect area. When calculating the raindrop flow effect, the flow speed can be calculated based on the shape and size of the raindrop. In order to improve the authenticity of the raindrop flow effect, the evaporation speed and raindrop shape change data during the raindrop flow process can be further calculated. Finally, the normal calculation of the initial raindrop flow effect data is performed to determine the normal effect of the raindrop flow, and the target raindrop flow effect data is obtained. Specifically, the normal direction of the dynamic raindrop is consistent with the normal direction of the pixel point where the raindrop is located mapped to the UV position on the UV expansion map of the character's face.

[0039] Step 103, determining dynamic raindrop effect data of the raindrop effect display area according to the target raindrop flowing effect data, wherein the dynamic raindrop effect data is used to generate the dynamic raindrop effect in the raindrop effect display area.

[0040] Finally, the target raindrop flow effect data is used to determine the dynamic effect data of the raindrop effect display area, where the dynamic raindrop effect can only include the flow effect of raindrops, or it can be superimposed with other effects, such as water mark effects. After determining the dynamic raindrop effect data, when the dynamic raindrop effect needs to be displayed, the dynamic raindrop effect data can be used to calculate the dynamic raindrop effect on the character's face. For example, when displaying the dynamic raindrop effect on a rainy day in the game, the calculation of the raindrop flow effect can be completed in the material of the character's face, that is, the dynamic raindrop effect is superimposed on the character's facial effect. No additional rendering process is required, and the dynamic raindrop effect rendering can be completed directly using the process used for character facial rendering. In addition, the dynamic raindrop effect data is calculated based on a raindrop sampling map based on the character's facial UV expansion map. The dynamic raindrop effect is more consistent with the character's facial effect and more realistic.

[0041] By applying the technical solution of this embodiment, the UV expansion map of the raindrop effect display area of ​​the target virtual object is used to determine the raindrop sampling map, so as to randomly sample the raindrop dynamic effect area in the raindrop sampling map, determine the dynamic raindrop starting point corresponding to each raindrop dynamic effect area, and further perform a preliminary calculation of the raindrop flowing effect based on the dynamic raindrop starting point position and the length of the dynamic raindrop effect area, and perform normal calculation on the preliminary calculation result to obtain the final target raindrop flowing effect data, so as to generate the raindrop flowing effect of the raindrop effect display area using the target raindrop flowing effect data when the raindrop effect needs to be displayed. The calculation of the raindrop flowing effect in the embodiment of the present application is completed in the material of the raindrop effect display area, and no additional rendering process is required. The dynamic raindrop effect rendering can be completed directly using the process used for character face rendering, which is simple and efficient, and the dynamic raindrop effect data is calculated based on the raindrop sampling map based on the character face UV expansion map, and the dynamic raindrop effect is more in line with the character face effect and more realistic, and the performance and effect are well balanced to achieve a natural and random raindrop effect, and a good raindrop effect can also be achieved on electronic devices with lower performance.

[0042] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another method for generating raindrop effects is provided, such as Figure 6 As shown, the method includes:

[0043] Step 201 : determining a raindrop sampling map based on a UV expansion map of a raindrop effect display area of ​​a target virtual object, and randomly sampling a plurality of raindrop static effect pixels and a plurality of raindrop dynamic effect areas in the raindrop sampling map.

[0044] In the embodiment of the present application, in addition to the dynamic effect of raindrops, the raindrop effect may also include a static effect. The dynamic effect of raindrops in the embodiment of the present application refers to the effect of raindrops that will produce position changes, such as the flowing effect of raindrops and the water mark effect of raindrops, while the static effect of raindrops refers to the effect of raindrops that will not produce position changes, such as the effect of raindrops that fall on the face of a person and are fixed at the landing point until they evaporate. After obtaining the raindrop sampling map, multiple raindrop dynamic effect areas and multiple raindrop static pixel points are randomly sampled in the raindrop sampling map, so as to subsequently calculate the dynamic and static effect data of raindrops, thereby increasing the randomness and realism of the raindrop effect.

[0045] Step 202, for any raindrop static effect pixel point, determining corresponding static raindrop effect data, including:

[0046] The raindrop brightness value of the raindrop static effect pixel point is randomly calculated, and the position of the raindrop static effect pixel point is used as the position of the static raindrop, initial static raindrop effect data including the position and the raindrop brightness value is generated, and normal calculation is performed on the initial static raindrop effect data to obtain static raindrop effect data.

[0047] In this embodiment, for the static raindrop effect, randomly sampled raindrop static effect pixel points are used as the location of the static raindrop. The static raindrop is always at this location from appearance to disappearance. The raindrop brightness value is randomly calculated for each raindrop static effect pixel point, and the brightness value of each static raindrop is randomly assigned, so that the static raindrop shows different depths and is more realistic and vivid. In addition, the shape and size of the static raindrop can be determined by randomly adjusting the initial value of the static raindrop, further increasing the randomness of the static raindrop. The normal line calculation is further performed on the initially determined initial static raindrop effect data to obtain the static raindrop effect data, wherein the static raindrop effect data can include the location of the static raindrop on the face of the person, the raindrop brightness value and the normal line direction.

[0048] Step 203, for any raindrop dynamic effect area, determining corresponding target raindrop flow effect data and target raindrop water mark effect data, including:

[0049] Taking the starting pixel point of the raindrop dynamic effect area in the preset direction as the starting point of the dynamic raindrop, the dynamic raindrop starting point data of the raindrop dynamic effect area is generated; based on the dynamic raindrop starting point data and the length of the pixel point in the preset direction of the raindrop dynamic effect area, initial raindrop flowing effect data is generated, and the normal calculation is performed on the initial raindrop flowing effect data to obtain target raindrop flowing effect data; based on the dynamic raindrop starting point data and the initial raindrop flowing effect data, initial raindrop water mark effect data is generated, and the normal calculation is performed on the initial raindrop water mark effect data to obtain target raindrop water mark effect data.

[0050] In this embodiment, the calculation process of the target raindrop flow effect data can refer to the above description.

[0051] In addition, raindrops can also form water marks after flowing on the face of the character. After determining the initial raindrop flow effect data, the raindrop water mark effect can be further calculated. Since the raindrop flow effect is limited to the raindrop dynamic effect area, and the water mark appears on the path of the raindrop flow, the raindrop water mark effect should also be limited to the raindrop dynamic effect area. The raindrop flow effect data can be directly used to calculate the water mark effect. For a dynamic raindrop, the corresponding water mark does not exceed the raindrop flow range. Specifically, the shape, duration and other data of the water mark can be determined within the raindrop flow range based on the shape, size, flow speed, evaporation speed, etc. of the dynamic raindrop. It is further necessary to calculate the normal of the initial raindrop water mark effect data so that the water mark effect can also be superimposed on the material of the character's face to avoid adding additional calculation overhead.

[0052] Step 204, determining the dynamic raindrop effect data according to the target raindrop flow effect data and the target raindrop water mark effect data; determining the regional raindrop effect data of the raindrop effect display area according to the dynamic raindrop effect data and the static raindrop effect data, wherein the regional raindrop effect data is used to generate the dynamic raindrop effect and the static raindrop effect in the raindrop effect display area.

[0053] Among them, the target raindrop flow effect data is used to indicate the process of dynamic raindrops appearing from the starting point and flowing along a preset direction until they disappear; the target raindrop water mark effect data in the dynamic raindrop effect data is used to indicate the process of water marks appearing based on the flow of dynamic raindrops until the water marks disappear; the static raindrop effect data is used to indicate the process of static raindrops appearing and disappearing at their locations; the target raindrop flow effect data includes the raindrop starting point position, raindrop shape data, raindrop flow speed and first normal direction corresponding to the dynamic raindrops; the target raindrop water mark effect data includes the water mark shape data, water mark duration and second normal direction corresponding to the dynamic raindrops; the static raindrop effect data includes the location, raindrop brightness value and third normal direction corresponding to the static raindrops.

[0054] In this embodiment, the raindrop effect is a superposition of the dynamic raindrop effect and the static raindrop effect. The dynamic raindrop effect includes the raindrop flow effect and the raindrop water mark effect. Finally, the dynamic and static multiple effect data are integrated to form the regional raindrop effect data. Figure 7 As shown, the final raindrop effect calculated using the regional raindrop effect data includes the entire process of dynamic raindrops appearing from the starting point and flowing along the preset direction until they disappear, the entire process of water marks appearing based on the flow of dynamic raindrops until the water marks disappear, and the entire process of static raindrops appearing from a certain landing point until they disappear.

[0055] Step 205 : When the raindrop effect display condition is met, based on the viewing direction of the virtual camera and the regional raindrop effect data, a dynamic raindrop effect and a static raindrop effect are generated in the raindrop effect display area.

[0056] In this embodiment, in a game world shot based on a virtual camera, when the conditions for displaying raindrop effects are met in the game world, in order to make the raindrop effect always in front of the virtual camera to maintain a clear and obvious visual effect, for raindrops in different normal directions, the normal direction of each raindrop can be dot-multiplied with the viewing direction of the virtual camera to obtain the highlight direction of each raindrop, and the raindrop effect is rendered based on the highlight direction, so that the highlight of each raindrop is always in front of the virtual camera, and then the flowing effect, water mark effect, and static effect are all superimposed on the character's face, thereby displaying a variety of raindrop effects on the character's face.

[0057] In an embodiment of the present application, optionally, the raindrop effect display conditions include multiple conditions, and different raindrop effect display conditions correspond to different rainfall levels; the regional raindrop effect data is generated based on each rainfall level respectively; step 205 includes: when the raindrop effect display conditions corresponding to any target rainfall level among the multiple rainfall levels are met, based on the viewing direction of the virtual camera and the regional raindrop effect data corresponding to the target rainfall level, generating a dynamic raindrop effect and a static raindrop effect in the raindrop effect display area.

[0058] In the above embodiment, the raindrop size, speed and other parameters of different rainfall levels are different, and the corresponding raindrop effects should also be different. Therefore, when calculating the raindrop effect, the rainfall level can be further combined to calculate different regional raindrop effect data at different rainfall levels, so as to show different raindrop effects based on different rainfall levels, and further improve the authenticity of the raindrop effect. For example, the larger the rainfall level, the larger the initial value of the raindrop size of the corresponding dynamic raindrops (and static raindrops), and the raindrop shape size after random adjustment based on this initial value will also be larger than the raindrop shape size of the raindrop with a smaller rainfall level on the whole.

[0059] Further, as Figure 1 The specific implementation of the method, the embodiment of the present application provides a raindrop effect generating device, such as Figure 8 As shown, the device comprises:

[0060] A dynamic raindrop selection module 301 is used to determine a raindrop sampling map based on a UV expansion map of a raindrop effect display area of ​​a target virtual object, and randomly sample a plurality of raindrop dynamic effect areas in the raindrop sampling map, wherein each raindrop dynamic effect area includes a plurality of pixel points that are continuous in a preset direction;

[0061] The flowing effect generating module 302 is used for generating dynamic raindrop starting point data of any raindrop dynamic effect area by taking the starting point pixel point of the raindrop dynamic effect area in a preset direction as the starting point of the dynamic raindrop, generating initial raindrop flowing effect data based on the dynamic raindrop starting point data and the length of the pixel point in the preset direction of the raindrop dynamic effect area, and performing normal calculation on the initial raindrop flowing effect data to obtain target raindrop flowing effect data;

[0062] The dynamic effect generation module 303 is used to determine the dynamic raindrop effect data of the raindrop effect display area according to the target raindrop flow effect data, wherein the dynamic raindrop effect data is used to generate the dynamic raindrop effect in the raindrop effect display area.

[0063] Alternatively, if Fig. 9 As shown, the device also includes:

[0064] A water mark effect generating module 304 is used to generate initial raindrop water mark effect data based on the dynamic raindrop starting point data and the initial raindrop flow effect data, and perform normal calculation on the initial raindrop water mark effect data to obtain target raindrop water mark effect data;

[0065] Accordingly, the dynamic effect generation module 303 is also used for:

[0066] The dynamic raindrop effect data is determined according to the target raindrop flow effect data and the target raindrop water mark effect data.

[0067] Optionally, the device further comprises:

[0068] The static raindrop selection module 305 is used to randomly sample a plurality of raindrop static effect pixels in the raindrop sampling map after determining the raindrop sampling map in the UV expansion map of the raindrop effect display area based on the target virtual object;

[0069] The static effect generation module 306 is used to randomly calculate the raindrop brightness value of any raindrop static effect pixel point, take the position of the raindrop static effect pixel point as the position of the static raindrop, generate initial static raindrop effect data including the position and the raindrop brightness value, and perform normal calculation on the initial static raindrop effect data to obtain static raindrop effect data;

[0070] Accordingly, the device further comprises:

[0071] The regional effect generating module 307 is used to determine the regional raindrop effect data of the raindrop effect display area according to the dynamic raindrop effect data and the static raindrop effect data, wherein the regional raindrop effect data is used to generate the dynamic raindrop effect and the static raindrop effect in the raindrop effect display area.

[0072] Optionally, the device further comprises:

[0073] A display module 308, configured to generate a dynamic raindrop effect and a static raindrop effect in the raindrop effect display area based on the viewing direction of the virtual camera and the regional raindrop effect data when the raindrop effect display condition is met;

[0074] The target raindrop flow effect data is used to indicate the process of dynamic raindrops flowing from the starting point to the preset direction until they disappear; the target raindrop water mark effect data in the dynamic raindrop effect data is used to indicate the process of water marks appearing based on the flow of dynamic raindrops until they disappear; the static raindrop effect data is used to indicate the process of static raindrops appearing at the location to disappearing;

[0075] The target raindrop flow effect data includes the raindrop starting point position, raindrop shape data, raindrop flow speed and first normal direction corresponding to the dynamic raindrops; the target raindrop water mark effect data includes the water mark shape data, water mark duration and second normal direction corresponding to the dynamic raindrops; the static raindrop effect data includes the location, raindrop brightness value and third normal direction corresponding to the static raindrops.

[0076] Optionally, the raindrop effect display conditions include multiple conditions, and different raindrop effect display conditions correspond to different rainfall levels; the regional raindrop effect data are generated based on each rainfall level respectively;

[0077] The display module 308 is also used to generate dynamic raindrop effects and static raindrop effects in the raindrop effect display area based on the viewing direction of the virtual camera and the regional raindrop effect data corresponding to the target rainfall level when the raindrop effect display conditions corresponding to any target rainfall level among the multiple rainfall levels are met.

[0078] Optionally, the dynamic raindrop selection module 301 is further used to:

[0079] Random noise is added to the UV expansion map of the raindrop effect display area of ​​the target virtual object to obtain the raindrop sampling map.

[0080] Optionally, the dynamic raindrop selection module 301 is further used to:

[0081] Randomly sampling a plurality of target pixel grids on the raindrop sampling map, and stretching the target pixel grids in the preset direction according to a randomly determined stretching coefficient;

[0082] Determine the raindrop dynamic effect area based on the stretched target pixel grid; or,

[0083] The color of each pixel grid on the stretched raindrop sampling image is randomly set to one of two colors, and a plurality of pixel grids of any color are determined as the raindrop dynamic effect area.

[0084] It should be noted that for other corresponding descriptions of the functional units involved in the raindrop effect generating device provided in the embodiment of the present application, reference can be made to Figures 1 to 7 The corresponding description in the method will not be repeated here.

[0085] The present application also provides a computer device, which may be a personal computer, a server, a network device, etc. Fig.10As shown, the computer device includes a bus 10, a processor 20, a memory 30 and a communication interface 40, and may also include an input and output interface 50 and a display device 60. Among them, the processor 20 of the computer device is used to provide computing and control capabilities. The memory 30 of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store location information. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in each method embodiment are implemented.

[0086] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0087] In one embodiment, a computer-readable storage medium is provided. The computer-readable storage medium may be non-volatile or volatile, and stores a computer program thereon. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0088] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0089] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0090] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0091] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0092] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for generating a raindrop effect, characterized in that: The method comprises: Determine a raindrop sampling map based on a UV expansion map of a raindrop effect display area of ​​a target virtual object, and randomly sample a plurality of raindrop dynamic effect areas in the raindrop sampling map, wherein each raindrop dynamic effect area includes a plurality of pixel points that are continuous in a preset direction; For any raindrop dynamic effect area, taking the starting point pixel point of the raindrop dynamic effect area in a preset direction as the starting point of the dynamic raindrop, generating dynamic raindrop starting point data of the raindrop dynamic effect area, generating initial raindrop flowing effect data based on the dynamic raindrop starting point data and the length of the pixel point in the preset direction of the raindrop dynamic effect area, and performing normal calculation on the initial raindrop flowing effect data to obtain target raindrop flowing effect data; Dynamic raindrop effect data of the raindrop effect display area is determined according to the target raindrop flowing effect data, wherein the dynamic raindrop effect data is used to generate the dynamic raindrop effect in the raindrop effect display area.

2. The method according to claim 1, characterized in that After generating the initial raindrop flowing effect data, the method further includes: Based on the dynamic raindrop starting point data and the initial raindrop flow effect data, initial raindrop water mark effect data is generated, and normal calculation is performed on the initial raindrop water mark effect data to obtain target raindrop water mark effect data; Correspondingly, determining the dynamic raindrop effect data of the raindrop effect display area according to the target raindrop flowing effect data includes: The dynamic raindrop effect data is determined according to the target raindrop flow effect data and the target raindrop water mark effect data.

3. The method according to claim 1 or 2, characterized in that: After determining the raindrop sampling map based on the UV expansion map of the raindrop effect display area of ​​the target virtual object, the method further includes: Randomly sampling a plurality of raindrop static effect pixels in the raindrop sampling image; For any raindrop static effect pixel point, randomly calculate the raindrop brightness value of the raindrop static effect pixel point, take the position of the raindrop static effect pixel point as the position of the static raindrop, generate initial static raindrop effect data including the position and the raindrop brightness value, and perform normal calculation on the initial static raindrop effect data to obtain static raindrop effect data; Correspondingly, after determining the dynamic raindrop effect data of the raindrop effect display area according to the target raindrop flowing effect data, the method further includes: Regional raindrop effect data of the raindrop effect display area is determined according to the dynamic raindrop effect data and the static raindrop effect data, wherein the regional raindrop effect data is used to generate the dynamic raindrop effect and the static raindrop effect in the raindrop effect display area.

4. The method according to claim 3, characterized in that: After determining the regional raindrop effect data of the raindrop effect display area according to the dynamic raindrop effect data and the static raindrop effect data, the method further includes: When the raindrop effect display condition is met, based on the viewing direction of the virtual camera and the regional raindrop effect data, a dynamic raindrop effect and a static raindrop effect are generated in the raindrop effect display area; The target raindrop flow effect data is used to indicate the process of dynamic raindrops flowing from the starting point to the preset direction until they disappear; the target raindrop water mark effect data in the dynamic raindrop effect data is used to indicate the process of water marks appearing based on the flow of dynamic raindrops until they disappear; the static raindrop effect data is used to indicate the process of static raindrops appearing at the location to disappearing; The target raindrop flow effect data includes the raindrop starting point position, raindrop shape data, raindrop flow speed and first normal direction corresponding to the dynamic raindrops; the target raindrop water mark effect data includes the water mark shape data, water mark duration and second normal direction corresponding to the dynamic raindrops; the static raindrop effect data includes the location, raindrop brightness value and third normal direction corresponding to the static raindrops.

5. The method according to claim 4, characterized in that The raindrop effect display conditions include multiple ones, and different raindrop effect display conditions correspond to different rainfall levels; the regional raindrop effect data are generated based on each rainfall level respectively; The method of generating a dynamic raindrop effect and a static raindrop effect in the raindrop effect display area based on the viewing direction of the virtual camera and the regional raindrop effect data when the raindrop effect display condition is met includes: When the raindrop effect display conditions corresponding to any target rainfall level among the multiple rainfall levels are met, dynamic raindrop effects and static raindrop effects are generated in the raindrop effect display area based on the viewing direction of the virtual camera and the regional raindrop effect data corresponding to the target rainfall level.

6. The method according to claim 1, characterized in that The step of determining the raindrop sampling map based on the UV expansion map of the raindrop effect display area of ​​the target virtual object comprises: Random noise is added to the UV expansion map of the raindrop effect display area of ​​the target virtual object to obtain the raindrop sampling map.

7. The method according to claim 1, characterized in that The randomly sampling of multiple raindrop dynamic effect areas in the raindrop sampling map includes: Randomly sampling a plurality of target pixel grids on the raindrop sampling map, and stretching the target pixel grids in the preset direction according to a randomly determined stretching coefficient; Determine the raindrop dynamic effect area based on the stretched target pixel grid; or, The color of each pixel grid on the stretched raindrop sampling image is randomly set to one of two colors, and a plurality of pixel grids of any color are determined as the raindrop dynamic effect area.

8. A raindrop effect generating device, characterized in that: The device comprises: A dynamic raindrop selection module, used to determine a raindrop sampling map based on a UV expansion map of a raindrop effect display area of ​​a target virtual object, and randomly sample a plurality of raindrop dynamic effect areas in the raindrop sampling map, wherein each raindrop dynamic effect area includes a plurality of pixel points that are continuous in a preset direction; A flowing effect generating module is used for generating dynamic raindrop starting point data of any raindrop dynamic effect area by taking the starting point pixel point of the raindrop dynamic effect area in a preset direction as the starting point of the dynamic raindrop, generating initial raindrop flowing effect data based on the dynamic raindrop starting point data and the length of the pixel point in the preset direction of the raindrop dynamic effect area, and performing normal calculation on the initial raindrop flowing effect data to obtain target raindrop flowing effect data; The dynamic effect generation module is used to determine the dynamic raindrop effect data of the raindrop effect display area according to the target raindrop flow effect data, wherein the dynamic raindrop effect data is used to generate the dynamic raindrop effect in the raindrop effect display area.

9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.