Water body interaction simulation method, equipment, medium and product
By using a general influence module and a dedicated response module to generate differentiated water body fluctuation responses in water body simulation, the problems of high computational cost and poor adaptability in the SWE method are solved, and efficient water body interactive simulation is achieved.
Patent Information
- Application Number
- CN202511106557.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-11-25
AI Technical Summary
In existing SWE methods, water body simulation computation has high overhead and cannot be adaptively adjusted, resulting in dual CPU/GPU overhead and stuttering latency.
A general influence module and a dedicated response module are used to determine the influence parameters and dynamic response parameters of interactive objects and floating objects on the water body, respectively. Differentiated water body fluctuation responses are generated through the synergistic effect of physical fields, avoiding redundant rendering and cross-device data transmission.
It significantly reduces interactive processing overhead, adapts to mobile platform requirements, improves simulation efficiency and performance, and supports flexible configuration.
Smart Images

Figure CN121003799A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and in particular, to a water body interaction simulation method, device, medium and product. BACKGROUND
[0002] In game development, the simulation and interaction of water bodies are key links to improve the immersion of players.
[0003] At present, the core of water body simulation is to solve the approximate solution of the Navier-Stokes equation to obtain the state of the water body. Among them, the shallow water equation (SWE) is a widely used method, which greatly simplifies the Navier-Stokes equation: this method assumes that the water depth is very shallow and ignores the vertical motion, thereby greatly reducing the difficulty of solving the equation.
[0004] However, the inventors have found that at least the following technical problems exist in the related art: in the existing SWE method, the calculation results in high overhead, and cannot be adaptively adjusted. SUMMARY
[0005] An object of the present application is to provide a water body interaction simulation method, device, medium and product, at least to solve the technical problem that the existing SWE method results in high overhead and cannot be adaptively adjusted.
[0006] To achieve the above object, some embodiments of the present application provide the following aspects:
[0007] In a first aspect, some embodiments of the present application further provide a water body interaction simulation method, the method comprising: determining a general influence module of an interactive object on a water body physical field; the general influence module is configured to determine an influence parameter of the interactive object on the water body physical field in space; determining a special response module of a floating object driving a dynamic response of the water body; the special response module is configured to determine a dynamic response parameter of the floating object driving the water body; and generating a differentiated water body fluctuation response of the interactive object and the floating object according to a physical field synergistic effect between the influence parameter and the dynamic response parameter.
[0008] In a second aspect, some embodiments of the present application further provide an electronic device, comprising: one or more processors; and a memory storing computer program instructions, which when executed cause the processor to perform the steps of the method described above.
[0009] In a third aspect, some embodiments of the present application further provide a computer readable medium having stored thereon computer program instructions executable by a processor to implement the method described above.
[0010] Fourthly, some embodiments of this application also provide a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the method described above.
[0011] Compared with related technologies, the solution provided in this application provides a solution that uses a general influence module to determine the influence parameters of the water body's physical field on the interactive object's fixed position, and a dedicated response module to track the kinematic state of the floating object and generate dynamic response parameters. By leveraging the synergistic effect of the physical fields of both, it generates differentiated water body wave responses for the interactive object and the floating object, which can specifically solve the problem of differentiated responses between the interactive object and the floating object. Compared with the traditional SWE method, which suffers from the dual CPU / GPU overhead caused by rendering depth for the interactive object and the stuttering and latency caused by GPU and CPU communication for the floating object, this method directly binds object attributes and motion states through the sampler, which can avoid redundant rendering and cross-device data transmission, thereby significantly reducing the interaction processing overhead. Moreover, the performance can be flexibly configured through the sampler parameters, making it more suitable for mobile platform requirements. Attached Figure Description
[0012] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0013] Figure 1 An exemplary flowchart of a water body interaction simulation method provided in some embodiments of this application;
[0014] Figure 2 An exemplary schematic diagram of an object embedded in water provided for some embodiments of this application;
[0015] Figure 3 An exemplary flowchart for rendering and running a multi-precision hierarchical mesh on a water surface, provided for some embodiments of this application;
[0016] Figure 4 This is an exemplary structural diagram of an electronic device provided for some embodiments of this application. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0018] The following terms are used in this document.
[0019] Shallow Water Equations (SWE) are mathematical models used in fluid mechanics to describe shallow water flow, simplifying complex fluid motion laws.
[0020] Water surface interaction refers to the dynamic interaction between an object and the water surface. It mainly involves two core concepts: interacting objects and floating objects, each corresponding to different modes of interaction and physical properties.
[0021] Interactive objects: Objects or force fields that can directly affect water and cause changes in the state of the water surface. Interactive objects are proactive and can disrupt the original balance of the water surface through their own existence, movement, or energy release, producing visible dynamic changes such as ripples, waves, and eddies.
[0022] Floating objects: refer to objects that are suspended on the water surface by buoyancy, and whose motion (such as position and attitude) is mainly affected by the water surface, such as water flow and waves.
[0023] Deformable mesh: A type of mesh that can modify its own vertex positions, connectivity, and other attributes in real time during the game's execution. It is often used in game scenes with simulated interactive effects, such as water bodies, to dynamically adjust the mesh shape to present the deformation effects of objects caused by external forces, physical simulations, or player operations.
[0024] LOD: Level of Detail. In the game development field, it refers to the level of detail of the mesh, specifically the number of vertices per unit area. The higher the value, the denser the vertices are distributed within the unit area, and the higher the mesh accuracy.
[0025] Multi-level asymptotic textures: In game development, this refers to an atlas of low-resolution textures generated from a single texture through downsampling. Its purpose is to select a texture of appropriate resolution based on the size of the texture area covered by screen pixels as the distance between the object and the camera changes. This speeds up texture matching during rendering and effectively solves the jagged edge problem caused by an imbalance between texture and screen pixel ratios.
[0026] First Embodiment
[0027] The first embodiment of this application relates to a method for simulating water body interaction. For example... Figure 1 As shown, the method may include the following steps:
[0028] Step S101: Determine the general influence module for the interaction of the object on the physical field of the water body; the general influence module is used to determine the influence parameters of the interaction on the physical field of the water body in space;
[0029] Step S102: Determine a dedicated response module for the dynamic response of the floating object driving the water body; the dedicated response module is used to determine the dynamic response parameters of the floating object driving the water body.
[0030] Step S103: Based on the synergistic effect of the physical fields between the influencing parameters and the dynamic response parameters, generate differentiated water wave responses between the interacting objects and the floating objects.
[0031] The following sections will provide a detailed explanation of each of the above steps.
[0032] For step S101, for example, the interactive object is used to represent various objects in the game scene that can interact with the water body. It can include static objects, such as rocks on the shore, fixed bridge piers, etc., and dynamic objects, such as moving characters, props thrown into the water, etc. The interactive object refers to all objects that can disturb the physical field of the water body (regardless of the mode and intensity of the disturbance), and its essence lies in the exchange of energy or momentum with the water body.
[0033] For example, the general effect module can specifically be a general spherical sampler. This application embodiment uses a general spherical sampler to replace the traditional rendering depth method, approximating interactive objects (including actual models, skill effects, and other imaginary objects) through manual configuration or automatic generation. The general effect module is directly bound to the spatial position of the interactive object and can be dynamically adjusted according to its movement or state changes (such as ripples generated by character movement, skill impacts, etc.), and transmitted to the GPU for real-time water surface interaction with the water surface height field. Simultaneously, based on the balance requirements of performance and accuracy, the number and parameters of the general effect module (such as radius, intensity, etc.) can be flexibly configured to achieve differentiated water interaction effect simulation.
[0034] Regarding step S102, for example, the floating object is used to represent an object in a game scene that can float on the water surface and whose position or state changes dynamically, such as a small boat, fallen leaves, ice floes, or floating equipment dropped by a character. The floating object can change its spatial position and motion state with the movement of the water or due to its own forces. The floating object refers to an object that can maintain buoyancy balance on the water surface and whose motion state is affected by hydrodynamics; its essence lies in its continuous contact with the water surface and the fact that buoyancy dominates its vertical balance.
[0035] For example, the dedicated response module can specifically be a dedicated spherical sampler. This embodiment uses a dedicated spherical sampler to configure a single sampling sphere for the floating object. The dedicated response module establishes a binding relationship with the floating object, enabling real-time tracking of the floating object's position, velocity, attitude, and other kinematic states to maintain synchronization. During configuration, spatial position parameters of the dedicated response module relative to the floating object are set, including offset distance, orientation, sphere radius, and physical parameters affecting the floating state such as density and buoyancy coefficient, thereby simulating the dynamic behavior of the floating object.
[0036] Regarding step S103, for example, the physical influences generated by the general influence module of the interactive object and the dedicated response module of the floating object can work together in the water simulation process. By merging the physical field influences of the two samplers using the GPU, the response results of water ripples can be obtained. The response results can include ripple morphology and propagation speed in different regions. Through this synergistic effect, differentiated responses can be achieved, that is: for interactive objects, instantaneous or dynamic water disturbances matching their actions can be presented (such as diffused ripples generated by skill impacts), while for floating objects, stable water responses that change with their floating state can be presented (such as the slight undulations of a raft floating with the waves).
[0037] For example, the differentiated water body wave response can be achieved by the following method: generating static basic waves in the static interaction region based on the set of physical field action points of the general influence module; generating dynamic waves in the local area of the floating object based on the domain parameters and kinematic state of the dedicated response module; and generating the differentiated water body wave response based on the static basic waves and the dynamic waves.
[0038] For example, before executing steps S101-S103, a series of configuration steps can be performed to provide a data and rule foundation for runtime water body simulation and interactive effects. Specifically, this can include: first, creating a water surface of a specified size that meets the scene requirements, setting parameters to define basic water surface properties (such as initial height, simulation range, etc.) and capturing boundary information; next, configuring floating objects, associating the floating objects with water surface nodes, configuring dedicated response modules (including parameters such as relative position and radius) and other floating-related rules such as buoyancy magnitude and rotation limits; subsequently, generating the water surface, summarizing the sampling information from the dedicated response modules of the floating objects and converting it into buffered data that the GPU can directly process, storing water surface configuration files according to scene categories, and saving the water surface objects as prefabs for quick subsequent calls; furthermore, configuring general influence modules for all interactive objects, determining the number of general influence modules based on the balance between device performance and effect accuracy, and setting specific parameters such as the force intensity and influence range of each general sampling ball to clarify the rules governing the interaction of interactive objects on the water body.
[0039] It is not difficult to see that, compared with related technologies, the solution provided in this application, by configuring a general influence module for interactive objects to determine the influence parameters of their fixed positions on the water physical field, configuring a dedicated response module for floating objects to track their kinematic state and generate dynamic response parameters, and using the synergistic effect of the physical fields of the two to generate differentiated water wave responses for interactive objects and floating objects, can specifically solve the problem of differentiated responses between interactive objects and floating objects. Compared with the problems of CPU / GPU dual overhead caused by rendering depth for interactive objects and stuttering latency caused by GPU and CPU communication for floating objects in the traditional SWE method, this method directly binds object attributes and motion states through samplers, which can avoid redundant rendering and cross-device data transmission, thereby significantly reducing the interaction processing overhead. Moreover, the performance can be flexibly configured through sampler parameters, making it more suitable for mobile platform requirements.
[0040] Second Embodiment
[0041] The second embodiment of this application relates to a water body interaction simulation method. The second embodiment is an improvement upon the first embodiment, specifically in that it provides a method for determining the general influence module and a method for determining the dedicated response module.
[0042] In some embodiments, the method for determining the general influence module may include:
[0043] Step S201: Determine static sampling points based on the spatial position of the interactive object; the static sampling points are bound to the prefab of the interactive object and are triggered when the prefab is loaded, and the spatial position of the static sampling points is consistent with the spatial position of the interactive object;
[0044] Step S202: Determine dynamic sampling points based on the triggering state of preset logical events; after the dynamic sampling points are generated, the water surface manager interface is automatically called to trigger interaction;
[0045] The set of physical field action points of the general influence module consists of static sampling points and dynamic sampling points.
[0046] For example, static sampling points can be directly bound to the prefab of an interactive object, so that the position of the sampling points is fixed according to the spatial position of the interactive object. For example, in the game scene, a bridge pier prefab, which is an interactive object, will be bound to several static sampling points during the configuration phase. The position of these sampling points is consistent with the installation position of the bridge pier in the scene. When the bridge pier prefab is loaded into the scene, the static sampling points are also triggered and activated, continuously exerting an influence on the surrounding water body with the fixed position as the center (such as simulating the blocking effect of the bridge pier on the water flow). Its position will not change with the water flow or other dynamic factors, and will always be synchronized with the spatial position of the bridge pier.
[0047] For example, a dynamic sampling point is a temporary sampling point generated by the triggering of a specific logical event, and the position of the dynamic sampling point corresponds to the point of action of the event. The specific logical event may include, but is not limited to, a skill release event or a wind field activation event. That is, the dynamic sampling point can be determined according to the location of action of the skill release event or the wind field activation event. For example, when a player character releases the "Water Ripple" skill, the skill release event can trigger the generation of a dynamic sampling point, and the initial position of the dynamic sampling point is the center point of the water surface where the skill is applied; as another example, when a wind field activation event is triggered, the dynamic sampling point can be generated according to the center position of the wind field coverage area.
[0048] The physical field action point set of the general influence module consists of static sampling points and dynamic sampling points. Static sampling points serve as fixed action points bound to interactive objects, while dynamic sampling points are triggered by logical events. Through a unified physical field action mechanism, both provide the basis for the general influence module's action source, ensuring that the module can comprehensively cover the influence range of both fixed interactive objects and dynamic events on the water body. Based on this, in terms of interactive object processing, functionally, non-technical personnel can freely balance the number of sampling points to meet the influence effect requirements of any object on the water body, while also supporting the configuration of hypothetical objects such as skills and wind fields to realize their influence on the water body; performance-wise, it can support a large number of interactions within a single frame, successfully applying the effect of any object influencing the water body to mid-range mobile devices.
[0049] Furthermore, after the static sampling point and the dynamic sampling point are generated, the water surface manager interface can be automatically called to trigger the interaction: the position of the dynamic sampling point will change dynamically with the progress of events such as skill diffusion and wind field movement to simulate the impact of instantaneous or mobile interaction on the water body, while the position of the static sampling point will be consistent with the spatial position of the interactive object to simulate the continuous impact of fixed interaction on the water body.
[0050] For example, after the interaction is triggered by calling the water surface manager interface, the water surface manager can decompose the basic parameters (such as position, radius, force intensity, etc.) of the two types of sampling points in a unified manner, and then write them into the GPU buffer by passing them in frames. In this way, the GPU can ensure that the GPU can process the synergistic effects of all sampling points on the water body in parallel, ensuring that the fixed effect of static sampling points continues to take effect, and also realizing the real-time interactive effect of dynamic sampling points.
[0051] In some embodiments, the method for determining the dedicated response module may include:
[0052] Step S301: Determine the anchor point based on the center of gravity of the floating object;
[0053] Step S302: Determine the scope parameters based on the dynamic parameters of the floating object; the scope parameters are used to define the sampling range of the dedicated response module in physical space.
[0054] The dedicated response module consists of the anchor point and the scope parameter.
[0055] For example, the center of gravity of a floating object can be used as the spatial binding reference point for a dedicated response module. For instance, in a game scene, a raft that acts as a floating object has its center of gravity located slightly below its geometric center. An anchor point can be set at this center of gravity location. When the raft translates or rotates due to water flow or player pushing, the anchor point can move synchronously with the raft's center of gravity, always maintaining consistency with the raft's spatial position.
[0056] For example, the physical range of the water body affected by a dedicated response module can be defined by combining the dynamic parameters of the floating object, such as its mass, volume, and inertia. For instance, for floating objects with a large mass and wide volume (such as pontoons), the pontoon's dynamic parameters (such as displacement and moment of inertia) determine the wide range of interaction between the pontoon and the water body. Therefore, the domain parameter (such as the sampling sphere radius) is set to a larger value (e.g., 5 meters) to cover the bottom of the pontoon and the surrounding water area. Conversely, for floating objects with a light mass and small volume (such as fallen leaves), the domain parameter is set to a smaller value (e.g., 0.3 meters), only producing a sampling effect in a small area around the fallen leaf. It is evident that determining the domain parameter directly defines the boundary of the dedicated response module's sampling of the water body in physical space, which helps ensure that the range of the interactive simulation matches the dynamic characteristics of the floating object.
[0057] It is not difficult to see that this application embodiment provides a method for determining the general influence module and a method for determining the dedicated response module. By distinguishing the set of physical field action points of the general influence module into static sampling points and dynamic sampling points, the fixed spatial position of the interactive object and the dynamic triggering state of the preset logical event can be accurately matched respectively, thereby achieving comprehensive coverage of the interaction between the interactive object and the water body in different scenarios; at the same time, by defining the dedicated response module as consisting of anchor points and domain parameters, the center of gravity movement of the floating object can be associated in real time through the anchor points, and the sampling range can be accurately defined by the domain parameters, thereby adapting to the dynamic characteristics of the floating object. Compared with the high overhead caused by the need for multiple rendering depths of the interactive object in the traditional SWE method and the latency caused by the need for GPU and CPU communication of the floating object, this solution can achieve lightweight processing of the interaction logic through the separation of static / dynamic sampling points and anchor point binding mechanism, which is more controllable and more suitable for mobile platforms.
[0058] Third Embodiment
[0059] The third embodiment of this application relates to a water body interaction simulation method. The third embodiment is an improvement upon the first embodiment, specifically in that it provides a concrete implementation method for generating differentiated water body fluctuation responses between interacting objects and floating objects based on the synergistic effect of the physical fields between the influencing parameters and the dynamic response parameters.
[0060] Specifically, step S103, which generates differentiated water wave responses between interacting objects and floating objects based on the synergistic effect of the physical fields between the influencing parameters and the dynamic response parameters, may further include the following steps:
[0061] Step S1031: Determine the updated height field data based on the first sampling data submitted by the general influence module, the second sampling data submitted by the dedicated response module, and the shallow water equation;
[0062] Step S1032: Determine the gradient data of the updated height field data;
[0063] Step S1033: Based on the updated height field data and the gradient data, simulate the water body wave response and output the simulation results.
[0064] Optionally, in some embodiments, before step S1031, the method may further include: determining the frame-segmentation submission strategy of the general impact module and the dedicated response module based on the interactive event triggering state; and acquiring the first sampled data submitted by the general impact module and the second sampled data submitted by the dedicated response module in frames according to the frame-segmentation submission strategy.
[0065] For step S1031, for example, the system can first decompose the sampling points of the general influence module and the special response module into basic parameters such as position, radius, and force intensity through the water surface manager, and pass them into the GPU buffer frame by frame; at the same time, according to the triggering state of the interaction event (such as the movement of the interactive object, the change of the floating object's attitude, etc.), the system can determine the frame submission strategy of the two types of samplers (such as high-frequency interaction events corresponding to submission every frame, and low-frequency events corresponding to submission every other frame), and then obtain the sampling data frame by frame according to the frame submission strategy.
[0066] Furthermore, the first sampling data submitted by the general impact module may include information such as the force exerted by the interacting object on the water body and the contact range; the second sampling data submitted by the dedicated response module may include information such as the displacement of the floating object and the coordinates of the contact point with the water surface. This application directly uses the shallow water equation height field iteration form to iterate the height field. The shallow water equation, as a mathematical equation describing the flow law of water in shallow water areas, can reflect the relationship between water level changes and water flow. By substituting the first and second sampling data into the shallow water equation to solve, the updated height field data can be obtained. This height field data is a data set reflecting the water surface undulation state under the combined action of the interacting object and the floating object, which can provide absolute height information of each point on the water surface and determine the peak and trough positions of the waves.
[0067] For step S1032, for example, the gradient data is a parameter describing the rate of change of height at each point in the height field. It can provide trend information on height change, including the direction of change (i.e., the direction of height from high to low) and the magnitude of change (i.e., the height difference per unit distance). It determines the direction and speed of wave propagation. For example, the transition area from wave crest to wave trough will show obvious gradient data, with its direction pointing to the wave trough and its magnitude reflecting the steepness of the water surface in that area. By calculating the gradient data at each position in the updated height field data, the tilt trend of the water surface can be quantitatively represented. The velocity field is obtained by calculating the gradient of the height field, which can obtain an approximate velocity field with ideal effect. When the velocity field is not needed, it can be completely omitted from calculation. Each frame can also adaptively decide whether to calculate the velocity field based on the upper layer interaction.
[0068] For step S1033, for example, a visualization or quantitative result of the dynamic changes of the water body can be generated based on the updated height field data and the gradient data. The output simulation result can be a dynamic image that intuitively shows the water surface undulations and flow state; or it can be quantitative data, such as water level values, flow velocity values, etc. at various times. This embodiment does not specifically limit this.
[0069] For steps S1031-S1033, for example, when a stone (interactive object) falls into a lake with a raft (floating object): In step S1031, the general influence module submits first sampling data such as the impact force and contact area of the stone when it falls into the water, and the dedicated response module submits second sampling data such as the weight and draft of the raft. These data are substituted into the shallow water equation to calculate the updated height field data, which shows that the stone creates ripples and the water level below the raft is slightly lower. In step S1032, the gradient data of the height field is calculated to obtain the direction of height change from the crest to the trough at the ripple location and the height difference per meter, as well as the tilt trend data of the water level around the raft. In step S1033, the updated height field data (showing the height distribution of the ripples and the water level at the raft's location) and the gradient data (showing the direction of ripple propagation and the water flow trend around the raft) are combined to simulate the dynamic process of the ripples spreading in all directions and the raft slightly undulating with the ripples, thereby outputting a simulation result that includes this wave effect.
[0070] Optionally, in some embodiments, the step of simulating the water wave response and outputting the simulation results based on the updated height field data and the gradient data, i.e., step S1033, may include:
[0071] Step S1033A: Determine the approximate velocity field based on the gradient data;
[0072] Step S1033B: Based on the device performance configuration and the triggering state of the interactive event, perform hierarchical control processing on the approximate velocity field to obtain a controlled velocity field;
[0073] Step S1033C: Based on the updated height field data and the controlled velocity field, simulate the water wave response and output the simulation results.
[0074] For step S1033A, for example, the approximate velocity field is a data model used to characterize the flow characteristics of water bodies, which is estimated through gradient data. The flow direction can be determined by the direction of change of the gradient data (usually along the direction of decreasing height), and the flow rate can be derived from the magnitude of change of the gradient data (the larger the magnitude, the faster the rate may be).
[0075] For step S1033B, for example, the approximate velocity field can be tiered and adjusted to be enabled or disabled based on the performance level of the operating equipment and the presence or absence of interactive events (such as objects entering the water, floating objects moving, etc.). Here, equipment performance configuration characterizes hardware parameters such as the equipment's computing power, and the triggering state of interactive events characterizes whether water-related interactive behavior has been detected. Tiered control processing is an adjustment method that adopts different strategies based on the above conditions; for example, under specific conditions, the approximate velocity field may be fully preserved, or under other conditions, the approximate velocity field may be set to a null value. The controlled velocity field obtained after such processing can adapt to the simulation requirements of different scenarios.
[0076] For step S1033C, for example, the basic height of each point on the water surface can be determined first based on the updated height field data. Then, combined with the water flow direction and velocity information contained in the controlled velocity field, the motion trajectory of the water body under the action of force can be calculated using a fluid dynamics algorithm. For example, when the water body at the wave crest flows from the wave trough along the velocity field direction, the height field data will update the position changes of the wave crest and wave trough in real time, and adjust the amplitude and range of wave propagation according to the attenuation coefficient of the velocity field. For objects interacting with the water body (such as floating objects), the resultant force of buoyancy and water flow thrust on the object can be calculated by matching the height field data and velocity field data of its contact point, thereby determining the displacement and attitude changes of the object. Furthermore, the calculated data such as the dynamic changes in water surface height and the motion state of the object are converted into a visual frame sequence or quantized parameters, and the output is a presentable simulation result.
[0077] Steps S1033A-S1033C, for example, when a wooden plank (interactive object) falls into a pool containing a plastic bottle (floating object): In step S1033A, based on the gradient data of the wave crest to trough formed by the impact of the wooden plank on the water surface (e.g., a drop of 0.1 meters per meter in height and an outward direction), the approximate velocity field is determined to be the water flow spreading outward at a rate of 0.2 meters per second; In step S1033B, if the running device is a high-performance computer and the interactive event of the plastic bottle moving with the water flow is detected, the approximate velocity field is preserved to obtain a controlled velocity field; if it is a low-end device, the controlled velocity field is set to a null value; In step S1033C, combining the updated height field data (displaying the wave height around the wooden plank) and the controlled velocity field (or a null value), the dynamic effect of wave diffusion and the plastic bottle moving with the water flow (or only the basic effect of wave undulation) is simulated, and the corresponding simulation results are output.
[0078] It should be noted that this embodiment can also be an improvement based on the second embodiment.
[0079] It is not difficult to see that in this embodiment, by combining the first sampling data of the general influence module, the second sampling data of the dedicated response module, and the shallow water equation, the dual effects of interacting objects and floating objects on the water body can be comprehensively considered. This allows the updated height field data to reflect both the overall fluctuations caused by the interacting objects and the local water level changes caused by the floating objects, solving the problem that single sampling data cannot fully reflect the water body state. Compared to the high overhead and lack of adaptive configuration caused by the binding calculation of velocity field and height field in the traditional SWE method, this solution derives an approximate velocity field through gradient data and implements hierarchical control based on device performance and interactive events. It can flexibly enable or disable velocity field calculation, achieving a dynamic balance between simulation accuracy and resource consumption. At the same time, by extracting gradient data, the static height distribution of the height field is transformed into dynamic information that can characterize the water flow trend, providing a quantitative basis for simulating the direction and speed of wave propagation. Therefore, by combining the height field and gradient data for simulation, it can not only present the undulations of the water surface but also restore the dynamic propagation process of waves. The output simulation results take into account both the realism of water body fluctuations and the richness of details, which is conducive to the accurate calculation of the synergistic effect of physical fields and improves simulation efficiency.
[0080] Fourth embodiment
[0081] The fourth embodiment of this application relates to a water body interaction simulation method. The fourth embodiment is an improvement upon the third embodiment, specifically in that it provides a method for performing hierarchical control processing on the approximate velocity field based on device performance configuration and the triggering state of interactive events to obtain a controlled velocity field.
[0082] Specifically, in some embodiments, the step of performing hierarchical control processing on the approximate velocity field based on device performance configuration and the triggering state of interactive events to obtain a controlled velocity field, i.e., step S1033B, may include:
[0083] For low-end devices, the first control strategy is executed; in the first control strategy, the velocity field calculation is globally turned off, so that the controlled velocity field is null.
[0084] For mid-to-high-end equipment, a second control strategy is implemented; in the second control strategy, when an interaction event exists, the approximate velocity field is used as the controlled velocity field; when no interaction event exists, the controlled velocity field is set to null.
[0085] Specifically, this application employs a first control strategy for low-end equipment. By globally disabling velocity field calculations, the controlled velocity field is kept in a null state, thereby reducing system load. Since velocity field calculations consume significant hardware resources, and low-end equipment has limited processing capabilities, globally disabling them means that velocity field-related calculations are never performed under any circumstances. This avoids equipment lag or malfunctions due to complex calculations, ensuring the stable implementation of the basic functions of water body fluctuation simulation. Furthermore, this application can adaptively disable velocity field calculations during runtime to save costs, and can also directly configure certain water bodies to disable velocity field calculations on low-end machines, further reducing system load and ensuring the stable operation of basic simulation functions.
[0086] For example, if the device is an older smartphone with lower specifications, the first control strategy will be executed regardless of whether there are interactive events such as leaves falling into the water or small fish swimming. In this case, the system globally disables velocity field calculation, and the controlled velocity field is always empty. It only simulates the up and down of the water surface based on the height field data, without reflecting the horizontal movement direction and speed of the water flow, in order to reduce the computational burden on the device and ensure the smooth operation of the basic ripple effect.
[0087] Specifically, the second control strategy is suitable for mid-to-high-end equipment with strong computing power, aiming to balance simulation accuracy and resource consumption. When an interactive event is detected (such as an object entering the water or a floating object moving), the water ripples require more refined dynamic effects. In this case, the approximate velocity field determined by gradient data can be directly used as the controlled velocity field to support the simulation of details such as water flow direction and speed. When there is no interactive event, the water is in a relatively stable state, and there is no need for complex velocity field information. Making the controlled velocity field null can reduce unnecessary calculations, save hardware resources, and at the same time ensure the smoothness of the basic ripple effect.
[0088] For example, if the device is a high-performance tablet, when interactive events such as a boat passing over the water or a person throwing stones into the water are detected, the logic of enabling the velocity field in the second control strategy is executed. The approximate velocity field determined by gradient data is directly used as the controlled velocity field to simulate details such as the direction of water flow as the boat moves and the diffusion rate of waves as the stones enter the water. When the tablet does not detect any interactive events such as floating objects moving or objects contacting the water surface, the logic of disabling the velocity field in the second control strategy is executed, making the controlled velocity field null and only retaining the basic simulation of the natural undulation of the water surface, reducing unnecessary resource consumption.
[0089] It should be noted that this embodiment may also be an improvement based on the first embodiment and / or the second embodiment.
[0090] It is not difficult to see that in this embodiment, by implementing the first control strategy on low-end devices, globally disabling velocity field calculation and setting the controlled velocity field to null values, computational overload caused by processing complex velocity field data can be avoided, thereby ensuring the smoothness of the basic water body fluctuation simulation and resolving the contradiction between the insufficient performance of low-end devices and simulation requirements. For mid-to-high-end devices, the second control strategy uses the approximate velocity field as the controlled velocity field when interactive events exist, which can preserve details such as water flow direction and speed to improve the realism of the simulation. When there are no interactive events, setting the controlled velocity field to null values reduces redundant calculations and enables efficient use of resources. This solution can specifically solve the problems of excessive overhead and inability to adaptively configure caused by binding the velocity field and height field in the traditional SWE method. Through hierarchical control, performance adaptation under different hardware environments is achieved, balancing simulation effect and operating efficiency.
[0091] Fifth Embodiment
[0092] The fifth embodiment of this application relates to a water body interaction simulation method. The fifth embodiment is an improvement upon the third embodiment, specifically in that it provides a concrete implementation method for simulating water body fluctuation responses and outputting simulation results based on the updated height field data and the gradient data.
[0093] Specifically, in some embodiments, the step of simulating water wave response and outputting simulation results based on the updated height field data and the gradient data, i.e., step S1033, may further include: implementing the motion simulation of the floating object in the GPU vertex shader based on the updated height field data and the gradient data.
[0094] For example, for floating objects, this application can use a single sampling sphere for sampling, and the sampling sphere can be freely configured. Utilizing the efficient parallel computing capabilities of the GPU vertex shader, the updated height field data and gradient data are combined, so that the dynamic influence of the water body on the floating object is calculated in the GPU through sampling points and directly applied to the vertex shader of the corresponding model to realize its dynamic simulation and final motion as it fluctuates with the water body. By configuration, velocity field generation can also be turned off, affecting only the vertical motion of the floating object, while its horizontal motion is controlled by other systems. Thus, not only can the floating motion effect of any object on the water surface be realized, but the need to control the object's motion simultaneously by controlling the direction of influence can also be met. In terms of performance, it supports the existence of a large number of floating objects in the same water body and can run efficiently on mid-range mobile devices.
[0095] Optionally, in some embodiments, the step of simulating the motion of the floating object in the GPU vertex shader based on the updated height field data and the gradient data may include:
[0096] Step S10331: Based on the updated height field data, determine the sampling point identifier associated with the anchor point position of the dedicated response module;
[0097] Step S10332: Based on the sampling point identifier, the anchor point position, and the gradient data, the motion simulation of the floating object is implemented in the GPU vertex shader.
[0098] Regarding step S10331, for example, the anchor point position of the dedicated response module is used to characterize the key point where the floating object contacts the water body. The updated height field data may contain height information of a large number of sampling points on the water surface, and each sampling point has a unique identifier (such as a number or index). By comparing the coordinates of the anchor point position with the coordinates of each sampling point in the height field data, the sampling point closest to the anchor point can be found, and the sampling point identifier associated with the anchor point can be determined.
[0099] For step S10332, for example, the real-time height of the corresponding location can be obtained from the height field data through the sampling point identifier. Combined with the relative position of the anchor point on the floating object, the vertical displacement of the floating object caused by the rise and fall of the water surface can be calculated. At the same time, since the gradient data can reflect the tilt direction and degree of the water surface at the sampling point, the tilt angle and horizontal offset of the floating object can be determined accordingly. The GPU vertex shader can make the floating object exhibit natural motion states such as undulation and tilt synchronized with the water ripples by calculating the motion parameters of each vertex of the floating object in parallel.
[0100] For example, when there is a small boat (floating object) on the lake, in step S10331, the lake surface sampling points corresponding to the anchor points of the dedicated response module at the bottom of the small boat (such as the three points where the boat body contacts the water surface) can be found based on the updated height field data (including the height data of each point on the lake surface), and the identifiers of these sampling points (such as numbers A, B, and C) can be determined. In step S10332, the real-time water level at the corresponding position can be obtained from the height field data using the identifiers A, B, and C. Combined with the distribution position of the anchor points on the boat body, the rise and fall height of the boat body due to the change in water level can be calculated. At the same time, the tilt angle of the boat body can be determined based on the gradient data (such as the direction and magnitude of the water surface tilt from point A to point B). In the GPU vertex shader, the displacement of each vertex of the small boat is calculated in parallel to simulate the dynamic effect of the small boat rising and falling and tilting left and right with the waves.
[0101] Optionally, in some embodiments, the step of simulating the motion of the floating object in the GPU vertex shader based on the sampling point identifier, the anchor point position, and the gradient data, i.e., step S10332, may include:
[0102] Step S103321: Obtain the height value and gradient data of the corresponding location according to the sampling point identifier;
[0103] Step S103322: Determine the vertical displacement component based on the height value;
[0104] Step S103323: Determine the horizontal displacement component based on the gradient data and the anchor point position;
[0105] Step S103324: Determine the displacement vector of the floating object vertex based on the vertical displacement component and the horizontal displacement component, so as to realize the motion simulation of the floating object in the GPU vertex shader based on the displacement vector.
[0106] For step S103321, for example, the sampling point identifier is a key index that associates floating objects with the water surface. The height value of the corresponding sampling point (i.e., the real-time height of the water surface at that location) can be extracted from the updated height field data through the sampling point identifier. At the same time, the gradient information (including the direction and magnitude of the height change) at the sampling point can be obtained from the determined gradient data.
[0107] For example, in step S103322, the height value reflects the real-time water level at the sampling point. By comparing this height value with the water level at the initial state of the floating object, the difference between the rise and fall of the water level can be obtained. The difference between the rise and fall is the vertical displacement component of the anchor point position of the floating object, which directly determines the rise or fall of the floating object in the vertical direction.
[0108] For step S103323, for example, the gradient data reflects the tilt direction and steepness of the water surface at the sampling point, while the anchor point position clarifies the relative coordinates of the sampling point on the floating object. Combining the two, the direction and magnitude of the horizontal thrust generated by the water surface tilt on the floating object can be analyzed, thereby determining the displacement component of the floating object in the horizontal direction, reflecting the sliding or shifting trend of the floating object as the water surface tilts.
[0109] For step S103324, for example, the vertical displacement component and the horizontal displacement component describe the motion state of the floating object in two directions, respectively. Combining the two can form the displacement vector of each vertex of the floating object (including the direction of motion and distance). The GPU vertex shader uses this displacement vector to quickly update the position of all vertices of the floating object through parallel computation, and finally presents the comprehensive motion effect of the floating object moving with the water, such as simultaneous up-and-down undulation and horizontal sliding.
[0110] For example, taking a buoy (floating object) on the water surface as an example: In step S103321, based on the sampling point identifier (such as number D) associated with the anchor point of the dedicated response module at the bottom of the buoy, the height value (such as the current water level being 0.3 meters higher than the initial state) and gradient data (such as a decrease of 0.1 meters per meter along the positive X-axis) at that location are obtained from the height field data; In step S103322, based on the 0.3-meter height value, the vertical displacement component of the buoy anchor point is determined to be 0.3 meters upward; In step S103323, combining the gradient data (tilted in the positive X-axis direction) and the center position of the anchor point at the bottom of the buoy, the horizontal displacement component is determined to be 0.05 meters along the positive X-axis; In step S103324, the vertical displacement component (0.3 meters upward) and the horizontal displacement component (0.05 meters along the positive X-axis) are combined to form the displacement vector of the buoy vertex. The GPU vertex shader updates the position of each vertex of the buoy based on this vector, simulating the motion state of the buoy lifting upward and sliding slightly along the X-axis direction.
[0111] It should be noted that this embodiment may also be an improvement based on any one or more of the first, second, and fourth embodiments.
[0112] It is easy to see that in this embodiment, the motion simulation of the floating object is implemented in the GPU vertex shader based on the updated height field data and gradient data. This leverages the efficiency of GPU parallel computing to quickly process large amounts of vertex data and respond to water changes in real time, solving the latency problem that may exist in CPU computation. Compared to the stuttering and high overhead caused by GPU-CPU communication in the traditional SWE method, this solution directly completes the motion calculation of the floating object through the GPU vertex shader, avoiding cross-device data transmission, significantly improving the smoothness of interaction, and is simple to configure, making it more suitable for mobile devices. Simultaneously, the vertical motion of the floating object is determined based on the height field data, and its horizontal and tilting motion is determined based on the gradient data, ensuring that the motion state of the floating object maintains physical consistency with water fluctuations, avoiding false motions that deviate from the water's state. This implementation method can improve the real-time performance of the simulation through the GPU and ensure the realism of the simulation through the combination of height field and gradient data. While balancing operational efficiency, it also enhances the credibility of the interaction between the floating object and the water.
[0113] Sixth Embodiment
[0114] The sixth embodiment of this application relates to a water body interaction simulation method. The sixth embodiment is an improvement upon the third embodiment, specifically in that it provides a technical solution prior to determining the updated height field data based on the first sampling data submitted by the general influence module, the second sampling data submitted by the dedicated response module, and the shallow water equation.
[0115] Specifically, before determining the updated height field data based on the first sampling data submitted by the general influence module, the second sampling data submitted by the dedicated response module, and the shallow water equation, i.e., step S1031, the method may further include:
[0116] Step S401: Determine the height information of the water body boundary obstruction according to the layered depth projection algorithm;
[0117] Step S402: Determine the extended boundary information based on the extended orthogonal camera capture technology;
[0118] Step S403: Determine the constraint conditions for the shallow water equation height field iteration based on the occlusion height information and the extended boundary information; the constraint conditions are used to correct the updated height field data.
[0119] This application proposes an algorithm to automatically capture complex boundaries through hierarchical depth projection. By introducing an extension method, additional height information can be incorporated into the calculation process during simulation: for boundary regions, the boundary regions can continue to participate in the simulation, or their height can be limited to the height of obstructions after the simulation is completed. At the same time, the underwater height (i.e., the depth of the water) can be used as a parameter to perform a more detailed simulation of the boundary regions. As a result, the water bodies in this application support water surface boundaries of arbitrary shapes, which can meet the needs of complex water surface environments in games.
[0120] Regarding step S401, for example, the hierarchical depth projection algorithm is a technique for determining the spatial location of objects by calculating scene depth information at multiple levels. It can identify occlusions at the edge of water bodies (such as banks, bridge piers, etc.). This algorithm can determine the height information of these occlusions, such as the height of a dam on the bank or the elevation of the top of a rock extending into the water.
[0121] For step S402, exemplarily, the extended orthogonal camera capture technology is a method that expands the shooting range based on a conventional orthogonal camera. It can capture water body edge information beyond the screen display area, such as the outline of a riverbank extending beyond the field of view, or the boundary of water areas hidden behind obstacles. The extended boundary information determined by this technology can avoid the problem of incomplete water body simulation boundaries caused by limited field of view.
[0122] For step S403, for example, the height information of the obstruction can determine the physical barriers that the water body cannot overcome (such as the maximum water level limit imposed by the height of a dam), and the extended boundary information defines the spatial range of the water body simulation (if this range is exceeded, the calculation stops). The constraint formed by combining the two can correct the height field data during the iterative calculation of the shallow water equation, ensuring that the updated height field data neither exceeds the actual physical boundary nor misses the water state of the extended area, making the simulation results more consistent with the real scene.
[0123] For steps S401-S403, for example, when simulating a pond (water body) and its surrounding environment: In step S401, a hierarchical depth projection algorithm is used to calculate the depth of obstructions such as stone steps and bushes along the pond edge, determining the height information of obstructions such as the top of the stone steps being 0.5 meters and the bottom of the bushes being 0.3 meters above the water surface; In step S402, the pond edge area beyond the initial field of view is captured by extended orthogonal camera capture technology, obtaining extended boundary information such as the direction of the shoreline extending beyond the field of view and the corner position; In step S403, combining the height information of obstructions (such as the stone steps limiting the water level to no more than 0.5 meters) and the extended boundary information (such as the coordinate range of the shoreline outside the field of view), the constraints for the iteration of the shallow water equation height field are determined: the water level must not be higher than the top of the stone steps, and the calculation range must include all water areas within the extended boundary. When updating the height field data in subsequent step S1031, these constraints will correct the data to avoid situations where the water level overflows the stone steps or the state of water areas outside the field of view is missed.
[0124] Optionally, in some embodiments, determining the height information of the water body boundary obstruction according to the hierarchical depth projection algorithm, i.e., step S401, may include:
[0125] Step S4011: Determine the multi-level depth detection ray projection strategy based on the hierarchical depth projection algorithm;
[0126] Step S4012: Determine the strategy for generating continuous closed boundaries based on the spatial topological relationship of the ray collision points;
[0127] Step S4013: Determine the height information of the water body boundary obstruction based on the height value of the boundary vertex.
[0128] For step S4011, for example, the hierarchical depth projection algorithm acquires scene depth information by emitting probe rays in layers. The multi-level depth probe ray projection strategy is used to determine the projection direction, density, and range of rays at different levels. For example, high-density rays are used for the near-area of water body boundaries to obtain fine data, while low-density rays are used for the far-area to balance efficiency. This layered approach ensures that it is conducive to accurately capturing details of obstructions while covering the complete detection range.
[0129] For step S4012, for example, the ray collision point is the position where the ray contacts the surface of the occluder. Its spatial topological relationship reflects the relative position and connection method of these points (such as the distance between adjacent points, the arrangement direction, etc.). The continuous closed boundary generation strategy is based on these relationships. The algorithm connects discrete collision points into a continuous and closed contour line. For example, multiple collision points of stone steps by a pond are connected into a closed boundary around the stone steps, thereby fully presenting the spatial form of the occluder.
[0130] For step S4013, for example, the boundary vertices are key points that constitute a continuous closed boundary. Each vertex contains three-dimensional spatial coordinates, and its height value (such as the vertical distance relative to the water surface) directly reflects the elevation of the obstruction at that location. By extracting and integrating the height values of all boundary vertices (such as taking the maximum value as the highest height of the obstruction, or recording the height changes at different locations), the height information of the obstruction at the water body boundary is determined, such as the height range of the shoreline wall, the top elevation of the rock, etc.
[0131] For example, taking a scenario simulating a lakeside with walls and trees (obstacles) as an example: In step S4011, based on the hierarchical depth projection algorithm, a multi-level depth detection ray projection strategy is determined: high-density vertical rays are emitted towards the walls near the lake, and low-density oblique rays are emitted towards the trees in the distance, ensuring comprehensive and accurate detection of obstructions; In step S4012, the spatial topological relationship between the rays and the collision points on the surfaces of the walls and trees is analyzed (e.g., the collision points of the walls are arranged in a straight line, and the collision points of the trees are scattered), and a continuous closed boundary generation strategy is determined, connecting the collision points of the walls into regular rectangular closed boundaries, and connecting the collision points of the trees into irregular circular closed boundaries; In step S4013, the height values of the vertices of these closed boundaries are extracted, obtaining data such as the height of the top vertex of the wall being 2 meters and the height of the bottom vertex of the tree being 0.5 meters, thereby determining the height information of the water boundary obstructions.
[0132] Optionally, in some embodiments, determining the extended boundary information based on the extended orthogonal camera capture technology, i.e., step S402, may include:
[0133] Step S4021: Determine underwater occlusion information based on the orthogonal camera's vertical downward shooting strategy;
[0134] Step S4022: Determine the water surface obstruction information based on the orthogonal camera's vertical upward shooting strategy;
[0135] Step S4023: Determine the extended boundary information based on the underwater obstruction information and the above-water obstruction information.
[0136] For step S4021, an exemplary vertically downward shooting strategy can focus on the bottom of the water body and underwater obstructions, such as underwater rocks, seaweed, shipwrecks, etc. This method can capture the outline and position of these objects, forming underwater obstruction information.
[0137] For step S4022, for example, a vertically upward shooting direction can cover the space above the water surface, such as trees, buildings, bridge piers, and other objects located above or at the edge of the water surface. At this angle, the orthographic camera can accurately record the relative position and outline of these objects with respect to the water surface, forming water occlusion information, which is used to define the horizontal extension boundary of the water body.
[0138] For step S4023, for example, underwater occlusion information clarifies the physical obstacles at the bottom of the water body (such as the edges of rocks), while surface occlusion information defines the horizontal extension limits of the water surface (such as the bottom boundaries of shore-side buildings). By combining these two types of information, the complete boundary of the water body beyond the initial visible range in three-dimensional space can be determined, including the underwater bottom boundary and the horizontal extension boundary above the water. The resulting extension boundary information ensures the integrity of the water body simulation range.
[0139] For example, let's take a simulated lake scene with underwater reefs and shore houses as an example: In step S4021, the orthographic camera uses a vertical downward shooting strategy to capture the outline and distribution of the reefs on the lake bottom, and determines the underwater occlusion information as the edge coordinates and height of the reef group; In step S4022, the orthographic camera switches to a vertical upward shooting strategy to capture the bottom outline of the shore houses, the position of the steps, etc., and determines the water occlusion information as the boundary line between the house foundation and the water surface and the starting coordinates of the steps; In step S4023, by combining the edge range of the underwater reef group and the boundary line of the shore houses, the extended boundary information of the lake is obtained, that is, the bottom boundary limited by the underwater reefs and the shore boundary defined by the house foundation, ensuring that the simulated lake boundary can still be accurately presented when it exceeds the initial field of view.
[0140] Optionally, in some embodiments, an 8-bit data structure can be used to encode relevant information. Specific rules can be referenced as follows: Bit 0 is used to store the boundary masking state, where 0 indicates the boundary location is an underwater region, and 1 indicates an above-water region; bits 1 to 7 are used to store the relative height value based on the water surface, with above-water height values recorded as positive numbers and underwater height values recorded as negative numbers. This 8-bit encoding method allows for the simultaneous determination of the boundary region type and corresponding height information within a limited storage space.
[0141] Understandably, in related technologies, water bodies have boundaries and are usually simulated using regular meshes. However, in real-world scenarios, water body cross-sections are often irregular, thus requiring additional masking textures to determine water body boundaries. Traditional boundary textures are generated by orthogonal camera captures and typically contain only 1 bit of information, marking whether a corresponding plot is water in a non-zero or one-to-one manner. For complex scenarios, such as... Figure 2 When an object is embedded in a body of water, the area within the dashed frame cannot be simply represented by whether it is water or not; this type of information is clearly insufficient for describing the boundary.
[0142] In this embodiment, the present application achieves the recording of additional information by extending the orthogonal camera's boundary information capture method. The extension is mainly reflected in two aspects: First, a two-stage capture method is adopted. During the first boundary capture, the camera shoots vertically downwards to record underwater occlusion information, and during the second boundary capture, the camera shoots vertically upwards to record surface occlusion information. Second, the recorded information is increased from 1 bit to 8 bits, occupying the texture content of one channel, and the additional 7 bits are used to record height information. For the boundary area, the height output by the mask is the height above the water, and vice versa, the height below the water is output, and the height is relative to the water surface. Compared to traditional boundary masking maps containing only 1 bit of information (which can only simply mark water / non-water bodies), the 8-bit data structure used in this embodiment can significantly improve the accuracy and dimensionality of boundary description. It not only distinguishes the attributes of above-water / underwater regions through the 0th bit, but also uses the 1st to 7th bits to store the precise relative height value based on the water surface (positive and negative indicate direction). This design specifically addresses the core defects of traditional methods: first, it cannot describe the complex vertical structure of water body boundaries (such as banks, underwater reefs, and above-water hanging objects), resulting in overly rigid and unrealistic boundaries; second, it lacks height information, making it difficult to support the simulation of fine physical interactions between water bodies and shorelines and underwater terrain. By integrating regional attributes and quantitative height information, this method can more accurately depict the irregular shape of water body cross sections in real-world scenarios.
[0143] It should be noted that this embodiment may also be an improvement based on any one or more of the first, second, fourth, and fifth embodiments.
[0144] It is easy to see that in this embodiment, by using a hierarchical depth projection algorithm to determine the height information of water boundary occluders, the height data of occluders such as banks and bridge piers can be accurately obtained, providing a physical basis for limiting the range of water fluctuations and avoiding unreasonable phenomena such as water overflowing occluders in the simulation. By using extended orthogonal camera capture technology to determine extended boundary information, the edge area of the water body beyond the initial field of view can be covered, solving the problem of incomplete boundary simulation caused by limited field of view. Compared with the shortcomings of traditional technologies where the boundary map only contains 1 bit of information and cannot define complex boundaries (such as the area where objects are embedded in the water), this solution achieves accurate capture of complex water surface boundaries by combining occluder height information and extended boundary information. Moreover, information storage and processing can be completed with low overhead through 8-bit encoding and other methods, meeting the needs of actual scenarios. Based on the results of the first two steps, the determined iterative constraints of the shallow water equation height field can correct the data when calculating and updating the height field data, so that the height field not only conforms to the physical barrier constraints formed by the obstruction, but also fully includes the water state within the extended boundary. This progressive processing provided in this embodiment can make the updated height field data more in line with the spatial constraints of the real scene. While improving the simulation realism, it can reduce invalid calculations caused by missing or incorrect boundary information, which is conducive to improving the overall simulation efficiency.
[0145] Seventh Embodiment
[0146] The seventh embodiment of this application relates to a water body interaction simulation method. The seventh embodiment is an improvement on the third embodiment, specifically in that: in this embodiment, the method further includes: generating a multi-precision hierarchical grid based on the updated height field data.
[0147] Because water bodies often exhibit complex surface geometry during interaction, deformable meshes have become a common rendering entity in games. Unlike conventional static meshes, deformable meshes have more vertices as control points, which participate in the simulation calculations before rendering. A large number of vertices significantly increases rendering overhead. The multi-precision hierarchical mesh generation scheme provided in this embodiment effectively balances rendering accuracy and overhead.
[0148] Optionally, in some embodiments, generating a multi-precision hierarchical mesh based on the updated height field data includes:
[0149] Step S501: Determine the multi-level asymptotic texture based on the updated height field data;
[0150] Step S502: Determine the height difference between adjacent blocks based on the current layer of the asymptotic texture;
[0151] Step S503: Determine the block merging region based on the height difference;
[0152] Step S504: Determine the parameterization scheme of the low-precision grid based on the block merging region;
[0153] Step S505: Determine the iterative generation strategy for the next level of asymptotic texture based on the block merging region and the parameterized representation scheme;
[0154] Step S506: Generate a multi-precision layer mesh based on the iteratively completed multi-level asymptotic texture.
[0155] In confirming the mesh accuracy level, this method only needs the height difference information to confirm the mesh accuracy level, and provides parameters for adjusting the height difference sensitivity. For devices with low performance budgets, the number of vertices can be further limited by parameter control. Each pixel on the height map represents the height of a unit of actual area. When generating the mesh using the reduction method, if the height difference between adjacent blocks is small, it is considered that a high-precision mesh is not needed to achieve a good result, and thus it continues to participate in the next level of reduction. At the same time, since the number of blocks to be compared for each confirmation increases with the increase of the level, a multi-level asymptotic texture of the height is generated first. For each lower level, the multi-level asymptotic texture of the next level of height is used as the comparison basis to approximate a larger range of comparison results.
[0156] For step S501, for example, the height information can be downsampled according to distance based on the updated height field data to generate multi-level asymptotic textures with different precision. In other words, the multi-level asymptotic texture is a series of textures obtained by downsampling the height field data in order of distance from the observer, from near to far. The near-field texture retains fine height details, while the distant texture simplifies the data to reduce the amount of information.
[0157] For step S502, for example, the current layer asymptotic texture has been divided into multiple blocks with a certain precision, and each block represents a continuous water area. Based on the current layer asymptotic texture, the height data within adjacent blocks can be extracted, the height difference between the two blocks can be calculated (such as the maximum difference or the average difference), and the degree of height change of these blocks can be determined.
[0158] For step S503, for example, the merging range of adjacent blocks can be determined by comparing the height difference between adjacent blocks with a preset threshold: adjacent blocks with a difference less than the threshold are judged as mergeable regions due to their gradual height changes and similar features. Such continuous regions can adopt a minimalist quadrilateral mesh generation strategy with only 4 vertices and 6 indices to accurately present a minimalist structure; blocks with a difference exceeding the threshold are retained independently. For these regions with discontinuous height changes and complex shapes, a conventional mesh generation strategy with at least 5 vertices and 9 indices can be adopted to preserve details through denser vertices and indices. At the same time, in terms of style generation, since the deformable parts of the mesh are all generated based on player interaction, the interaction effect is only reflected in a small area of the mesh. Most of the remaining areas only require the coarsest level of precision mesh style (only 4 vertices and 6 indices are needed for description), while other conventional styles require at least 5 vertices and 9 indices. This method can save about 1 / 3 of the vertex data while ensuring that the mesh rendering effect remains unchanged by special processing of the coarsest style. This approach reduces the number of unnecessary blocks while ensuring simulation accuracy and presentation quality, thus achieving optimized resource allocation.
[0159] For step S504, for example, the block merging region is a large area formed by merging multiple adjacent small blocks. The parameterized representation scheme of the low-precision mesh describes the shape of this region through mathematical formulas or simplified models (such as approximations using planes or simple curved surfaces), replacing the original fine mesh. This approach can significantly reduce the number of mesh vertices while maintaining the overall morphological characteristics of the region, thus reducing data storage and computational costs.
[0160] Regarding step S505, for example, the block merging region is used to clarify the range that can be simplified in the current level. The parameterized representation scheme provides a simplification method. Combining the two, iterative parameters such as the downsampling ratio and merging threshold of the texture in the next level can be determined. For example, a greater simplification is applied to merged regions, while unmerged detailed regions are kept relatively refined. A multi-level texture system from near to far is gradually constructed through iterative generation. In terms of mesh data generation, this method uses a method of directly generating indexes within blocks to generate vertex data. Specifically, within each block that needs to generate vertices, a data region is obtained through global synchronization to write the information of the current block. This method can generate a compact global index in one process, which can avoid conflicts in mesh data writing and make the mesh data as compact as possible. At the same time, since the area to be simulated is small, the data generation of this method only requires one processing, which can save the extra overhead of multiple processing in traditional methods.
[0161] For step S506, for example, the iteratively completed multi-level asymptotic texture contains height information of different precision from near to far. By converting the texture data of each level into a three-dimensional mesh (high precision fine mesh for near objects and low precision coarse mesh for distant objects), a mesh system that can dynamically adjust the precision according to the viewing distance can be constructed, which can both ensure the realism of near details and reduce the computational load of distant scenes.
[0162] For example, taking a simulated lake surface grid as an example: In step S501, based on the updated height field data of the lake, a multi-level progressively farther texture is generated from the shore to the center of the lake, with the near texture retaining ripple details and the distant texture simplified to smooth height information; In step S502, for the current level texture, the height difference between adjacent blocks (such as two adjacent 10×10 meter blocks on the shore) is calculated, and the average difference is 0.2 meters; In step S503, since 0.2 meters is less than the preset threshold of 0.5 meters, these two blocks are determined as... Merging regions; in step S504, a low-precision mesh parameterization scheme is formulated for the merged 20×10 meter region, and the height change of the region is approximated by a linear function; in step S505, based on the range of the merged region and the parameterization scheme, an iterative strategy for further downsampling of the region by 50% for the next level of texture is determined; in step S506, after all levels of texture are iteratively generated, a multi-precision mesh is generated by combining the data of each level: the shoreline is represented by a high-precision mesh to show ripples, and the distant center of the lake is represented by a low-precision mesh for simplification, taking into account both detail and efficiency.
[0163] It is worth mentioning that, in the process of generating multi-precision hierarchical meshes based on the updated height field data, the following optimizations can be achieved by combining the characteristics of the GPU computing pipeline: When processing mesh blocks corresponding to multi-level asymptotic textures, an appropriate mesh block processing strategy is determined based on the GPU computing pipeline configuration to ensure that it matches the precision requirements of the texture level; then, for the block merging regions and independent blocks determined in step S503 in each level, vertex / index data generation tasks are assigned to them according to the independent computing thread allocation strategy to improve the efficiency of parallel data generation; subsequently, the vertex / index data generated by each thread is uniformly written to the shared buffer through global synchronization instructions to provide unified data support for the low-precision mesh parameterization representation in step S504 and the multi-precision mesh generation in step S506; furthermore, based on the block merging results in step S503, an index cache dynamic update strategy is formulated to synchronize the cached data with the merged mesh structure, thereby achieving efficient processing and updating of multi-precision hierarchical mesh data.
[0164] It is understandable that traditional methods for large-scale terrain rendering, while requiring dynamic determination of rendering accuracy, do not require interaction, and the information defining the mesh subdivision levels (such as terrain height and normals) is fixed. However, interactive deformable mesh information changes dynamically with water fluctuations. If traditional methods were used to generate a large amount of information in real-time to confirm the levels, it would incur extremely high overhead, making it unsuitable for mobile devices. This embodiment, through a multi-level asymptotic texture and block merging mechanism, dynamically adjusts accuracy based solely on height differences, avoiding redundant information generation and significantly reducing the overhead of level confirmation.
[0165] like Figure 3 As shown, the specific application of the above-mentioned multi-precision hierarchical mesh in the water surface rendering and runtime workflow is as follows: Water surface rendering workflow: First, a height map is generated during the simulation phase; then, the height map is downsampled to generate multi-level asymptotic textures. Specifically, the region corresponding to one pixel in the height map is used as a unit, and each 2x2 block is used as a processing unit. The maximum height within each unit is taken as the height of the corresponding position of the next level of multi-level asymptotic texture. This process is repeated level by level to finally generate a 4-level multi-level asymptotic texture with the maximum height value; then, block testing is performed to determine the subdivision level of each block, starting from the highest precision level 0 and processing upwards level by level: if If the previous level is greater than 0, first check if the current position has been marked in the previous level. If so, mark it as processed. If the current level is greater than 0 and has not been marked in the previous step, then check if its adjacent positions in the previous level are marked. If so, mark it as processed in the previous level and determine the block style. If it has not been marked in the above steps, use the multi-level asymptotic texture of the current level to determine if the height difference between the current position and the adjacent area exceeds the threshold. If it does, mark it as needing to be subdivided. After all blocks have been processed, spread the markings of the marked sub-blocks in the current level to their respective 2x2 areas. Finally, based on the above markings and styles, generate the final mesh information level by level.
[0166] The runtime process is as follows: First, the water surface manager is initialized, which includes loading and initializing GPU resources, as well as initializing the buffer information of all floating objects and uploading it to the GPU; then the water surface manager executes the per-frame refresh logic, that is, it listens to the player's position to determine whether the water body is activated. If activated, the water body is obtained and the iteration time interval is calculated. When the interval reaches the set value, the water body is added to the simulation queue; otherwise, the per-frame refresh continues. For all water bodies in the simulation queue, the following simulation operations are performed sequentially: refresh the dynamic boundary of the water body; check if there are any interactive objects in the interaction queue. If so, submit the interactive objects to the GPU buffer and initiate calculations to apply the effects to the current height field. Then, obtain the height field data of the next frame through the SWE height iteration equation. If there are no interactive objects, directly obtain the height field data of the next frame through SWE equation iteration; determine if the velocity field is enabled. If enabled, generate an approximate velocity field and then generate the normal. Otherwise, directly generate the normal; refresh all water body simulation results. If the water body needs to stop the simulation, add it to the stop simulation queue. Then, combine the generated water body information to simulate the motion of the sampling points in the floating object buffer. If it does not need to stop, directly simulate the motion of the sampling points; finally, continuously track the stop simulation queue and remove it from the simulation queue when the conditions are met.
[0167] It should be noted that this embodiment may also be an improvement based on any one or more of the first, second, fourth to sixth embodiments.
[0168] Understandably, traditional methods typically calculate all possible vertex indices within a large region when generating the final mesh data, then select all the vertices actually needed and reconstruct the indices. This process requires numerous synchronous operations across the entire region to complete the index reconstruction, which is inefficient for GPUs where parallelism is a core performance consideration. Furthermore, traditional methods apply a uniform generation process to all block styles during pattern generation, resulting in a significant number of redundant vertices.
[0169] It is easy to see that in the embodiments of this application, when generating multi-precision hierarchical meshes, multi-level asymptotic textures are first obtained based on the updated height field data. Then, mergeable regions are determined by the height difference between adjacent blocks, and a low-precision mesh parameterization scheme is formulated for the merged regions. Combined with these, an iterative generation strategy for determining the next level of texture is established to generate multi-precision meshes based on complete multi-level textures. In this process, multi-level textures adapt to the precision requirements of different viewing distances, block merging reduces redundant data, parameterization schemes reduce computational load, and iterative strategies ensure texture coherence. This allows the generated mesh to retain near-field details through fine parts and simplify some parts to optimize distant calculations, improving running efficiency while ensuring simulation realism. Compared with traditional deformable mesh rendering methods (such as high overhead due to direct rendering of high-vertex meshes and invalid triangles generated by hardware subdivision), this solution can efficiently achieve realistic rendering of complex water surfaces on mobile devices through dynamic precision adjustment and lightweight hierarchical confirmation mechanisms.
[0170] Eighth embodiment
[0171] The eighth embodiment of this application relates to a water body interaction simulation method. The eighth embodiment is an improvement on the first embodiment, specifically in that: in this embodiment, an optimization scheme is provided after generating differentiated water body fluctuation responses between interacting objects and floating objects.
[0172] This application also proposes a scheme for scheduling multiple water surfaces in a large scene using a streaming loading method. For multiple water bodies in a large-scale scene, the required water surfaces can be simulated on demand according to the player's position, while other water surfaces that do not need to be simulated are turned off without causing distortion problems such as water surface jumping. In this embodiment, the registration and scheduling process of water surfaces is the basic link to realize the streaming water surface scheduling strategy. Specifically, it can include: the scene streaming loading system loads water surface prefabs according to the current camera position to ensure that only water resources related to the field of view are loaded; after the water surface prefab is loaded, it first checks whether it is in a disabled state. If it is not disabled, it actively registers with the water surface manager to realize the association between the water body and the manager; then, the prefab reads the water body configuration information, initializes basic data and obtains boundary information to provide data support for the water surface manager to accurately identify and schedule water bodies.
[0173] Specifically, after generating the differentiated water wave responses of the interacting objects and the floating objects, the method may further include:
[0174] Step S601: Determine the flow-type water surface scheduling strategy based on the large-scale dynamic characteristics of the water body fluctuation response simulation results.
[0175] Step S602: Determine the loading range of the water body block according to the flow-type water surface scheduling strategy;
[0176] Step S603: Determine the differential adjustment mechanism for the physical field update frequency based on the loading range.
[0177] Regarding step S601, for example, the dynamic characteristics of a large-scale scene refer to the changing patterns of water body fluctuations over a wide area, such as wave propagation speed and the expansion trend of the affected area over time. By analyzing these characteristics, a flow-based water surface scheduling strategy can be formulated. Specifically, rules can be set for dynamically loading or unloading water body data by region and time period. For example, when simulating a lake, if waves spread from the center to the shore, the strategy will first load the data of the lake center area, and then load the shore area block when the waves approach the shore, while unloading the old data of the lake center that has already been simulated, thus achieving efficient data flow.
[0178] Regarding step S602, for example, because the data loading logic can be clearly defined through the streaming water surface scheduling strategy, the specific loading boundaries of water blocks can be further delineated based on the data loading logic. Here, the water block refers to a small, independent data unit into which a large scene is divided. For example, if the streaming water surface scheduling strategy is centered on the player's perspective, it can calculate the loading radius (e.g., 300 meters) based on the current wave position, determine the coordinate range and accuracy level of all blocks within this range, and ensure that the loaded blocks both cover the area required for the current simulation and avoid redundant data consuming resources.
[0179] For step S603, for example, the physical field is a dataset describing the state of the water body (e.g., a height field reflecting water surface elevation, a velocity field reflecting water flow), and the update frequency of the physical field refers to the number of times the data is refreshed per unit time. In this step, a differentiation mechanism can be set based on the importance of different blocks within the loading range (e.g., core areas require detailed simulation, while edge areas can be simplified): for example, for blocks within the loading range close to the observer, the physical field is updated 20 times per second to ensure detail; for edge blocks, it is updated 5 times per second to reduce computation, thus reducing the overall load while ensuring the accuracy of the core area.
[0180] For example, taking the simulation of wave propagation in a large reservoir as an example: In step S601, the dynamic characteristics of the reservoir waves propagating from the dam to the tail of the reservoir (such as wave speed of 0.5 m / s and arrival at the tail of the reservoir after 10 minutes) are analyzed to determine the flow-type water surface scheduling strategy: first load the block near the dam, then gradually load the middle area as the waves advance, and unload the block that has been stabilized by the dam at the same time; In step S602, based on this strategy and combined with the current wave position (100 meters away from the dam), the loading range is determined to be the water block within 200 meters before and after the wave front, accurately covering the current wave area; In step S603, for the core area within the loading range (within 100 meters of the wave front), the update frequency of the physical field (such as the height field) is set to 30 times per second to preserve details, and for the edge area (100-200 meters), it is set to 10 times per second to reduce the load, so as to achieve efficient simulation.
[0181] Optionally, in some embodiments, the differential adjustment mechanism for determining the physical field update frequency based on the loading range, i.e., step S603, may include:
[0182] The first-level LOD update strategy is determined based on the water block within the loading range and located in the core area of the field of view.
[0183] The second-level LOD update strategy is determined based on the water block within the loading range and located in the view transition zone;
[0184] The third-level LOD update strategy is determined based on the water block located within the loading range and at the edge of the field of view.
[0185] In this embodiment, corresponding physical field update strategies can be formulated based on the different field-of-view regions where the water blocks are located within the loading range: For water blocks located in the core field of view, a first-level LOD update strategy is adopted to update physical field data at the highest frequency, ensuring accurate representation of fluctuation details in this region; for water blocks located in the transitional field of view, a second-level LOD update strategy is implemented to update data at a medium frequency, balancing computational resources while preserving certain details; for water blocks located in the edge field of view, a third-level LOD update strategy is adopted to update data at a lower frequency, reducing computational load while meeting basic simulation requirements. This hierarchical strategy enables differentiated adjustments to physical field updates.
[0186] Optionally, in some embodiments: the first-level LOD update strategy enables velocity field calculation while simultaneously performing height field iteration at full precision to accurately capture the dynamic motion details of the water body; the second-level LOD update strategy disables velocity field calculation and only performs height field iteration at half precision, simplifying calculations while preserving the basic undulation characteristics of the water body; the third-level LOD update strategy freezes the height field data, retaining only basic rendering functions to maintain the display state of the water body with minimal resource consumption. Through such hierarchical settings, the computational intensity can be flexibly adjusted according to actual needs, achieving reasonable resource allocation.
[0187] It should be noted that this embodiment may also be an improvement based on any one or more of the first to seventh embodiments.
[0188] It is easy to see that in this embodiment, by analyzing the dynamic characteristics of the large-scale water surface scheduling strategy based on the simulation results of water body fluctuation response, on-demand loading and unloading of data can be achieved according to the dynamic change law of water body, avoiding redundant data occupying resources. Based on this scheduling strategy, the loading range of water body blocks can be determined, which can accurately cover the current required simulation area and ensure the effective use of core data. Furthermore, a differentiated adjustment mechanism for the physical field update frequency is formulated according to the loading range, which allows important areas to receive high-frequency updates to maintain accuracy, while reducing the frequency of secondary areas to reduce load. This solution specifically addresses the problem of the lack of a unified solution for handling large-scale multi-water surface scenarios in traditional technologies. Through streaming scheduling and differentiated updates, it significantly improves resource utilization efficiency while ensuring the realism of large-scale scenario simulation, achieving a balance between performance and effectiveness.
[0189] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this application. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this application.
[0190] Furthermore, some embodiments of this application also provide an electronic device. The electronic device can be various forms of digital computer, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, etc. The electronic device can also be various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices.
[0191] The electronic device includes: one or more processors; and a memory storing computer program instructions that, when executed, cause the processor to perform the steps of the methods provided in any one or more of the above embodiments. Figure 4 An exemplary structural diagram of the electronic device is disclosed. The electronic device includes one or more processors 1101, a memory 1102, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components are interconnected via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations. The components, their connections and relationships, and their functions shown herein are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.
[0192] The electronic device may further include an input device 1103 and an output device 1104. The processor 1101, memory 1102, input device 1103 and output device 1104 may be connected by a bus or other means, as shown in the figure, which is connected by a bus.
[0193] Input device 1103 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 1104 may include a display device, auxiliary lighting device (e.g., LED), and haptic feedback device (e.g., vibration motor). The display device may include, but is not limited to, a liquid crystal display, a light-emitting diode display, and a plasma display. In some embodiments, the display device may be a touch screen.
[0194] To provide interaction with the user, the electronic device can be a computer. The computer has: a display device (e.g., a cathode ray tube or LCD monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback); and input from the user can be received in any form (e.g., voice input or tactile input).
[0195] In this embodiment, a computer-readable medium stores a computer program / instructions that, when executed by a processor, implement the steps of the methods provided in any one or more of the above embodiments. This computer-readable medium may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into that device. The aforementioned computer-readable medium carries one or more computer-readable instructions.
[0196] The memory 1102 can serve as a non-transitory computer-readable storage medium, used to store non-transitory software programs, non-transitory computer-executable programs, and modules. The processor 1101 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions, and modules stored in the memory 1102, thereby implementing the program instructions / modules corresponding to the methods provided in any one or more of the embodiments described above in this application.
[0197] The memory 1102 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 1102 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 1102 may optionally include memory remotely located relative to the processor 1101, and these remote memories can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0198] It should be noted that the computer-readable medium described in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections having one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, optical fibers, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0199] Computer-readable media include permanent and non-permanent, removable and non-removable media, which can store information by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory, static random access memory, dynamic random access memory, other types of random access memory, read-only memory, electrically erasable programmable read-only memory, flash memory or other memory technologies, read-only optical discs, digital versatile optical discs or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0200] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including local area networks (LANs) or wide area networks (WANs), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0201] In the above embodiments, all or part of the implementation can be achieved through software, hardware, firmware, or any combination thereof. For example, it can be implemented using an application-specific integrated circuit (ASIC), a general-purpose computer, or any other similar hardware device. In some embodiments, the software program of this application can be executed by a processor to implement the above steps or functions. Similarly, the software program of this application (including related data structures) can be stored in a computer-readable recording medium, such as RAM memory, magnetic or optical drives, floppy disks, and similar devices. In addition, some steps or functions of this application can be implemented in hardware, for example, as circuitry that cooperates with a processor to perform the various steps or functions.
[0202] The computer program product provided in this application includes one or more computer programs / instructions. When executed by a processor, these computer programs / instructions generate, in whole or in part, the processes or functions described in this application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0203] The flowcharts or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-specific system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0204] The scope of this application is defined by the appended claims rather than the foregoing description, and is therefore intended to encompass all variations falling within the meaning and scope of equivalents of the claims. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device in software or hardware. Terms such as "first," "second," etc., are used only for distinguishing descriptions and do not indicate any particular order, nor should they be construed as indicating or implying relative importance.
[0205] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily made by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims, and the above embodiments should be regarded as exemplary and non-limiting.
Claims
1. A method for simulating water body interaction, characterized in that, The method includes: A general influence module for determining the impact of interactive objects on the physical field of water bodies; the general influence module is used to determine the influence parameters of the interactive objects on the physical field of water bodies in space; A dedicated response module for determining the dynamic response of a floating object to a water body; the dedicated response module is used to determine the dynamic response parameters of the floating object to the water body. Based on the synergistic effect of the physical fields between the influencing parameters and the dynamic response parameters, differentiated water wave responses of interacting objects and floating objects are generated.
2. The method according to claim 1, characterized in that, The method for determining the general impact module includes: Based on the spatial location of the interactive object, determine the static sampling point; Determine dynamic sampling points based on the triggering state of preset logical events; The set of physical field action points of the general influence module consists of static sampling points and dynamic sampling points.
3. The method according to claim 1, characterized in that, The method for determining the dedicated response module includes: The anchor point is determined based on the position of the center of gravity of the floating object; Based on the dynamic parameters of the floating object, the scope parameters are determined; the scope parameters are used to define the sampling range of the dedicated response module in physical space. The dedicated response module consists of the anchor point and the scope parameter.
4. The method according to claim 1, characterized in that, The step of generating differentiated water wave responses between interacting objects and floating objects based on the synergistic effect of the physical fields between the influencing parameters and the dynamic response parameters includes: Based on the first sampling data submitted by the general influence module, the second sampling data submitted by the dedicated response module, and the shallow water equation, the updated height field data is determined. Determine the gradient data of the updated height field data; Based on the updated height field data and the gradient data, the water body wave response is simulated and the simulation results are output.
5. The method according to claim 4, characterized in that, The step of simulating the water body wave response and outputting simulation results based on the updated height field data and the gradient data includes: Based on the gradient data, an approximate velocity field is determined; Based on the device performance configuration and the triggering state of interactive events, hierarchical control processing is performed on the approximate velocity field to obtain a controlled velocity field; Based on the updated height field data and the controlled velocity field, the water body wave response is simulated and the simulation results are output.
6. The method according to claim 5, characterized in that, The step of performing hierarchical control processing on the approximate velocity field based on device performance configuration and the triggering state of interactive events to obtain a controlled velocity field includes: For low-end devices, the first control strategy is executed; in the first control strategy, the velocity field calculation is globally turned off, so that the controlled velocity field is null. For mid-to-high-end equipment, a second control strategy is implemented; in the second control strategy, when an interaction event exists, the approximate velocity field is used as the controlled velocity field; when no interaction event exists, the controlled velocity field is set to null.
7. The method according to claim 4, characterized in that, The step of simulating the water body wave response and outputting simulation results based on the updated height field data and the gradient data includes: Based on the updated height field data and the gradient data, the motion simulation of the floating object is implemented in the GPU vertex shader.
8. The method according to claim 7, characterized in that, The step of simulating the motion of the floating object in the GPU vertex shader based on the updated height field data and the gradient data includes: Based on the updated height field data, determine the sampling point identifier associated with the anchor point position of the dedicated response module; Based on the sampling point identifier, the anchor point position, and the gradient data, the motion simulation of the floating object is implemented in the GPU vertex shader.
9. The method according to claim 8, characterized in that, The step of simulating the motion of the floating object in the GPU vertex shader based on the sampling point identifier, the anchor point position, and the gradient data includes: The height value and gradient data of the corresponding location are obtained based on the sampling point identifier; Based on the height value, determine the vertical displacement component; The horizontal displacement component is determined based on the gradient data and the anchor point position; Based on the vertical displacement component and the horizontal displacement component, the displacement vector of the floating object vertex is determined, so as to realize the motion simulation of the floating object in the GPU vertex shader according to the displacement vector.
10. The method according to claim 4, characterized in that, Before determining the updated height field data based on the first sampling data submitted by the general influence module, the second sampling data submitted by the dedicated response module, and the shallow water equation, the method further includes: The height information of water body boundary obstructions is determined based on the hierarchical depth projection algorithm; Based on the extended orthogonal camera acquisition technology, the extended boundary information is determined; Based on the height information of the obstruction and the extended boundary information, the constraint conditions for the shallow water equation height field iteration are determined; the constraint conditions are used to correct the updated height field data.
11. The method according to claim 10, characterized in that, The determination of the height information of water body boundary obstructions based on the hierarchical depth projection algorithm includes: Based on the hierarchical depth projection algorithm, determine the multi-level depth detection ray projection strategy; Based on the spatial topological relationship of the ray collision points, determine the strategy for generating continuous closed boundaries; The height information of the water body boundary obstruction is determined based on the height value of the boundary vertex.
12. The method according to claim 10, characterized in that, The determination of extended boundary information based on extended orthogonal camera acquisition technology includes: Based on the vertical downward shooting strategy of the orthogonal camera, underwater occlusion information is determined; Based on the orthogonal camera's vertical upward shooting strategy, determine the water surface obstruction information; Based on the underwater obstruction information and the above-water obstruction information, the extended boundary information is determined.
13. The method according to claim 4, characterized in that, The method further includes: Based on the updated height field data, determine the multi-level gradient texture; Determine the height difference between adjacent blocks based on the current layer of the asymptotic texture; Based on the height difference, the block merging region is determined; Based on the block merging region, determine the parameterization representation scheme of the low-precision grid; Based on the block merging region and the parameterized representation scheme, determine the iterative generation strategy for the next level of asymptotic texture; Based on the iteratively completed multi-level asymptotic texture, a multi-precision hierarchical mesh is generated.
14. The method according to claim 1, characterized in that, The differentiated water body fluctuation response is achieved through the following methods: Based on the set of physical field action points of the general influence module, the static basic fluctuations of the static interaction region are generated; Based on the domain parameters and kinematic state of the dedicated response module, local dynamic fluctuations of the floating object are generated; The differentiated water body fluctuation response is generated based on the static basic fluctuation and the dynamic fluctuation.
15. The method according to any one of claims 1 to 14, characterized in that, After generating the differentiated water wave responses of the interacting objects and the floating objects, the method further includes: Based on the large-scale dynamic characteristics of the water body fluctuation response simulation results, a flow-type water surface scheduling strategy is determined. Based on the aforementioned flow-type water surface scheduling strategy, the loading range of the water body block is determined; Based on the loading range, a differentiated adjustment mechanism for the physical field update frequency is determined.
16. The method according to claim 15, characterized in that, The differential adjustment mechanism for determining the physical field update frequency based on the loading range includes: The first-level LOD update strategy is determined based on the water block within the loading range and located in the core area of the field of view. The second-level LOD update strategy is determined based on the water block within the loading range and located in the view transition zone; The third-level LOD update strategy is determined based on the water block located within the loading range and at the edge of the field of view.
17. An electronic device, characterized in that, The electronic device includes: One or more processors; and A memory storing computer program instructions, which, when executed, cause the processor to perform the steps of the method as described in any one of claims 1 to 16.
18. A computer-readable medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 16.
19. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method described in any one of claims 1 to 16.