Method, device and electronic device for generating weather effects in virtual scenes

By obtaining the target weather object in the game engine and updating the attribute information of the weather blueprint framework, we will automatically generate weather effects in the virtual scene, solving the problems of cumbersome production and inefficiency in the existing technology, and achieving efficient and automated weather effect generation.

CN115382215BActive Publication Date: 2025-08-22NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210869799.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-21
Publication Date
2025-08-22
Estimated Expiration
2042-07-21

AI Technical Summary

Technical Problem

In the prior art, the production process of weather phenomena in game engines is cumbersome and requires a lot of manpower. The existing plug-ins cannot achieve the linkage and unified operation interface of complex weather effects, resulting in inefficient production efficiency.

Method used

By obtaining the target weather objects among multiple preset weather objects, updating the attribute information of the weather blueprint framework, generating the target weather blueprint, and automatically generating weather effects in the virtual scene based on the blueprint, and using the graphical user interface to automatically control the generation of weather effects.

Benefits of technology

It improves the efficiency of weather effects generation, reduces manpower consumption, realizes the automatic generation and unified operation interface of complex weather effects, and improves the production quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115382215B_ABST
    Figure CN115382215B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device, and electronic device for generating weather effects in a virtual scene. The method comprises obtaining a target weather object selected from a plurality of preset weather objects, the weather object being used to achieve the weather effect. Based on the target weather object, the attribute information of a weather blueprint framework is updated to obtain a target weather blueprint corresponding to the target weather object. The target weather blueprint is used to indicate the generation time and location of the target weather effect corresponding to the target weather object in the virtual scene. Based on the target weather blueprint, the target weather effect is generated in the virtual scene. This method selects the target weather object from a plurality of pre-set weather objects, saving time in creating the weather object. The target weather effect corresponding to the target weather object is then displayed in the virtual scene based on the weather blueprint corresponding to the target weather object. This method is automated, saving manpower and improving the efficiency of achieving weather effects in the virtual scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software development, and in particular to a method, device and electronic equipment for generating weather effects in a virtual scene. Background Art

[0002] Creating weather phenomena for game scenes is a common function in game engines. These weather phenomena include rain, snow, lightning, rainbows, etc. In related technologies, weather phenomena can be created manually by artists, but this method requires artists to manually create weather blueprints and manually modify the scene materials corresponding to the weather, making the manual production process cumbersome and the logic used in the game complex, requiring a lot of manpower. In order to simplify the production process, plug-ins can also be used to create weather phenomena in game scenes, but existing plug-ins can only realize a single weather phenomenon in the form of a blueprint. If you want to use other weather phenomena, you need to manually modify the materials and blueprints, resulting in limited implementation effects and low production efficiency. Summary of the Invention

[0003] The object of the present invention is to provide a method, device and electronic device for generating weather effects in a virtual scene, so as to improve the efficiency of setting weather effects in a game scene.

[0004] In a first aspect, the present invention provides a method for generating weather effects in a virtual scene, the method comprising: obtaining a selected target weather object; the target weather object is included in a plurality of preset weather objects; the weather object is used to achieve a corresponding weather effect; the weather object includes material information and / or grid information for achieving the corresponding weather effect; based on the target weather object, updating the attribute information in a preset weather blueprint framework to obtain a target weather blueprint corresponding to the target weather object, the target weather blueprint being used to indicate the generation time and generation location of the target weather effect corresponding to the target weather object in the virtual scene; based on the target weather blueprint, generating the target weather effect in the virtual scene.

[0005] In an optional embodiment, the above-mentioned step of updating the attribute information in the preset weather blueprint framework based on the target weather object to obtain the target weather blueprint corresponding to the target weather object includes: updating the attribute information in the weather blueprint framework to attribute information that matches the target weather effect corresponding to the target weather object; wherein the attribute information includes at least one of wind force, temperature, humidity and fog effect; and determining the weather blueprint framework after the attribute information is updated as the target weather blueprint.

[0006] In an optional embodiment, before the step of obtaining the selected target weather object, the method further includes: generating a weather blueprint framework containing attribute information; wherein the attributes in the attribute information are all set to default values.

[0007] In an optional embodiment, each of the preset multiple weather objects is constructed in the following manner: forming an initial object by stacking mesh faces; obtaining vertex data of the initial object; wherein the vertex data includes the coordinate positions of multiple vertices of the initial object; based on the vertex data, performing coordinate transformation on the initial object to obtain an intermediate object facing the lens; setting attribute information of the intermediate object to obtain a weather object.

[0008] In an optional embodiment, the above-mentioned step of generating a target weather effect in a virtual scene based on a target weather blueprint includes: adjusting the material properties of a specified model in the virtual scene based on the target weather blueprint, obtaining a display status of the specified model under the target weather effect, and displaying the specified model in the virtual scene based on the display status.

[0009] In an optional embodiment, the above-mentioned steps of adjusting the material properties of the specified model in the virtual scene based on the target weather blueprint, obtaining the display status of the specified model under the target weather effect, and displaying the specified model in the virtual scene based on the display status include: identifying the specified model in the virtual scene whose material properties need to be adjusted; adjusting the material properties of the specified model based on the material information corresponding to the target weather in the target weather blueprint, obtaining the display status of the specified model under the target weather effect; and displaying the specified model in the virtual scene based on the display status.

[0010] In an optional embodiment, the above-mentioned step of adjusting the material properties of the specified model based on the material information corresponding to the target weather in the target weather blueprint to obtain the display status of the specified model under the target weather effect includes: scanning the material properties of the specified model to obtain the material setting node of the specified model; automatically connecting the material setting node of the target weather object with the material setting node of the specified model; through the connection relationship of the material setting node, superimposing the material properties of the specified model on the material properties indicated by the material information corresponding to the target weather object to obtain the display status of the specified model under the target weather effect.

[0011] In an optional embodiment, after the above steps of adjusting the material properties of the specified model in the virtual scene based on the target weather blueprint to obtain the display state of the specified model under the target weather effect, and displaying the specified model in the virtual scene based on the display state, the above method further includes: replacing the material properties of the specified model after the material properties are adjusted with the material properties of the specified model before the material properties are adjusted according to the original material conversion instructions.

[0012] In an optional embodiment, after the step of generating the target weather effect in the virtual scene based on the target weather blueprint, the method further includes: generating a screen post-processing effect of the virtual lens for shooting the virtual scene according to the material information corresponding to the target weather object; wherein the screen processing effect matches the target weather effect, and the screen post-processing effect includes: one of: screen freezing, screen wetness, or screen heat distortion.

[0013] In an optional implementation, the above method further includes: identifying a scene model that needs to be blocked in the virtual scene under the target weather effect, and adding blocking objects to the scene model.

[0014] In an optional embodiment, a graphical user interface is provided by a terminal device, in which controls for generating weather effects in a virtual scene are displayed; the above method also includes: in response to a trigger operation on a framework generation control, obtaining a weather blueprint framework; in response to a selection operation on a target weather object from a plurality of preset weather objects, obtaining the selected target weather object, and based on the target weather object, updating the attribute information in the weather blueprint framework to obtain a target weather blueprint corresponding to the target weather object; wherein, one weather object corresponds to one selectable control; in response to a trigger operation on an effect conversion control, generating a target weather effect in the virtual scene based on the target weather blueprint.

[0015] In an optional embodiment, the above method further includes: in response to a triggering operation of a stacking setting control, previewing the humidity and snow coverage of the model surface in the virtual scene; in response to a triggering operation of a wind setting control, setting the vector direction of the wind.

[0016] In an optional embodiment, the method further includes: in response to an operation of dragging the virtual character to a designated position in the virtual scene for generating the target weather effect, setting the virtual character at the designated position.

[0017] In an optional embodiment, the above method further includes: in response to a modification operation on the generation time and / or generation location indicated by the target weather blueprint, generating the target weather effect in the virtual scene according to the modification result.

[0018] In an optional embodiment, the above method further includes: in response to the operation of modifying the generation location in the target weather blueprint to the area where the virtual character is located, generating the target weather effect in the area where the virtual character is located.

[0019] In a second aspect, the present invention provides a device for generating weather effects in a virtual scene, the device comprising: a weather object determination module for obtaining a selected target weather object; the target weather object is included in a preset plurality of weather objects; the weather object is used to achieve a corresponding weather effect; the weather object includes material information and / or grid information for achieving the corresponding weather effect; a property update module for updating the property information in a preset weather blueprint framework based on the target weather object to obtain a target weather blueprint corresponding to the target weather object, the target weather blueprint being used to indicate the generation time and generation location of the target weather effect corresponding to the target weather object in the virtual scene; a weather effect generation module for generating a target weather effect in the virtual scene based on the target weather blueprint.

[0020] In a third aspect, the present invention provides an electronic device comprising a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the method for generating weather effects in the above-mentioned virtual scene.

[0021] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method for generating weather effects in the above-mentioned virtual scene.

[0022] The embodiments of the present invention bring the following beneficial effects:

[0023] The present invention provides a method, device, and electronic device for generating weather effects in a virtual scene. The method first obtains a selected target weather object, which is included in multiple preset weather objects and is used to achieve a corresponding weather effect. Based on the target weather object, the method updates the attribute information in a preset weather blueprint framework to obtain a target weather blueprint corresponding to the target weather object. The target weather blueprint indicates the generation time and location of the target weather effect corresponding to the target weather object in the virtual scene. The method then generates the target weather effect in the virtual scene based on the target weather blueprint. This method selects the target weather object from multiple pre-set weather objects, saving time in creating the weather object. The method then displays the target weather effect corresponding to the target weather object in the virtual scene based on the weather blueprint corresponding to the target weather object. This method is automated, saving manpower and improving the efficiency of achieving weather effects in the virtual scene.

[0024] Other features and advantages of the present invention will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present invention.

[0025] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are specifically listed below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0027] Figure 1 A flowchart of a method for generating weather effects in a virtual scene provided by an embodiment of the present invention;

[0028] Figure 2 A flowchart of another method for generating weather effects in a virtual scene provided by an embodiment of the present invention;

[0029] Figure 3 A schematic diagram of creating a rain object provided by an embodiment of the present invention;

[0030] Figure 4 A schematic diagram of coordinate transformation of an initial object provided by an embodiment of the present invention;

[0031] Figure 5 A schematic diagram of a screen post-processing effect provided by an embodiment of the present invention;

[0032] Figure 6 A flowchart of another method for generating weather effects in a virtual scene provided by an embodiment of the present invention;

[0033] Figure 7 A schematic diagram of a weather object creation control provided by an embodiment of the present invention;

[0034] Figure 8 A schematic diagram of the structure of a device for generating weather effects in a virtual scene provided by an embodiment of the present invention;

[0035] Figure 9 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.

[0037] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but rather merely represents selected embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort shall fall within the scope of protection of the present invention.

[0038] Creating weather phenomena for game scenes is a common feature in game engines. These weather phenomena include rain, snow, lightning, rainbows, etc. In related technologies, weather phenomena can be created manually by artists. When manually creating weather phenomena, the following preparations are required:

[0039] 1. It is necessary to produce the required resources such as models, materials, textures, special effects, and blueprint logic. The production process is cumbersome and cannot be quickly built into the game scene. Some weather effect combinations cannot achieve the desired effect. The linkage between weather effects is not strong, making production difficult and prone to errors. It has a large reliance on the logical implementation of the client program, takes a long time to debug, and the effect is not ideal.

[0040] 2. Use particle effects to create weather phenomena, and then manually modify the PBR (also known as specular reflection / gloss) properties of the material to create the surface effects of virtual objects affected by the weather. For example, the surface of an object wetted by precipitation and the accumulation of snow on an object require manual design of the Shader (equivalent to a shader) connection of the PBR material node in the Material Editor (the Material Editor is used to describe the vertex data and triangle indicators of a 3D model). This process is completely manual and time-consuming. If there are many objects and many materials, it will take many people and days to set the materials of different objects. This is inefficient, and if multiple people are involved in editing, the time and effect cannot be guaranteed, and it is difficult to achieve a satisfactory effect, which also wastes man-days. Among them, PBR material is a physically based rendering material that can provide an accurate representation of how light interacts with surfaces; man-days refers to the amount of work completed by one person in a day.

[0041] 3. Create weather objects. For example, creating weather objects such as rain, snow, and lightning is a tedious manual process and requires complex logic to use in games.

[0042] Therefore, manually creating weather phenomena by artists is a tedious process, with complex logic required for in-game use, and requires significant manpower. Furthermore, current game engines lack direct functionality for weather phenomena, forcing users to create them manually (equivalent to the manual implementation mentioned above) or through plugins. Related technologies include the Dynamic_Weather and Good Rain weather plugins.

[0043] However, the Dynamic_Weather plug-in can only implement each individual weather phenomenon in the form of a blueprint, and there is no overall tool to integrate it. Others who want to use it can only copy its project to modify the materials and blueprints inside, which does not effectively solve the production efficiency and production quality issues in the production. In addition, there is no correlation between weather phenomena, such as snow, rain, and other individual weather phenomena. At the same time, the plug-in does not have a unified operation interface, and needs to be manually called up in the resource bar and various nodes added in the blueprint editor. This also requires knowledge of weather blueprint production, which is complicated to operate. In addition, this method has no unified material conversion function. When making objects affected by weather phenomena such as rain and snow, it is necessary to manually change the node connections in the object's material ball one by one. The whole process is very cumbersome and requires knowledge of weather material production.

[0044] The GoodRain weather plug-in only implements a raining solution, and the effect achieved is relatively simple. It can be barely used if it only deals with rainy days, but it cannot achieve complex linked weather changes (such as instantaneous changes in various weather conditions, transitioning from rainy days to snowy days, controlling weather changes in time, controlling weather changes in space, interaction with the water surface, and other complex transformation effects).

[0045] In summary, creating weather phenomena in game engines is a lengthy process, and quality is unpredictable. Even for experienced users, Blueprint's built-in connection logic is complex, the effects are limited, and inefficiency is a common problem. Different software programs have varying requirements for weather effects, and within the current limits of what can be achieved, creating a perfect weather effect remains difficult.

[0046] Based on the above problems, the embodiments of the present invention provide a method, device and electronic device for generating weather effects in a virtual scene. The technology can be applied to the scene of adding weather effects to the game scene. In order to facilitate the understanding of the embodiments of the present invention, the method for generating weather effects in a virtual scene provided by the embodiments of the present invention is first introduced in detail. The method is applied to a game engine with a weather plug-in installed. The weather plug-in can automatically generate weather effects in the virtual scene (the weather effect can also be understood as the effect of a certain weather phenomenon); Figure 1 As shown, the method includes the following specific steps:

[0047] Step S102, obtaining a selected target weather object; the target weather object is included in a plurality of preset weather objects; the weather object is used to achieve a corresponding weather effect; the weather object includes material information and / or grid information for achieving the corresponding weather effect.

[0048] During implementation, developers pre-set multiple weather objects (also called weather objects) in the weather plugin. These objects can include lightning, rain, thunderstorms, hail, dust, sandstorms, rainbows, auroras, snow, and more. The specific preset weather objects are determined by development requirements. Each weather object corresponds to a corresponding weather effect. For example, the weather effect for rain is rainfall, and the weather effect for snow is snowfall.

[0049] Each weather object includes material information and / or mesh information used to implement its corresponding weather effect. Specifically, a weather object may correspond to only material information, only mesh information, or both. Material information indicates the material properties of the weather object and the material properties of the model in the virtual scene under the weather effect corresponding to the weather object. Mesh information indicates the shape and size of the weather object, as well as the shape of the weather effect corresponding to the weather object.

[0050] Step S104, based on the target weather object, update the attribute information in the preset weather blueprint framework to obtain the target weather blueprint corresponding to the target weather object, which is used to indicate the generation time and generation location of the target weather effect corresponding to the target weather object in the virtual scene.

[0051] The aforementioned weather blueprint framework is a universal framework required for generating any type of weather effect. This universal framework contains preset weather-related attribute information, which includes multiple attributes and default values ​​for each attribute. The attribute information may include attributes such as wind speed, temperature, humidity, and fog effects. In a specific implementation, after acquiring a target weather object, the material information of the target weather object is automatically identified. Then, based on the material information of the target weather object, the attribute information in the weather blueprint framework is updated, thereby determining the updated weather blueprint framework as the target weather blueprint corresponding to the target weather object. This target weather blueprint contains the logic for achieving the target weather effect for the target weather object, as well as the generation time and location for generating the target weather effect in the virtual scene.

[0052] The above generation time and generation location can be adjusted according to user needs, or default values ​​can be used. For example, the time for generating the target weather effect in the virtual scene can be noon, and the generation location can be the location of the virtual character or the entire virtual scene.

[0053] It's important to note that the game scene (equivalent to the aforementioned virtual scene) built by a game engine consists of a node network used to construct game logic and models (these models can be referred to as objects within the game scene). A blueprint is typically a special type of asset within a game engine. Blueprints can create logic and set variable data, such as material and mesh information, in an intuitive, node-based manner. In other words, blueprints are primarily used to construct game logic and objects.

[0054] Step S106: generating a target weather effect in the virtual scene based on the target weather blueprint.

[0055] In a specific implementation, a target weather effect corresponding to a target weather object can be automatically generated in a virtual scene according to the logic of the target weather blueprint. Specifically, the material properties of objects in the virtual scene can be adjusted according to the material information or object characteristics (such as the humidity and shape of the weather object) of the target weather object corresponding to the target weather blueprint, so that the material properties of the objects match the target weather effect corresponding to the target weather object, thereby displaying the virtual scene under the target weather effect.

[0056] In actual applications, a graphical user interface is provided by a terminal device, in which multiple controls in a weather plug-in for generating weather effects in a virtual scene are displayed; therefore, in response to a trigger operation on a weather generation control, a weather blueprint framework is obtained; then, in response to a selection operation of a target weather object from a plurality of preset weather objects, the selected target weather object can be obtained, and based on the target weather object, the attribute information in the weather blueprint framework is updated to obtain a target weather blueprint corresponding to the target weather object; wherein, one weather object corresponds to one selectable control; in response to a trigger operation on an effect conversion control, a target weather effect is generated in the virtual scene based on the target weather blueprint.

[0057] Specifically, the weather object creation control displays multiple preset weather objects. The user can select one of these weather objects as the selected target weather object, allowing the game engine to retrieve the target weather object. Specifically, the user can click the desired weather object in the weather object creation control with the mouse, and use the clicked weather object as the target weather object. For example, if the user wants to generate a rainy weather effect in the virtual scene, they need to click the rain object in the weather object creation control with the mouse; if the user wants to generate a snowy weather effect in the virtual scene, they need to click the snow object in the weather object creation control with the mouse.

[0058] An embodiment of the present invention provides a method for generating weather effects in a virtual scene. The method first obtains a selected target weather object, which is included in multiple preset weather objects and is used to achieve a corresponding weather effect. Based on the target weather object, the method updates the attribute information in a preset weather blueprint framework to obtain a target weather blueprint corresponding to the target weather object. The target weather blueprint indicates the generation time and generation location of the target weather effect corresponding to the target weather object in the virtual scene. The method then generates the target weather effect in the virtual scene based on the target weather blueprint. This method selects the target weather object from multiple pre-set weather objects, saving time in creating the weather object. The method then displays the target weather effect corresponding to the target weather object in the virtual scene based on the weather blueprint corresponding to the target weather object. This method is automated, saves manpower, and improves the efficiency of achieving weather effects in the virtual scene.

[0059] The embodiment of the present invention also provides another method for generating weather effects in a virtual scene. This method is implemented on the basis of the above embodiment. The method focuses on describing the specific process of updating the attribute information in the preset weather blueprint framework based on the target weather object to obtain the target weather blueprint corresponding to the target weather object (specifically implemented by the following steps S206-S208), and the specific process of generating the target weather effect in the virtual scene based on the target weather blueprint (implemented by the following step S210); Figure 2 As shown, the method includes the following specific steps:

[0060] Step S202: Generate a weather blueprint framework containing attribute information; wherein the attribute information includes at least one of wind force, temperature, humidity, and fog effect; and all attributes in the attribute information are set to default values.

[0061] In practice, the game engine's graphical user interface for the weather plugin displays a framework generation control. Clicking this control instantly generates a weather blueprint framework containing attributes for key functions like wind speed, temperature, humidity, and fog effects. Within the weather blueprint framework, the attribute values ​​are all default values ​​designed by the developer, which can be adjusted or not.

[0062] Step S204, obtaining a selected target weather object; the target weather object is included in a plurality of preset weather objects, and the weather object is used to achieve a corresponding weather effect.

[0063] In a specific implementation, the target weather object is selected by the user from a plurality of pre-set weather objects, wherein each of the plurality of pre-set weather objects can be constructed by the following steps 10-13:

[0064] Step 10: Form an initial object by stacking mesh faces.

[0065] The initial object is formed by stacking single mesh patches, such as Figure 3 The following is a schematic diagram of the production of the rain object. Figure 3 The left side of the figure shows the effect of stacking multiple meshes. Each single piece corresponds to a mesh. By converting the stacked meshes, a Figure 3 The right side shows the rain object. Furthermore, each mesh in this initial object uses only one material. Compared to existing methods of creating weather objects using particle effects, this initial object creation method does not require particle system initialization time, thus improving object creation efficiency.

[0066] The stacking effect of these meshes can also be understood as the initial state of the weather object (equivalent to the initial object), which is usually invisible. Because the stacking effect is calculated in the vertex shader, this production method has almost no CPU (Central Processing Unit) computational cost and runs extremely fast.

[0067] Step 11: Obtain vertex data of the initial object; wherein the vertex data includes coordinate positions of multiple vertices of the initial object.

[0068] Step 12: Based on the vertex data, coordinate transformation is performed on the initial object to obtain an intermediate object facing the camera.

[0069] In actual implementation, the GPU (Graphics Processing Unit) indexes the vertices of the initial object to obtain vertex data. At this point, the stacked mesh faces and the final weather object seen on the screen are in two different coordinate systems. A coordinate transformation is then required. This is done by finding the transformed coordinate system of the two coordinate systems. Based on this transformed coordinate system, a matrix transformation is then applied to the mesh faces, ultimately transforming them into a long, rectangular object. The transformed object then undergoes another conversion to world space, with the corner faces of the rectangular object oriented towards the camera, becoming a billboard object (equivalent to the intermediate object).

[0070] In order to facilitate the understanding of the coordinate transformation of the initial object, such as Figure 4 The figure shows a schematic diagram of coordinate transformation of an initial object; Figure 4 The three cylinders in the figure can identify the initial object, the observation point e represents the camera position, and the target point t is also calculated as a triangular face on the initial object. The heading vector is used to indicate the direction of the target point in the coordinate system of the object. By transforming the heading vector to the world coordinate system, we can get the intermediate object facing the camera.

[0071] Step 13: Set the attribute information of the intermediate object to obtain the weather object.

[0072] The attribute information here can include the material properties of the weather object, the falling speed, the falling trajectory, or other properties. For example, when creating a rain object, the initial rain particles are formed when the billboard object is transformed. Then, by performing a positioning operation on the patch and moving it downward according to the preset speed and direction, the falling motion trajectory can be achieved. Then, based on the set weather object, different textures and transparent maps are assigned to the materials, and fusion and transition are set on the materials to initially generate the rain object.

[0073] Step S206: Update the attribute information in the weather blueprint framework to attribute information that matches the target weather effect corresponding to the target weather object.

[0074] Since different weather effects correspond to different attribute information, and the attribute information corresponding to each weather effect is pre-set and can be arbitrarily set according to user needs, in specific implementation, after the user selects the target weather object, the attribute information in the weather blueprint framework can be updated with the attribute information of the target weather effect corresponding to the target weather object.

[0075] Step S208: The weather blueprint framework after the attribute information is updated is determined as the target weather blueprint. The target weather blueprint is used to indicate the generation time and generation position of the target weather effect corresponding to the target weather object in the virtual scene.

[0076] Step S210 , based on the target weather blueprint, adjusting the material properties of the specified model in the virtual scene, obtaining the display state of the specified model under the target weather effect, and displaying the specified model in the virtual scene based on the display state.

[0077] In a specific implementation, the material properties of a designated model in the virtual scene can be adjusted based on the material information or object characteristics (such as the humidity and shape of the weather object) of the target weather blueprint. The designated model is the object in the virtual scene whose material properties need to be modified. The object can be a scene, a building, or the ground in the virtual scene. In actual applications, the objects in the virtual scene can be pre-set as designated models, or the designated models whose material properties need to be modified can be automatically identified among the objects contained in the virtual scene.

[0078] The material properties of the specified model in the virtual scene will be adjusted according to the current target weather effect, so that the material properties of the specified model match the target weather effect corresponding to the target weather object, so that the virtual scene can be displayed under the target weather effect.

[0079] Step S212, generating a screen post-processing effect of a virtual lens for shooting a virtual scene based on the material information corresponding to the target weather object; wherein the screen processing effect matches the target weather effect, and the screen post-processing effect includes: one of: a frozen screen, a wet screen, or a heat-distorted screen.

[0080] In specific implementation, screen post-processing can be dynamically generated based on the material information corresponding to the target weather object, which is used to distort the original virtual lens screen to achieve the effect of the lens being wet, frozen, and twisted by hot air, which more realistically shows the target weather effect. In actual applications, the implementation method of screen post-processing is to connect the material nodes of the virtual screen through pre-made nodes, automatically generate normal maps for raindrops and ice, and then generate post-processing effects (equivalent to screen post-processing effects) through Post Process Volume (referred to as post-processing box). Figure 5 FIG. 1 is a schematic diagram of a screen post-processing effect provided by an embodiment of the present invention. Figure 5 The screen lens is shown as wet.

[0081] Specifically, the graphical user interface provided by the game engine for the weather plug-in displays a control for quickly setting the player character's weather post-processing effects. Clicking this control quickly generates screen post-processing effects based on the target weather effect (which can also be understood as one-click generation). In actual implementation, the above-mentioned screen wetting effect is specifically achieved by determining the position and flow direction of raindrops through word normal, and generating the wetting effect of falling raindrops based on the determination result; the above-mentioned screen heat distortion effect can be achieved by perturbing the virtual screen with a noise map; and the above-mentioned screen icing can be achieved through the ice crack normal-screen-sticking method.

[0082] The above-mentioned method for generating weather effects in virtual scenes utilizes a fully automated process and advanced weather object setting effects, effectively improving production efficiency. This method is characterized by fast production speed, high-quality generated weather effects, ease of implementation, extremely low memory usage, and good optimization performance. At the same time, this technology will not have any performance issues when used in mobile game production.

[0083] The embodiment of the present invention also provides another method for generating weather effects in a virtual scene. This method is implemented on the basis of the above embodiment. The method focuses on the specific process of adjusting the material properties of a specified model in the virtual scene based on the target weather blueprint, obtaining the display state of the specified model under the target weather effect, and displaying the specified model in the virtual scene based on the display state (specifically implemented through the following steps S508-S512); Figure 6 As shown, the method includes the following specific steps:

[0084] Step S502: Generate a weather blueprint framework containing attribute information; wherein the attribute information includes wind speed, temperature, humidity and fog effect.

[0085] Step S504, obtaining a selected target weather object; the target weather object is included in a plurality of preset weather objects, and the weather object is used to achieve a corresponding weather effect.

[0086] The preset multiple weather objects are set in advance by the R&D personnel, and each weather object can achieve the corresponding weather effect. Figure 7 FIG. 1 is a schematic diagram of a weather object creation control provided by an embodiment of the present invention. The weather creation control (the weather creation control is equivalent to the class selection control corresponding to the above-mentioned weather object) includes 9 preset weather objects. Figure 7 Rain in the example represents a rain object, Lightning represents a lightning object, L-rain represents a thunderstorm object, Snow represents a snow object, Hail represents a hail object, Dust represents a dust object, SandStrom represents a sandstorm object, Rainbow represents a rainbow object, and Aurora represents an aurora object. Users can click Figure 6Click the icon corresponding to any weather object shown to select the weather object.

[0087] Figure 7 The second line in the display has "Follow seletion object's position to create", Figure 7 By checking the box in front of the display area, you can generate a weather object based on the coordinates of the selected object (the object is usually an object in the virtual object).

[0088] After the user selects the target weather object, the user can click the control that lists weather objects corresponding to the weather plug-in, and then a list of target weather objects selected by the user will be displayed in the graphical user interface. Clicking the list can also modify the information in the list. The information in the list includes attribute information, etc., which is set according to R&D needs.

[0089] Step S506, based on the target weather object, update the attribute information in the preset weather blueprint framework to obtain the target weather blueprint corresponding to the target weather object, and the target weather blueprint is used to indicate the generation time and generation location of the target weather effect corresponding to the target weather object in the virtual scene.

[0090] In some embodiments, in response to a modification operation on the generation time and / or generation location indicated by the target weather blueprint, a target weather effect can be generated in the virtual scene based on the modification result. Specifically, the generation time and generation location of the target weather effect in the virtual scene can be manually modified or adjusted by the user, thereby increasing the fun of the game.

[0091] Step S508: identifying a designated model in the virtual scene whose material properties need to be adjusted.

[0092] In specific implementation, the objects in the virtual scene that currently need to adjust the material properties can be automatically identified and the objects that need to adjust the material properties can be determined as designated models; or the user can select the objects in the virtual scene that need to adjust the material properties.

[0093] Step S510: Based on the material information corresponding to the target weather in the target weather blueprint, the material properties of the specified model are adjusted to obtain the display state of the specified model under the target weather effect.

[0094] In a specific implementation, the material information corresponding to the target weather object may include the material properties that need to be adjusted for the specified model. This allows the material properties of the specified model to be directly adjusted to a combination of the material properties included in the material information and the original material properties of the specified model, thereby making the weather effects presented in the virtual scene more realistic. In some embodiments, a material may be selected based on the target weather effect corresponding to the target weather object, and then the material properties of the specified model may be overlaid on the selected material.

[0095] In practical applications, the above step S510 can be implemented through the following steps 20-22:

[0096] Step 20: Scan the material properties of the specified model to obtain the material setting node of the specified model.

[0097] Step 21: Automatically connect the material setting node of the target weather object with the material setting node of the specified model.

[0098] Step 22, through the connection relationship of the material setting node, the material properties of the specified model are superimposed on the material properties indicated by the material information corresponding to the target weather object to obtain the display state of the specified model under the target weather effect.

[0099] In a specific implementation, this method dynamically sets a material system through programming. This material system can scan the original material properties of objects in the virtual scene, analyze the data structure of the material properties, and then determine the location of the object's material setting node. The preset weather object's material setting node is then automatically connected to the object's material setting node. At this time, the function of the object's material setting node will become the function of the weather object's material setting node, which means that the node structure in the material system is changed, so that the object's material can be set through the weather object's material setting node. Therefore, the present invention can set the material properties required by any weather object for objects in the virtual scene.

[0100] In actual applications, the graphical user interface provided by the game engine for the weather plug-in displays a control for converting materials to weather materials. The user clicks the control to adjust the material properties of the specified model to the material properties corresponding to the selected weather object, or to the selected material properties.

[0101] In the specific implementation, the above-mentioned weather control also has the function of batch conversion of materials: select the root material file that needs to be changed, and press the control to convert the material into a weather material to automatically convert the material into a weather material. The material will show the appearance of being wet, snowy, and sandy, and will not destroy the original function of the material.

[0102] In some embodiments, the material properties of the specified model after the material properties are adjusted can be replaced with the material properties of the specified model before the material properties are adjusted, according to the original material conversion instruction. Specifically, the graphical user interface also displays a control for restoring the weather material to a normal material. The user clicks this control to send the original material conversion instruction, thereby replacing the adjusted material properties of the specified model (equivalent to the weather material) with the normal material (equivalent to the original material of the specified object).

[0103] Step S512: displaying the designated model in the virtual scene based on the display state.

[0104] Step S514: generating a screen post-processing effect of a virtual lens for shooting a virtual scene according to the material information corresponding to the target weather object; wherein the screen processing effect matches the target weather effect.

[0105] In actual applications, the weather plug-in provided by the embodiments of the present invention can also identify scene models in the virtual scene that need to be blocked under the target weather effect and add occluders to the scene models. Specifically, the occluder creation control provided in the graphical user interface can be clicked to automatically add occluders to the scene models in the virtual scene.

[0106] In a specific implementation, the weather plug-in provided by an embodiment of the present invention also includes a quick settings panel that displays stacked settings controls. In response to a triggering operation (which may be a click operation on the controls) of the stacked settings controls, a quick preview of the humidity and snow cover of the model surface in the virtual scene can be provided. The quick settings panel also displays a wind speed setting control. In response to a triggering operation of the wind speed setting control, a quick setting of the wind vector direction can be provided.

[0107] In actual application, in response to the operation of dragging the virtual character to the designated location in the virtual scene generating the target weather effect, the virtual character is set at the designated location. Specifically, the quick setting panel is also provided with a character setting control, which can be triggered to drag the designated character to the designated location in the virtual scene.

[0108] In some embodiments, the target weather can be generated in the area where the avatar is located in response to the operation of modifying the generation location of the target weather blueprint to the area where the avatar is located. This method can increase the fun of the game and help improve the player's gaming experience.

[0109] In practical applications, the weather plug-in provided by the embodiment of the present invention also includes a trampled ground map management system, which can set the traces of wet mud and snow left by people or objects; the weather plug-in also includes an indentation control system, which can control the indentation.

[0110] The above-mentioned method for generating weather effects in virtual scenes can effectively reduce the cumbersome weather production steps and the retroactive changes caused during production. It also has advanced weather production modes to produce various weather effects, quickly achieve product-level production, and does not place excessive demands on producers, while minimizing development cycles and costs, optimizing product design quality, and maximizing production efficiency.

[0111] Corresponding to the above method embodiment, the embodiment of the present invention further provides a device for generating weather effects in a virtual scene, such as Figure 8 As shown, the device includes:

[0112] The weather object determination module 70 is used to obtain the selected target weather object; the target weather object is included in the preset multiple weather objects; the weather object is used to achieve the corresponding weather effect; the weather object includes material information and / or grid information for achieving the corresponding weather effect.

[0113] The attribute update module 71 is used to update the attribute information in the preset weather blueprint framework based on the target weather object, and obtain the target weather blueprint corresponding to the target weather object. The target weather blueprint is used to indicate the generation time and generation location of the target weather effect corresponding to the target weather object in the virtual scene.

[0114] The weather effect generation module 72 is used to generate a target weather effect in a virtual scene based on the target weather blueprint.

[0115] The device for generating weather effects in the virtual scene described above first obtains a selected target weather object, which is included in a plurality of preset weather objects and is used to achieve the corresponding weather effect. Based on the target weather object, the device updates the attribute information in the preset weather blueprint framework to obtain a target weather blueprint corresponding to the target weather object. The target weather blueprint indicates the generation time and location of the target weather effect corresponding to the target weather object in the virtual scene. The device then generates the target weather effect in the virtual scene based on the target weather blueprint. This method selects the target weather object from a plurality of pre-set weather objects, saving time in creating the weather object. The device then displays the target weather effect corresponding to the target weather object in the virtual scene based on the weather blueprint corresponding to the target weather object. This method is automated, saving manpower and improving the efficiency of achieving weather effects in the virtual scene.

[0116] Specifically, the above-mentioned weather object determination module 70 is used to: update the attribute information in the weather blueprint framework to attribute information that matches the target weather effect corresponding to the target weather object; wherein the attribute information includes at least one of wind force, temperature, humidity and fog effect; and determine the weather blueprint framework after the attribute information is updated as the target weather blueprint.

[0117] In a specific implementation, the above-mentioned device also includes a framework generation module, which is used to: generate a weather blueprint framework containing attribute information before obtaining the selected target weather object; wherein the attributes in the attribute information are all set to default values.

[0118] In actual applications, each of the preset multiple weather objects is constructed in the following way: forming an initial object by stacking mesh faces; obtaining vertex data of the initial object; wherein the vertex data includes the coordinate positions of multiple vertices of the initial object; based on the vertex data, performing coordinate transformation on the initial object to obtain an intermediate object facing the lens; setting the attribute information of the intermediate object to obtain the weather object.

[0119] Furthermore, the weather effect generation module 72 is used to adjust the material properties of the specified model in the virtual scene based on the target weather blueprint, obtain the display status of the specified model under the target weather effect, and display the specified model in the virtual scene based on the display status.

[0120] Furthermore, the above-mentioned weather effect generation module 72 is also used to: identify a specified model in the virtual scene whose material properties need to be adjusted; adjust the material properties of the specified model based on the material information corresponding to the target weather in the target weather blueprint to obtain the display status of the specified model under the target weather effect; and display the specified model in the virtual scene based on the display status.

[0121] In specific implementation, the above-mentioned weather effect generation module 72 is used to: scan the material properties of the specified model to obtain the material setting node of the specified model; automatically connect the material setting node of the target weather object with the material setting node of the specified model; through the connection relationship of the material setting node, superimpose the material properties of the specified model on the material properties indicated by the material information corresponding to the target weather object to obtain the display status of the specified model under the target weather effect.

[0122] Furthermore, the above-mentioned device also includes a material conversion module, which is used to: adjust the material properties of the specified model in the virtual scene based on the target weather blueprint to obtain the display state of the specified model under the target weather effect; after displaying the specified model in the virtual scene based on the display state, according to the original material conversion instructions, replace the material properties of the specified model after the material properties are adjusted with the material properties of the specified model before the material properties are adjusted.

[0123] Furthermore, the above-mentioned device also includes a screen effect generation module, which is used to: after generating the target weather effect in the virtual scene based on the target weather blueprint, generate a screen post-processing effect of the virtual lens shooting the virtual scene according to the material information corresponding to the target weather object; wherein the screen processing effect matches the target weather effect, and the screen post-processing effect includes: one of: screen freezing, screen wetness or screen heat distortion.

[0124] In a specific implementation, the above-mentioned device further includes an occlusion setting module, which is used to: identify a scene model that needs to be occluded in the virtual scene under the target weather effect, and add an occluder to the scene model.

[0125] In actual applications, a graphical user interface is provided by a terminal device, in which controls for generating weather effects in a virtual scene are displayed; the above-mentioned framework generation module is used to obtain a weather blueprint framework in response to a trigger operation on a weather generation control; a weather object determination module 70 is used to obtain a selected target weather object in response to a selection operation of a target weather object among a plurality of preset weather objects, and update the attribute information in the weather blueprint framework based on the target weather object to obtain a target weather blueprint corresponding to the target weather object; wherein, one weather object corresponds to one selectable control; an attribute update module 71 is used to generate a target weather effect in a virtual scene based on the target weather blueprint in response to a trigger operation on an effect conversion control.

[0126] In actual application, the above-mentioned device also includes a quick setting module, which is used to: preview the humidity and snow coverage of the model surface in the virtual scene in response to the trigger operation of the accumulation setting control; and set the vector direction of the wind in response to the trigger operation of the wind setting control.

[0127] Furthermore, the above-mentioned device also includes a character dragging module, which is used to set the virtual character at the designated position in response to the operation of dragging the virtual character to the designated position in the virtual scene that generates the target weather effect.

[0128] Furthermore, the above-mentioned device includes a parameter modification module for generating a target weather effect in the virtual scene according to the modification result in response to the modification operation of the generation time and / or generation location indicated by the target weather blueprint.

[0129] Furthermore, the above-mentioned device also includes a position modification module, which is used to: generate the target weather effect in the area where the virtual character is located in response to the operation of modifying the generation position in the target weather blueprint to the area where the virtual character is located.

[0130] The device for generating weather effects in a virtual scene provided in an embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding content in the aforementioned method embodiment.

[0131] The embodiment of the present invention further provides an electronic device, such as Figure 9 As shown, the electronic device includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the method for generating weather effects in the above-mentioned virtual scene.

[0132] Specifically, the method for generating weather effects in the above-mentioned virtual scene includes: obtaining a selected target weather object; the target weather object is included in a plurality of preset weather objects; the weather object is used to achieve the corresponding weather effect; the weather object includes material information and / or grid information for achieving the corresponding weather effect; based on the target weather object, updating the attribute information in the preset weather blueprint framework to obtain a target weather blueprint corresponding to the target weather object, the target weather blueprint being used to indicate the generation time and generation location of the target weather effect corresponding to the target weather object in the virtual scene; based on the target weather blueprint, generating the target weather effect in the virtual scene.

[0133] The above-mentioned method for generating weather effects in the virtual scene can select the target weather object from multiple pre-set weather objects, saving the time of making weather objects; then, according to the weather blueprint corresponding to the target weather object, the target weather effect corresponding to the target weather object is displayed in the virtual scene. This method is completed automatically, saving manpower and improving the efficiency of realizing weather effects in the virtual scene.

[0134] In an optional embodiment, the above-mentioned step of updating the attribute information in the preset weather blueprint framework based on the target weather object to obtain the target weather blueprint corresponding to the target weather object includes: updating the attribute information in the weather blueprint framework to attribute information that matches the target weather effect corresponding to the target weather object; wherein the attribute information includes at least one of wind force, temperature, humidity and fog effect; and determining the weather blueprint framework after the attribute information is updated as the target weather blueprint.

[0135] In an optional embodiment, before the step of obtaining the selected target weather object, the method further includes: generating a weather blueprint framework containing attribute information; wherein the attributes in the attribute information are all set to default values.

[0136] In an optional embodiment, each of the preset multiple weather objects is constructed in the following manner: forming an initial object by stacking mesh faces; obtaining vertex data of the initial object; wherein the vertex data includes the coordinate positions of multiple vertices of the initial object; based on the vertex data, performing coordinate transformation on the initial object to obtain an intermediate object facing the lens; setting attribute information of the intermediate object to obtain a weather object.

[0137] In an optional embodiment, the above-mentioned step of generating a target weather effect in a virtual scene based on a target weather blueprint includes: adjusting the material properties of a specified model in the virtual scene based on the target weather blueprint, obtaining a display status of the specified model under the target weather effect, and displaying the specified model in the virtual scene based on the display status.

[0138] In an optional embodiment, the above-mentioned steps of adjusting the material properties of the specified model in the virtual scene based on the target weather blueprint, obtaining the display status of the specified model under the target weather effect, and displaying the specified model in the virtual scene based on the display status include: identifying the specified model in the virtual scene whose material properties need to be adjusted; adjusting the material properties of the specified model based on the material information corresponding to the target weather in the target weather blueprint, obtaining the display status of the specified model under the target weather effect; and displaying the specified model in the virtual scene based on the display status.

[0139] In an optional embodiment, the above-mentioned step of adjusting the material properties of the specified model based on the material information corresponding to the target weather in the target weather blueprint to obtain the display status of the specified model under the target weather effect includes: scanning the material properties of the specified model to obtain the material setting node of the specified model; automatically connecting the material setting node of the target weather object with the material setting node of the specified model; through the connection relationship of the material setting node, superimposing the material properties of the specified model on the material properties indicated by the material information corresponding to the target weather object to obtain the display status of the specified model under the target weather effect.

[0140] In an optional embodiment, after the above steps of adjusting the material properties of the specified model in the virtual scene based on the target weather blueprint to obtain the display state of the specified model under the target weather effect, and displaying the specified model in the virtual scene based on the display state, the above method further includes: replacing the material properties of the specified model after the material properties are adjusted with the material properties of the specified model before the material properties are adjusted according to the original material conversion instructions.

[0141] In an optional embodiment, after the step of generating the target weather effect in the virtual scene based on the target weather blueprint, the method further includes: generating a screen post-processing effect of the virtual lens for shooting the virtual scene according to the material information corresponding to the target weather object; wherein the screen processing effect matches the target weather effect, and the screen post-processing effect includes: one of: screen freezing, screen wetness, or screen heat distortion.

[0142] In an optional implementation, the above method further includes: identifying a scene model that needs to be blocked in the virtual scene under the target weather effect, and adding blocking objects to the scene model.

[0143] In an optional embodiment, a graphical user interface is provided by a terminal device, in which controls for generating weather effects in a virtual scene are displayed; the above method also includes: in response to a trigger operation on a framework generation control, obtaining a weather blueprint framework; in response to a selection operation on a target weather object from a plurality of preset weather objects, obtaining the selected target weather object, and based on the target weather object, updating the attribute information in the weather blueprint framework to obtain a target weather blueprint corresponding to the target weather object; wherein, one weather object corresponds to one selectable control; in response to a trigger operation on an effect conversion control, generating a target weather effect in the virtual scene based on the target weather blueprint.

[0144] In an optional embodiment, the above method further includes: in response to a triggering operation of a stacking setting control, previewing the humidity and snow coverage of the model surface in the virtual scene; in response to a triggering operation of a wind setting control, setting the vector direction of the wind.

[0145] In an optional embodiment, the method further includes: in response to an operation of dragging the virtual character to a designated position in the virtual scene for generating the target weather effect, setting the virtual character at the designated position.

[0146] In an optional embodiment, the above method further includes: in response to a modification operation on the generation time and / or generation location indicated by the target weather blueprint, generating the target weather effect in the virtual scene according to the modification result.

[0147] In an optional embodiment, the above method further includes: in response to the operation of modifying the generation location in the target weather blueprint to the area where the virtual character is located, generating the target weather effect in the area where the virtual character is located.

[0148] Furthermore, Figure 9 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 101 , the communication interface 103 and the memory 100 are connected via the bus 102 .

[0149] Among them, the memory 100 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 102 can be an ISA bus, a PCI bus or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 9 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0150] The processor 101 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in the processor 101 or by software instructions. The above processor 101 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as a random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or register. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100 and, in conjunction with its hardware, completes the steps of the method of the aforementioned embodiment.

[0151] An embodiment of the present invention also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method for generating weather effects in the above-mentioned virtual scene. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0152] Specifically, the method for generating weather effects in the above-mentioned virtual scene includes: obtaining a selected target weather object; the target weather object is included in a plurality of preset weather objects; the weather object is used to achieve the corresponding weather effect; the weather object includes material information and / or grid information for achieving the corresponding weather effect; based on the target weather object, updating the attribute information in the preset weather blueprint framework to obtain a target weather blueprint corresponding to the target weather object, the target weather blueprint being used to indicate the generation time and generation location of the target weather effect corresponding to the target weather object in the virtual scene; based on the target weather blueprint, generating the target weather effect in the virtual scene.

[0153] The above-mentioned method for generating weather effects in the virtual scene can select the target weather object from multiple pre-set weather objects, saving the time of making weather objects; then, according to the weather blueprint corresponding to the target weather object, the target weather effect corresponding to the target weather object is displayed in the virtual scene. This method is completed automatically, saving manpower and improving the efficiency of realizing weather effects in the virtual scene.

[0154] In an optional embodiment, the above-mentioned step of updating the attribute information in the preset weather blueprint framework based on the target weather object to obtain the target weather blueprint corresponding to the target weather object includes: updating the attribute information in the weather blueprint framework to attribute information that matches the target weather effect corresponding to the target weather object; wherein the attribute information includes at least one of wind force, temperature, humidity and fog effect; and determining the weather blueprint framework after the attribute information is updated as the target weather blueprint.

[0155] In an optional embodiment, before the step of obtaining the selected target weather object, the method further includes: generating a weather blueprint framework containing attribute information; wherein the attributes in the attribute information are all set to default values.

[0156] In an optional embodiment, each of the preset multiple weather objects is constructed in the following manner: forming an initial object by stacking mesh faces; obtaining vertex data of the initial object; wherein the vertex data includes the coordinate positions of multiple vertices of the initial object; based on the vertex data, performing coordinate transformation on the initial object to obtain an intermediate object facing the lens; setting attribute information of the intermediate object to obtain a weather object.

[0157] In an optional embodiment, the above-mentioned step of generating a target weather effect in a virtual scene based on a target weather blueprint includes: adjusting the material properties of a specified model in the virtual scene based on the target weather blueprint, obtaining a display status of the specified model under the target weather effect, and displaying the specified model in the virtual scene based on the display status.

[0158] In an optional embodiment, the above-mentioned steps of adjusting the material properties of the specified model in the virtual scene based on the target weather blueprint, obtaining the display status of the specified model under the target weather effect, and displaying the specified model in the virtual scene based on the display status include: identifying the specified model in the virtual scene whose material properties need to be adjusted; adjusting the material properties of the specified model based on the material information corresponding to the target weather in the target weather blueprint, obtaining the display status of the specified model under the target weather effect; and displaying the specified model in the virtual scene based on the display status.

[0159] In an optional embodiment, the above-mentioned step of adjusting the material properties of the specified model based on the material information corresponding to the target weather in the target weather blueprint to obtain the display status of the specified model under the target weather effect includes: scanning the material properties of the specified model to obtain the material setting node of the specified model; automatically connecting the material setting node of the target weather object with the material setting node of the specified model; through the connection relationship of the material setting node, superimposing the material properties of the specified model on the material properties indicated by the material information corresponding to the target weather object to obtain the display status of the specified model under the target weather effect.

[0160] In an optional embodiment, after the above steps of adjusting the material properties of the specified model in the virtual scene based on the target weather blueprint to obtain the display state of the specified model under the target weather effect, and displaying the specified model in the virtual scene based on the display state, the above method further includes: replacing the material properties of the specified model after the material properties are adjusted with the material properties of the specified model before the material properties are adjusted according to the original material conversion instructions.

[0161] In an optional embodiment, after the step of generating the target weather effect in the virtual scene based on the target weather blueprint, the method further includes: generating a screen post-processing effect of the virtual lens for shooting the virtual scene according to the material information corresponding to the target weather object; wherein the screen processing effect matches the target weather effect, and the screen post-processing effect includes: one of: screen freezing, screen wetness, or screen heat distortion.

[0162] In an optional implementation, the above method further includes: identifying a scene model that needs to be blocked in the virtual scene under the target weather effect, and adding blocking objects to the scene model.

[0163] In an optional embodiment, a graphical user interface is provided by a terminal device, in which controls for generating weather effects in a virtual scene are displayed; the above method also includes: in response to a trigger operation on a framework generation control, obtaining a weather blueprint framework; in response to a selection operation on a target weather object from a plurality of preset weather objects, obtaining the selected target weather object, and based on the target weather object, updating the attribute information in the weather blueprint framework to obtain a target weather blueprint corresponding to the target weather object; wherein, one weather object corresponds to one selectable control; in response to a trigger operation on an effect conversion control, generating a target weather effect in the virtual scene based on the target weather blueprint.

[0164] In an optional embodiment, the above method further includes: in response to a triggering operation of a stacking setting control, previewing the humidity and snow coverage of the model surface in the virtual scene; in response to a triggering operation of a wind setting control, setting the vector direction of the wind.

[0165] In an optional embodiment, the method further includes: in response to an operation of dragging the virtual character to a designated position in the virtual scene for generating the target weather effect, setting the virtual character at the designated position.

[0166] In an optional embodiment, the above method further includes: in response to a modification operation on the generation time and / or generation location indicated by the target weather blueprint, generating the target weather effect in the virtual scene according to the modification result.

[0167] In an optional embodiment, the above method further includes: in response to the operation of modifying the generation location in the target weather blueprint to the area where the virtual character is located, generating the target weather effect in the area where the virtual character is located.

[0168] 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 invention, 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. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, terminal device, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. 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.

[0169] In the description of the present invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation, and therefore should not be construed as limitations on the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0170] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. A method for generating weather effects in a virtual scene, characterized in that: The method comprises: Acquire a selected target weather object; the target weather object is included in a plurality of preset weather objects; the weather object is used to achieve a corresponding weather effect; the weather object includes material information and / or grid information used to achieve the corresponding weather effect; wherein the material information is used to indicate: material properties of the weather object, and material properties of a model in a virtual scene under the weather effect corresponding to the weather object; the grid information is used to indicate: the shape and size of the weather object, and the shape of the weather effect corresponding to the weather object; Based on the target weather object, updating the attribute information in a preset weather blueprint framework to obtain a target weather blueprint corresponding to the target weather object; the target weather blueprint is used to indicate the generation time and generation location of the target weather effect corresponding to the target weather object in the virtual scene; wherein the weather blueprint framework is a general framework for generating weather effects, and the general framework contains preset weather-related attribute information; generating the target weather effect in the virtual scene based on the target weather blueprint; The step of generating the target weather effect in the virtual scene based on the target weather blueprint includes: adjusting the material properties of a specified model in the virtual scene based on the target weather blueprint to obtain a display state of the specified model under the target weather effect, and displaying the specified model in the virtual scene based on the display state.

2. The method according to claim 1, characterized in that The step of updating the attribute information in the preset weather blueprint framework based on the target weather object to obtain the target weather blueprint corresponding to the target weather object includes: Updating the attribute information in the weather blueprint framework to attribute information that matches the target weather effect corresponding to the target weather object; wherein the attribute information includes at least one of wind force, temperature, humidity, and fog effect; The weather blueprint framework after the attribute information is updated is determined as the target weather blueprint.

3. The method according to claim 1 or 2, characterized in that Before the step of obtaining the selected target weather object, the method further includes: A weather blueprint framework including attribute information is generated; wherein the attributes in the attribute information are all set to default values.

4. The method according to claim 1, wherein Each of the preset multiple weather objects is constructed in the following manner: By stacking mesh patches, an initial object is formed; Acquire vertex data of the initial object; wherein the vertex data includes coordinate positions of multiple vertices of the initial object; Based on the vertex data, coordinate transformation is performed on the initial object to obtain an intermediate object facing the camera; The attribute information of the intermediate object is set to obtain the weather object.

5. The method according to claim 1, wherein The step of adjusting the material properties of the specified model in the virtual scene based on the target weather blueprint to obtain a display state of the specified model under the target weather effect, and displaying the specified model in the virtual scene based on the display state includes: Identifying a specified model in the virtual scene whose material properties need to be adjusted; Adjusting the material properties of the designated model based on the material information corresponding to the target weather in the target weather blueprint to obtain a display state of the designated model under the target weather effect; The designated model is displayed in the virtual scene based on the display state.

6. The method according to claim 5, characterized in that The step of adjusting the material properties of the designated model based on the material information corresponding to the target weather in the target weather blueprint to obtain the display state of the designated model under the target weather effect includes: Scan the material properties of the specified model to obtain the material setting node of the specified model; Automatically connect the material setting node of the target weather object with the material setting node of the specified model; Through the connection relationship of the material setting node, the material properties of the specified model are superimposed on the material properties indicated by the material information corresponding to the target weather object to obtain the display state of the specified model under the target weather effect.

7. The method according to claim 1, characterized in that After the steps of adjusting the material properties of the designated model in the virtual scene based on the target weather blueprint to obtain a display state of the designated model under the target weather effect, and displaying the designated model in the virtual scene based on the display state, the method further comprises: According to the original material conversion instruction, the material attributes of the specified model after the material attributes are adjusted are replaced with the material attributes of the specified model before the material attributes are adjusted.

8. The method according to claim 1, characterized in that After the step of generating the target weather effect in the virtual scene based on the target weather blueprint, the method further includes: Based on the material information corresponding to the target weather object, a screen post-processing effect of a virtual lens for shooting the virtual scene is generated; wherein the screen processing effect matches the target weather effect, and the screen post-processing effect includes: one of: a frozen screen, a wet screen, or a heat-distorted screen.

9. The method according to claim 1, characterized in that The method further comprises: A scene model that needs to be blocked in the virtual scene under the target weather effect is identified, and an obstruction is added to the scene model.

10. The method according to claim 1, characterized in that Providing a graphical user interface through a terminal device, wherein the graphical user interface displays controls for generating weather effects in the virtual scene; the method further includes: In response to a triggering operation on a framework generation control, obtaining the weather blueprint framework; In response to a selection operation of the target weather object from a plurality of preset weather objects, the selected target weather object is obtained, and based on the target weather object, attribute information in the weather blueprint framework is updated to obtain a target weather blueprint corresponding to the target weather object; wherein one weather object corresponds to one selectable control; In response to a triggering operation on an effect conversion control, the target weather effect is generated in the virtual scene based on the target weather blueprint.

11. The method according to claim 1, wherein The method further comprises: In response to a triggering operation of a deposition setting control, previewing the wetness and snow coverage of the model surface in the virtual scene; In response to a triggering operation of the wind force setting control, the wind vector direction is set.

12. The method according to claim 1, characterized in that The method further comprises: In response to an operation of dragging the virtual character to a designated position in the virtual scene for generating the target weather effect, the virtual character is set at the designated position.

13. The method according to claim 1, wherein The method further comprises: In response to a modification operation on the generation time and / or the generation location indicated by the target weather blueprint, the target weather effect is generated in the virtual scene according to the modification result.

14. The method according to claim 1, wherein The method further comprises: In response to the operation of modifying the generation location in the target weather blueprint to the area where the virtual character is located, the target weather effect is generated in the area where the virtual character is located.

15. A device for generating weather effects in a virtual scene, characterized in that: The device comprises: A weather object determination module is configured to obtain a selected target weather object; the target weather object is included in a plurality of preset weather objects; the weather object is configured to achieve a corresponding weather effect; the weather object includes material information and / or grid information for achieving the corresponding weather effect; wherein the material information indicates: material properties of the weather object and material properties of a model in a virtual scene under the weather effect corresponding to the weather object; and the grid information indicates: the shape and size of the weather object and the shape of the weather effect corresponding to the weather object. an attribute update module for updating attribute information in a preset weather blueprint framework based on the target weather object to obtain a target weather blueprint corresponding to the target weather object; the target weather blueprint is used to indicate the generation time and generation location of the target weather effect corresponding to the target weather object in the virtual scene; wherein the weather blueprint framework is a general framework for generating weather effects, and the general framework contains preset weather-related attribute information; A weather effect generation module, configured to generate the target weather effect in the virtual scene based on the target weather blueprint; The weather effect generation module is further used to: adjust the material properties of the specified model in the virtual scene based on the target weather blueprint, obtain the display status of the specified model under the target weather effect, and display the specified model in the virtual scene based on the display status.

16. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the method for generating weather effects in a virtual scene according to any one of claims 1 to 14.

17. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions prompt the processor to implement the method for generating weather effects in a virtual scene according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Information processing method and device in game

    CN111569428A

  • Weather system generation method and device, and equipment

    CN112037292A

  • Weather system editing method, device and system and equipment

    CN112037308A

  • Weather simulation method for driving test simulation scene

    CN114399612A