Rainwater special effect processing method, device, equipment, medium and program in virtual scene

By dynamically adjusting the target position of the rainwater special effects according to the position of the virtual camera in the game, the problem of high performance consumption and unrealistic effects in the existing technology is solved, and more efficient and realistic raining effects are achieved.

CN119499645APending Publication Date: 2025-02-25NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411885567.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The special effects implementation methods for raining in existing games consume high performance and are not realistic enough, especially when the camera rotates, the direction of the rain does not change, and the visual effect does not conform to life experience.

Method used

By determining the target position of the preset rainwater special effect based on the current position of the virtual camera in the virtual scene and the preset operation mode, and moving it to the target position in the virtual scene, dynamic follow-up of the rainwater special effect is achieved.

Benefits of technology

It reduces the number of rainwater particles, reduces machine performance consumption, improves the fidelity and efficiency of special effects, and realizes the raining effect of the picture captured by the virtual camera.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119499645A_ABST
    Figure CN119499645A_ABST
Patent Text Reader

Abstract

The invention provides a rainwater special effect processing method and device in a virtual scene, equipment, a medium and a program, and relates to the technical field of games. According to the method, a target position of a preset rainwater special effect in a virtual scene is determined according to a current position of a virtual camera in the virtual scene and a preset operation mode of the virtual camera, and the preset rainwater special effect is an area special effect formed by rainwater particles in a preset area; and moving the preset rainwater special effect to a target position in the virtual scene. Therefore, only a small-range preset rainwater special effect needs to be designed, the effect that all pictures captured by the virtual camera present a raining effect can be achieved, the number of rainwater particles is reduced, machine performance consumption is reduced, and the special effect cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of game technology, and in particular to a method, device, equipment, medium and program for processing rain special effects in a virtual scene. Background Art

[0002] In order to achieve the effect of an open world in the game, a weather system is essential. However, due to the limitations of machine performance, mobile phones usually use some simpler implementation methods, such as a sequence of frame screen effects of rain, or setting a rain map in a cone that surrounds the rotation of the camera. There are also scripts to control rain particles. Each implementation method has different effects and performance consumption.

[0003] In the existing methods, the screen effects of the rain sequence frames, or the rain map set in a cone that surrounds the lens rotation, these two methods have low performance consumption. However, the effect is average. When the camera rotates, the direction of the rain will not change. For example, the rain is leaning to the right, but after the camera rotates 180 degrees, the rain is still leaning to the right. The visual effect is inconsistent with life experience. The script control is used to form a large number of regional rain particles. This method requires a large number of rain particles to ensure that when the camera position changes, the camera is also under the entire regional rain effect. This rain area needs to include the camera. Because there are many rain particles, they need to be controlled one by one through the script program on the CPU side, which consumes a lot of CPU. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a method, device, equipment, medium and program for processing rain special effects in a virtual scene to solve the problem of high special effects consumption.

[0005] In a first aspect, an embodiment of the present application provides a method for processing rain special effects in a virtual scene, the method comprising:

[0006] Determine a target position of a preset rain effect in the virtual scene according to a current position of a virtual camera in the virtual scene and a preset operation mode of the virtual camera, wherein the preset rain effect is a regional effect formed by rain particles in a preset area;

[0007] The preset rain special effect is moved to the target position in the virtual scene.

[0008] In a second aspect, an embodiment of the present application provides a rain special effect processing device in a virtual scene, the device comprising:

[0009] A determination module, configured to determine a target position of a preset rain effect in the virtual scene according to a current position of a virtual camera in the virtual scene and a preset operation mode of the virtual camera, wherein the preset rain effect is a regional effect formed by rain particles in a preset region;

[0010] A control module is used to move the preset rain effect to the target position in the virtual scene.

[0011] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for processing rain special effects in a virtual scene as described in any one of the first aspects.

[0012] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for processing rain special effects in a virtual scene as described in any one of the first aspects are executed.

[0013] In a fifth aspect, an embodiment of the present application provides a computer program instruction, which, when executed by a processor, implements the steps of the method for processing rain special effects in a virtual scene as described in any one of the first aspects.

[0014] Compared with the prior art, this application has the following beneficial effects:

[0015] The present application provides a method, device, equipment, medium and program for processing rain special effects in a virtual scene. The method determines the target position of the preset rain special effect in the virtual scene according to the current position of the virtual camera in the virtual scene and the preset operation mode of the virtual camera, wherein the preset rain special effect is a regional special effect formed by rain particles in a preset area; and moves the preset rain special effect to the target position in the virtual scene. Therefore, only a small range of preset rain special effects need to be designed to achieve the effect of rain in all the images captured by the virtual camera, thereby reducing the number of rain particles, reducing machine performance consumption, and reducing special effect costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 A flowchart of a method for processing rain special effects in a virtual scene provided by an embodiment of the present application;

[0018] Figure 2 A flowchart of a method for determining a target position according to a current position of a virtual camera and a position of a controlled virtual object provided in an embodiment of the present application;

[0019] Figure 3 A schematic diagram of a flow chart of another method for processing rain special effects in a virtual scene provided in an embodiment of the present application;

[0020] Figure 4 A schematic diagram of a rain special effect processing device in a virtual scene provided in an embodiment of the present application;

[0021] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0022] Icon: 401 - determination module, 402 - control module, 501 - processor, 502 - storage medium, 503 - bus. DETAILED DESCRIPTION

[0023] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0024] In one embodiment of the present application, a method for processing rain effects in a virtual scene can be run on a local terminal device or a server. When a method for processing rain effects in a virtual scene is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0025] In a possible implementation, an embodiment of the present invention provides a method for processing rain special effects in a virtual scene, providing a graphical user interface through a terminal device, the graphical user interface including: a virtual scene, and the virtual scene can be set with rain special effects; wherein the terminal device can be the local terminal device mentioned above, or it can be a client device in the cloud interactive system mentioned above.

[0026] Figure 1 This is a flow chart of a method for processing rain special effects in a virtual scene provided by an embodiment of the present application. Figure 1 As shown, the method includes:

[0027] S101. Determine a target position of a preset rain effect in a virtual scene according to a current position of a virtual camera in a virtual scene and a preset operation mode of the virtual camera.

[0028] Among them, the preset rain special effect is a regional special effect formed by rain particles in a preset area.

[0029] For example, a regional rain particle special effect is freely made using the game engine function to obtain a regional special effect formed by rain particles in a preset area. The shape of the area can be cylindrical or rectangular, that is, the top of the area is a circular or square rain particle emission area, in which the rain particles move down one by one to form a rain effect. The special effect can be a CPU particle special effect or a GPU particle special effect. The size of the special effect area is related to the distance between the special effect and the virtual camera in the virtual scene, and can be adjusted by itself, but it is necessary to ensure that all the pictures in the virtual camera lens are covered by the rain range, and the particle size is adapted to the performance effect of the virtual camera at a distance, so that the user can always see a realistic rain effect. And using the game engine to make rain special effects (for example, game editors such as Unreal Engine and Unity support the production of special effects), supports art engineers to use the game engine function to make freely, does not require program developers to control rain particles one by one, is conducive to development division of labor, and improves development efficiency.

[0030] According to the current position of the virtual camera in the virtual scene and the preset operation mode of the virtual camera, the target position of the virtual camera can be determined. According to the target position of the virtual camera, the target position of the preset rain effect in the virtual scene can be determined so that the preset rain effect always follows the virtual camera.

[0031] S102: Move the preset rain special effect to a target position in the virtual scene.

[0032] Since the target position of the preset rain effect is determined according to the virtual camera, the preset rain effect always moves with the virtual camera and moves to the target position in the virtual scene. During the movement of the virtual camera and the preset rain effect, the virtual camera is close to the preset rain effect, and visually, all the images in the lens of the virtual camera can be covered by the preset rain effect.

[0033] Therefore, it is only necessary to design a small-scale preset rain special effect to achieve the effect of rain in the images captured by the virtual camera, which reduces the number of rain particles, reduces machine performance consumption, and reduces special effects costs.

[0034] In summary, in this embodiment, according to the current position of the virtual camera in the virtual scene and the preset operation mode of the virtual camera, the target position of the preset rain effect in the virtual scene is determined, wherein the preset rain effect is a regional effect formed by rain particles in a preset area; the preset rain effect is moved to the target position in the virtual scene. Therefore, only a small range of preset rain effects need to be designed to achieve the effect of rain in all the images captured by the virtual camera, which reduces the number of rain particles, reduces the machine performance consumption, and reduces the cost of special effects.

[0035] In the above Figure 1 On the basis of the corresponding embodiment, in another embodiment of the present application, determining the target position of the preset rain effect in the virtual scene according to the current position of the virtual camera in the virtual scene and the preset operation mode of the virtual camera in S101 includes:

[0036] If the preset operation mode is the preset trajectory operation mode, the target position is determined from the preset trajectory of the virtual camera according to the current position of the virtual camera.

[0037] The preset track operation mode is a known and determined operation track. When the virtual camera moves on the preset track, the next moving position of the virtual camera is determined as the target position. Thus, the preset rain special effect follows the movement of the virtual camera.

[0038] In summary, in this embodiment, if the preset operation mode is the preset track operation mode, the target position is determined from the preset track of the virtual camera according to the current position of the virtual camera, so that the preset rain effect moves with the virtual camera.

[0039] On the basis of the above embodiment, in another embodiment of the present application, according to the current position of the virtual camera, determining the target position from the preset trajectory of the virtual camera includes:

[0040] According to the current position of the virtual camera and the first preset distance, the target position is determined along the forward direction of the virtual camera and from the preset track of the virtual camera.

[0041] In order to make the rain effect more realistic, a first preset distance is set. When the preset rain effect moves with the virtual camera, the position at the first preset distance from the lens of the virtual camera is determined as the target position. The preset rain effect always maintains the first preset distance from the lens of the virtual camera to prevent the rain effect from sticking to the lens of the virtual camera.

[0042] For example, the first preset distance is preset by a user.

[0043] In summary, in this embodiment, according to the current position of the virtual camera and the first preset distance, the target position is determined from the preset track of the virtual camera along the forward direction of the virtual camera. Thus, by setting the first preset distance, the rain effect is made more realistic.

[0044] Based on the above embodiment, in another embodiment of the present application, according to the current position of the virtual camera and the first preset distance, along the forward direction of the virtual camera, the target position is determined from the preset trajectory of the virtual camera, including:

[0045] At every preset time interval, according to the current position of the virtual camera and the first preset distance, the target position is determined along the forward direction of the virtual camera from the preset track of the virtual camera.

[0046] When the preset rain effect moves with the virtual camera, a position that is a first preset distance away from the lens of the virtual camera is determined as a target position at every preset time interval.

[0047] For example, the preset time interval may be one frame or one second. Determining the target position once at each preset time interval may improve the movement accuracy of the preset rain special effect, thereby making the preset rain special effect more realistic.

[0048] In summary, in this embodiment, at every preset time interval, according to the current position of the virtual camera and the first preset distance, along the forward direction of the virtual camera, the target position is determined from the preset trajectory of the virtual camera. Thus, the movement accuracy of the preset rain special effect is improved, and the preset rain special effect is made more realistic.

[0049] In the above Figure 1 On the basis of the corresponding embodiment, in another embodiment of the present application, determining the target position of the preset rain effect in the virtual scene according to the current position of the virtual camera in the virtual scene and the preset operation mode of the virtual camera in S101 also includes:

[0050] If the preset operation mode is the follow operation mode, the target position is determined according to the current position of the virtual camera and the position of the controlled virtual object in the virtual scene.

[0051] The following operation mode is: the virtual camera always follows the movement of the controlled virtual object. For example, the controlled virtual object is a virtual person, and the virtual camera always follows the movement of the virtual person, so that the virtual person always appears in the lens of the virtual camera.

[0052] In the follow-up operation mode, the target position of the preset rain effect is determined according to the current position of the virtual camera and the position of the controlled virtual object. Thus, the virtual camera lens is always filled with rain effects, and the controlled virtual object is always in the rain effect in terms of visual effect, ensuring that the rain effect is presented more realistically in the virtual scene.

[0053] In summary, in this embodiment, if the preset operation mode is the follow operation mode, the target position is determined according to the current position of the virtual camera and the position of the controlled virtual object in the virtual scene, thereby ensuring that the rain effect is presented more realistically in the virtual scene.

[0054] On the basis of the above-mentioned embodiments, the embodiments of the present application further provide a method for determining a target position according to a current position of a virtual camera and a position of a controlled virtual object. Figure 2 A flowchart of a method for determining a target position according to the current position of a virtual camera and the position of a controlled virtual object provided by an embodiment of the present application. Figure 2 As shown, according to the current position of the virtual camera and the position of the controlled virtual object in the virtual scene, the target position is determined, including:

[0055] S201. Obtain the current positions of the virtual camera and the controlled virtual object.

[0056] S202: Calculate the current distance between the virtual camera and the controlled virtual object according to the current position of the virtual camera and the current position of the controlled virtual object.

[0057] S203: If the current distance is less than the second preset distance, determine the current position of the controlled virtual object as the target position.

[0058] If the current distance is less than the second preset distance, it means that the controlled virtual object is very close to the virtual camera. The current position of the controlled virtual object can be directly used as the target position, and the preset rain effect is centered on the controlled virtual object so that the preset rain effect moves with the controlled virtual object.

[0059] Therefore, in terms of visual effects, the lens of the virtual camera is always full of rain effects, and it is also ensured that the controlled virtual object is always in the rain effects, ensuring that the rain effects are presented more realistically in the virtual scene.

[0060] In summary, in this embodiment, the current positions of the virtual camera and the controlled virtual object are obtained; the current distance between the virtual camera and the controlled virtual object is calculated according to the current position of the virtual camera and the current position of the controlled virtual object; if the current distance is less than the second preset distance, the current position of the controlled virtual object is determined to be the target position. Thus, in terms of visual effects, the lens of the virtual camera is always full of rain effects, and the controlled virtual object is always in the rain effects, ensuring that the rain effects are more realistically presented in the virtual scene.

[0061] On the basis of the above embodiment, in another embodiment of the present application, the target position is determined according to the current position of the virtual camera and the position of the controlled virtual object in the virtual scene, further comprising:

[0062] If the current distance is greater than or equal to the second preset distance, the target position is determined according to the current position of the virtual camera and the third preset distance along the forward direction of the virtual camera.

[0063] If the current distance is greater than or equal to the second preset distance, it indicates that the controlled virtual object is far away from the virtual camera. If the current position of the controlled virtual object is used as the target position, it may not be possible to ensure that the lens of the virtual camera is always full of rain effects. Therefore, in this case, when the preset rain effect moves with the virtual camera, the position at the third preset distance from the lens of the virtual camera along the forward direction of the virtual camera is determined as the target position.

[0064] Therefore, in terms of visual effects, the lens of the virtual camera is always full of rain effects, and it is also ensured that the controlled virtual objects are also in the rain effects, ensuring that the rain effects are presented more realistically in the virtual scene.

[0065] In summary, in this embodiment, if the current distance is greater than or equal to the second preset distance, the target position is determined according to the current position of the virtual camera and the third preset distance along the forward direction of the virtual camera. Thus, in terms of visual effects, the lens of the virtual camera is always full of rain effects, and the controlled virtual object is also ensured to be in the rain effects, ensuring that the rain effects are presented more realistically in the virtual scene.

[0066] Based on the above embodiment, in another embodiment of the present application, if the current distance is less than the second preset distance, before determining that the current position of the controlled virtual object is the target position, the method further includes:

[0067] The second preset distance is determined according to the size of the area corresponding to the preset rain special effect and the size of rain particles in the preset rain special effect.

[0068] For example, the larger the area corresponding to the preset rain effect is, the larger the second preset distance is; otherwise, the smaller the second preset distance is. The larger the rain particles in the preset rain effect are, the larger the second preset distance is; otherwise, the smaller the second preset distance is. It should be noted that in actual determination of the second preset distance, it is necessary to comprehensively consider the size of the area corresponding to the preset rain effect and the size of the rain particles in the preset rain effect. Thus, it is ensured that all images in the lens of the virtual camera are covered by the rain effect.

[0069] In summary, in this embodiment, the second preset distance is determined according to the size of the area corresponding to the preset rain effect and the size of the rain particles in the preset rain effect, thereby ensuring that all images in the lens of the virtual camera are covered by the rain effect.

[0070] In the above Figure 1 On the basis of the corresponding embodiments, the embodiments of the present application also provide another method for processing rain special effects in a virtual scene. Figure 3 A flowchart of another method for processing rain special effects in a virtual scene provided by an embodiment of the present application. Figure 3 As shown, the method also includes:

[0071] S301: If there is a preset wind special effect in the virtual scene, determine the motion control parameters of rain particles in the preset rain special effect according to the current wind force information of the preset wind special effect.

[0072] In order to make the rain special effect more realistic, the motion control parameters of the rain particles in the preset rain special effect are determined according to the current wind force information of the preset wind special effect, so that the motion direction of the rain special effect is consistent with that of the wind special effect.

[0073] S302: Control the movement of rain particles in a preset rain special effect according to the motion control parameters.

[0074] In the existing rain special effects, if the lens of the virtual camera rotates, since the movement direction of the rain does not change, different movement directions of the rain particles will be seen from different angles.

[0075] By controlling the rain particles according to the motion control parameters, even when the lens of the virtual camera rotates, the movement direction of the rain special effect is consistent with the wind special effect, and the target position is consistent with the position of the virtual camera. Therefore, the rain particles combined with the wind special effect can always be seen, making the rain special effect more realistically presented in the virtual scene.

[0076] In summary, in this embodiment, if there is a preset wind special effect in the virtual scene, the motion control parameters of the rain particles in the preset rain special effect are determined according to the current wind force information of the preset wind special effect; and the rain particles in the preset rain special effect are controlled to move according to the motion control parameters. Thus, the rain special effect is presented more realistically in the virtual scene.

[0077] In the above Figure 3 On the basis of the corresponding embodiment, in another embodiment of the present application, the wind force information includes: wind direction information, and / or wind force magnitude.

[0078] In S301, according to the current wind force information of the preset wind special effect, the motion control parameters of the rain particles in the preset rain special effect are determined, including:

[0079] According to the wind direction information and / or the wind force, the motion control parameters of the rain particles are determined, and the motion control parameters include: rotation parameters and / or tilt parameters.

[0080] The information of wind effects is represented by wind direction information and / or wind force, and both wind direction information and wind force will affect rain particles.

[0081] For example, according to the influence relationship between the preset wind special effect and the preset rain special effect, the mapping relationship between "wind direction information and / or wind force" and "rotation parameter and / or tilt parameter" can be predetermined. During motion control, the rotation parameter and / or tilt parameter can be directly determined according to the above mapping relationship.

[0082] In summary, in this embodiment, the wind force information includes: wind direction information and / or wind force size; according to the wind direction information and / or wind force size, the motion control parameters of the rainwater particles are determined, and the motion control parameters include: rotation parameters and / or tilt parameters. Thus, the motion control parameters are accurately determined.

[0083] The following describes a rain special effects processing device, equipment, storage medium, and program for executing the present application in a virtual scene. The specific implementation process and technical effects are described above and will not be repeated below.

[0084] Figure 4 A schematic diagram of a rain special effect processing device in a virtual scene provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the device comprises:

[0085] The determination module 401 is used to determine the target position of the preset rain effect in the virtual scene according to the current position of the virtual camera in the virtual scene and the preset operation mode of the virtual camera, wherein the preset rain effect is a regional effect formed by rain particles in a preset area.

[0086] The control module 402 is used to move the preset rain effect to a target position in the virtual scene.

[0087] Furthermore, the determination module 401 is specifically configured to determine the target position from the preset track of the virtual camera according to the current position of the virtual camera if the preset operation mode is the preset track operation mode.

[0088] Furthermore, the determination module 401 is specifically configured to determine the target position from a preset track of the virtual camera along the forward direction of the virtual camera according to the current position of the virtual camera and the first preset distance.

[0089] Furthermore, the determination module 401 is specifically configured to determine the target position from a preset track of the virtual camera along the forward direction of the virtual camera according to the current position of the virtual camera and the first preset distance at every preset time interval.

[0090] Furthermore, the determination module 401 is specifically used to determine the target position according to the current position of the virtual camera and the position of the controlled virtual object in the virtual scene if the preset operation mode is the follow operation mode.

[0091] Furthermore, the determination module 401 is specifically used to obtain the current position of the virtual camera and the controlled virtual object; calculate the current distance between the virtual camera and the controlled virtual object according to the current position of the virtual camera and the current position of the controlled virtual object; if the current distance is less than the second preset distance, determine the current position of the controlled virtual object as the target position.

[0092] Furthermore, the determination module 401 is specifically configured to determine the target position along the forward direction of the virtual camera according to the current position of the virtual camera and the third preset distance if the current distance is greater than or equal to the second preset distance.

[0093] Furthermore, the determination module 401 is specifically configured to determine the second preset distance according to the size of the area corresponding to the preset rain special effect and the size of rain particles in the preset rain special effect.

[0094] Furthermore, the control module 402 is also used to determine the motion control parameters of rain particles in the preset rain effect according to the current wind force information of the preset wind effect if there is a preset wind effect in the virtual scene; and control the movement of rain particles in the preset rain effect according to the motion control parameters.

[0095] Furthermore, the control module 402 is also used for wind information including: wind direction information, and / or wind force size; according to the wind direction information, and / or wind force size, determining motion control parameters of rain particles, the motion control parameters including: rotation parameters and / or tilt parameters.

[0096] In the above manner, according to the current position of the virtual camera in the virtual scene and the preset operation mode of the virtual camera, the target position of the preset rain effect in the virtual scene is determined, wherein the preset rain effect is a regional effect formed by rain particles in a preset area; the preset rain effect is moved to the target position in the virtual scene. Therefore, only a small range of preset rain effects need to be designed to achieve the effect of rain in all the images captured by the virtual camera, which reduces the number of rain particles, reduces the machine performance consumption, and reduces the cost of special effects.

[0097] Figure 5 A structural diagram of an electronic device provided in an embodiment of the present application includes: a processor 501, a storage medium 502 and a bus 503, the storage medium 502 stores machine-readable instructions executable by the processor 501, the processor 501 communicates with the storage medium 502 via the bus 503, and the processor 501 executes the machine-readable instructions to execute the above method.

[0098] Determine a target position of a preset rain effect in the virtual scene according to the current position of the virtual camera in the virtual scene and the preset operation mode of the virtual camera, wherein the preset rain effect is a regional effect formed by rain particles in a preset area;

[0099] Move the preset rain effect to the target position in the virtual scene.

[0100] Optionally, determining a target position of a preset rain effect in the virtual scene according to a current position of the virtual camera in the virtual scene and a preset operation mode of the virtual camera includes:

[0101] If the preset operation mode is the preset trajectory operation mode, the target position is determined from the preset trajectory of the virtual camera according to the current position of the virtual camera.

[0102] Optionally, according to the current position of the virtual camera, determining the target position from a preset track of the virtual camera includes:

[0103] According to the current position of the virtual camera and the first preset distance, the target position is determined along the forward direction of the virtual camera and from the preset track of the virtual camera.

[0104] Optionally, according to the current position of the virtual camera and the first preset distance, determining the target position along the forward direction of the virtual camera from a preset track of the virtual camera includes:

[0105] At every preset time interval, according to the current position of the virtual camera and the first preset distance, the target position is determined along the forward direction of the virtual camera from the preset track of the virtual camera.

[0106] Optionally, determining a target position of a preset rain effect in the virtual scene according to a current position of the virtual camera in the virtual scene and a preset operation mode of the virtual camera includes:

[0107] If the preset operation mode is the follow operation mode, the target position is determined according to the current position of the virtual camera and the position of the controlled virtual object in the virtual scene.

[0108] Optionally, determining the target position according to the current position of the virtual camera and the position of the controlled virtual object in the virtual scene includes:

[0109] Get the current position of the virtual camera and the controlled virtual object;

[0110] Calculate the current distance between the virtual camera and the controlled virtual object according to the current position of the virtual camera and the current position of the controlled virtual object;

[0111] If the current distance is less than the second preset distance, the current position of the controlled virtual object is determined to be the target position.

[0112] Optionally, determining the target position according to the current position of the virtual camera and the position of the controlled virtual object in the virtual scene further includes:

[0113] If the current distance is greater than or equal to the second preset distance, the target position is determined according to the current position of the virtual camera and the third preset distance along the forward direction of the virtual camera.

[0114] Optionally, if the current distance is less than the second preset distance, before determining that the current position of the controlled virtual object is the target position, the method further includes:

[0115] The second preset distance is determined according to the size of the area corresponding to the preset rain special effect and the size of rain particles in the preset rain special effect.

[0116] Optionally, the method further comprises:

[0117] If there is a preset wind special effect in the virtual scene, determine the motion control parameters of rain particles in the preset rain special effect according to the current wind force information of the preset wind special effect;

[0118] According to the motion control parameters, the rain particles in the preset rain special effects are controlled to move.

[0119] Optionally, the wind force information includes: wind direction information, and / or wind force magnitude; determining the motion control parameters of rain particles in the preset rain effect according to the current wind force information of the preset wind effect includes:

[0120] According to the wind direction information and / or the wind force, the motion control parameters of the rain particles are determined, and the motion control parameters include: rotation parameters and / or tilt parameters.

[0121] In the above manner, according to the current position of the virtual camera in the virtual scene and the preset operation mode of the virtual camera, the target position of the preset rain effect in the virtual scene is determined, wherein the preset rain effect is a regional effect formed by rain particles in a preset area; the preset rain effect is moved to the target position in the virtual scene. Therefore, only a small range of preset rain effects need to be designed to achieve the effect of rain in all the images captured by the virtual camera, which reduces the number of rain particles, reduces the machine performance consumption, and reduces the cost of special effects.

[0122] The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above method embodiment is executed.

[0123] Determine a target position of a preset rain effect in the virtual scene according to the current position of the virtual camera in the virtual scene and the preset operation mode of the virtual camera, wherein the preset rain effect is a regional effect formed by rain particles in a preset area;

[0124] Move the preset rain effect to the target position in the virtual scene.

[0125] Optionally, determining a target position of a preset rain effect in the virtual scene according to a current position of the virtual camera in the virtual scene and a preset operation mode of the virtual camera includes:

[0126] If the preset operation mode is the preset trajectory operation mode, the target position is determined from the preset trajectory of the virtual camera according to the current position of the virtual camera.

[0127] Optionally, according to the current position of the virtual camera, determining the target position from a preset track of the virtual camera includes:

[0128] According to the current position of the virtual camera and the first preset distance, the target position is determined along the forward direction of the virtual camera and from the preset track of the virtual camera.

[0129] Optionally, according to the current position of the virtual camera and the first preset distance, determining the target position along the forward direction of the virtual camera from a preset track of the virtual camera includes:

[0130] At every preset time interval, according to the current position of the virtual camera and the first preset distance, the target position is determined along the forward direction of the virtual camera from the preset track of the virtual camera.

[0131] Optionally, determining a target position of a preset rain effect in the virtual scene according to a current position of the virtual camera in the virtual scene and a preset operation mode of the virtual camera includes:

[0132] If the preset operation mode is the follow operation mode, the target position is determined according to the current position of the virtual camera and the position of the controlled virtual object in the virtual scene.

[0133] Optionally, determining the target position according to the current position of the virtual camera and the position of the controlled virtual object in the virtual scene includes:

[0134] Get the current position of the virtual camera and the controlled virtual object;

[0135] Calculate the current distance between the virtual camera and the controlled virtual object according to the current position of the virtual camera and the current position of the controlled virtual object;

[0136] If the current distance is less than the second preset distance, the current position of the controlled virtual object is determined to be the target position.

[0137] Optionally, determining the target position according to the current position of the virtual camera and the position of the controlled virtual object in the virtual scene further includes:

[0138] If the current distance is greater than or equal to the second preset distance, the target position is determined according to the current position of the virtual camera and the third preset distance along the forward direction of the virtual camera.

[0139] Optionally, if the current distance is less than the second preset distance, before determining that the current position of the controlled virtual object is the target position, the method further includes:

[0140] The second preset distance is determined according to the size of the area corresponding to the preset rain special effect and the size of rain particles in the preset rain special effect.

[0141] Optionally, the method further comprises:

[0142] If there is a preset wind special effect in the virtual scene, determine the motion control parameters of rain particles in the preset rain special effect according to the current wind force information of the preset wind special effect;

[0143] According to the motion control parameters, the rain particles in the preset rain special effects are controlled to move.

[0144] Optionally, the wind force information includes: wind direction information, and / or wind force magnitude; determining the motion control parameters of rain particles in the preset rain effect according to the current wind force information of the preset wind effect includes:

[0145] According to the wind direction information and / or the wind force, the motion control parameters of the rain particles are determined, and the motion control parameters include: rotation parameters and / or tilt parameters.

[0146] In the above manner, according to the current position of the virtual camera in the virtual scene and the preset operation mode of the virtual camera, the target position of the preset rain effect in the virtual scene is determined, wherein the preset rain effect is a regional effect formed by rain particles in a preset area; the preset rain effect is moved to the target position in the virtual scene. Therefore, only a small range of preset rain effects need to be designed to achieve the effect of rain in all the images captured by the virtual camera, which reduces the number of rain particles, reduces the machine performance consumption, and reduces the cost of special effects.

[0147] In the embodiment of the present application, the computer program can also execute other machine-readable instructions when run by the processor to execute other methods described in the embodiment. For the specific execution method steps and principles, please refer to the description of the embodiment, which will not be repeated here.

[0148] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0149] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0150] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0151] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0152] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0153] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for processing rain special effects in a virtual scene, characterized in that: The method comprises: Determine a target position of a preset rain effect in the virtual scene according to a current position of a virtual camera in the virtual scene and a preset operation mode of the virtual camera, wherein the preset rain effect is a regional effect formed by rain particles in a preset area; The preset rain special effect is moved to the target position in the virtual scene.

2. The method according to claim 1, characterized in that The step of determining a target position of a preset rain effect in the virtual scene according to a current position of the virtual camera in the virtual scene and a preset operation mode of the virtual camera includes: If the preset operation mode is a preset track operation mode, the target position is determined from the preset track of the virtual camera according to the current position of the virtual camera.

3. The method according to claim 2, characterized in that Determining the target position from a preset track of the virtual camera according to the current position of the virtual camera includes: The target position is determined according to the current position of the virtual camera and a first preset distance, along the forward direction of the virtual camera and from a preset track of the virtual camera.

4. The method according to claim 3, characterized in that The step of determining the target position according to the current position of the virtual camera and the first preset distance, along the forward direction of the virtual camera and from a preset track of the virtual camera, comprises: At every preset time interval, the target position is determined from a preset track of the virtual camera along a forward direction of the virtual camera according to the current position of the virtual camera and the first preset distance.

5. The method according to claim 1, characterized in that The step of determining a target position of a preset rain effect in the virtual scene according to a current position of the virtual camera in the virtual scene and a preset operation mode of the virtual camera includes: If the preset operation mode is the follow operation mode, the target position is determined according to the current position of the virtual camera and the position of the controlled virtual object in the virtual scene.

6. The method according to claim 5, characterized in that The step of determining the target position according to the current position of the virtual camera and the position of the controlled virtual object in the virtual scene comprises: Obtaining the current positions of the virtual camera and the controlled virtual object; Calculating a current distance between the virtual camera and the controlled virtual object according to the current position of the virtual camera and the current position of the controlled virtual object; If the current distance is less than the second preset distance, the current position of the controlled virtual object is determined to be the target position.

7. The method according to claim 6, characterized in that The step of determining the target position according to the current position of the virtual camera and the position of the controlled virtual object in the virtual scene further includes: If the current distance is greater than or equal to the second preset distance, the target position is determined along the forward direction of the virtual camera according to the current position of the virtual camera and a third preset distance.

8. The method according to claim 6, characterized in that If the current distance is less than the second preset distance, before determining that the current position of the controlled virtual object is the target position, the method further includes: The second preset distance is determined according to the size of the area corresponding to the preset rain special effect and the size of rain particles in the preset rain special effect.

9. The method according to claim 1, characterized in that: The method further comprises: If there is a preset wind special effect in the virtual scene, determining the motion control parameters of rain particles in the preset rain special effect according to the current wind force information of the preset wind special effect; According to the motion control parameters, the rain particles in the preset rain special effect are controlled to move.

10. The method according to claim 9, characterized in that The wind force information includes: wind direction information and / or wind force magnitude; the step of determining the motion control parameters of rain particles in the preset rain effect according to the current wind force information of the preset wind effect includes: According to the wind direction information and / or wind force, the motion control parameters of the rain particles are determined, and the motion control parameters include: rotation parameters and / or tilt parameters.

11. A rain special effect processing device in a virtual scene, characterized in that: The device comprises: A determination module, configured to determine a target position of a preset rain effect in the virtual scene according to a current position of a virtual camera in the virtual scene and a preset operation mode of the virtual camera, wherein the preset rain effect is a regional effect formed by rain particles in a preset region; A control module is used to move the preset rain effect to the target position in the virtual scene.

12. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for processing rain special effects in a virtual scene as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for processing rain special effects in a virtual scene as claimed in any one of claims 1 to 10 are executed.

14. A computer program instruction, characterized in that: When the program instructions are executed by the processor, the steps of the method for processing rain special effects in a virtual scene as described in any one of claims 1 to 10 are implemented.