Method, device and storage medium for generating a virtual weapon model firing special effect

By creating virtual curves and generating flame attributes in a virtual 3D space, virtual flames are automatically generated to simulate firing effects, solving the problems of high cost, low efficiency and poor stability in existing technologies, and realizing efficient and stable generation of firing effects for virtual weapon models.

CN116570912BActive Publication Date: 2026-06-09NETEASE (HANGZHOU) NETWORK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2023-04-18
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing methods for generating firing effects for virtual weapon models rely on real-life footage, plugins, or manual generation, resulting in high costs, low efficiency, and poor stability.

Method used

Virtual curves are created in a virtual 3D space. The curve properties are used to generate the first and second flame properties. The gradient size and gradient temperature of the virtual flame are determined. Based on these properties, the target shape and material are determined, and the virtual flame is automatically generated to simulate firing effects.

Benefits of technology

It enables the rapid generation of firing effects for virtual weapon models in an automated and tool-based manner, reducing costs and improving generation efficiency and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116570912B_ABST
    Figure CN116570912B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for generating a virtual weapon model firing special effect and a storage medium. The method comprises the following steps: creating a virtual curve in a virtual three-dimensional space; generating a first flame attribute and a second flame attribute by using a curve attribute of the virtual curve, wherein the first flame attribute is used to determine a gradual size of a virtual flame to be generated, the second flame attribute is used to determine a gradual temperature of the virtual flame, and the virtual flame is used to simulate a firing special effect of the virtual weapon model; determining a target modeling to be used by the virtual flame and a target material corresponding to the target modeling based on the first flame attribute and the second flame attribute; and generating the virtual flame according to the target modeling and the target material. The application solves the technical problem of high generation cost, low efficiency and poor stability of the firing special effect caused by the dependence on real shooting materials, plug-ins or artificial generation of the firing special effect of the virtual weapon model in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a method, apparatus, and storage medium for generating firing effects for virtual weapon models. Background Technology

[0002] In 3D virtual scenes, especially virtual game scenes, it is often necessary to display the firing effects of virtual weapon models, such as the firing effects of virtual wallpaper models in first-person shooter (FPS) games. The existing technologies for generating firing effects for virtual weapon models mainly include the following:

[0003] The first method is to use live-action footage and then assemble it in post-production based on the time points of the scene. However, this method relies on live-action footage and is limited by the shooting angle of the live-action footage, resulting in poor perspective effects for the generated firing effects.

[0004] The second method involves using a gunshot plugin in video compositing software to track the muzzle position and perform perspective matching in post-production. However, when using the gunshot plugin in post-production, manual tracking of the display position is required, which is labor-intensive and the gunshot plugin has poor stability.

[0005] The third method involves using 3D image editing software to manually simulate the volume effect of gunfire. However, this method is not tool-based, resulting in high labor costs and low efficiency.

[0006] There is currently no effective solution to the aforementioned problems in the existing technology.

[0007] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0008] At least some embodiments of this application provide a method, apparatus, and storage medium for generating firing effects of virtual weapon models, so as to at least solve the technical problems of high cost, low efficiency, and poor stability in generating firing effects of virtual weapon models that rely on real footage, plugins, or manual generation in the prior art.

[0009] According to one embodiment of this application, a method for generating firing effects of a virtual weapon model is provided, comprising: creating a virtual curve in a virtual three-dimensional space; generating a first flame attribute and a second flame attribute using the curve attributes of the virtual curve, wherein the first flame attribute is used to determine the gradient size of the virtual flame to be generated, the second flame attribute is used to determine the gradient temperature of the virtual flame, and the virtual flame is used to simulate the firing effects of a virtual weapon model; determining the target shape to be used by the virtual flame and the target material corresponding to the target shape based on the first flame attribute and the second flame attribute; and generating the virtual flame according to the target shape and the target material.

[0010] According to one embodiment of this application, an apparatus for generating firing effects of a virtual weapon model is also provided, comprising: a creation module for creating a virtual curve in a virtual three-dimensional space; a first generation module for generating a first flame attribute and a second flame attribute using the curve attributes of the virtual curve, wherein the first flame attribute is used to determine the gradient size of the virtual flame to be generated, the second flame attribute is used to determine the gradient temperature of the virtual flame, and the virtual flame is used to simulate the firing effects of a virtual weapon model; a determination module for determining the target shape to be used by the virtual flame and the target material corresponding to the target shape based on the first flame attribute and the second flame attribute; and a second generation module for generating the virtual flame according to the target shape and the target material.

[0011] According to one embodiment of this application, a computer-readable storage medium is also provided, in which a computer program is stored, wherein the computer program is configured to execute, at runtime, the method for generating firing effects of a virtual weapon model as described in any of the preceding claims.

[0012] According to one embodiment of this application, an electronic device is also provided, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the method for generating virtual weapon model firing effects as described above.

[0013] In at least some embodiments of this application, a virtual curve is created in a virtual three-dimensional space; a first flame attribute and a second flame attribute are generated using the curve attributes of the virtual curve, wherein the first flame attribute is used to determine the gradient size of the virtual flame to be generated, and the second flame attribute is used to determine the gradient temperature of the virtual flame. The virtual flame is used to simulate the firing effect of a virtual weapon model; the target shape to be used for the virtual flame and the target material corresponding to the target shape are determined based on the first flame attribute and the second flame attribute; and the virtual flame is generated according to the target shape and the target material. Thus, this application automatically determines the flame attributes corresponding to the firing effect of a virtual weapon model based on a virtual curve in a virtual three-dimensional space, and generates a virtual flame, achieving the goal of quickly creating virtual flames for simulating the firing effect of a virtual weapon model in an automated and tool-based manner. This achieves the technical effect of improving the generation efficiency and stability of the firing effect of the virtual weapon model while reducing costs, thereby solving the technical problems of high cost, low efficiency, and poor stability in the prior art caused by relying on real-shot materials, plugins, or manual generation of firing effects for virtual weapon models. Attached Figure Description

[0014] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0015] Figure 1 This is a hardware structure block diagram of a mobile terminal for a method of generating firing effects of a virtual weapon model according to one embodiment of this application.

[0016] Figure 2 This is a flowchart of a method for generating firing effects for a virtual weapon model according to one embodiment of this application;

[0017] Figure 3 This is a schematic diagram of an optional virtual curve according to one embodiment of this application;

[0018] Figure 4 This is a schematic diagram of an optional first flame property according to one embodiment of this application;

[0019] Figure 5 This is a schematic diagram of an optional second flame property according to one embodiment of this application;

[0020] Figure 6 This is a schematic diagram of an optional second virtual three-dimensional model according to one embodiment of this application;

[0021] Figure 7 This is a schematic diagram of an optional first virtual three-dimensional model according to one embodiment of this application;

[0022] Figure 8 This is a schematic diagram of an optional initial point cloud density field according to one embodiment of this application;

[0023] Figure 9 This is a schematic diagram of an optional target point cloud density field according to one embodiment of this application;

[0024] Figure 10 This is a schematic diagram of an optional branch curve according to one embodiment of this application;

[0025] Figure 11 This is a schematic diagram of an optional virtual flame according to one embodiment of this application;

[0026] Figure 12 This is a schematic diagram of the normal of an optional virtual curve according to one embodiment of this application;

[0027] Figure 13 This is a schematic diagram of the normal of an optional branch curve according to one embodiment of this application;

[0028] Figure 14 This is a visual rendering of an optional virtual flame digital asset according to one embodiment of this application;

[0029] Figure 15 This is a schematic diagram of a virtual character model of an optional handheld stick-shaped weapon model according to one embodiment of this application;

[0030] Figure 16 This is a schematic diagram of the firing effect of an optional rod-shaped weapon model according to one embodiment of this application;

[0031] Figure 17 This is a structural block diagram of an apparatus for generating firing effects of a virtual weapon model according to one embodiment of this application;

[0032] Figure 18 This is a structural block diagram of an optional apparatus for generating firing effects of a virtual weapon model according to one embodiment of this application;

[0033] Figure 19 This is a structural block diagram of an alternative apparatus for generating firing effects of a virtual weapon model according to one embodiment of this application;

[0034] Figure 20 This is a schematic diagram of an electronic device according to one embodiment of the present application. Detailed Implementation

[0035] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0036] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0037] It should be noted that, in the specification of this application, the word "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. In the following description, details are set forth for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid unnecessarily obscuring the description of this application. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.

[0038] In the description of the embodiments of this application, some nouns or terms appearing shall be interpreted as follows:

[0039] Screen coordinates (ScreenUV): refers to the two-dimensional coordinate information based on the device screen (e.g., mobile phone display, computer display, etc.), where U can represent the horizontal coordinate and V can represent the vertical coordinate, and U and V are perpendicular to each other.

[0040] In one possible implementation of this application, the inventors, after practice and careful research, found that the existing technology for generating firing effects of virtual weapon models in computer graphics technology, especially in the field of video game technology, which typically relies on real-shot materials, plugins, or artificially generated virtual weapon models, still suffers from technical problems such as high cost, low efficiency, and poor stability in generating firing effects. Based on this, the application scenarios of this application can be computer graphics processing, virtual reality / augmented reality, video game scene production, etc. In particular, the application scenarios for video game scene production can target game types such as action, adventure, simulation, role-playing, and casual games.

[0041] This application proposes a method for generating firing effects for virtual weapon models. It employs a technical concept that uses virtual curves in a virtual 3D space to automatically determine the flame attributes corresponding to the firing effects of the virtual weapon model and generate virtual flames. This automated and tool-based approach rapidly creates virtual flames to simulate firing effects for virtual weapon models, achieving the technical effect of improving the generation efficiency and stability of firing effects for virtual weapon models while reducing costs. This solves the technical problems of high cost, low efficiency, and poor stability in the prior art, which relies on real-life footage, plugins, or manual generation of firing effects for virtual weapon models.

[0042] The methods described in this application can be executed in a terminal device (e.g., a mobile terminal, a computer terminal, or a similar computing device). Taking a mobile terminal as an example, the mobile terminal can be a smartphone, tablet computer, PDA, mobile internet device, game console, or other terminal device.

[0043] Figure 1 This is a hardware structure block diagram of a mobile terminal for a method of generating firing effects for a virtual weapon model according to one embodiment of this application. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 (Only one is shown) Processor 102, memory 104, transmission device 106, input / output device 108, and display device 110. Taking the method of generating virtual weapon model firing effects applied to a video game scene through this mobile terminal as an example, processor 102 calls and runs the computer program stored in memory 104 to execute the method of generating virtual weapon model firing effects. The virtual flame used to simulate the firing effects of the virtual weapon model in the generated video game scene is transmitted to input / output device 108 and / or display device 110 through transmission device 106, and then the virtual flame is provided to the player.

[0044] Still as Figure 1As shown, the processor 102 may include, but is not limited to, processing devices such as: Central Processing Unit (CPU), Graphics Processing Unit (GPU), Digital Signal Processing (DSP) chip, Microcontroller Unit (MCU), Field Programmable Gate Array (FPGA), Neural-Network Processing Unit (NPU), Tensor Processing Unit (TPU), Artificial Intelligence (AI) type processor, etc.

[0045] Those skilled in the art will understand that Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0046] In some optional embodiments primarily focused on gaming scenarios, the aforementioned terminal device may also provide a human-computer interaction interface with a touch-sensitive surface. This interface can sense finger contact and / or gestures to interact with a graphical user interface (GUI). The human-computer interaction functions may include the following: creating web pages, drawing, word processing, creating electronic documents, playing games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. Executable instructions for performing the aforementioned human-computer interaction functions are configured / stored in one or more processor-executable computer program products or readable storage media.

[0047] The methods described in this application can also be executed on a server. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Taking the method for generating virtual weapon model firing effects applied to a video game scene via a video game server as an example, the video game server can generate virtual flames in the video game scene to simulate the firing effects of virtual weapon models based on this method, and provide these virtual flames to the player (e.g., by rendering and displaying them on the player's terminal screen, or by providing them to the player through holographic projection, etc.).

[0048] According to one embodiment of this application, an embodiment of a method for generating firing effects of a virtual weapon model is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0049] This embodiment provides a method for generating virtual weapon model firing effects that runs on the aforementioned mobile terminal. Figure 2 This is a flowchart illustrating a method for generating firing effects for a virtual weapon model according to one embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:

[0050] Step S21: Create a virtual curve in the virtual three-dimensional space.

[0051] The aforementioned virtual three-dimensional space can be the scene space of a video game scene. The game type corresponding to the video game scene can be: action (e.g., first-person or third-person shooter games, two-dimensional or three-dimensional fighting games, war action games, and sports action games), adventure (e.g., exploration games, collection games, puzzle games), simulation (e.g., simulation sandbox games, simulation management games, strategy simulation games, city building simulation games, business simulation games), role-playing games, and casual (e.g., board games, casual competitive games, music rhythm games, dress-up and simulation games), etc.

[0052] The virtual curves described above can be created at a default position in virtual 3D space. This default position can be pre-specified; for example, the starting point can be specified as the origin of the virtual 3D coordinate system (XYZ Cartesian coordinate system), and the default drawing direction is the positive X-axis. Creating these virtual curves involves: creating the virtual curve and determining its curve attributes based on its screen coordinates (ScreenUV). Curve attributes include: shape (e.g., straight line, ellipse, hyperbola, parabola, sine curve), length (length from start to finish), arc length (length of an arc segment on the curve), slope, curvature, concavity / convexity, and periodicity.

[0053] According to step S21 of the present application embodiment, a virtual curve is created. The virtual curve is used to determine the flame properties of the virtual flame. In other words, the created virtual curve serves as the basis for generating virtual flames to simulate the firing effects of a virtual weapon model.

[0054] Step S22: Generate a first flame attribute and a second flame attribute using the curve attribute of the virtual curve. The first flame attribute is used to determine the gradient size of the virtual flame to be generated, and the second flame attribute is used to determine the gradient temperature of the virtual flame. The virtual flame is used to simulate the firing effect of the virtual weapon model.

[0055] For example, in the field of video games, the aforementioned virtual weapon model is a model to display firing effects. For instance, the virtual weapon model may include at least one of the following: a virtual gun model, a virtual tank model, a virtual fighter jet model, a virtual rocket launcher model, and a virtual grenade launcher model. The virtual gun model includes: a rifle model, a submachine gun model, a shotgun model, a sniper rifle model, a pistol model, a machine gun model, etc. The firing effect is the flame effect displayed at the firing position of the aforementioned virtual weapon model. For example, the firing position includes the muzzle position of the virtual gun model, the muzzle position of the virtual tank model, and the firing port position of the virtual fighter jet model, etc.

[0056] It is readily understood that, in this embodiment of the application, the firing effect of a virtual weapon model is simulated by generating virtual flames. Specifically, the aforementioned virtual flames can be displayed at the firing position of the virtual weapon model.

[0057] The first flame attribute of the virtual flame is used to determine the gradient size of the virtual flame. For example, the first flame attribute is used to visually determine the thickness of the virtual flame; the larger the gradient size, the more robust the virtual flame appears. The second flame size of the virtual flame is used to determine the gradient temperature of the virtual flame. For example, the second flame attribute is used to visually determine the display color of the virtual flame; the higher the gradient temperature, the closer the display color is to the first color in the colormap, and the lower the gradient temperature, the closer the display color is to the second color in the colormap. For example, the colormap corresponds to a linear color transformation from red to blue (i.e., RGB values ​​from (255, 0, 0) to (0, 0, 255)). The higher the gradient temperature of the virtual flame, the closer the display color is to red (255, 0, 0), and the lower the gradient temperature, the closer the display color is to blue (0, 0, 255).

[0058] According to step S22 of the embodiments of this application, in order to determine the gradient size of the virtual flame to be generated, a first flame attribute is generated using the curve attribute of the virtual curve; and in order to determine the gradient temperature of the virtual flame to be generated, a second flame attribute is generated using the curve attribute of the virtual curve. Thus, the generated first and second flame attributes can determine the visual appearance of the virtual flame to be generated.

[0059] Step S23: Determine the target shape of the virtual flame to be used and the target material corresponding to the target shape based on the first flame attribute and the second flame attribute.

[0060] The aforementioned target shape can be a volumetric shape to be used, generated based on the target shape category of the virtual flame. For example, the target shape category can be determined from multiple candidate shape categories, including: cone, line, cylinder, pentagon, heart, etc. The target material corresponding to the aforementioned target shape is used to determine the visual attributes of the virtual flame, such as texture, gloss, and transparency. The aforementioned target material can be determined from multiple candidate materials associated with the target shape, including: metal, glass, fluid, or pre-made flame textures of different styles. The aforementioned target shape can be a shape identifier, and the aforementioned target material can be a material identifier or a material map; that is, the aforementioned target shape and its corresponding target material are data that supports direct reading and utilization by the renderer.

[0061] According to step S23 of the present application embodiment, based on the first flame attribute and the second flame attribute, the target shape to be used for the virtual flame and the target material corresponding to the target shape are further determined. Thus, the determined target shape and the target material corresponding to the target shape can characterize the visual performance of the virtual flame to be generated and can be directly used by the renderer.

[0062] Step S24: Generate virtual flames according to the target shape and target material.

[0063] The generation of virtual flames based on the target shape and material can be accomplished by a renderer. The renderer can be a rendering tool, rendering plugin, rendering engine, or an application that provides rendering functionality. The virtual flames can be editable digital assets. For example, using Houdini software to generate virtual flames based on the target shape and material, the virtual flame can be a Houdini Digital Asset (Had) packaged within Houdini software. The virtual flame's Had can be attached to the firing position of a virtual weapon model, automatically matching the virtual flame's position to the virtual weapon model's. In other words, the firing effect simulated by the virtual flame will automatically follow the firing position movement of the virtual weapon model and dynamically display in the virtual 3D scene.

[0064] It is easy to understand that the process of generating virtual flames described above can be automated by the client or server running the method, thus automating and tooling the production of firing effects for virtual weapon models. Compared with existing technologies, this application significantly reduces the labor costs in the firing effect generation process and improves the efficiency of firing effect generation. Furthermore, since virtual flames can be directly used by renderers or attached to digital asset models, rather than being a plugin for firing effects, the firing effect generation process for virtual weapon models is more stable compared to the crash-prone nature of plugins in existing technologies.

[0065] Specifically, the above-mentioned steps include creating a virtual curve in a virtual three-dimensional space; generating a first flame attribute and a second flame attribute using the curve attributes of the virtual curve; determining the target shape to be used for the virtual flame and the target material corresponding to the target shape based on the first flame attribute and the second flame attribute; and generating the virtual flame according to the target shape and the target material. Other methods and steps may also be included, which can be referred to in the further description of the embodiments of this application below, and will not be repeated here.

[0066] In at least some embodiments of this application, a virtual curve is created in a virtual three-dimensional space; a first flame attribute and a second flame attribute are generated using the curve attributes of the virtual curve, wherein the first flame attribute is used to determine the gradient size of the virtual flame to be generated, and the second flame attribute is used to determine the gradient temperature of the virtual flame. The virtual flame is used to simulate the firing effect of a virtual weapon model; the target shape to be used for the virtual flame and the target material corresponding to the target shape are determined based on the first flame attribute and the second flame attribute; and the virtual flame is generated according to the target shape and the target material. Thus, this application automatically determines the flame attributes corresponding to the firing effect of a virtual weapon model based on a virtual curve in a virtual three-dimensional space, and generates a virtual flame, achieving the goal of quickly creating virtual flames for simulating the firing effect of a virtual weapon model in an automated and tool-based manner. This achieves the technical effect of improving the generation efficiency and stability of the firing effect of the virtual weapon model while reducing costs, thereby solving the technical problems of high cost, low efficiency, and poor stability in the prior art caused by relying on real-shot materials, plugins, or manual generation of firing effects for virtual weapon models.

[0067] The methods described in the embodiments of this application will be further described below.

[0068] Optionally, in step S21, creating a virtual curve in the virtual three-dimensional space may include the following steps:

[0069] Step S211: Determine the reference plane based on the world coordinate origin of the virtual three-dimensional space;

[0070] Step S212: Set the first coordinate point and the second coordinate point on the reference plane;

[0071] Step S213: Create a virtual curve using the first coordinate point and the second coordinate point.

[0072] The aforementioned first coordinate point and second coordinate point can be the two endpoints of the aforementioned virtual curve. For example, the first coordinate point can be the starting point of the virtual curve, and the second coordinate point can be the ending point of the virtual curve. Setting the first and second coordinate points on the reference plane can be achieved by specifying the first coordinate value of the first coordinate point in the spatial coordinate system of the virtual three-dimensional space, and specifying the second coordinate value of the second coordinate point in the spatial coordinate system of the virtual three-dimensional space.

[0073] In one embodiment, the virtual curve created by the above steps S211 to S213 of the embodiments of this application can be as follows: Figure 3 As shown. Figure 3 The spatial coordinate system of the virtual 3D space shown is an XYZ 3D Cartesian coordinate system, and point A is the world coordinate origin of the virtual 3D space (0, 0, 0). The reference plane determined based on the world coordinate origin of the virtual 3D space is as follows: Figure 3 The grid plane shown is also known as the XZ plane. On this grid plane, point A is set as the first coordinate point, and point B (0, 0, 1) is set as the second coordinate point. A virtual curve is created using points A and B as its two endpoints, as follows: Figure 3 As shown, this example uses a straight line as the shape of the virtual curve for illustration. This completes the process of creating a virtual curve in virtual three-dimensional space, as described in step S21.

[0074] Optionally, in step S22, generating the first flame attribute using the curve attribute of the virtual curve may include the following execution steps:

[0075] Step S221: Obtain the first value range, wherein the first value range is the value range of the input data and the value range of the output data corresponding to the gradient size of the virtual flame;

[0076] Step S222: Remap the curve attributes according to the first value range to generate the first flame attribute.

[0077] For example, obtaining the first value range includes: obtaining a first threshold and a second threshold for the input data corresponding to the gradient size of the virtual flame; and obtaining a third threshold and a fourth threshold for the output data corresponding to the gradient size of the virtual flame. For example, the first threshold is the minimum input size (denoted as width_Input_Min), the second threshold is the maximum input size (denoted as width_Input_Max), the third threshold is the minimum output size (denoted as width_Output_Min), and the fourth threshold is the maximum output size (denoted as width_Output_Max).

[0078] For example, based on the aforementioned first value range, a first remapping process is performed on the curve attributes of the virtual curve to obtain a first flame attribute. This first remapping process is determined by a first mapping rule. The first mapping rule may include interpolation transformations at at least one node. The parameters of the interpolation transformation at each node include: the node identifier of the current node, the node position of the current node, the interpolation type, and the interpolation parameters. This first mapping rule can be preset. The curve attribute obtained after the first remapping process is used as the first flame attribute to determine the gradient size of the virtual flame to be generated.

[0079] In one implementation, a two-dimensional schematic diagram of the generated first flame properties is shown below. Figure 4 As shown in the two-dimensional diagram, the four vertices of the rectangular region are a1, b1, c1, and d1. Taking the direction from a1 to c1 as the x-direction and the direction from a1 to b1 as the y-direction, based on the first, second, third, and fourth thresholds mentioned above, the two-dimensional coordinates (x, y) of the four vertices a1, b1, c1, and d1 are as follows:

[0080] a1(width_Input_Min, width_Output_Min);

[0081] b1(width_Input_Max, width_Output_Min);

[0082] c1(width_Input_Min, width_Output_Max);

[0083] d1(width_Input_Max, width_Output_Max).

[0084] Still as Figure 4 As shown, the line segment between a1 and c1 corresponds to the virtual curve. For example, a1 corresponds to the starting point on the virtual curve, and c1 corresponds to the ending point on the virtual curve. Figure 4 The attribute values ​​between a1 and c1 in the diagram correspond to the attribute values ​​of the points between the start and end points on the virtual curve. Figure 4 The height value of the black area (i.e., the height in the direction from a1 to b1) represents the visual volume of the virtual flame to be generated. The higher the height value of a point between a1 and c1, the thicker the virtual flame to be generated at that point on the virtual curve.

[0085] According to steps S221 to S222 of the embodiments of this application, in practical application scenarios, by setting the first threshold, second threshold, third threshold, and fourth threshold corresponding to the first value range, the client or server running the above-described method for generating virtual weapon model firing effects can automatically generate the first flame attribute, thereby visually specifying the volume and thickness of the virtual flame to be generated. The above process has a high degree of automation. Thus, the process of generating the first flame attribute using the curve attribute of the virtual curve in step S22 is realized.

[0086] Optionally, in step S22, generating the second flame attribute using the curve attribute of the virtual curve may include the following steps:

[0087] Step S223: Obtain the second value range, wherein the second value range is the value range of the input data and the value range of the output data corresponding to the gradual temperature of the virtual flame;

[0088] Step S224: Remap the curve attribute according to the second value range to generate the second flame attribute.

[0089] For example, obtaining the second value range includes: obtaining the fifth and sixth thresholds of the input data corresponding to the gradual temperature of the virtual flame; and obtaining the seventh and eighth thresholds of the output data corresponding to the gradual temperature of the virtual flame. For example, the fifth threshold is the minimum temperature input value (denoted as temperature_Input_Min), the sixth threshold is the maximum temperature input value (denoted as temperature_Input_Max), the seventh threshold is the minimum temperature output value (denoted as temperature_Output_Min), and the eighth threshold is the maximum temperature output value (denoted as temperature_Output_Max).

[0090] For example, based on the aforementioned second value range, a second remapping process is performed on the curve attributes of the virtual curve to obtain a second flame attribute. This second remapping process is determined by a second mapping rule. The second mapping rule may include interpolation transformations at at least one node. The parameters of the interpolation transformation at each node include: the node identifier of the current node, the node position of the current node, the interpolation type, and the interpolation parameters. This second mapping rule can be preset. The curve attribute obtained after the aforementioned second remapping process is used as the second flame attribute to determine the gradient size of the virtual flame to be generated.

[0091] In one implementation, a two-dimensional schematic diagram of the generated second flame properties is shown below. Figure 5 As shown in the two-dimensional diagram, the four vertices of the rectangular region are a2, b2, c2, and d2. Taking the direction from a2 to c2 as the x-direction and the direction from a2 to b2 as the y-direction, based on the aforementioned fifth, sixth, seventh, and eighth thresholds, the two-dimensional coordinates (x, y) of the four vertices a2, b2, c2, and d2 are as follows:

[0092] a2(temperature_Input_Min, temperature_Output_Min);

[0093] b2(temperature_Input_Max, temperature_Output_Min);

[0094] c2(temperature_Input_Min, temperature_Output_Max);

[0095] d2(temperature_Input_Max, temperature_Output_Max).

[0096] Still as Figure 5As shown, the line segment between a2 and c2 corresponds to the virtual curve. For example, a2 corresponds to the starting point on the virtual curve, and c2 corresponds to the ending point on the virtual curve. Figure 5 The attribute values ​​between a2 and c2 in the diagram correspond to the attribute values ​​of the points between the start and end points on the virtual curve. Figure 5 The height value of the black area (i.e., the height in the direction from a2 to b2) represents the visual color of the virtual flame to be generated. The higher the height value of a point between a2 and c2, the closer the color of the virtual flame to be generated at that point on the virtual curve is to the first color in the color map.

[0097] According to steps S223 to S224 of the embodiments of this application, in practical application scenarios, by setting the fifth, sixth, seventh, and eighth thresholds corresponding to the second value range, the client or server running the above-described method for generating virtual weapon model firing effects can automatically generate the second flame attribute, thereby specifying the display color of the virtual flame to be generated from a visual perspective. The above process has a high degree of automation. Thus, the process of generating the second flame attribute using the curve attribute of the virtual curve in step S22 is realized.

[0098] Optionally, in step S23, determining the target shape of the virtual flame to be used based on the first flame attribute and the second flame attribute may include the following execution steps:

[0099] Step S231: Generate a first virtual three-dimensional model based on the first flame attribute, wherein the first virtual three-dimensional model is used to determine the three-dimensional form of the virtual flame to be used;

[0100] Step S232: Using the second flame attribute and the first virtual 3D model, obtain the target point cloud density field and the target point cloud temperature field, wherein the target point cloud density field is used to determine the density change of the virtual flame and the target point cloud temperature field is used to determine the temperature change of the virtual flame.

[0101] Step S233: Merge the target point cloud density field and the target point cloud temperature field to obtain the target shape of the virtual flame to be used.

[0102] In order to generate virtual flames for simulating firing effects of virtual weapon models, a first virtual 3D model is generated based on a first flame attribute. The volume shape of the first virtual 3D model is used to determine the 3D shape to be used by the virtual flame. The volume shape of the first virtual 3D model is determined by the gradient size corresponding to the first flame attribute.

[0103] To facilitate control over the density and temperature of the virtual flame, and thus the visual representation of the simulated firing effect, point cloud field data is used to characterize the target shape of the virtual flame. This point cloud field data includes the target point cloud density field and the target point cloud temperature field. Using the second flame attribute and the first virtual 3D model, the target point cloud density field and the target point cloud temperature field are obtained to determine the density and temperature variations of the virtual flame.

[0104] For example, merging the target point cloud density field and the target point cloud temperature field to obtain the target shape of the virtual flame can be achieved through the following process: Merging the density data carried by multiple points in the target point cloud density field and the temperature data carried by multiple points in the target point cloud temperature field to obtain multiple tuples corresponding to multiple points, i.e., <density data, temperature data>; storing these multiple tuples into multiple points in the target point cloud field to obtain the target point cloud data field, which is used to characterize the target shape. Specifically, the aforementioned target point cloud field can also be the original target point cloud density field or the target point cloud temperature field.

[0105] According to steps S223 to S224 of the embodiments of this application, in practical application scenarios, after the client or server running the above-described method for generating firing effects of virtual weapon models generates the first flame attribute and the second flame attribute, it can automatically perform the above-described process of generating the first virtual three-dimensional model and obtaining the target point cloud density field and the target point cloud temperature field, thereby efficiently and quickly obtaining the target shape of the virtual flame. Thus, the process of determining the target shape of the virtual flame to be used based on the first flame attribute and the second flame attribute in step S23 is realized.

[0106] Optionally, in step S231, generating the first virtual 3D model based on the first flame attribute may include the following execution steps:

[0107] Step S2311: Based on the first flame attribute, convert the virtual curve into a second virtual 3D model;

[0108] Step S2312: Add three-dimensional noise to the second virtual three-dimensional model to obtain the first virtual three-dimensional model.

[0109] From a visual perspective, the aforementioned second virtual 3D model is a volumetric model with a regular shape. In one embodiment, according to... Figure 4 The first flame attribute shown converts the virtual curve into a three-dimensional model, resulting in, as follows: Figure 6 The second virtual 3D model is shown. (As shown in the image) Figure 6 As shown, the second virtual 3D model can be viewed as a solid model of revolution, with the axis of rotation of this solid model as follows: Figure 3 The virtual curve shown (a straight line in this example) represents the basic shape of the solid of revolution model as follows. Figure 4 The black area in the diagram of the first fire attribute shown represents, in other words, what is meant by... Figure 4 The black area shown is mapped to, as Figure 3 On the virtual straight line shown, and the mapped shape obtained by mapping is as follows Figure 3 The virtual straight line shown is rotated along the axis of rotation, and the volume area swept by the mapped shape is the volume area of ​​the second virtual three-dimensional model.

[0110] However, the volume and shape of flames in real-world scenarios are irregular. The aforementioned regularly shaped second virtual 3D model is insufficient to simulate the flame model in the displayed scene. Therefore, 3D noise is added to the second virtual 3D model to obtain a first virtual 3D model. This application does not limit the function used to add 3D noise to the second virtual 3D model. In one optional implementation, the first virtual 3D model obtained by adding 3D noise to the second virtual 3D model is as follows: Figure 7 As shown.

[0111] It should be noted that the variable in the function used to add three-dimensional noise to the second virtual three-dimensional model includes time. In other words, the three-dimensional noise added to the second virtual three-dimensional model can shift rapidly over time. In this case, the first virtual three-dimensional model is a dynamic volume model. Therefore, the first virtual three-dimensional model can simulate the flickering dynamic effect of flames in a real scene.

[0112] According to steps S2311 to S2312 of the embodiments of this application, in practical application scenarios, a client or server running the above-described method for generating firing effects of a virtual weapon model can first convert the virtual curve into a second virtual 3D model with a regular shape based on the first flame attribute, and then add 3D noise to the second virtual 3D model to obtain a first virtual 3D model with an irregular shape used to simulate the 3D form of a virtual flame. The above process helps to improve the physical realism of the generated first virtual 3D model when simulating virtual flames, thereby ensuring the visual display effect of the firing effects of the subsequently generated virtual weapon model. Thus, the process of generating the first virtual 3D model based on the first flame attribute in step S231 is realized.

[0113] Optionally, in step S232, obtaining the target point cloud density field and target point cloud temperature field using the second flame attribute and the first virtual 3D model may include the following steps:

[0114] Step S2321: Convert the first virtual 3D model into an initial point cloud density field and an initial point cloud temperature field;

[0115] Step S2322: Add three-dimensional noise to the initial point cloud density field to obtain the target point cloud density field, and adjust the temperature value of the initial point cloud temperature field based on the second flame attribute to obtain the target point cloud temperature field.

[0116] As another optional implementation, the target point cloud density field and target point cloud temperature field can also be obtained by using the second flame attribute and the first virtual three-dimensional model as follows: convert the first virtual three-dimensional model into an initial point cloud density field; add three-dimensional noise to the initial point cloud density field to obtain the target point cloud density field; use the target point cloud density field as the initial point cloud temperature field, and adjust the temperature value of the initial point cloud temperature field based on the second flame attribute to obtain the target point cloud temperature field.

[0117] In one implementation, for example Figure 7 The initial point cloud density field obtained by converting the first virtual 3D model shown is as follows: Figure 8 As shown, the specific implementation method is as follows: based on the position information of the model grid points of the first virtual three-dimensional model, the first virtual three-dimensional model is converted into an initial point cloud density field. Each point in the initial point cloud density field stores the density volume data corresponding to the first virtual three-dimensional model.

[0118] To further enhance the randomness of the target shape of the virtual flame to simulate flames in a real-world scene, three-dimensional noise is added to the initial point cloud density field to obtain the target point cloud density field. This application does not limit the function used to add three-dimensional noise to the initial point cloud density field. In an optional implementation, for example... Figure 8 Adding 3D noise to the initial point cloud density field shown, we get: Figure 9 The target point cloud density field is shown. For example... Figure 9 The target point cloud density field shown can characterize the spatial density distribution of the virtual flame.

[0119] like Figure 8 The initial point cloud density field shown can also be used as the initial point cloud temperature field. At this time, the temperature value stored at each of the multiple points in the initial point cloud temperature field is the default value. The temperature values ​​of the multiple points in the initial point cloud temperature field are adjusted by using the gradient temperature of the virtual flame determined by the second flame attribute to obtain the target point cloud temperature field. Furthermore, three-dimensional noise is added to the target point cloud temperature field to update the target point cloud temperature field.

[0120] In addition, such as Figure 9The target point cloud density field shown can also be used as the initial point cloud temperature field. In this case, the temperature value stored at each of the multiple points in the initial point cloud temperature field is the default value. The temperature values ​​of the multiple points in the initial point cloud temperature field are adjusted by using the gradient temperature of the virtual flame determined by the second flame attribute to obtain the target point cloud temperature field.

[0121] It should be noted that the variable in the function used to add three-dimensional noise to the initial point cloud density field includes time. In other words, the three-dimensional noise added to the initial point cloud density field can shift rapidly over time. In this case, the target point cloud density field is a dynamic point cloud density field. Therefore, the target point cloud density field can be used to simulate the flickering dynamic effect of flames in real-world scenes.

[0122] According to steps S2321 to S2322 of the embodiments of this application, in practical application scenarios, based on the first virtual 3D model, the client or server running the above-mentioned method for generating virtual weapon model firing effects can first convert the first virtual 3D model into an initial point cloud density field and an initial point cloud temperature field, and then automatically trigger the action of obtaining the corresponding target point cloud density field and target point cloud temperature field by adding 3D noise processing and temperature value adjustment processing. The above process helps to improve the randomness and dynamism of the target point cloud density field and target point cloud temperature field, thereby ensuring the physical realism of the target shape of the subsequently generated virtual flame. Thus, the process of obtaining the target point cloud density field and target point cloud temperature field using the second flame attribute and the first virtual 3D model in step S232 is realized. On this basis, the above-mentioned client or server combines the target point cloud density field and target point cloud temperature field to obtain the target shape, so as to realize the automatic determination of the target shape to be used by the virtual flame based on the first flame attribute and the second flame attribute.

[0123] Optionally, in step S23, determining the target material for the virtual flame based on the first flame attribute and the second flame attribute may include the following execution steps:

[0124] Step S234: Assign an initial material to the target shape, wherein the initial material is the volume material corresponding to the target shape;

[0125] Step S235: Adjust the material properties of the initial material based on the first flame property and the second flame property to obtain the target material.

[0126] The initial material can be determined from multiple candidate materials associated with the target shape. To further improve the visual display effect of the virtual flame to be generated, after assigning the initial material to the target shape, the material properties of the initial material are adjusted based on the gradient size determined by the first flame attribute and the gradient temperature determined by the second flame attribute to obtain the target material. The material properties include at least density distribution and flame intensity.

[0127] According to steps S234 to S235 of the embodiments of this application, in practical application scenarios, after determining the target shape of the virtual flame, the client or server running the above-described method for generating firing effects of virtual weapon models automatically executes the following process: assigning an initial material to the target shape, and adjusting the material properties of the initial material based on the first flame attribute and the second flame attribute to obtain the target material. Thus, the method provided by this application automatically determines the target shape and target material of the virtual flame to be generated based on the first flame attribute and the second flame attribute generated by the virtual curve. This process reduces the degree of manual intervention, resulting in low cost and high efficiency. Thus, the process of determining the target material to be used for the virtual flame based on the first flame attribute and the second flame attribute in step S23 is realized.

[0128] Optionally, in step S24, generating a virtual flame according to the target shape and target material may include the following steps:

[0129] Step S241: Generate the main body of the virtual flame according to the target shape and target material.

[0130] In real-world scenarios, the firing effects of some firearms with concentrated firepower (such as pistols and sniper rifles) are also visually concentrated, specifically manifested by the absence of visible flame branches. Therefore, in one optional embodiment of this application, for virtual weapon models with concentrated firepower (such as virtual pistol models and virtual sniper rifle models), according to... Figure 9 The target shape of the virtual flame and the target material to be used for the virtual flame are shown to generate the main flame of the virtual flame. During the rendering process, the main flame is displayed at the firing position (such as the muzzle position) of the virtual weapon model to create a firing effect.

[0131] Optionally, in step S24, generating a virtual flame according to the target shape and target material may further include the following steps:

[0132] Step S242: Create a preset number of branch curves on the virtual curve, wherein the angle between the branch curves and the virtual curve and the preset number satisfy a preset distribution rule;

[0133] Step S243: Generate branched flames of the virtual flame based on multiple branched curves;

[0134] Step S244: Merge the main flame and the branch flames to obtain a virtual flame.

[0135] In real-world scenarios, the firing effects of some firearms with dispersed firepower (such as machine guns and shotguns) are also visually dispersed, specifically manifested as branching flames. In response, in an optional embodiment of this application, for virtual weapon models with dispersed firepower (such as virtual machine gun models and virtual shotgun models), a preset number of branch curves are created based on the virtual curves. Branch flames of the virtual flame are generated based on the multiple branch curves, and then the main flame and the branch flames are merged to obtain the virtual flame.

[0136] For example, in such Figure 3 Two branch curves (both straight lines in this example) are created on the virtual curve shown. The creation of the two branch curves can be achieved by: determining the angle between the two branch curves to be created and the virtual curve according to a preset distribution rule; and creating the two branch curves respectively based on the angle and the virtual curve. In one optional implementation, the two branch curves created are as follows: Figure 10 AC and AD are shown in the diagram. Further, based on... Figure 10 The two branch curves shown generate corresponding branch flames; merging the main flame and the branch flames results in... Figure 11 The virtual flame shown. It's easy to see, as... Figure 11 The virtual flame shown includes a main flame and multiple branch flames, which can be used to simulate the firing effects of a virtual gun model with dispersed firepower, and has a strong sense of physical realism.

[0137] For example, one specific way to determine the angle between the two branch curves to be created and the virtual curve according to preset distribution rules is: if the flame distribution rule in the firing effect is preset to uniform distribution, then the angle between any two of the three curves (two branches and the virtual curve) is 120°. Another example is that one specific way to determine the angle between the three branch curves to be created and the virtual curve according to preset proportions is: if the flames in the firing effect are uniformly distributed, then the angle between any two of the four curves (three branches and the virtual curve) is 90°. And so on.

[0138] For example, according to the preset distribution rules, one of the specific ways to determine the angle between the two branch curves to be created and the virtual curve is: the flame distribution rule in the firing effect is preset to be a gravity field distribution, then the angle between the three curves, the two branches and the virtual curve, is calculated by a preset algorithm that takes into account the influence of the gravity field, so that in the vertical direction, the density of the flame distribution below is higher than that above.

[0139] For example, one specific way to determine the angle between the two branch curves to be created and the virtual curve according to the preset distribution rules is as follows: The flame distribution rule in the firing effect is preset to a wind field distribution. The angle between the three curves (two branches and the virtual curve) is calculated using a preset algorithm that considers the influence of the wind field, ensuring that the downstream flame distribution is denser than the upstream flame in the direction from upwind to downwind. It should be noted that during the process of merging the main flame and branch flames to obtain the virtual flame, a specific angular relationship exists between the branch flame and the main flame. This specific angular relationship is determined by the angular relationship between the branch curve and the virtual curve.

[0140] According to steps S241 and S242 to S244 of the embodiments of this application, in practical application scenarios, depending on the category of the virtual weapon model for which firing effects are to be generated, at least one of the following methods can be flexibly selected to generate virtual flames: generating main flames; generating branch flames. Thus, the process of generating virtual flames according to the target shape and target material in step S24 is realized, and the above process is highly flexible and efficient, suitable for scenario applications.

[0141] Optionally, in step S243, generating the branched flames of the virtual flame based on multiple branch curves may include the following execution steps:

[0142] Step S2431: Obtain the third flame attribute based on the tangent direction of multiple branch curves, and obtain the fourth and fifth flame attributes based on the number of starting points of multiple branch curves. The third flame attribute is used to control the normal direction of the branch flame, the fourth flame attribute is used to control the size of the branch flame, and the fifth flame attribute is used to control the shape of the branch flame.

[0143] Step S2432: Generate branch flames using the third, fourth, and fifth flame attributes.

[0144] To control the direction of the branch flames, when generating virtual flames based on multiple branch curves, a third flame attribute is obtained based on the tangent direction of each branch curve. This third flame attribute is the normal attribute of the branch flame corresponding to each branch curve. The tangent direction of each branch curve is determined by its screen coordinates (ScreenUV).

[0145] To control the size and shape of branch flames, when generating virtual flames based on multiple branch curves, a fourth and fifth flame attribute are obtained based on the number of starting points of the multiple branch curves. The fourth flame attribute is the size attribute of the branch flame corresponding to each branch curve, and the fifth flame attribute is the shape attribute of the branch flame corresponding to each branch curve. The number of starting points of the multiple branch curves is determined by the screen coordinates (ScreenUV) of the multiple branch curves.

[0146] It should be noted that the fourth flame attribute can be randomly selected from a preset size attribute value range based on the number of starting points of multiple branch curves, and the fifth flame attribute can be randomly selected from a preset shape attribute value range based on the number of starting points of multiple branch curves. After obtaining the above third, fourth, and fifth flame attributes, noise can be added to the attribute values ​​of the third, fourth, and fifth flame attributes to improve the randomness and physical realism of the generated branch flames.

[0147] For example, such as Figure 3 The normal direction of the virtual curve shown is set to the direction from A to B, such as... Figure 12 As shown. Based on this, the normal directions of the two generated branch curves AC and AD are as follows. Figure 13 As shown, the normal direction of branch curve AC is from A to C, and the normal direction of branch curve AD is from A to D. Further, as shown... Figure 9 The target shape shown is assigned two branch curves, AC and AD. That is, AB, AC, and AD each correspond to a target shape and material to be used. Each curve's target shape includes density and temperature data stored in the point cloud; the density data can be used to characterize volume information. In other words, after linking the target shape to the normals of the branch curves, the point cloud includes not only density and temperature data but also normal attribute data, which controls the normal direction of the branch flames. Further, random attribute generation is performed on each point in the point cloud corresponding to each curve, acquiring size and shape attributes for each point. Additionally, the attribute data stored in the point cloud can be time-shifted based on the number of points in the point cloud corresponding to each curve to reduce the repetition of flame shapes. Time shifting refers to shifting the attribute data of the displayed virtual flame across multiple image frames.

[0148] According to steps S2431 to S2432 of the embodiments of this application, in practical application scenarios, the client or server running the above-described method for generating virtual weapon model firing effects can automatically obtain the third, fourth, and fifth flame attributes based on multiple branch curves, and then generate branch flames of the virtual flame. The above process has a high degree of automation, generating branch flames with good visual representation in direction, size, and shape without human intervention, which is beneficial for application in scenarios. Thus, the process of generating branch flames of the virtual flame based on multiple branch curves in step S243 is realized.

[0149] Optionally, the method for generating firing effects for virtual weapon models may further include the following steps:

[0150] Step S25: Switch the display between the virtual flame and the third virtual 3D model, wherein the third virtual 3D model is used to occlude the virtual flame or the branch flame of the virtual flame.

[0151] The aforementioned third virtual 3D model can be a pre-set mask model used to occlude part or all of the virtual flames, for example, occluding all virtual flames, or occluding branch flames in the virtual flames, or occluding one of the specified branch flames.

[0152] The aforementioned third virtual 3D model can also be an empty model, that is, a completely transparent virtual model. When the screen displaying the virtual flame is switched to the screen displaying the corresponding third virtual 3D model, it appears visually that the virtual flame has disappeared. By repeatedly switching the display between the virtual flame and the third virtual 3D model, a flickering effect of the virtual flame can be achieved.

[0153] Furthermore, when switching between the virtual flame and the third virtual 3D model, a flashing area for the virtual flame can be specified, thereby achieving a partial flashing effect. For example, if the preset flashing area is the display area corresponding to the branch flame, then the visual representation of switching between the virtual flame and the third virtual 3D model is: the main flame of the virtual flame is continuously displayed, while the branch flame flashes. The flame flashing effect achieved in step S25 above can further enhance the realism of the firing effects of the virtual weapon model.

[0154] Optionally, the method for generating firing effects for virtual weapon models may further include the following steps:

[0155] Step S261: Determine the firing position of the virtual weapon model;

[0156] Step S262: Attach the virtual flame to the virtual weapon model based on the normal direction of the firing position.

[0157] Before using the aforementioned virtual flame to simulate the firing effects of a virtual weapon model, the virtual flame is packaged and encapsulated into a digital asset within the image editing tool or renderer that generates the virtual flame. This digital asset includes exposed adjustable parameters that allow users to adjust attributes such as the virtual flame's density, temperature, shape, material, direction, size, flame intensity, flicker frequency, and flicker area. For example, a visual effect image corresponding to an optional virtual flame digital asset might be shown below. Figure 14 As shown, when a user adjusts the adjustable parameters corresponding to a digital asset, such as... Figure 14 The visual effect diagram shown can be updated in real time based on the adjustment results.

[0158] Furthermore, when using the aforementioned virtual flame to simulate the firing effect of a virtual weapon model, the firing position of the virtual weapon model is determined, and the virtual flame is attached to the virtual weapon model based on the normal direction of the firing position. For example, as shown... Figure 15 The opening at the front of the rod-shaped weapon model held by the virtual character model is designated as the firing position. Figure 14 The digital asset representing the virtual flame shown in the visual effect diagram is attached to, for example, the virtual flame. Figure 15 The firing position of the rod-shaped weapon model shown above yields the following result: Figure 16 The firing effects shown. In addition, as... Figure 16 The image shown can be a frame from an animation. Since the virtual flame is attached to the rod-shaped weapon model based on the firing position, when the coordinates of the firing position on the rod-shaped weapon model change in the animation, it means that the attachment position changes synchronously. At this time, the virtual flame will move with the firing position, thus realizing a dynamic firing effect in the animation. The process of realizing the firing effect in the animation described above does not require manual alignment of the virtual flame and the virtual weapon model, resulting in a high degree of automation, low labor costs, and high animation production efficiency.

[0159] Thus, according to the various embodiments described above in this application, the goal of quickly creating virtual flames for simulating firing effects of virtual weapon models in an automated and tool-based manner has been achieved. This achieves the technical effect of improving the generation efficiency and stability of firing effects of virtual weapon models while reducing costs, thereby solving the technical problems of high cost, low efficiency and poor stability in the generation of firing effects of virtual weapon models caused by relying on real-life footage, plugins or manual generation in the prior art.

[0160] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as a magnetic disk or optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0161] This embodiment also provides an apparatus for generating firing effects for virtual weapon models. This apparatus is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0162] Figure 17 This is a structural block diagram of an apparatus for generating firing effects of a virtual weapon model according to one embodiment of this application, such as... Figure 17 As shown, the device includes: a creation module 1701 for creating virtual curves in a virtual three-dimensional space; a first generation module 1702 for generating a first flame attribute and a second flame attribute using the curve attributes of the virtual curve, wherein the first flame attribute is used to determine the gradient size of the virtual flame to be generated, the second flame attribute is used to determine the gradient temperature of the virtual flame, and the virtual flame is used to simulate the firing effect of a virtual weapon model; a determination module 1703 for determining the target shape to be used by the virtual flame and the target material corresponding to the target shape based on the first flame attribute and the second flame attribute; and a second generation module 1704 for generating the virtual flame according to the target shape and the target material.

[0163] Optionally, the creation module 1701 described above is also used to: determine a reference plane based on the world coordinate origin of the virtual three-dimensional space; set a first coordinate point and a second coordinate point on the reference plane; and create a virtual curve using the first coordinate point and the second coordinate point.

[0164] Optionally, the first generation module 1702 is further configured to: obtain a first value range, wherein the first value range is the value range of the input data and the value range of the output data corresponding to the gradient size of the virtual flame; remap the curve attributes according to the first value range to generate the first flame attribute.

[0165] Optionally, the first generation module 1702 is further configured to: obtain a second value range, wherein the second value range is the value range of the input data and the value range of the output data corresponding to the gradual temperature of the virtual flame; remap the curve attributes according to the second value range to generate a second flame attribute.

[0166] Optionally, the aforementioned determining module is further configured to: generate a first virtual three-dimensional model based on the first flame attribute, wherein the first virtual three-dimensional model is used to determine the three-dimensional shape of the virtual flame to be used; obtain the target point cloud density field and the target point cloud temperature field using the second flame attribute and the first virtual three-dimensional model, wherein the target point cloud density field is used to determine the density change of the virtual flame and the target point cloud temperature field is used to determine the temperature change of the virtual flame; and merge the target point cloud density field and the target point cloud temperature field to obtain the target shape of the virtual flame to be used.

[0167] Optionally, the aforementioned determining module 1703 is further configured to: convert the virtual curve into a second virtual three-dimensional model based on the first flame attribute; add three-dimensional noise to the second virtual three-dimensional model to obtain the first virtual three-dimensional model.

[0168] Optionally, the aforementioned determining module 1703 is further configured to: convert the first virtual three-dimensional model into an initial point cloud density field and an initial point cloud temperature field; add three-dimensional noise to the initial point cloud density field to obtain a target point cloud density field; and adjust the temperature value of the initial point cloud temperature field based on the second flame attribute to obtain a target point cloud temperature field.

[0169] Optionally, the aforementioned determining module 1703 is further configured to: assign an initial material to the target shape, wherein the initial material is the volume material corresponding to the target shape; and adjust the material properties of the initial material based on the first flame property and the second flame property to obtain the target material.

[0170] Optionally, the second generation module 1704 is further configured to: generate the main flame of the virtual flame according to the target shape and target material.

[0171] Optionally, the second generation module 1704 is further configured to: create a preset number of branch curves on the virtual curve, wherein the angle between the branch curves and the virtual curve satisfies a preset distribution rule; generate branch flames of the virtual flame based on the branch curves; and merge the main flame and the branch flames to obtain the virtual flame.

[0172] Optionally, the second generation module 1704 is further configured to: obtain a third flame attribute based on the tangent direction of multiple branch curves, and obtain a fourth flame attribute and a fifth flame attribute based on the number of starting points of multiple branch curves, wherein the third flame attribute is used to control the normal direction of the branch flame, the fourth flame attribute is used to control the size of the branch flame, and the fifth flame attribute is used to control the shape of the branch flame; and generate branch flames using the third flame attribute, the fourth flame attribute, and the fifth flame attribute.

[0173] Optionally, Figure 18 This is a structural block diagram of an optional apparatus for generating firing effects of a virtual weapon model according to one embodiment of this application, such as... Figure 18 As shown, the device includes, in addition to Figure 17 In addition to all the modules shown, it also includes: a switching module 1705, used to switch the display between the virtual flame and the third virtual 3D model, wherein the third virtual 3D model is used to obscure the virtual flame or obscure the branch flames of the virtual flame.

[0174] Optionally, Figure 19 This is a structural block diagram of another optional apparatus for generating firing effects of a virtual weapon model according to one embodiment of this application, such as... Figure 19 As shown, the device includes, in addition to Figure 18 In addition to all the modules shown, it also includes: a hooking module 1706, used to determine the firing position of the virtual weapon model; and to hook the virtual flame to the virtual weapon model based on the normal direction of the firing position.

[0175] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0176] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.

[0177] Optionally, in this embodiment, the computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0178] Optionally, in this embodiment, the computer-readable storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0179] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0180] S1, creating virtual curves in virtual 3D space;

[0181] S2, using the curve properties of the virtual curve to generate the first flame property and the second flame property, wherein the first flame property is used to determine the gradient size of the virtual flame to be generated, the second flame property is used to determine the gradient temperature of the virtual flame, and the virtual flame is used to simulate the firing effect of the virtual weapon model.

[0182] S3, determine the target shape of the virtual flame to be used and the target material corresponding to the target shape based on the first flame attribute and the second flame attribute;

[0183] S4 generates virtual flames based on the target shape and material.

[0184] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining a reference plane based on the world coordinate origin of the virtual three-dimensional space; setting a first coordinate point and a second coordinate point on the reference plane; and creating a virtual curve using the first coordinate point and the second coordinate point.

[0185] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: obtaining a first value range, wherein the first value range is the value range of input data and the value range of output data corresponding to the gradient size of the virtual flame; remapping the curve attributes according to the first value range to generate a first flame attribute.

[0186] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: obtaining a second value range, wherein the second value range is the value range of input data and the value range of output data corresponding to the gradual temperature of the virtual flame; remapping the curve attributes according to the second value range to generate a second flame attribute.

[0187] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: generating a first virtual three-dimensional model based on a first flame attribute, wherein the first virtual three-dimensional model is used to determine the three-dimensional shape of the virtual flame to be used; using a second flame attribute and the first virtual three-dimensional model, obtaining a target point cloud density field and a target point cloud temperature field, wherein the target point cloud density field is used to determine the density change of the virtual flame, and the target point cloud temperature field is used to determine the temperature change of the virtual flame; merging the target point cloud density field and the target point cloud temperature field to obtain the target shape of the virtual flame to be used.

[0188] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: converting a virtual curve into a second virtual three-dimensional model based on a first flame attribute; adding three-dimensional noise to the second virtual three-dimensional model to obtain a first virtual three-dimensional model.

[0189] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: converting a first virtual 3D model into an initial point cloud density field and an initial point cloud temperature field; adding 3D noise to the initial point cloud density field to obtain a target point cloud density field; and adjusting the temperature value of the initial point cloud temperature field based on a second flame attribute to obtain a target point cloud temperature field.

[0190] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: assigning an initial material to the target shape, wherein the initial material is the volume material corresponding to the target shape; adjusting the material properties of the initial material based on the first flame property and the second flame property to obtain the target material.

[0191] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: generating the main flame of the virtual flame according to the target shape and target material.

[0192] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: creating a preset number of branch curves on a virtual curve, wherein the angle between the branch curves and the virtual curve satisfies a preset distribution rule with respect to the preset number; generating branch flames of the virtual flame based on the branch curves; merging the main flame and the branch flames to obtain a virtual flame.

[0193] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: obtaining a third flame attribute based on the tangent direction of multiple branch curves, and obtaining a fourth and fifth flame attribute based on the number of starting points of the multiple branch curves, wherein the third flame attribute is used to control the normal direction of the branch flame, the fourth flame attribute is used to control the size of the branch flame, and the fifth flame attribute is used to control the shape of the branch flame; and generating a branch flame using the third, fourth, and fifth flame attributes.

[0194] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: switching the display of a virtual flame and a third virtual 3D model, wherein the third virtual 3D model is used to occlude the virtual flame or to occlude a branch flame of the virtual flame.

[0195] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining the firing position of the virtual weapon model; and attaching a virtual flame to the virtual weapon model based on the normal direction of the firing position.

[0196] In the computer-readable storage medium of the above embodiments, a technical solution is provided for a method to generate firing effects of virtual weapon models. A virtual curve is created in a virtual three-dimensional space; a first flame attribute and a second flame attribute are generated using the curve attributes of the virtual curve, wherein the first flame attribute is used to determine the gradient size of the virtual flame to be generated, and the second flame attribute is used to determine the gradient temperature of the virtual flame. The virtual flame is used to simulate the firing effects of a virtual weapon model; a target shape and a target material corresponding to the target shape are determined based on the first and second flame attributes; and the virtual flame is generated according to the target shape and target material. Therefore, this application automatically determines the flame attributes corresponding to the firing effects of a virtual weapon model based on a virtual curve in a virtual three-dimensional space, and generates a virtual flame, achieving the goal of quickly creating virtual flames for simulating firing effects of virtual weapon models in an automated and tool-based manner. This achieves the technical effect of improving the generation efficiency and stability of firing effects of virtual weapon models while reducing costs, thereby solving the technical problems of high cost, low efficiency, and poor stability in the generation of firing effects of virtual weapon models caused by relying on real-life footage, plugins, or manual generation in the prior art.

[0197] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this application.

[0198] In exemplary embodiments of this application, a computer-readable storage medium stores a program product capable of implementing the methods described above in this embodiment. In some possible implementations, various aspects of the embodiments of this application may also be implemented as a program product including program code, which, when the program product is run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this embodiment according to various exemplary embodiments of this application.

[0199] The program product for implementing the above-described method according to embodiments of this application may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the embodiments of this application is not limited thereto. In the embodiments of this application, the computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0200] The aforementioned program product may take the form of any combination of one or more computer-readable media. Such computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (not exhaustive) of computer-readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0201] It should be noted that the program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0202] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0203] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0204] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0205] S1, creating virtual curves in virtual 3D space;

[0206] S2, using the curve properties of the virtual curve to generate the first flame property and the second flame property, wherein the first flame property is used to determine the gradient size of the virtual flame to be generated, the second flame property is used to determine the gradient temperature of the virtual flame, and the virtual flame is used to simulate the firing effect of the virtual weapon model.

[0207] S3, determine the target shape of the virtual flame to be used and the target material corresponding to the target shape based on the first flame attribute and the second flame attribute;

[0208] S4 generates virtual flames based on the target shape and material.

[0209] Optionally, the processor described above can also be configured to perform the following steps via a computer program: determining a reference plane based on the world coordinate origin of the virtual three-dimensional space; setting a first coordinate point and a second coordinate point on the reference plane; and creating a virtual curve using the first coordinate point and the second coordinate point.

[0210] Optionally, the processor may also be configured to perform the following steps via a computer program: obtaining a first value range, wherein the first value range is the value range of the input data and the value range of the output data corresponding to the gradient size of the virtual flame; remapping the curve attributes according to the first value range to generate a first flame attribute.

[0211] Optionally, the processor may also be configured to perform the following steps via a computer program: obtaining a second value range, wherein the second value range is the value range of the input data and the value range of the output data corresponding to the gradual temperature of the virtual flame; remapping the curve attributes according to the second value range to generate a second flame attribute.

[0212] Optionally, the processor may also be configured to perform the following steps via a computer program: generating a first virtual three-dimensional model based on a first flame attribute, wherein the first virtual three-dimensional model is used to determine the three-dimensional shape of the virtual flame to be used; using a second flame attribute and the first virtual three-dimensional model, obtaining a target point cloud density field and a target point cloud temperature field, wherein the target point cloud density field is used to determine the density change of the virtual flame and the target point cloud temperature field is used to determine the temperature change of the virtual flame; merging the target point cloud density field and the target point cloud temperature field to obtain the target shape of the virtual flame to be used.

[0213] Optionally, the processor may also be configured to perform the following steps via a computer program: converting a virtual curve into a second virtual three-dimensional model based on a first flame attribute; adding three-dimensional noise to the second virtual three-dimensional model to obtain a first virtual three-dimensional model.

[0214] Optionally, the processor may also be configured to perform the following steps via a computer program: converting the first virtual 3D model into an initial point cloud density field and an initial point cloud temperature field; adding 3D noise to the initial point cloud density field to obtain a target point cloud density field; and adjusting the temperature value of the initial point cloud temperature field based on the second flame attribute to obtain the target point cloud temperature field.

[0215] Optionally, the processor may also be configured to perform the following steps via a computer program: assigning an initial material to the target shape, wherein the initial material is the volume material corresponding to the target shape; adjusting the material properties of the initial material based on the first flame property and the second flame property to obtain the target material.

[0216] Optionally, the processor can also be configured to perform the following steps via a computer program: generating the main flame of the virtual flame according to the target shape and target material.

[0217] Optionally, the processor may also be configured to perform the following steps via a computer program: creating a preset number of branch curves on a virtual curve, wherein the angle between the branch curves and the virtual curve satisfies a preset distribution rule; generating branch flames of the virtual flame based on the branch curves; merging the main flame and the branch flames to obtain a virtual flame.

[0218] Optionally, the processor may also be configured to perform the following steps via a computer program: obtaining a third flame attribute based on the tangent direction of multiple branch curves, and obtaining a fourth and fifth flame attribute based on the number of starting points of multiple branch curves, wherein the third flame attribute is used to control the normal direction of the branch flame, the fourth flame attribute is used to control the size of the branch flame, and the fifth flame attribute is used to control the shape of the branch flame; and generating the branch flame using the third, fourth, and fifth flame attributes.

[0219] Optionally, the processor may also be configured to perform the following steps via a computer program: switching the display of a virtual flame and a third virtual 3D model, wherein the third virtual 3D model is used to occlude the virtual flame or to occlude the branch flames of the virtual flame.

[0220] Optionally, the processor may also be configured to perform the following steps via a computer program: determining the firing position of the virtual weapon model; and attaching the virtual flame to the virtual weapon model based on the normal direction of the firing position.

[0221] In the electronic device described in the above embodiments, a technical solution is provided for generating firing effects of virtual weapon models. A virtual curve is created in a virtual three-dimensional space; a first flame attribute and a second flame attribute are generated using the curve attributes of the virtual curve, wherein the first flame attribute is used to determine the gradient size of the virtual flame to be generated, and the second flame attribute is used to determine the gradient temperature of the virtual flame. The virtual flame is used to simulate the firing effects of a virtual weapon model; a target shape and a target material corresponding to the target shape are determined based on the first and second flame attributes; and the virtual flame is generated according to the target shape and target material. Therefore, this application automatically determines the flame attributes corresponding to the firing effects of a virtual weapon model based on a virtual curve in a virtual three-dimensional space, and generates a virtual flame, achieving the goal of quickly creating virtual flames for simulating firing effects of virtual weapon models in an automated and tool-based manner. This achieves the technical effect of improving the generation efficiency and stability of firing effects of virtual weapon models while reducing costs, thereby solving the technical problems of high cost, low efficiency, and poor stability in the generation of firing effects of virtual weapon models caused by relying on real-life footage, plugins, or manual generation in the prior art.

[0222] Figure 20 This is a schematic diagram of an electronic device according to one embodiment of this application. Figure 20 As shown, the electronic device 2000 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0223] like Figure 20 As shown, the electronic device 2000 is manifested in the form of a general-purpose computing device. The components of the electronic device 2000 may include, but are not limited to: at least one processor 2010, at least one memory 2020, a bus 2030 connecting different system components (including memory 2020 and processor 2010), and a display 2040.

[0224] The memory 2020 stores program code that can be executed by the processor 2010, causing the processor 2010 to perform the steps described in the method section of the embodiments of this application according to various exemplary implementations of this application.

[0225] The memory 2020 may include a readable medium in the form of volatile memory cells, such as random access memory (RAM) 20201 and / or cache memory 20202, and may further include read-only memory (ROM) 20203, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.

[0226] In some instances, memory 2020 may also include programs / utilities 20204 having a set (at least one) of program modules 20205, including but not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Memory 2020 may further include memory remotely located relative to processor 2010, which can be connected to electronic device 2000 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0227] Bus 2030 can represent one or more of several types of bus structures, including memory cell bus or memory cell controller, peripheral bus, graphics acceleration port, processor 2010, or local bus using any of the various bus structures.

[0228] The display 2040 may be, for example, a touch-screen liquid crystal display (LCD) that allows a user to interact with the user interface of the electronic device 2000.

[0229] Optionally, the electronic device 2000 can also communicate with one or more external devices 2100 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 2000, and / or any device that enables the electronic device 2000 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via the input / output (I / O) interface 2050. Furthermore, the electronic device 2000 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via the network adapter 2060. Figure 20 As shown, network adapter 2060 communicates with other modules of electronic device 2000 via bus 2030. It should be understood that, although... Figure 20 As not shown, other hardware and / or software modules may be used in conjunction with the electronic device 2000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, Redundant Arrays of Independent Disks (RAID) systems, tape drives, and data backup storage systems.

[0230] The aforementioned electronic device 2000 may also include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply, and / or a camera.

[0231] Those skilled in the art will understand that Figure 20 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, the electronic device 2000 may also include components that are more... Figure 20 The more or fewer components shown, or having the same Figure 20 Different configurations are shown. The memory 2020 can be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the method for generating virtual weapon model firing effects in this embodiment. The processor 2010 executes various functional applications and data processing by running the computer program stored in the memory 2020, thereby implementing the aforementioned method for generating virtual weapon model firing effects.

[0232] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0233] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0234] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0235] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0236] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0237] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0238] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for generating firing effects for virtual weapon models, characterized in that, include: A virtual curve is created in a virtual three-dimensional space, wherein the virtual curve is used to determine the flame properties of a virtual flame; The curve properties of the virtual curve are used to generate a first flame property and a second flame property. The first flame property is used to determine the gradient size of the virtual flame to be generated, and the second flame property is used to determine the gradient temperature of the virtual flame. The virtual flame is used to simulate the firing effect of a virtual weapon model. The target shape of the virtual flame to be used and the target material corresponding to the target shape are determined based on the first flame attribute and the second flame attribute. The virtual flame is generated according to the target shape and the target material; The step of determining the target shape of the virtual flame based on the first flame attribute and the second flame attribute further includes: generating a first virtual three-dimensional model based on the first flame attribute, wherein the first virtual three-dimensional model is used to determine the three-dimensional shape of the virtual flame to be used, the first virtual three-dimensional model is obtained by adding three-dimensional noise to a second virtual three-dimensional model, and the second virtual three-dimensional model is obtained by transforming the virtual curve based on the first flame attribute; Using the second flame attribute and the first virtual 3D model, a target point cloud density field and a target point cloud temperature field are obtained. The target point cloud density field is used to determine the density change of the virtual flame, and the target point cloud temperature field is used to determine the temperature change of the virtual flame. The density data carried by multiple points in the target point cloud density field and the temperature data carried by multiple points in the target point cloud temperature field are merged to obtain multiple pairs of data corresponding to the multiple points. The multiple pairs of data are stored in the multiple points of the target point cloud density field or the target point cloud temperature field to obtain a target point cloud data field. Based on the target point cloud data field, the target shape to be used for the virtual flame is determined.

2. The method according to claim 1, characterized in that, Creating the virtual curve in the virtual three-dimensional space includes: The reference plane is determined based on the world coordinate origin of the virtual three-dimensional space; A first coordinate point and a second coordinate point are set on the reference plane; The virtual curve is created using the first coordinate point and the second coordinate point.

3. The method according to claim 1, characterized in that, Generating the first flame attribute using the curve attribute of the virtual curve includes: Obtain a first value range, wherein the first value range is the value range of the input data and the value range of the output data corresponding to the gradient size of the virtual flame; The curve attribute is remapped according to the first value range to generate the first flame attribute.

4. The method according to claim 1, characterized in that, Generating the second flame attribute using the curve attribute of the virtual curve includes: Obtain a second value range, wherein the second value range is the value range of the input data and the value range of the output data corresponding to the gradual temperature of the virtual flame; The curve attribute is remapped according to the second value range to generate the second flame attribute.

5. The method according to claim 1, characterized in that, Obtaining the target point cloud density field and the target point cloud temperature field using the second flame attribute and the first virtual 3D model includes: The first virtual 3D model is converted into an initial point cloud density field and an initial point cloud temperature field; Three-dimensional noise is added to the initial point cloud density field to obtain the target point cloud density field, and the temperature value of the initial point cloud temperature field is adjusted based on the second flame attribute to obtain the target point cloud temperature field.

6. The method according to claim 1, characterized in that, The target material to be used for the virtual flame is determined based on the first flame attribute and the second flame attribute, including: Assign an initial material to the target shape, wherein the initial material is the volume material corresponding to the target shape; The material properties of the initial material are adjusted based on the first flame property and the second flame property to obtain the target material.

7. The method according to claim 1, characterized in that, Generating the virtual flame according to the target shape and the target material includes: The main flame of the virtual flame is generated according to the target shape and the target material.

8. The method according to claim 7, characterized in that, Generating the virtual flame according to the target shape and the target material also includes: A predetermined number of branch curves are created on the virtual curve, wherein the angle between the branch curves and the virtual curve and the predetermined number of branch curves satisfy a predetermined distribution rule; The virtual flame is generated based on the multiple branch curves; The main flame and the branch flames are merged to obtain the virtual flame.

9. The method according to claim 8, characterized in that, The branched flames that generate the virtual flames based on the multiple branched curves include: The third flame attribute is obtained based on the tangent direction of the multiple branch curves, and the fourth and fifth flame attributes are obtained based on the number of starting points of the multiple branch curves. The third flame attribute is used to control the normal direction of the branch flame, the fourth flame attribute is used to control the size of the branch flame, and the fifth flame attribute is used to control the shape of the branch flame. The branch flame is generated using the third flame attribute, the fourth flame attribute, and the fifth flame attribute.

10. The method according to claim 1, characterized in that, The method further includes: The virtual flame and the third virtual 3D model are switched for display, wherein the third virtual 3D model is used to obscure the virtual flame or obscure the branch flames of the virtual flame.

11. The method according to claim 1, characterized in that, The method further includes: Determine the firing position of the virtual weapon model; The virtual flame is attached to the virtual weapon model based on the normal direction of the firing position.

12. A device for generating firing effects for virtual weapon models, characterized in that, include: A creation module is used to create virtual curves in a virtual three-dimensional space, wherein the virtual curves are used to determine the flame properties of a virtual flame; The first generation module is used to generate a first flame attribute and a second flame attribute using the curve attribute of the virtual curve. The first flame attribute is used to determine the gradient size of the virtual flame to be generated, and the second flame attribute is used to determine the gradient temperature of the virtual flame. The virtual flame is used to simulate the firing effect of a virtual weapon model. The determination module is used to determine the target shape to be used by the virtual flame and the target material corresponding to the target shape based on the first flame attribute and the second flame attribute; The second generation module is used to generate the virtual flame according to the target shape and the target material; The determining module is further configured to: generate a first virtual 3D model based on the first flame attribute, wherein the first virtual 3D model is used to determine the 3D shape to be used by the virtual flame, the first virtual 3D model is obtained by adding 3D noise to a second virtual 3D model, and the second virtual 3D model is obtained by transforming the virtual curve based on the first flame attribute; obtain a target point cloud density field and a target point cloud temperature field using the second flame attribute and the first virtual 3D model, wherein the target point cloud density field is used to determine the density change of the virtual flame, and the target point cloud temperature field is used to determine the temperature change of the virtual flame; merge the density data carried by multiple points in the target point cloud density field and the temperature data carried by multiple points in the target point cloud temperature field to obtain multiple pairs of data corresponding to the multiple points; store the multiple pairs of data into the multiple points in the target point cloud density field or the target point cloud temperature field to obtain a target point cloud data field; and determine the target shape to be used by the virtual flame based on the target point cloud data field.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to be executed by a processor to perform the method for generating firing effects of a virtual weapon model as described in any one of claims 1 to 11.

14. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method for generating firing effects of a virtual weapon model as described in any one of claims 1 to 11.