Virtual fluid surface rendering method and device, electronic equipment and storage medium

By responding to the interaction event between the virtual object and the fluid surface in a virtual scene, calculating the target fluid velocity information and determining the rendering parameters, the problem of insufficient simulation of the fluid surface velocity change in the prior art is solved, and the visual realism of the rendering is improved.

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

Patent Information

Application Number
CN202411561976.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

Existing fluid surface interactive rendering cannot effectively simulate the changes in fluid surface velocity caused by interaction, resulting in insufficient visual reality of the rendering.

Method used

In response to the physical interaction event between the virtual object in the virtual scene and the virtual fluid surface, the initial fluid velocity information is obtained and the target fluid velocity information of multiple consecutive frames is calculated frame by frame to determine the fluid fluctuation rendering parameters, and then render.

Benefits of technology

Effectively simulate the ripple caused by changes in the surface velocity of virtual fluids and improve visual reality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119406060A_ABST
    Figure CN119406060A_ABST
Patent Text Reader

Abstract

The invention provides a virtual fluid surface rendering method and device, electronic equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: responding to a physical interaction trigger event between a virtual object in a preset virtual scene and a virtual fluid surface, and obtaining initial fluid speed information of a preset physical interaction range corresponding to the physical interaction trigger event on the virtual fluid surface; calculating continuous multi-frame target fluid velocity information in the preset physical interaction range frame by frame according to the initial fluid velocity information; and determining fluid fluctuation rendering parameters of the virtual fluid surface frame by frame according to the initial fluid speed information and the continuous multi-frame target fluid speed information, and rendering the virtual fluid surface. The speed change of the fluid surface in the interaction process can be simulated, and the visual reality sense is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a virtual fluid surface rendering method, device, electronic device and storage medium. Background Art

[0002] Fluid interaction is a feature available in most consoles, PC games, and high-quality mobile games on the market. It can simulate the changes in the surface of a fluid when a real target interacts with the fluid.

[0003] Existing fluid surface interaction rendering usually uses height map rendering. During the fluid interaction process, the height change of the fluid surface does not show the speed change of the fluid surface caused by the interaction, which seriously affects the visual realism of the rendering. Summary of the invention

[0004] The purpose of the present application is to provide a virtual fluid surface rendering method, device, electronic device and storage medium to address the deficiencies in the above-mentioned prior art, so as to simulate the speed change of the fluid surface during the interaction process and improve the visual realism.

[0005] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0006] In a first aspect, an embodiment of the present application provides a method for rendering a virtual fluid surface, the method comprising:

[0007] In response to a physical interaction triggering event between a virtual object in a preset virtual scene and a virtual fluid surface, initial fluid velocity information of a preset physical interaction range corresponding to the physical interaction triggering event on the virtual fluid surface is obtained;

[0008] Calculating, frame by frame, multiple frames of target fluid velocity information within the preset physical interaction range according to the initial fluid velocity information;

[0009] According to the initial fluid velocity information and the continuous multiple frames of target fluid velocity information, the fluid fluctuation rendering parameters of the virtual fluid surface are determined frame by frame, and the virtual fluid surface is rendered.

[0010] In a second aspect, an embodiment of the present application further provides a virtual fluid surface rendering device, the device comprising:

[0011] A response module, used to respond to a physical interaction trigger event between a virtual object in a preset virtual scene and a virtual fluid surface, and obtain initial fluid velocity information of a preset physical interaction range corresponding to the physical interaction trigger event on the virtual fluid surface;

[0012] A calculation module, used for calculating, frame by frame, the target fluid velocity information of a plurality of consecutive frames in the preset physical interaction range according to the initial fluid velocity information;

[0013] A rendering module is used to determine the fluid fluctuation rendering parameters of the virtual fluid surface frame by frame according to the initial fluid velocity information and the continuous multiple frames of target fluid velocity information, and render the virtual fluid surface.

[0014] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the virtual fluid surface rendering method as described in any one of the first aspects.

[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the virtual fluid surface rendering method as described in any one of the first aspects are executed.

[0016] The beneficial effects of this application are:

[0017] The virtual fluid surface rendering method, device, electronic device and storage medium provided in the present application calculate the target fluid velocity information of multiple consecutive frames based on the initial fluid velocity information when the virtual object interacts with the virtual fluid surface, and determine the fluid fluctuation rendering parameters of the virtual fluid surface frame by frame according to the initial fluid velocity information and the target fluid velocity information of multiple consecutive frames, and render the virtual fluid surface, which can effectively simulate the ripples on the virtual fluid surface caused by the change of the virtual fluid surface velocity and improve the visual realism. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0019] Figure 1 Schematic diagram of the process of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 1 ;

[0020] Figure 2 A schematic diagram of a preset physical interaction range provided in an embodiment of the present application;

[0021] Figure 3The effect after multiple consecutive frames provided by the embodiment of the present application Figure 1 ;

[0022] Figure 4 Schematic diagram of the process of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 2 ;

[0023] Figure 5 Schematic diagram of the process of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 3 ;

[0024] Figure 6 A schematic diagram of the interaction of a virtual character provided in an embodiment of the present application;

[0025] Figure 7 Schematic diagram of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 4 ;

[0026] Figure 8 Schematic diagram of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 5 ;

[0027] Fig. 9 The effect after multiple consecutive frames provided by the embodiment of the present application Figure 2 ;

[0028] Fig.10 Schematic diagram of the process of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 6 ;

[0029] Fig.11 Schematic diagram of the process of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 7 ;

[0030] Fig.12 Schematic diagram of the process of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 8 ;

[0031] Fig.13 Schematic diagram of the process of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 9 ;

[0032] Fig.14 A schematic diagram of the structure of a virtual fluid surface rendering device provided in an embodiment of the present application;

[0033] Fig.15 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.

[0035] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0036] In addition, the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0037] It should be noted that, in the absence of conflict, the features in the embodiments of the present application may be combined with each other.

[0038] Figure 1 Schematic diagram of the process of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 1 ,like Figure 1 As shown, the method may include:

[0039] S101, responding to a physical interaction triggering event between a virtual object in a preset virtual scene and a virtual fluid surface, obtaining initial fluid velocity information of a preset physical interaction range corresponding to the physical interaction triggering event on the virtual fluid surface.

[0040] In this embodiment, a virtual fluid surface is set in the preset virtual scene, such as a river, a swimming pool, quicksand, etc. The virtual object is an object that can be moved in the preset virtual scene. When the virtual object moves in the preset virtual scene and enters the virtual fluid surface, a physical interaction trigger event is generated.

[0041] Based on the physical interaction triggering event, a preset physical interaction range is determined, where the preset physical interaction range is the range that affects the change of the virtual fluid surface when the virtual object interacts with the virtual fluid surface. Figure 2A schematic diagram of a preset physical interaction range provided in an embodiment of the present application, such as Figure 2 As shown in FIG. 1 , when the virtual object interacts with the virtual fluid surface, the range that affects the change of the virtual fluid surface is an annular area with the virtual object as the center. Figure 2 The white inner ring in the figure is the area where the virtual object is located, and the black outer ring is the area where the virtual fluid surface changes.

[0042] In some instances, the inner ring radius of the preset physical interaction range can be determined by the size of the virtual object, and the outer ring radius of the preset physical interaction range can be a fixed radius, or can be determined by the size of the virtual object. The larger the virtual object, the larger the outer ring radius, and the smaller the virtual object, the smaller the outer ring radius. It can also be determined by the initial velocity of the virtual object when it enters the fluid. The smaller the initial velocity, the smaller the outer ring radius, and the larger the initial velocity, the larger the outer ring radius.

[0043] The initial velocity of the virtual object when entering the water is determined by a velocity algorithm set by the program. For example, the initial velocity of the virtual object when entering the fluid is calculated based on the moving speed and acceleration of the virtual object.

[0044] The initial velocity of each pixel in the outer ring can be calculated based on the initial velocity of the virtual object when it enters the fluid. For example, the initial velocity of the inner ring is the initial velocity of the virtual object when it enters the fluid. The initial velocity of each pixel in the outer ring is calculated based on the attenuation coefficient of the preset fluid and the initial velocity of the inner ring.

[0045] The initial velocity of each pixel point in the outer ring is stored in the velocity field RT, so that the initial velocity of each pixel point can be obtained from the velocity field RT during the rendering process.

[0046] S102. Calculate multiple frames of target fluid velocity information within a preset physical interaction range frame by frame based on the initial fluid velocity information.

[0047] In this embodiment, after the virtual object physically interacts with the virtual fluid surface, the change of the virtual fluid surface is not a change in one frame, but a change in multiple consecutive frames. In the multiple consecutive frames, the speed of each pixel point on the virtual fluid surface gradually decreases.

[0048] In some embodiments, the target fluid velocity information of the first frame after the virtual object enters the virtual fluid surface can be calculated based on the velocity change characteristics of the virtual fluid surface and the initial fluid velocity information, and then the target fluid velocity information of the next frame can be calculated in turn based on the velocity change characteristics of the virtual fluid surface and the target fluid velocity information of the current frame.

[0049] In other embodiments, since the change of the virtual fluid surface diffuses to the surrounding areas with the virtual object as the center, and the speed decreases from the center to the outside due to the attenuation of the virtual fluid surface, the target pixel point corresponding to each pixel point in the first frame after the outward diffusion can be determined based on the initial fluid velocity and unit time of each pixel point, and the target fluid velocity information of the target pixel point in the first frame is calculated based on the initial fluid velocity of each pixel point and the attenuation velocity of the virtual fluid surface; then, the target pixel point corresponding to each pixel point in the next frame after the outward diffusion is determined based on the target fluid velocity and unit time of each pixel point in the current frame, and the target fluid velocity information of the target pixel point in the next frame is calculated based on the target fluid velocity of each pixel point and the attenuation velocity of the virtual fluid surface.

[0050] Furthermore, after calculating the target fluid velocity information of each frame, the target fluid information of each pixel point in each frame is updated in sequence in the velocity field RT.

[0051] For example, Figure 3 The effect after multiple consecutive frames provided by the embodiment of the present application Figure 1 ,like Figure 3 As shown in FIG. 1 , it is a map of the target fluid velocity information of each pixel point in the velocity field RT after continuous multi-frame iterations in the RG channel. The fluid velocity information includes: the fluid velocity magnitude and fluid velocity direction of each pixel point. The fluid velocity direction is the velocity direction of the fluid when looking down at the virtual fluid surface. In the velocity field RT, the values ​​(x, y) of the RG dual channels are recorded, and the positive direction of the X axis is defined as rightward and the positive direction of the Y axis is defined as downward. The velocity in the X direction is stored in the R channel, and the velocity in the Y axis is stored in the G channel. When x>0, red is displayed in the velocity field RT, when x<=0, black is displayed in the velocity field RT, when y>0, green is displayed in the velocity field RT, when y<=0, black is displayed in the velocity field RT, and when x and y are both greater than 0, yellow is mixed in proportion.

[0052] Therefore, in the velocity field RT, the red area indicates that the fluid velocity direction is to the right when looking down on the virtual fluid surface, the green area indicates that the fluid velocity direction is downward when looking down on the fluid surface, the yellow area indicates downward to the lower right, and the black area indicates other directions. The speed of the black area may be 0, indicating no speed, or it may indicate that the pixel is negative in a single channel or both RG channels. Although no color is displayed on the velocity field RT, the value can be read and effectively rendered in the corresponding direction.

[0053] S103 . Determine fluid wave rendering parameters of a virtual fluid surface frame by frame according to the initial fluid velocity information and the target fluid velocity information of consecutive frames, and render the virtual fluid surface.

[0054] In this embodiment, according to the initial fluid velocity information, the normal of the virtual fluid surface is determined in the pixel drawing stage of the shader, and the initial fluid fluctuation rendering parameters are calculated based on the normal to render the virtual fluid surface to form a ripple simulation of the virtual fluid surface at the moment of interaction between the virtual object and the virtual fluid surface.

[0055] Then, according to the target fluid velocity information of each frame, the normal of the virtual fluid surface is determined in the pixel drawing stage of the shader, and the target fluid fluctuation rendering parameters of each frame are calculated according to the normal to render the virtual fluid surface to form a ripple simulation of the virtual fluid surface in multiple consecutive frames.

[0056] In some embodiments, the normal of each pixel is determined based on the velocity difference between the fluid velocity information of each pixel and the fluid velocity information of adjacent pixels.

[0057] The algorithm for calculating the fluid wave rendering parameters according to the normal line can be designed according to actual needs, and this embodiment does not limit this.

[0058] The virtual fluid surface rendering method provided in the above embodiment calculates the target fluid velocity information of multiple consecutive frames based on the initial fluid velocity information when the virtual object interacts with the virtual fluid surface, and determines the fluid fluctuation rendering parameters of the virtual fluid surface frame by frame according to the initial fluid velocity information and the target fluid velocity information of multiple consecutive frames, and renders the virtual fluid surface. This can effectively simulate the ripples on the virtual fluid surface caused by the change in the velocity of the virtual fluid surface and improve the visual realism.

[0059] In one possible implementation, Figure 4 Schematic diagram of the process of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 2 ,like Figure 4 As shown, the process of obtaining the initial fluid velocity information of a preset physical interaction range corresponding to the physical interaction triggering event on the virtual fluid surface in S101 may include:

[0060] S201. Creating a virtual physical interaction model corresponding to the interaction part according to the interaction part between the virtual object and the virtual fluid surface.

[0061] S202: Acquire initial fluid velocity information of a preset physical interaction range centered on a virtual physical interaction model on a virtual fluid surface.

[0062] In three-dimensional space, when a virtual object physically interacts with a virtual fluid surface, different parts of the interaction will produce different interaction effects. Since the virtual object is stored in the form of a bounding box in the backend, its appearance displayed on the graphical user interface is only the UI effect designed by the artist. The bounding box as a whole cannot simulate the visual effect of different parts interacting with the virtual fluid surface.

[0063] In order to better simulate the interaction between the virtual object and the virtual fluid surface in three-dimensional space, it is necessary to perform physical interaction detection on the virtual object and the virtual fluid surface.

[0064] In this embodiment, in order to render the fluid fluctuation effects generated by various parts where the virtual object interacts with the virtual fluid surface, when the virtual object interacts with the virtual fluid surface, a corresponding virtual physical interaction model is created for the interaction part according to the part where the interaction occurs, the part where the virtual object interacts with the virtual fluid surface is represented by the virtual physical interaction model, and the initial fluid velocity information of the preset physical interaction range centered on the virtual physical interaction model is obtained.

[0065] In some embodiments, the process of creating a virtual physical interaction model corresponding to the interaction part according to the interaction part between the virtual object and the virtual fluid surface in S201 may include:

[0066] If the virtual object is the first virtual object, a corresponding number of virtual sphere interaction models are created according to the interaction parts and the number of interaction parts; if the virtual object is the second virtual object, a virtual ray interaction model is created according to the interaction parts.

[0067] In this embodiment, the shape of the virtual physical interaction model corresponding to the virtual object is determined according to the type of the virtual object.

[0068] The first virtual object is a virtual object whose horizontal coverage area of ​​the part interacting with the virtual fluid surface is greater than or equal to the preset coverage area, and the second virtual object is a virtual object whose horizontal coverage area of ​​the part interacting with the virtual fluid surface is smaller than the preset coverage area.

[0069] If the virtual object is the first virtual object, a corresponding number of virtual sphere interaction models are created according to the number of interaction locations where the first virtual object interacts with the virtual fluid surface, and one virtual sphere interaction model is used to represent one interaction location between the virtual object and the virtual fluid surface.

[0070] For example, if the first virtual object is a virtual object with movable limbs, such as a virtual character or a virtual animal, the movable limbs of the first virtual object are the interaction parts with the virtual fluid surface. According to the number of limbs used for movement of the first virtual character, a corresponding number of virtual sphere interaction models are created for the first virtual character.

[0071] If the first virtual object is a skill release effect, the skill release effect and the virtual fluid surface will only have one interaction portion, and an instantaneous virtual sphere interaction model is created for the skill release effect. For example, the skill release effect may be an effect of a virtual bomb exploding on the virtual fluid surface.

[0072] If the virtual object is the second virtual object, since the interaction portion of the second virtual object and the virtual fluid surface has a smaller coverage area, it can be visually approximated as a point. Therefore, a virtual ray interaction model is created for the interaction portion of the second virtual object.

[0073] For example, the second virtual object is a virtual object that is linearly moved into the surface of the virtual fluid by an external force, such as a shot bullet, arrow feather, etc.

[0074] In a possible implementation, the process of obtaining the initial fluid velocity information of a preset physical interaction range centered on the virtual physical interaction model on the virtual fluid surface in S202 may include:

[0075] Initial fluid velocity information of a preset physical interaction range centered on each virtual sphere interaction model on the virtual fluid surface is obtained.

[0076] In this embodiment, according to the virtual sphere interaction model created for the interaction part between the first virtual object and the virtual fluid, if the number of virtual sphere interaction models is one, the initial fluid velocity information within the preset physical interaction range centered on the virtual sphere interaction model is stored in the velocity field RT; if the number of virtual sphere interaction models is multiple, the initial fluid velocity information within the respective preset physical interaction ranges centered on the multiple virtual sphere interaction models is stored in the velocity field RT.

[0077] The virtual fluid surface rendering method provided in the above embodiment creates a virtual physical interaction model of the interaction part according to the interaction part between the virtual object and the virtual fluid surface, so that the interaction between each interaction part and the virtual fluid surface can be rendered to support the interaction in three-dimensional space and improve the visual rendering effect.

[0078] In one possible implementation, Figure 5 Schematic diagram of the process of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 3 ,like Figure 5As shown, the process of obtaining the initial fluid velocity information of the preset physical interaction range centered on the virtual physical interaction model on the virtual fluid surface in S202 may include:

[0079] S301. If the physical interaction triggering event is a continuous physical interaction triggering event, and there are multiple virtual spherical interaction models of the first virtual object, adjust the distance between the multiple virtual spherical interaction models according to the relative height change information between the first virtual object and the virtual fluid surface during the physical interaction process.

[0080] In this embodiment, the continuous physical interaction trigger event is a continuous multi-frame physical interaction trigger event generated when the first virtual object moves in the virtual fluid. The virtual object used to trigger the continuous physical interaction trigger event should be a virtual object with moving limbs.

[0081] For skill release effects and the second virtual object, their interactions with the virtual fluid surface are instantaneous and will not generate continuous physical interaction trigger events.

[0082] During the movement of the first virtual object in the virtual fluid, when the height of the virtual fluid surface changes relative to the first virtual object, the part of the first virtual object used to interact with the virtual fluid surface will change, so that the distance between the parts of the first virtual object used to interact with the virtual fluid surface will also change. Therefore, it is necessary to adjust the distance between the multiple virtual sphere interaction models according to the relative height change information.

[0083] For example, the first virtual object is a virtual character. When the height of the virtual fluid surface is at the foot, calf, thigh or waist of the virtual character, the interaction part with the virtual fluid surface changes, and the distance between the interaction parts also changes continuously. Therefore, it is necessary to adjust the distance between multiple virtual sphere interaction models according to the relative height change information.

[0084] S302, obtaining initial fluid velocity information of a plurality of consecutive frames on the virtual fluid surface in a preset physical interaction range centered on a plurality of virtual spherical interaction models.

[0085] In this embodiment, since the first virtual object moves continuously in the virtual fluid, multiple frames of physical interaction trigger events are generated with the surface of the virtual fluid. For each frame of physical interaction trigger event, a frame of initial fluid velocity information is generated within a preset physical interaction range centered on each virtual sphere interaction model.

[0086] For example, Figure 6 A schematic diagram of the interaction of virtual characters provided in the embodiment of the present application, such as Figure 6As shown, the two interaction parts of the virtual character correspond to two virtual spherical interaction models. As the virtual character moves in the virtual fluid, each frame will generate two initial fluid velocity information of a preset physical interaction range centered on the virtual spherical interaction model.

[0087] The initial fluid velocity information within the preset physical interaction range of each frame must be updated and iterated in subsequent consecutive frames to determine the target fluid velocity information of the preset physical interaction range of each frame in subsequent consecutive frames.

[0088] In some embodiments, Figure 7 Schematic diagram of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 4 ,like Figure 7 As shown, the process of adjusting the distance between the multiple virtual sphere interaction models according to the relative height change information between the first virtual object and the virtual fluid surface during the physical interaction process in S301 may include:

[0089] S401. According to the gradual increase in relative height between the first virtual object and the virtual fluid surface during the physical interaction process, the distance between the multiple virtual sphere interaction models is reduced.

[0090] S402: If the relative height increases to a preset height, control the multiple virtual sphere interaction models to be merged into one virtual sphere interaction model.

[0091] In this embodiment, when the height of the virtual fluid surface increases relative to the first virtual object, that is, when the part where the first virtual object interacts with the virtual fluid surface increases, the distance between the part where the first virtual object interacts with the virtual fluid surface is reduced. Therefore, it is necessary to reduce the distance between the multiple virtual sphere interaction models corresponding to the interaction part.

[0092] When the relative height increases to a preset height, that is, the interaction portion between the first virtual object and the virtual fluid surface becomes one interaction portion, only one virtual sphere interaction model is needed. Therefore, the original multiple virtual sphere interaction models can be merged into one virtual sphere interaction model.

[0093] For example, during the process of the first virtual object moving from the bank to the central area of ​​the virtual fluid, the height of the virtual fluid surface relative to the first virtual object gradually increases. When the height of the virtual fluid surface is at the foot of the first virtual object, the interaction part between the first virtual object and the virtual fluid is the foot, the distance between the feet of the first virtual object is far, and the distance between the corresponding two virtual sphere interaction models is also far; when the height of the virtual fluid surface rises to the calf of the first virtual object, the interaction part between the first virtual object and the virtual fluid is the calf, the distance between the calf of the first virtual object is reduced, and the distance between the corresponding two virtual sphere interaction models is also reduced; when the height of the virtual fluid surface rises to the thigh of the first virtual object, the interaction part between the first virtual object and the virtual fluid is the thigh, the distance between the thigh of the first virtual object is further reduced, and the distance between the corresponding two virtual sphere interaction models is also reduced; when the height of the virtual fluid surface rises to the waist of the first virtual object, the interaction part between the first virtual object and the virtual fluid is the waist, and the original two virtual sphere interaction models are merged into one virtual sphere interaction model.

[0094] In other embodiments, Figure 8 Schematic diagram of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 5 ,like Figure 8 As shown, the process of adjusting the distance between the multiple virtual sphere interaction models according to the relative height change information between the first virtual object and the virtual fluid surface during the physical interaction process in S301 may also include:

[0095] S403: If the relative height gradually decreases from the preset height, control one virtual sphere interaction model to be split into multiple virtual sphere interaction models.

[0096] S404: increasing the distance between the multiple virtual sphere interaction models according to the gradual decrease in relative height between the first virtual object and the virtual fluid surface during the physical interaction process.

[0097] In this embodiment, when the relative height is reduced to a preset height, that is, the interaction part between the first virtual object and the virtual fluid surface changes from one interaction part to multiple interaction parts, multiple virtual sphere interaction models are required. Therefore, the original virtual sphere interaction model can be split into multiple virtual sphere interaction models.

[0098] When the height of the virtual fluid surface is lowered relative to the first virtual object, that is, when the part where the first virtual object interacts with the virtual fluid surface is lowered, the distance between the part where the first virtual object interacts with the virtual fluid surface increases. Therefore, it is necessary to increase the distance between the multiple virtual sphere interaction models corresponding to the interaction part.

[0099] The specific change process is the opposite of the above S401 - S402 , and this embodiment does not limit this.

[0100] For example, Fig. 9 The effect after multiple consecutive frames provided by the embodiment of the present application Figure 2 ,like Fig. 9 As shown, in the process of the virtual character interacting with the virtual fluid surface, the interaction part gradually rises from the feet to the waist, the distance between the virtual sphere interaction models gradually decreases, and finally merges into one virtual sphere interaction model. It can be seen that the initial fluid velocity information of the preset physical interaction range of the virtual sphere interaction model of each frame is iterated on the RG channel after multiple consecutive frames.

[0101] The virtual fluid surface interaction method provided in the above embodiment adjusts the distance between multiple virtual sphere interaction models according to the relative height change information during the interaction between the first virtual object and the virtual fluid surface, which can more realistically model the interaction situation during the movement of the first virtual object and improve the rendering reality effect.

[0102] In a possible implementation, the process of calculating, frame by frame, multiple frames of target fluid velocity information in a preset physical interaction range according to the initial fluid velocity information in S102 may include:

[0103] The preset fluid motion equation and initial fluid velocity information corresponding to the virtual fluid are used to calculate the continuous multi-frame target fluid velocity information within the preset physical interaction range frame by frame.

[0104] In this embodiment, the Navier-Stokes equations (NS equations for short) are the theoretical basis of fluid dynamics, which reflect the basic mechanical laws of real fluid flow. According to the NS equations corresponding to the virtual fluid and the initial fluid velocity information, a preset solution method is used to calculate the continuous multi-frame target fluid velocity information within a preset physical interaction range frame by frame.

[0105] For example, the preset solution method may be the Lagrangian method or the Euler method.

[0106] In some embodiments, Fig.10 Schematic diagram of the process of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 6 ,like Fig.10 As shown, the above-mentioned use of the preset fluid motion equation and initial fluid velocity information corresponding to the virtual fluid to calculate the continuous multi-frame target fluid velocity information within the preset physical interaction range frame by frame may include:

[0107] S501. Calculate the fluid inertia force, fluid pressure and fluid viscosity force according to the fluid velocity information of the current frame.

[0108] S502: Determine the external force on the fluid according to the initial fluid velocity information.

[0109] S503, according to the fluid inertia force, fluid pressure, fluid viscosity and external force acting on the fluid, a preset fluid motion equation is used to calculate the target fluid velocity information of the next frame.

[0110] In this embodiment, the Navier-Stokes equations are as follows:

[0111]

[0112] Among them, u is the fluid velocity information, p is the fluid pressure, ρ is the fluid density, and μ is the fluid dynamic viscosity.

[0113] The above Navier-Stokes equations are simplified, with equation 1 representing the fluid inertia force, equation 2 representing the fluid pressure, equation 3 representing the fluid viscosity force, and equation 4 representing the external force acting on the fluid.

[0114] The initial fluid velocity information is used as the external force acting on the fluid, and the fluid inertia force, fluid pressure and fluid viscosity force of each frame are calculated according to the fluid velocity information of each frame. The fluid velocity information may be the initial fluid velocity information or the target fluid velocity information.

[0115] After that, solve the Navier-Stokes equations Specifically, as shown in the following equation, the velocity difference per unit time, the fluid density ρ is a constant and can be omitted, the fluid pressure, fluid viscosity and external force acting on the fluid are summed, and then the fluid inertia force is subtracted to obtain the target fluid velocity for the next frame.

[0116]

[0117] In one possible implementation, Fig.11 Schematic diagram of the process of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 7 ,like Fig.11 As shown, the process of calculating the fluid inertia force according to the fluid velocity information of the current frame may include:

[0118] S601. Determine a second position point before a first position point corresponding to the first pixel point according to fluid velocity information and unit time of a first pixel point of a current frame.

[0119] S602: Calculate the fluid velocity information of the first position point after a unit time according to the fluid velocity information of the second pixel point corresponding to the second position point in the current frame and the preset attenuation coefficient.

[0120] S603. Calculate the inertial force of the first pixel point according to the fluid velocity information of the second position point and the fluid velocity information of the first position point after a unit time, where the fluid inertial force includes the inertial forces of multiple pixel points of the current frame.

[0121] In this embodiment, due to the fluctuation of the virtual fluid surface, a position point at the current moment will fluctuate to another position point after a unit time. At the same time, due to the attenuation of the virtual fluid fluctuation, the speed from the position point at the current moment to another position point after a unit time will decay. The fluid inertia force is represented by the speed difference between the two position points.

[0122] Specifically, for the first pixel point in the current frame, it is necessary to first inversely calculate the second position point B of the first pixel point before the first position point A in the current frame, that is, the fluctuation of the virtual fluid surface is from the second position point B to the first position point A, and calculate the fluctuation distance based on the fluid velocity information and unit time of the first pixel point, and then determine the second position point B before the first position point A based on the fluctuation distance.

[0123] Based on the fluid velocity information of the second pixel point corresponding to the second position point B in the current frame and the preset attenuation coefficient, the fluid velocity information of the second position point B fluctuating to the first position point A after unit time is calculated, and the difference between the fluid velocity information of the second position point B and the fluid velocity information of the first position point A is used as the inertial force of the first pixel point.

[0124] In one possible implementation, Fig.12 Schematic diagram of the process of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 8 ,like Fig.12 As shown, the process of calculating the fluid pressure according to the fluid velocity information of the current frame may include:

[0125] S604: Calculate the speed difference between the fluid speed information of each pixel point in the current frame and the fluid speed information of other pixel points within a preset range of each pixel point.

[0126] S605 , iterating the speed difference of multiple pixel points in the current frame to obtain the pressure of each pixel point, where the fluid pressure includes the pressure of multiple pixel points in the current frame.

[0127] In this embodiment, the pressure inside the virtual fluid comes from the different speeds of each point. For each pixel point in the current frame, the speed difference between the pixel point and other pixel points within its preset range is calculated to obtain the speed difference of each pixel point. The speed differences of multiple pixel points are subjected to Jaccobi iteration to obtain a pressure map with the same resolution as the velocity field RT. The pressure map stores the pressure of each pixel point.

[0128] In one possible implementation, Fig.13 Schematic diagram of the process of the virtual fluid surface rendering method provided in the embodiment of the present application Figure 9 ,like Fig.13 As shown, the above calculation of fluid viscosity based on the fluid velocity information of the current frame includes:

[0129] S606: Calculate the fluid velocity information of each pixel point in the current frame and the average velocity of the fluid velocity information of other pixel points within a preset range of each pixel point.

[0130] S607. Calculate the viscosity of each pixel point according to the average speed, where the fluid viscosity includes the viscosity of multiple pixel points in the current frame.

[0131] In this embodiment, the viscosity force is the situation in which the density of the virtual fluid affects the speed of each point to diffuse outward. According to the average speed of the fluid speed information of each pixel point in the current frame and other pixel points within a preset range, the average speed of each pixel point is used as the viscosity force of each pixel point.

[0132] The virtual fluid surface rendering method provided in the above embodiment calculates the inertial force, pressure, viscosity and external force acting on the fluid at each pixel based on the fluid velocity information of each pixel, thereby simplifying the calculation of the fluid motion equation and reducing the overhead of the fluid surface interactive rendering algorithm so that it can run on a mobile terminal and ensure rendering performance.

[0133] In a possible implementation, before the above S101 responds to a physical interaction trigger event between a virtual object in a preset virtual scene and a virtual fluid surface, and obtains initial fluid velocity information of a preset physical interaction range corresponding to the physical interaction trigger event on the virtual fluid surface, the method may further include:

[0134] A virtual geometry is set on the surface of the virtual fluid; and a physical interaction trigger event is generated in response to the interaction between the virtual object and the virtual geometry.

[0135] In this embodiment, in order to limit the area for interactive calculation of the preset virtual scene, a virtual geometric body Volume is set on the virtual fluid surface, and the virtual fluid surface is framed by the virtual geometric body Volume, so that when the interaction between the virtual object and the virtual geometric body is detected, a physical interaction trigger event is generated.

[0136] The virtual fluid surface rendering method provided in the above embodiment sets geometric bodies on the virtual fluid surface to limit the area for interactive calculation, thereby reducing system performance overhead.

[0137] In a possible implementation, the method may further include:

[0138] The rendering resolution is determined according to the type of terminal device running the preset virtual scene. The rendering resolution is used to indicate the number of pixels in the preset physical interaction range, and the initial fluid velocity information or target fluid velocity information corresponding to the number of pixels is stored.

[0139] In this embodiment, in order to ensure that the present solution can be applied on different platforms such as PC, Android mobile terminal, ISO mobile terminal, etc., and to ensure the rendering effect, different rendering resolutions need to be set for different types of terminal devices. The higher the rendering resolution, the more pixels it contains, the more precise the stored initial fluid velocity information or target fluid velocity information, and the better the rendering effect.

[0140] For example, if the terminal device is a mobile terminal, a velocity field with a resolution of 256*256 is used to store the horizontal velocity of the virtual fluid surface, covering a square range of 25m*25m with the virtual character as the center.

[0141] If the terminal device is a PC terminal, a velocity field with a resolution of 1024*1024 is used to store the horizontal velocity of the virtual fluid surface, covering a 50*50 square range with the virtual exclusive as the center.

[0142] The virtual fluid surface rendering method provided in the above embodiment determines the rendering resolution according to the type of terminal device running the preset virtual scene, so that the rendering effect can be guaranteed on multiple platforms and the performance overhead can be reduced to meet the needs of different devices.

[0143] The virtual fluid surface rendering method provided by this solution controls the consumption of Android devices to about 10ma when the rendering calculation method is in the resident state. If virtual geometric bodies are arranged and the rendering calculation is only started when the virtual fluid appears in the virtual scene, the consumption will be lower.

[0144] Based on the above method embodiment, the embodiment of the present application also provides a virtual fluid surface rendering device. Fig.14 A schematic diagram of the structure of a virtual fluid surface rendering device provided in an embodiment of the present application is shown in FIG. Fig.14 As shown, the device may include:

[0145] The response module 701 is used to respond to a physical interaction trigger event between a virtual object in a preset virtual scene and a virtual fluid surface, and obtain initial fluid velocity information of a preset physical interaction range corresponding to the physical interaction trigger event on the virtual fluid surface.

[0146] The calculation module 702 is used to calculate the continuous multi-frame target fluid velocity information in the preset physical interaction range frame by frame according to the initial fluid velocity information.

[0147] The rendering module 703 is used to determine the fluid fluctuation rendering parameters of the virtual fluid surface frame by frame according to the initial fluid velocity information and the continuous multiple frames of target fluid velocity information, and render the virtual fluid surface.

[0148] Optionally, the response module 701 is specifically used to create a virtual physical interaction model corresponding to the interaction part according to the interaction part between the virtual object and the virtual fluid surface; and obtain initial fluid velocity information of a preset physical interaction range centered on the virtual physical interaction model on the virtual fluid surface.

[0149] Optionally, the response module 701 is specifically used to create a corresponding number of virtual sphere interaction models according to the interaction parts and the number of interaction parts if the virtual object is the first virtual object; and to create a virtual ray interaction model according to the interaction parts if the virtual object is the second virtual object.

[0150] Optionally, the response module 701 is specifically configured to obtain initial fluid velocity information on the virtual fluid surface in a preset physical interaction range centered on each virtual spherical interaction model.

[0151] Optionally, the response module 701 is specifically used to, if the physical interaction trigger event is a continuous physical interaction trigger event and there are multiple virtual sphere interaction models of the first virtual object, adjust the distance between the multiple virtual sphere interaction models according to the relative height change information between the first virtual object and the virtual fluid surface during the physical interaction process; and obtain the initial fluid velocity information of a preset physical interaction range centered on the multiple virtual sphere interaction models for multiple consecutive frames on the virtual fluid surface.

[0152] Optionally, the response module 701 is specifically used to reduce the distance between the multiple virtual sphere interaction models according to the gradual increase in the relative height between the first virtual object and the virtual fluid surface during the physical interaction process; if the relative height increases to a preset height, control the multiple virtual sphere interaction models to merge into one virtual sphere interaction model.

[0153] Optionally, the response module 701 is also used to control a virtual sphere interaction model to be split into multiple virtual sphere interaction models if the relative height gradually decreases from a preset height; and to increase the distance between the multiple virtual sphere interaction models according to the gradual decrease in the relative height between the first virtual object and the virtual fluid surface during the physical interaction process.

[0154] Optionally, the calculation module 702 is specifically configured to calculate multiple frames of continuous target fluid velocity information within a preset physical interaction range frame by frame using a preset fluid motion equation and initial fluid velocity information corresponding to the virtual fluid.

[0155] Optionally, the calculation module 702 is specifically used to calculate the fluid inertia force, fluid pressure and fluid viscosity force based on the fluid velocity information of the current frame; determine the external force acting on the fluid based on the initial fluid velocity information; and calculate the target fluid velocity information of the next frame using a preset fluid motion equation based on the fluid inertia force, fluid pressure, fluid viscosity force and the external force acting on the fluid.

[0156] Optionally, the calculation module 702 is specifically used to determine a second position point before a first position point corresponding to the first pixel point based on the fluid velocity information and unit time of the first pixel point of the current frame; calculate the fluid velocity information of the first position point after the unit time based on the fluid velocity information of the second pixel point corresponding to the second position point in the current frame and a preset attenuation coefficient; calculate the inertia force of the first pixel point based on the fluid velocity information of the second position point and the fluid velocity information of the first position point after the unit time, and the fluid inertia force includes the inertia forces of multiple pixel points of the current frame.

[0157] Optionally, the calculation module 702 is also used to calculate the speed difference between the fluid velocity information of each pixel point in the current frame and the fluid velocity information of other pixel points within a preset range of each pixel point; iterate the speed difference of multiple pixel points in the current frame to obtain the pressure of each pixel point, and the fluid pressure includes the pressures of multiple pixel points in the current frame.

[0158] Optionally, the calculation module 702 is also used to calculate the fluid velocity information of each pixel point in the current frame and the average speed of the fluid velocity information of other pixel points within a preset range of each pixel point; based on the average speed, the viscosity of each pixel point is calculated, and the fluid viscosity includes the viscosity of multiple pixel points in the current frame.

[0159] Optionally, the device further comprises:

[0160] A setting module, used for setting a virtual geometry on the surface of a virtual fluid;

[0161] The response module 701 is further used to respond to the interaction between the virtual object and the virtual geometric body and generate a physical interaction trigger event.

[0162] Optionally, the device may further include:

[0163] A determination module is used to determine the rendering resolution according to the type of terminal device running the preset virtual scene. The rendering resolution is used to indicate the number of pixels in the preset physical interaction range, and to store the initial fluid velocity information or the target fluid velocity information corresponding to the number of pixels.

[0164] The virtual fluid surface rendering device provided in the above embodiment calculates the target fluid velocity information of multiple consecutive frames based on the initial fluid velocity information when the virtual object interacts with the virtual fluid surface, and determines the fluid fluctuation rendering parameters of the virtual fluid surface frame by frame according to the initial fluid velocity information and the target fluid velocity information of multiple consecutive frames, and renders the virtual fluid surface, which can effectively simulate the ripples on the virtual fluid surface caused by the change of the virtual fluid surface velocity and improve the visual realism.

[0165] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0166] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0167] Fig.15 A schematic diagram of an electronic device provided in an embodiment of the present application, such as Fig.15 As shown, the electronic device 800 includes: a processor 801, a storage medium 802 and a bus. The storage medium 802 stores program instructions executable by the processor 801. When the electronic device 800 is running, the processor 801 communicates with the storage medium 802 through the bus, and the processor 801 executes the program instructions to execute the above method embodiment.

[0168] Specifically, the processor executes the steps of the above virtual fluid surface rendering method, which may include:

[0169] In response to a physical interaction trigger event between a virtual object in a preset virtual scene and a virtual fluid surface, initial fluid velocity information of a preset physical interaction range corresponding to the physical interaction trigger event on the virtual fluid surface is obtained; based on the initial fluid velocity information, continuous multi-frame target fluid velocity information of the preset physical interaction range is calculated frame by frame; based on the initial fluid velocity information and the continuous multi-frame target fluid velocity information, fluid fluctuation rendering parameters of the virtual fluid surface are determined frame by frame, and the virtual fluid surface is rendered.

[0170] Optionally, the processor executes the above step of obtaining the initial fluid velocity information of a preset physical interaction range corresponding to the physical interaction triggering event on the virtual fluid surface, which may include:

[0171] According to the interaction part between the virtual object and the virtual fluid surface, a virtual physical interaction model corresponding to the interaction part is created; and initial fluid velocity information of a preset physical interaction range centered on the virtual physical interaction model on the virtual fluid surface is obtained.

[0172] Optionally, the processor executes the above step of creating a virtual physical interaction model corresponding to the interaction part according to the interaction part between the virtual object and the virtual fluid surface, which may include:

[0173] If the virtual object is the first virtual object, a corresponding number of virtual sphere interaction models are created according to the interaction parts and the number of interaction parts; if the virtual object is the second virtual object, a virtual ray interaction model is created according to the interaction parts.

[0174] Optionally, the processor executing the above step of acquiring the initial fluid velocity information of a preset physical interaction range centered on the virtual physical interaction model on the virtual fluid surface may include:

[0175] Initial fluid velocity information of a preset physical interaction range centered on each virtual sphere interaction model on the virtual fluid surface is obtained.

[0176] Optionally, the processor executing the above step of acquiring the initial fluid velocity information of a preset physical interaction range centered on the virtual physical interaction model on the virtual fluid surface may include:

[0177] If the physical interaction trigger event is a continuous physical interaction trigger event, and there are multiple virtual spherical interaction models of the first virtual object, the distance between the multiple virtual spherical interaction models is adjusted according to the relative height change information between the first virtual object and the virtual fluid surface during the physical interaction process; and the initial fluid velocity information of a preset physical interaction range centered on the multiple virtual spherical interaction models for multiple consecutive frames on the virtual fluid surface is obtained.

[0178] Optionally, the processor performs the step of adjusting the distance between the multiple virtual sphere interaction models according to the relative height change information between the first virtual object and the virtual fluid surface during the physical interaction process, which may include:

[0179] According to the gradual increase in the relative height between the first virtual object and the virtual fluid surface during the physical interaction process, the distance between the multiple virtual sphere interaction models is reduced; if the relative height increases to a preset height, the multiple virtual sphere interaction models are controlled to be merged into one virtual sphere interaction model.

[0180] Optionally, the processor performs the step of adjusting the distance between the multiple virtual sphere interaction models according to the relative height change information between the first virtual object and the virtual fluid surface during the physical interaction process, and may further include:

[0181] If the relative height gradually decreases from the preset height, control a virtual sphere interaction model to be split into multiple virtual sphere interaction models; according to the gradual decrease in the relative height between the first virtual object and the virtual fluid surface during the physical interaction process, increase the distance between the multiple virtual sphere interaction models.

[0182] Optionally, the processor performs the above step of calculating, frame by frame, multiple frames of continuous target fluid velocity information within a preset physical interaction range according to the initial fluid velocity information, which may include:

[0183] The preset fluid motion equation and initial fluid velocity information corresponding to the virtual fluid are used to calculate the continuous multi-frame target fluid velocity information within the preset physical interaction range frame by frame.

[0184] Optionally, the processor executes the above step of using the preset fluid motion equation and initial fluid velocity information corresponding to the virtual fluid to calculate the continuous multi-frame target fluid velocity information within the preset physical interaction range frame by frame, which may include:

[0185] The fluid inertia force, fluid pressure and fluid viscosity force are calculated according to the fluid velocity information of the current frame; the external force acting on the fluid is determined according to the initial fluid velocity information; and the target fluid velocity information of the next frame is calculated using the preset fluid motion equation according to the fluid inertia force, fluid pressure, fluid viscosity force and the external force acting on the fluid.

[0186] Optionally, the processor performs the above step of calculating the fluid inertia force according to the fluid velocity information of the current frame, which may include:

[0187] According to the fluid velocity information and unit time of the first pixel point of the current frame, the second position point before the first position point corresponding to the first pixel point is determined; according to the fluid velocity information and the preset attenuation coefficient of the second pixel point corresponding to the second position point in the current frame, the fluid velocity information of the first position point after the unit time is calculated; according to the fluid velocity information of the second position point and the fluid velocity information of the first position point after the unit time, the inertia force of the first pixel point is calculated, and the fluid inertia force includes the inertia forces of multiple pixel points of the current frame.

[0188] Optionally, the processor performs the above step of calculating the fluid pressure according to the fluid velocity information of the current frame, which may include:

[0189] Calculate the speed difference between the fluid speed information of each pixel point in the current frame and the fluid speed information of other pixel points within a preset range of each pixel point; iterate the speed difference of multiple pixel points in the current frame to obtain the pressure of each pixel point, and the fluid pressure includes the pressure of multiple pixel points in the current frame.

[0190] Optionally, the processor performs the above step of calculating the fluid viscosity according to the fluid velocity information of the current frame, which may include:

[0191] Calculate the average speed of the fluid velocity information of each pixel point in the current frame and the fluid velocity information of other pixel points within a preset range of each pixel point; calculate the viscosity of each pixel point based on the average speed, and the fluid viscosity force includes the viscosity of multiple pixel points in the current frame.

[0192] Optionally, before the processor executes the above-mentioned step of responding to the physical interaction trigger event between the virtual object in the preset virtual scene and the virtual fluid surface and obtaining the initial fluid velocity information of the preset physical interaction range corresponding to the physical interaction trigger event on the virtual fluid surface, the processor executes the above-mentioned step of the virtual fluid surface rendering method, which may also include:

[0193] A virtual geometry is set on the surface of the virtual fluid; and a physical interaction trigger event is generated in response to the interaction between the virtual object and the virtual geometry.

[0194] Optionally, the processor executes the steps of the above virtual fluid surface rendering method, and may further include:

[0195] The rendering resolution is determined according to the type of terminal device running the preset virtual scene. The rendering resolution is used to indicate the number of pixels in the preset physical interaction range, and the initial fluid velocity information or target fluid velocity information corresponding to the number of pixels is stored.

[0196] The virtual fluid surface rendering method executed by the processor of the above-mentioned embodiment calculates the target fluid velocity information of multiple consecutive frames based on the initial fluid velocity information when the virtual object interacts with the virtual fluid surface, and determines the fluid fluctuation rendering parameters of the virtual fluid surface frame by frame according to the initial fluid velocity information and the target fluid velocity information of multiple consecutive frames, and renders the virtual fluid surface, which can effectively simulate the ripples on the virtual fluid surface caused by the change of the virtual fluid surface velocity and improve the visual realism.

[0197] Optionally, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above method embodiment is executed.

[0198] Specifically, the processor executes the steps of the above virtual fluid surface rendering method, which may include:

[0199] In response to a physical interaction trigger event between a virtual object in a preset virtual scene and a virtual fluid surface, initial fluid velocity information of a preset physical interaction range corresponding to the physical interaction trigger event on the virtual fluid surface is obtained; based on the initial fluid velocity information, continuous multi-frame target fluid velocity information of the preset physical interaction range is calculated frame by frame; based on the initial fluid velocity information and the continuous multi-frame target fluid velocity information, fluid fluctuation rendering parameters of the virtual fluid surface are determined frame by frame, and the virtual fluid surface is rendered.

[0200] Optionally, the processor executes the above step of obtaining the initial fluid velocity information of a preset physical interaction range corresponding to the physical interaction triggering event on the virtual fluid surface, which may include:

[0201] According to the interaction part between the virtual object and the virtual fluid surface, a virtual physical interaction model corresponding to the interaction part is created; and initial fluid velocity information of a preset physical interaction range centered on the virtual physical interaction model on the virtual fluid surface is obtained.

[0202] Optionally, the processor executes the above step of creating a virtual physical interaction model corresponding to the interaction part according to the interaction part between the virtual object and the virtual fluid surface, which may include:

[0203] If the virtual object is the first virtual object, a corresponding number of virtual sphere interaction models are created according to the interaction parts and the number of interaction parts; if the virtual object is the second virtual object, a virtual ray interaction model is created according to the interaction parts.

[0204] Optionally, the processor executing the above step of acquiring the initial fluid velocity information of a preset physical interaction range centered on the virtual physical interaction model on the virtual fluid surface may include:

[0205] Initial fluid velocity information of a preset physical interaction range centered on each virtual sphere interaction model on the virtual fluid surface is obtained.

[0206] Optionally, the processor executing the above step of acquiring the initial fluid velocity information of a preset physical interaction range centered on the virtual physical interaction model on the virtual fluid surface may include:

[0207] If the physical interaction trigger event is a continuous physical interaction trigger event, and there are multiple virtual spherical interaction models of the first virtual object, the distance between the multiple virtual spherical interaction models is adjusted according to the relative height change information between the first virtual object and the virtual fluid surface during the physical interaction process; and the initial fluid velocity information of a preset physical interaction range centered on the multiple virtual spherical interaction models for multiple consecutive frames on the virtual fluid surface is obtained.

[0208] Optionally, the processor performs the step of adjusting the distance between the multiple virtual sphere interaction models according to the relative height change information between the first virtual object and the virtual fluid surface during the physical interaction process, which may include:

[0209] According to the gradual increase in the relative height between the first virtual object and the virtual fluid surface during the physical interaction process, the distance between the multiple virtual sphere interaction models is reduced; if the relative height increases to a preset height, the multiple virtual sphere interaction models are controlled to be merged into one virtual sphere interaction model.

[0210] Optionally, the processor performs the step of adjusting the distance between the multiple virtual sphere interaction models according to the relative height change information between the first virtual object and the virtual fluid surface during the physical interaction process, and may further include:

[0211] If the relative height gradually decreases from the preset height, control a virtual sphere interaction model to be split into multiple virtual sphere interaction models; according to the gradual decrease in the relative height between the first virtual object and the virtual fluid surface during the physical interaction process, increase the distance between the multiple virtual sphere interaction models.

[0212] Optionally, the processor performs the above step of calculating, frame by frame, multiple frames of continuous target fluid velocity information within a preset physical interaction range according to the initial fluid velocity information, which may include:

[0213] The preset fluid motion equation and initial fluid velocity information corresponding to the virtual fluid are used to calculate the continuous multi-frame target fluid velocity information within the preset physical interaction range frame by frame.

[0214] Optionally, the processor executes the above step of using the preset fluid motion equation and initial fluid velocity information corresponding to the virtual fluid to calculate the continuous multi-frame target fluid velocity information within the preset physical interaction range frame by frame, which may include:

[0215] The fluid inertia force, fluid pressure and fluid viscosity force are calculated according to the fluid velocity information of the current frame; the external force acting on the fluid is determined according to the initial fluid velocity information; and the target fluid velocity information of the next frame is calculated using the preset fluid motion equation according to the fluid inertia force, fluid pressure, fluid viscosity force and the external force acting on the fluid.

[0216] Optionally, the processor performs the above step of calculating the fluid inertia force according to the fluid velocity information of the current frame, which may include:

[0217] According to the fluid velocity information and unit time of the first pixel point of the current frame, the second position point before the first position point corresponding to the first pixel point is determined; according to the fluid velocity information and the preset attenuation coefficient of the second pixel point corresponding to the second position point in the current frame, the fluid velocity information of the first position point after the unit time is calculated; according to the fluid velocity information of the second position point and the fluid velocity information of the first position point after the unit time, the inertia force of the first pixel point is calculated, and the fluid inertia force includes the inertia forces of multiple pixel points of the current frame.

[0218] Optionally, the processor performs the above step of calculating the fluid pressure according to the fluid velocity information of the current frame, which may include:

[0219] Calculate the speed difference between the fluid speed information of each pixel point in the current frame and the fluid speed information of other pixel points within a preset range of each pixel point; iterate the speed difference of multiple pixel points in the current frame to obtain the pressure of each pixel point, and the fluid pressure includes the pressure of multiple pixel points in the current frame.

[0220] Optionally, the processor performs the above step of calculating the fluid viscosity according to the fluid velocity information of the current frame, which may include:

[0221] Calculate the average speed of the fluid velocity information of each pixel point in the current frame and the fluid velocity information of other pixel points within a preset range of each pixel point; calculate the viscosity of each pixel point based on the average speed, and the fluid viscosity force includes the viscosity of multiple pixel points in the current frame.

[0222] Optionally, before the processor executes the above-mentioned step of responding to the physical interaction trigger event between the virtual object in the preset virtual scene and the virtual fluid surface and obtaining the initial fluid velocity information of the preset physical interaction range corresponding to the physical interaction trigger event on the virtual fluid surface, the processor executes the above-mentioned step of the virtual fluid surface rendering method, which may also include:

[0223] A virtual geometry is set on the surface of the virtual fluid; and a physical interaction trigger event is generated in response to the interaction between the virtual object and the virtual geometry.

[0224] Optionally, the processor executes the steps of the above virtual fluid surface rendering method, and may further include:

[0225] The rendering resolution is determined according to the type of terminal device running the preset virtual scene. The rendering resolution is used to indicate the number of pixels in the preset physical interaction range, and the initial fluid velocity information or target fluid velocity information corresponding to the number of pixels is stored.

[0226] The virtual fluid surface rendering method executed by the processor of the above-mentioned embodiment calculates the target fluid velocity information of multiple consecutive frames based on the initial fluid velocity information when the virtual object interacts with the virtual fluid surface, and determines the fluid fluctuation rendering parameters of the virtual fluid surface frame by frame according to the initial fluid velocity information and the target fluid velocity information of multiple consecutive frames, and renders the virtual fluid surface, which can effectively simulate the ripples on the virtual fluid surface caused by the change of the virtual fluid surface velocity and improve the visual realism.

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

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

[0229] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0230] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.

[0231] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A virtual fluid surface rendering method, characterized in that: The method comprises: In response to a physical interaction triggering event between a virtual object in a preset virtual scene and a virtual fluid surface, initial fluid velocity information of a preset physical interaction range corresponding to the physical interaction triggering event on the virtual fluid surface is obtained; Calculating, frame by frame, multiple frames of target fluid velocity information within the preset physical interaction range according to the initial fluid velocity information; According to the initial fluid velocity information and the continuous multiple frames of target fluid velocity information, the fluid fluctuation rendering parameters of the virtual fluid surface are determined frame by frame, and the virtual fluid surface is rendered.

2. The method according to claim 1, characterized in that The obtaining of initial fluid velocity information of a preset physical interaction range corresponding to the physical interaction triggering event on the virtual fluid surface includes: According to the interaction part between the virtual object and the virtual fluid surface, a virtual physical interaction model corresponding to the interaction part is created; Initial fluid velocity information of a preset physical interaction range centered on the virtual physical interaction model on the virtual fluid surface is obtained.

3. The method according to claim 2, characterized in that The step of creating a virtual physical interaction model corresponding to the interaction portion according to the interaction portion between the virtual object and the virtual fluid surface includes: If the virtual object is the first virtual object, creating a corresponding number of virtual spherical interaction models according to the interaction parts and the number of the interaction parts; If the virtual object is a second virtual object, a virtual ray interaction model is created according to the interaction part.

4. The method according to claim 3, characterized in that The obtaining of initial fluid velocity information of a preset physical interaction range centered on the virtual physical interaction model on the virtual fluid surface includes: Initial fluid velocity information of a preset physical interaction range centered on each virtual spherical interaction model on the virtual fluid surface is obtained.

5. The method according to claim 3, characterized in that: The obtaining of initial fluid velocity information of a preset physical interaction range centered on the virtual physical interaction model on the virtual fluid surface includes: If the physical interaction trigger event is a continuous physical interaction trigger event, there are multiple virtual sphere interaction models of the first virtual object, and according to the relative height change information between the first virtual object and the virtual fluid surface during the physical interaction process, the distance between the multiple virtual sphere interaction models is adjusted; Initial fluid velocity information of a plurality of consecutive frames on the virtual fluid surface in preset physical interaction ranges centered on the plurality of virtual spherical interaction models is obtained.

6. The method according to claim 5, characterized in that The adjusting the distance between the multiple virtual sphere interaction models according to the relative height change information between the first virtual object and the virtual fluid surface during the physical interaction process includes: According to the gradual increase in relative height between the first virtual object and the virtual fluid surface during the physical interaction process, reducing the distance between the multiple virtual spherical interaction models; If the relative height increases to a preset height, the multiple virtual sphere interaction models are controlled to be merged into one virtual sphere interaction model.

7. The method according to claim 6, characterized in that The adjusting the distances between the multiple virtual sphere interaction models according to the relative height change information between the first virtual object and the virtual fluid surface during the physical interaction process also includes: If the relative height gradually decreases from the preset height, controlling the one virtual sphere interaction model to be split into the multiple virtual sphere interaction models; According to the gradual decrease in relative height between the first virtual object and the virtual fluid surface during the physical interaction process, the distance between the multiple virtual sphere interaction models is increased.

8. The method according to claim 1, characterized in that The step of calculating, frame by frame, the continuous multi-frame target fluid velocity information in the preset physical interaction range according to the initial fluid velocity information comprises: The preset fluid motion equation corresponding to the virtual fluid and the initial fluid velocity information are used to calculate the continuous multi-frame target fluid velocity information within the preset physical interaction range frame by frame.

9. The method according to claim 8, characterized in that The method of using the preset fluid motion equation corresponding to the virtual fluid and the initial fluid velocity information to calculate the continuous multi-frame target fluid velocity information in the preset physical interaction range frame by frame includes: Calculate the fluid inertia force, fluid pressure and fluid viscosity force according to the fluid velocity information of the current frame; Determining the external force exerted on the fluid according to the initial fluid velocity information; The target fluid velocity information of the next frame is calculated based on the fluid inertia force, the fluid pressure, the fluid viscosity force and the external force acting on the fluid and using the preset fluid motion equation.

10. The method according to claim 9, characterized in that The step of calculating the fluid inertia force according to the fluid velocity information of the current frame includes: Determine, according to the fluid velocity information and unit time of a first pixel point of the current frame, a second position point before a first position point corresponding to the first pixel point; Calculating the fluid velocity information of the first position point after the unit time according to the fluid velocity information of the second pixel point corresponding to the second position point in the current frame and a preset attenuation coefficient; The inertial force of the first pixel point is calculated according to the fluid velocity information of the second position point and the fluid velocity information of the first position point after the unit time, and the fluid inertial force includes the inertial forces of multiple pixel points of the current frame.

11. The method according to claim 9, characterized in that The step of calculating the fluid pressure according to the fluid velocity information of the current frame includes: Calculate the speed difference between the fluid speed information of each pixel point in the current frame and the fluid speed information of other pixel points within a preset range of each pixel point; The speed difference of multiple pixel points of the current frame is iterated to obtain the pressure of each pixel point, and the fluid pressure includes the pressure of multiple pixel points of the current frame.

12. The method according to claim 9, characterized in that The calculating of the fluid viscosity force according to the fluid velocity information of the current frame includes: Calculate the fluid velocity information of each pixel point of the current frame and the average velocity of the fluid velocity information of other pixel points within a preset range of each pixel point; The viscosity of each pixel is calculated according to the average speed, and the fluid viscosity includes the viscosity of multiple pixels in the current frame.

13. The method according to claim 1, characterized in that Before responding to a physical interaction trigger event between a virtual object in a preset virtual scene and a virtual fluid surface and obtaining initial fluid velocity information of a preset physical interaction range corresponding to the physical interaction trigger event on the virtual fluid surface, the method further includes: Setting a virtual geometric body on the surface of the virtual fluid; The physical interaction trigger event is generated in response to the interaction between the virtual object and the virtual geometric body.

14. The method according to claim 1, characterized in that The method further comprises: The rendering resolution is determined according to the type of terminal device running the preset virtual scene. The rendering resolution is used to indicate the number of pixels in the preset physical interaction range, and the initial fluid velocity information or target fluid velocity information corresponding to the number of pixels is stored.

15. A virtual fluid surface rendering device, characterized in that: The device comprises: A response module, used to respond to a physical interaction trigger event between a virtual object in a preset virtual scene and a virtual fluid surface, and obtain initial fluid velocity information of a preset physical interaction range corresponding to the physical interaction trigger event on the virtual fluid surface; A calculation module, used for calculating, frame by frame, the target fluid velocity information of a plurality of consecutive frames in the preset physical interaction range according to the initial fluid velocity information; A rendering module is used to determine the fluid fluctuation rendering parameters of the virtual fluid surface frame by frame according to the initial fluid velocity information and the continuous multiple frames of target fluid velocity information, and render the virtual fluid surface.

16. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the virtual fluid surface rendering method as described in any one of claims 1 to 14.

17. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the virtual fluid surface rendering method according to any one of claims 1 to 14 are executed.