Virtual water ripple rendering method and device, computer program product and electronic equipment
By storing dynamic ripple information on the water surface when it is struck into the screen space middleware for rendering, the problem of excessively high performance requirements for water rendering methods is solved, achieving stable rendering and strong real-time interactive performance, and supporting large-scale scenes.
Patent Information
- Application Number
- CN202511266186.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2025-12-12
AI Technical Summary
Existing water rendering technologies have excessively high performance requirements, leading to a surge in computational load, making them unsuitable for large-scale scenarios and impacting game experience and real-time interactive performance.
By determining the impact information when the target water surface is hit, storing the dynamic ripple information in the middleware of the screen space, and using the middleware of the screen space to render the water ripple effect, the dependence on CPU and GPU resources is reduced.
It achieves stable rendering effects and low memory and performance overhead, supports real-time interactive performance in large-scale scenes, and enhances the gaming experience.
Smart Images

Figure CN121120900A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of rendering, and in particular, to a virtual water ripple rendering method, a virtual water ripple rendering device, a computer program product and an electronic device. BACKGROUND
[0002] Water body rendering is widely used in game development, film special effects, virtual reality, digital twin and disaster prevention simulation scenarios, and its rendering needs to meet two core requirements: one is to generate real-time water body dynamic effects with physical realism, and the other is to support interaction with the water body environment. However, the water body rendering methods commonly used in related technologies generally have excessively high performance requirements. For example, some fluid solving algorithms or rendering-to-texture processes often need to occupy a large amount of additional CPU (Central Processing Unit) or GPU (Graphics Processing Unit) resources, which will cause a dramatic increase in computing load and thus cause a large fluctuation in frame rate. This situation not only seriously affects the game experience of competitive players, but also weakens the real-time interaction performance, making it difficult to apply to large-scale scenes.
[0003] It should be noted that the information disclosed in the above background section is only used to strengthen the understanding of the background of the present disclosure, and therefore can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY
[0004] The present disclosure provides a virtual water ripple rendering method, a virtual water ripple rendering device, a computer program product and an electronic device to at least partially solve the problem that the water body rendering method in related technologies has high performance requirements and is difficult to apply to large-scale scenes.
[0005] According to a first aspect of the present disclosure, a virtual water ripple rendering method is provided, the method comprising: when a target water surface is hit, determining hit information of the target water surface, and based on the hit information of the target water surface, determining dynamic ripple information of the target water surface; storing the dynamic ripple information of the target water surface to an intermediate part of a screen space; and through the intermediate part of the screen space, rendering a water ripple effect on the screen for the target water surface.
[0006] According to a second aspect of this disclosure, a virtual water ripple rendering apparatus is provided. The apparatus includes: a ripple information determination module, configured to determine impact information of the target water surface when the target water surface is impacted, and to determine dynamic ripple information of the target water surface based on the impact information; a ripple information caching module, configured to store the dynamic ripple information of the target water surface in middleware of a screen space; and a ripple information rendering module, configured to render water ripple effects on the target water surface on the screen through the middleware of the screen space.
[0007] According to a third aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the virtual water ripple rendering method of the first aspect and its possible implementations.
[0008] According to a fourth aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the virtual water ripple rendering method of the first aspect and possible implementations thereof by executing the executable instructions.
[0009] The technical solution disclosed herein has the following beneficial effects:
[0010] In the aforementioned virtual water ripple rendering process, when the target water surface is hit, the impact information of the target water surface is determined, and based on the impact information, the dynamic ripple information of the target water surface is determined; the dynamic ripple information of the target water surface is stored in the middleware of the screen space; and the water ripple effect is rendered on the screen for the target water surface through the middleware of the screen space. This disclosure, by storing the dynamic ripple information generated when the target water surface is hit in the middleware of the screen space and using the middleware of the screen space for water ripple effect rendering, not only achieves stable rendering results but also has low memory and performance overhead, strong real-time interactive performance, and can support large-scale scenes. Attached Figure Description
[0011] Figure 1 This diagram illustrates a flowchart of a virtual water ripple rendering method in this exemplary embodiment;
[0012] Figure 2 This diagram illustrates a ripple mapping in this exemplary embodiment;
[0013] Figure 3 A schematic diagram of an interface showing a water ripple effect on a shallow water surface in this exemplary embodiment is shown.
[0014] Figure 4 This diagram illustrates a ripple rendering process for an interactive water surface in this exemplary embodiment.
[0015] Figure 5A This illustration shows a schematic diagram of water ripple rendering in a shooting pool scene according to this exemplary embodiment;
[0016] Figure 5B This illustration shows a water ripple rendering diagram of a shooting scene with water accumulation on the ground in this exemplary embodiment.
[0017] Figure 5C This illustration shows a water ripple rendering diagram of a shooting scene on a distant water surface in this exemplary embodiment;
[0018] Figure 5D This illustration shows a water ripple rendering of a person walking on accumulated water in this exemplary embodiment.
[0019] Figure 5E This illustration shows a water ripple rendering diagram in a rapids scene according to this exemplary embodiment, illustrating the effect of the rapids.
[0020] Figure 6 This diagram illustrates a structural block diagram of a virtual water ripple rendering device according to this exemplary embodiment;
[0021] Figure 7 An electronic device for implementing the above-described virtual water ripple rendering method is shown in this exemplary embodiment. Detailed Implementation
[0022] Exemplary embodiments of this disclosure will be described more fully below with reference to the accompanying drawings.
[0023] The accompanying drawings are schematic illustrations of this disclosure and are not necessarily drawn to scale. Some block diagrams shown in the drawings may be functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in hardware modules or integrated circuits, or in networks, processors, or microcontrollers. Implementations can be carried out in various forms and should not be construed as limited to the examples set forth herein. The features, structures, or characteristics described in this disclosure can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough description of embodiments of this disclosure. However, those skilled in the art will recognize that one or more specific details may be omitted when implementing the technical solutions of this disclosure, or other methods, components, apparatuses, steps, etc., may be used to replace one or more specific details.
[0024] Commonly used water rendering techniques in related technologies generally have excessively high performance requirements. For example, some fluid calculation algorithms or rendering-to-texture processes often require a large amount of additional CPU (Central Processing Unit) or GPU (Graphics Processing Unit) resources, which leads to a surge in computational load and consequently, significant frame rate fluctuations. This not only severely impacts the gaming experience for competitive players but also weakens real-time interactive performance, making it unsuitable for large-scale scenarios.
[0025] In view of one or more of the above-mentioned problems, exemplary embodiments of this disclosure provide a virtual water ripple rendering method, a virtual water ripple rendering apparatus, a computer program product, and an electronic device.
[0026] In one alternative implementation, refer to Figure 1 The flowchart shown illustrates a method for rendering virtual water ripples, which may include the following steps S110 to S130:
[0027] Step S110: When the target water surface is hit, determine the impact information of the target water surface, and determine the dynamic ripple information of the target water surface based on the impact information of the target water surface.
[0028] Step S120: Store the dynamic ripple information of the target water surface into the middleware of the screen space;
[0029] Step S130: Render water ripple effects on the target water surface on the screen using middleware in the screen space.
[0030] Figure 1 The method shown stores the dynamic ripple information generated when the target water surface is hit into the middleware in the screen space, and uses the middleware in the screen space to render the water ripple effect. This not only results in stable rendering, but also has low memory and performance overhead, strong real-time interactive performance, and can support large-scale scenes.
[0031] The following is about Figure 1 Each step in the process will be explained in detail.
[0032] In step S110, when the target water surface is hit, the impact information of the target water surface is determined, and the dynamic ripple information of the target water surface is determined based on the impact information of the target water surface.
[0033] The target water surface can be a virtual interactive water surface to be rendered in a virtual terrain scene. This interactive water surface refers to a water surface that can produce corresponding ripples when impacted. For example, the impact on the target water surface could be, for instance, being stepped on, being shot, or being exploded; this disclosure does not specifically limit this. For example, the terrain scene can be a virtual road surface, a virtual pond, a virtual sewer, or other virtual terrain scene; this disclosure does not specifically limit this.
[0034] Optionally, the depth of the target water surface may be less than a preset specific threshold, and this disclosure does not specifically limit this.
[0035] The impact information on the target water surface refers to the impact information received by the target water surface from other objects. These other objects can be, for example, walking feet, falling bullets, or explosive debris.
[0036] Among them, the dynamic ripple information of the target water surface refers to the ripple information generated when the target water surface is hit, which can characterize the dynamic shape of the water waves formed when the target water surface is impacted.
[0037] In one optional implementation, the determination of impact information of the target water surface when it is struck, and the determination of dynamic ripple information of the target water surface based on the impact information, can be achieved through the following steps: receiving the impact signal of the target water surface based on the impact body of the target water surface; determining the impact information corresponding to the impact signal according to the impact signal of the target water surface; wherein, the impact information includes any one or more of the impact position, impact direction, and impact force; and determining the dynamic ripple information of the target water surface according to the impact information corresponding to the impact signal.
[0038] Among them, the water surface impact object is used to characterize the range of impact that the water surface can receive, and can be used to determine whether an impact signal has been received through collision detection.
[0039] Among them, the impact signal is used to characterize the signal that the target water surface is impacted.
[0040] For example, collision detection can be performed between the target water surface and other objects in the terrain scene (such as walking feet, falling bullets, explosion debris, etc.) to receive the target water surface impact signal.
[0041] Specifically, if a collision between another object and the target water surface is detected, it indicates that the target water surface has received an impact signal; if no collision between another object and the target water surface is detected, it indicates that the target water surface has not received an impact signal.
[0042] If the object on the target water surface receives the impact signal from the target water surface, the impact information corresponding to the impact signal can be determined based on the impact signal; wherein, the impact information may include, but is not limited to, any one or more of the impact location, impact direction, and impact force.
[0043] Once the impact information is determined, impact simulation can be performed based on the impact information corresponding to the impact signal to determine the dynamic ripple information of the target water surface.
[0044] By receiving the impact signal from the target water surface through the target water surface receiver, real-time interaction with the target water surface can be achieved, enhancing the realism of the scene.
[0045] In one optional implementation, the determination of the dynamic ripple information of the target water surface based on the impact information corresponding to the impact signal can be achieved through the following steps: based on the impact position and ripple map corresponding to the impact signal, water ripple particles are emitted to generate a drawable ripple mesh; based on the impact direction and impact force corresponding to the impact signal, the drawable ripple mesh is triggered to simulate the impact and obtain the dynamic ripple information of the target water surface.
[0046] Among them, the ripple map is a texture image used to simulate the effect of ripples on the water surface. For example, such as... Figure 2 The diagram shown provides a schematic of a ripple texture.
[0047] Among them, water ripple particles are particles emitted and managed by a particle system, used to simulate water ripples.
[0048] Optionally, water ripple particles can be emitted at the hit location, and their behavior can be guided according to a ripple map to simulate water surface texture. By generating corresponding water ripple particles at the trigger location, the interaction is simple and easy to implement.
[0049] Among them, the drawable ripple mesh can be a mesh constructed from water ripple particles. By generating the drawable ripple mesh, scattered particles can be connected to form a mesh structure with a specific shape.
[0050] Optionally, the impact simulation can be triggered by the impact direction and impact force corresponding to the impact signal to obtain dynamic ripple information of the target water surface. For example, the movement of water ripple particles can be controlled according to the impact direction and impact force corresponding to the impact signal to make the drawable ripple mesh generate dynamic ripple information.
[0051] By guiding the behavior of water ripple particles through ripple mapping, the detailed representation of the ripples can be controlled, making the simulation effect more vivid and richer in detail.
[0052] Optionally, the generated water ripple particles can be configured with a lifecycle parameter. The generated water ripple particles can be destroyed after their lifecycle ends, restoring the target water surface to its original state. For example, the lifecycle of the water ripple particles can be determined based on the impact force corresponding to the impact signal; for instance, a greater impact force results in a longer lifecycle, and a smaller impact force results in a shorter lifecycle. Alternatively, the lifecycle of the water ripple particles can be determined based on their relative positions; for instance, the outermost position results in a shorter lifecycle, and the innermost position results in a longer lifecycle.
[0053] In step S120, the dynamic ripple information of the target water surface is stored in the middleware of the screen space.
[0054] In this context, middleware in screen space refers to middleware that operates in screen space (i.e., the two-dimensional pixel level that is ultimately output to the screen).
[0055] By storing the dynamic ripple information of the target water surface into middleware in the screen space, the visual effects can be efficiently enhanced and optimized without processing a large amount of complex 3D scene data.
[0056] In one optional implementation, the middleware that stores the dynamic ripple information of the target water surface into the screen space can be implemented through the following steps: using a first material, storing the dynamic ripple information of the target water surface into the middleware of the screen space in the water rendering channel; wherein the first material is a water material.
[0057] The first material can be a custom water material, used when storing the dynamic ripple information of the target water surface in the middleware of the screen space. The water rendering channel refers to the channel that processes the water part in the screen display separately.
[0058] By using a first material, the dynamic ripple information of the target water surface is stored in the middleware of the screen space in the water rendering channel, so as to convert the game interaction data into rendering-usable data, thereby providing a readable data foundation for rendering.
[0059] Optionally, the water rendering pass can reuse the view projection parameter using shader parameter bodies. The view projection parameter is used to project the drawable ripple mesh from the 3D coordinates of the terrain scene where the target water surface is located to the 2D coordinates of the screen space.
[0060] Among them, the drawable ripple mesh is triggered by a particle emitter and can be a drawable ripple mesh carrying dynamic ripple information.
[0061] For example, in the water rendering channel, the drawable ripple mesh carrying dynamic ripple information can be projected from the three-dimensional coordinates of the terrain scene where the target water surface is located to the two-dimensional coordinates of the screen space according to the view projection parameters, so that the dynamic ripple information of the target water surface can be stored in the middleware of the screen space.
[0062] Optionally, the dynamic ripple information may include any one or more of the following: ripple normal direction information, water surface height information, and foam concentration information.
[0063] Optionally, the middleware in screen space may include a target texture map that is the same size as the screen, and the target texture map includes R channel, G channel, B channel, and A channel.
[0064] Among them, the target texture can be used to store dynamic ripple information.
[0065] Optionally, in large-scale scenes, when improving processing efficiency by reducing resolution (i.e. performing effect degradation processing), a half-resolution target map can be used to store dynamic ripple information to reduce the amount of cache. This process does not require resolution correction based on terrain and has relatively low performance overhead.
[0066] In one optional implementation, the middleware that stores the dynamic ripple information of the target water surface into the screen space can be implemented through the following steps: storing the ripple normal direction information into the R channel and G channel; storing the water surface height information into the B channel; and storing the foam concentration information into the A channel.
[0067] By storing dynamic ripple information of different dimensions in different channels, it is possible to achieve diverse ripple expression effects.
[0068] In step S130, a water ripple effect is rendered on the target water surface on the screen using middleware in the screen space.
[0069] In one optional implementation, the above-mentioned rendering of water ripple effects on the target water surface on the screen through the middleware of the screen space can be achieved through the following steps: according to the stored information of the middleware of the screen space, using a second material, fitting the water ripple effect on the target water surface, and rendering the water ripple effect on the target water surface on the screen; wherein, the second material is a transparent or semi-transparent material.
[0070] The second material is the material used to fit the water ripple effect on the target water surface.
[0071] For example, in the rendering pipeline, by reading the stored information of the middleware in screen space, and based on the read stored information, using a second material, a water ripple effect for the target water surface can be fitted, and the water ripple effect of the target water surface can be rendered on the screen, such as...Figure 3 As shown, this is a schematic diagram of an interface that provides a water ripple effect on a shallow water surface.
[0072] Optionally, in practical applications, the resolution of the target texture can be reduced to decrease the storage information of the middleware in the screen space, thereby reducing the effect degradation. This can further improve processing efficiency while ensuring that the effect degradation is convenient and controllable, so as to better support large-scale scenes and reduce screen stuttering.
[0073] Optionally, in practical applications, the effect can be degraded by reducing the number of emitted water ripple particles. This ensures that the effect degradation is convenient and controllable while further improving processing efficiency to better support large-scale scenes and reduce screen stuttering.
[0074] In one alternative implementation, the virtual water wave rendering method of this disclosure can be implemented by modifying a conventional rendering pipeline.
[0075] For example, a new material property can be added: bCustomWater (the material property corresponding to the water material). Mesh that needs to draw ripples can use a material with this property, namely the first material mentioned above.
[0076] For example, an FCustomWaterPassMeshProcessor can be created, which can generate GPU-readable rendering instructions on the rendering thread.
[0077] For example, the CustomWaterPass (water body rendering pass) can be configured to reuse view projection parameters using the shader parameter body FCustomWaterPassParameters.
[0078] For example, a new method RenderCustomWater can be added to FDeferredShadingSceneRenderer to insert the processing of CustomWaterPass before the flow of fitting a water ripple effect for the target water surface using a second material.
[0079] For example, a CustomWaterGBuffer (screen-space middleware) can be created in the CustomWaterPass (water rendering channel) as the main output object for water surface information, and the format can be PF_R8G8B8A8_SNORM. The RG channels can store ripple normal direction information, the B channel can store water surface height information, and the A channel can store foam concentration information.
[0080] For example, a CustomWaterGBuffer (screen-space middleware) can be configured into a SceneTexture to access dynamic ripple information of the target water surface in a second material.
[0081] For example, such as Figure 4 As shown, a flowchart for rendering interactive water surface ripples is provided, which may include the following steps:
[0082] Step S401: Based on the target water surface impact object, receive the impact signal of the target water surface;
[0083] Step S402: Based on the impact signal on the target water surface, determine the impact information corresponding to the impact signal; wherein, the impact information includes any one or more of the following: impact location, impact direction, and impact force;
[0084] Step S403: Based on the impact location corresponding to the impact signal and the ripple map, emit water ripple particles to generate a drawable ripple mesh.
[0085] Step S404: Based on the impact direction and impact force corresponding to the impact signal, trigger the drawable ripple mesh to simulate the impact and obtain the dynamic ripple information of the target water surface.
[0086] Step S405: Using the first material, store the dynamic ripple information of the target water surface in the middleware of the screen space in the water rendering channel; wherein the first material is the water material.
[0087] Step S406: Based on the storage information of the middleware in the screen space, use the second material to fit the water ripple effect for the target water surface, and render the water ripple effect on the target water surface on the screen; wherein, the second material is a transparent or semi-transparent material.
[0088] Figure 4 The rendering method shown is efficient and simple, requires no additional hardware or software support, and has strong compatibility.
[0089] For example, such as Figure 5A As shown, a schematic diagram of water ripple rendering in a shooting pool scene is provided; for example, as... Figure 5B As shown, a schematic diagram of water ripple rendering is provided for a shooting scene with water accumulation on the ground; for example, as... Figure 5C As shown, this is a schematic diagram illustrating the rendering of water ripples in a scene where a gun is fired at a distant water surface; for example, as... Figure 5D As shown, a schematic diagram of water ripples on water is provided, illustrating walking on accumulated water; for example, as... Figure 5E As shown, a schematic diagram of water ripple rendering in a rapids scene is provided, illustrating the effect of water ripples in a rapids scene.
[0090] Exemplary embodiments of this disclosure also provide a virtual water ripple rendering apparatus, with reference to Figure 6 As shown, the virtual water ripple rendering device 600 may include the following program modules:
[0091] The ripple information determination module 610 is used to determine the impact information of the target water surface when the target water surface is hit, and to determine the dynamic ripple information of the target water surface based on the impact information.
[0092] The ripple information caching module 620 is a middleware used to store the dynamic ripple information of the target water surface into the screen space.
[0093] The ripple information rendering module 630 is used to render water ripple effects on the target water surface on the screen through middleware in screen space.
[0094] In an optional implementation, based on the aforementioned scheme, the ripple information determination module 610 includes: an impact signal receiving module, used to receive an impact signal from the target water surface based on the impacted body on the target water surface; an impact information determination module, used to determine the impact information corresponding to the impact signal based on the impact signal from the target water surface; wherein the impact information includes any one or more of impact position, impact direction, and impact force; and an impact simulation module, used to determine the dynamic ripple information of the target water surface based on the impact information corresponding to the impact signal.
[0095] In one optional implementation, based on the aforementioned scheme, the impact simulation module can be configured to: emit water ripple particles according to the impact position and ripple map corresponding to the impact signal to generate a drawable ripple mesh; and trigger the drawable ripple mesh to perform impact simulation according to the impact direction and impact force corresponding to the impact signal to obtain dynamic ripple information of the target water surface.
[0096] In an optional implementation, based on the aforementioned scheme, the ripple information caching module 620 can be configured to: use a first material to store the dynamic ripple information of the target water surface in the middleware of the screen space in the water rendering channel; wherein the first material is a water material.
[0097] In an alternative implementation, based on the aforementioned scheme, the water rendering channel reuses the view projection parameters using shader parameter volumes. The view projection parameters are used to project the drawable ripple mesh from the three-dimensional coordinates of the terrain scene where the target water surface is located to the two-dimensional coordinates of the screen space. The drawable ripple mesh is triggered by a particle emitter.
[0098] In one alternative implementation, based on the aforementioned scheme, the dynamic ripple information includes any one or more of the following: ripple normal direction information, water surface height information, and foam concentration information.
[0099] In one alternative implementation, based on the aforementioned scheme, the middleware of the screen space includes a target texture map with the same size as the screen, and the target texture map includes an R channel, a G channel, a B channel, and an A channel.
[0100] In one optional implementation, based on the aforementioned scheme, the ripple information caching module 620 can be configured to: store the ripple normal direction information in the R channel and the G channel; store the water surface height information in the B channel; and store the foam concentration information in the A channel.
[0101] In an optional implementation, based on the aforementioned scheme, the ripple information rendering module 630 can be implemented through the following steps: according to the storage information of the middleware in the screen space, using a second material, fitting the water ripple effect for the target water surface, and rendering the water ripple effect of the target water surface on the screen; wherein, the second material is a transparent or semi-transparent material.
[0102] The specific details of each part of the above-mentioned device have been described in detail in the method section of the implementation plan. For any undisclosed details, please refer to the implementation plan of the method section, and therefore will not be repeated here.
[0103] Exemplary embodiments of this disclosure also provide a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the aforementioned virtual water ripple rendering method.
[0104] In one embodiment, the computer program product can be a tangible product containing a computer program, such as a computer-readable storage medium storing the computer program. The readable storage medium can be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory, hard disk drive (HDD), solid-state drive (SSD), etc. For example, the computer program product can be implemented as a non-volatile storage medium storing the computer program, such as read-only memory, NAND flash memory, etc.
[0105] In one implementation, the computer program product can be an intangible product containing a computer program. For example, the computer program product can be implemented as a virtual digital product, such as an executable file, installation package, or other digital file storing the computer program.
[0106] Computer program code can be written in one or more programming languages. Examples of programming languages include C, Java, and C++. Program code can execute entirely on the user's computing device, partially on the user's computing device, or as a standalone software package. It can also execute partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, such as a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via an internet connection provided by a mobile network operator).
[0107] Computer programs can be carried or transmitted via signals such as electricity, magnetism, light, electromagnetic radiation, and infrared rays. Electronic devices can convert signals carrying computer programs into digital signals, thereby running the computer programs. When a computer program runs on an electronic device, its code causes the electronic device to execute (more specifically, the processor of the electronic device to execute) the method steps of various exemplary embodiments of this disclosure. Exemplarily, this may include the following steps:
[0108] When the target water surface is hit, the impact information of the target water surface is determined, and based on the impact information of the target water surface, the dynamic ripple information of the target water surface is determined.
[0109] Store the dynamic ripple information of the target water surface into middleware in the screen space;
[0110] The screen space middleware renders water ripple effects on the target water surface.
[0111] In an optional implementation, based on the aforementioned scheme, the determination of impact information of the target water surface when it is struck, and the determination of dynamic ripple information of the target water surface based on the impact information, can be achieved through the following steps: receiving an impact signal from the target water surface based on the impacted body; determining the impact information corresponding to the impact signal based on the impact signal; wherein the impact information includes any one or more of impact location, impact direction, and impact force; and determining the dynamic ripple information of the target water surface based on the impact information corresponding to the impact signal.
[0112] In an optional implementation, based on the aforementioned scheme, the determination of the dynamic ripple information of the target water surface according to the impact information corresponding to the impact signal can be achieved through the following steps: emitting water ripple particles to generate a drawable ripple mesh according to the impact position and ripple map corresponding to the impact signal; triggering the drawable ripple mesh to simulate the impact according to the impact direction and impact force corresponding to the impact signal, thereby obtaining the dynamic ripple information of the target water surface.
[0113] In an optional implementation, based on the aforementioned scheme, the middleware that stores the dynamic ripple information of the target water surface into the screen space can be implemented through the following steps: using a first material, storing the dynamic ripple information of the target water surface into the middleware of the screen space in the water rendering channel; wherein the first material is a water material.
[0114] In an alternative implementation, based on the aforementioned scheme, the water rendering channel reuses the view projection parameters using shader parameter volumes. The view projection parameters are used to project the drawable ripple mesh from the three-dimensional coordinates of the terrain scene where the target water surface is located to the two-dimensional coordinates of the screen space. The drawable ripple mesh is triggered by a particle emitter.
[0115] In one alternative implementation, based on the aforementioned scheme, the dynamic ripple information includes any one or more of the following: ripple normal direction information, water surface height information, and foam concentration information.
[0116] In one alternative implementation, based on the aforementioned scheme, the middleware of the screen space includes a target texture map with the same size as the screen, and the target texture map includes an R channel, a G channel, a B channel, and an A channel.
[0117] In an optional implementation, based on the aforementioned scheme, the middleware that stores the dynamic ripple information of the target water surface into the screen space can be implemented through the following steps: storing the ripple normal direction information into the R channel and G channel; storing the water surface height information into the B channel; and storing the foam concentration information into the A channel.
[0118] In an optional implementation, based on the aforementioned scheme, the above-mentioned rendering of water ripple effects on the target water surface on the screen through the middleware of the screen space can be achieved through the following steps: according to the storage information of the middleware of the screen space, using a second material, fitting the water ripple effect on the target water surface, and rendering the water ripple effect on the target water surface on the screen; wherein, the second material is a transparent or semi-transparent material.
[0119] In the above steps, by storing the dynamic ripple information generated when the target water surface is hit into the middleware of the screen space, and using the middleware of the screen space to render the water ripple effect, the rendering effect is not only stable, but also has low memory and performance overhead, strong real-time interactive performance, and can support large-scale scenes.
[0120] The exemplary embodiments of this disclosure also provide an electronic device capable of implementing the above-described virtual water ripple rendering method. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as program code. The processor executes the executable instructions to perform the method of this exemplary embodiment. Furthermore, the electronic device may also include a display for displaying a graphical user interface.
[0121] The following is for reference. Figure 7 The electronic device is illustrated by way of a general-purpose computing device. It should be understood that... Figure 7 The electronic device 700 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0122] like Figure 7 As shown, the electronic device 700 may include: a processor 710, a memory 720, a bus 730, an I / O (input / output) interface 740, a network adapter 750, and a display 760.
[0123] The memory 720 may include volatile memory, such as RAM 721 and cache unit 722, and may also include non-volatile memory, such as ROM 723. The memory 720 may also include one or more program modules 724, including but not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. For example, program module 724 may include the modules described above.
[0124] The processor 710 may include one or more processing units, such as an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor, and / or an NPU (Neural-Network Processing Unit).
[0125] The processor 710 can be used to execute executable instructions stored in the memory 720, such as performing any one or more method steps in this exemplary embodiment.
[0126] For example, processor 710 may perform the following steps:
[0127] When the target water surface is hit, the impact information of the target water surface is determined, and based on the impact information of the target water surface, the dynamic ripple information of the target water surface is determined.
[0128] Store the dynamic ripple information of the target water surface into middleware in the screen space;
[0129] The screen space middleware renders water ripple effects on the target water surface.
[0130] In an optional implementation, based on the aforementioned scheme, the determination of impact information of the target water surface when it is struck, and the determination of dynamic ripple information of the target water surface based on the impact information, can be achieved through the following steps: receiving an impact signal from the target water surface based on the impacted body; determining the impact information corresponding to the impact signal based on the impact signal; wherein the impact information includes any one or more of impact location, impact direction, and impact force; and determining the dynamic ripple information of the target water surface based on the impact information corresponding to the impact signal.
[0131] In an optional implementation, based on the aforementioned scheme, the determination of the dynamic ripple information of the target water surface according to the impact information corresponding to the impact signal can be achieved through the following steps: emitting water ripple particles to generate a drawable ripple mesh according to the impact position and ripple map corresponding to the impact signal; triggering the drawable ripple mesh to simulate the impact according to the impact direction and impact force corresponding to the impact signal, thereby obtaining the dynamic ripple information of the target water surface.
[0132] In an optional implementation, based on the aforementioned scheme, the middleware that stores the dynamic ripple information of the target water surface into the screen space can be implemented through the following steps: using a first material, storing the dynamic ripple information of the target water surface into the middleware of the screen space in the water rendering channel; wherein the first material is a water material.
[0133] In an alternative implementation, based on the aforementioned scheme, the water rendering channel reuses the view projection parameters using shader parameter volumes. The view projection parameters are used to project the drawable ripple mesh from the three-dimensional coordinates of the terrain scene where the target water surface is located to the two-dimensional coordinates of the screen space. The drawable ripple mesh is triggered by a particle emitter.
[0134] In one alternative implementation, based on the aforementioned scheme, the dynamic ripple information includes any one or more of the following: ripple normal direction information, water surface height information, and foam concentration information.
[0135] In one alternative implementation, based on the aforementioned scheme, the middleware of the screen space includes a target texture map with the same size as the screen, and the target texture map includes an R channel, a G channel, a B channel, and an A channel.
[0136] In an optional implementation, based on the aforementioned scheme, the middleware that stores the dynamic ripple information of the target water surface into the screen space can be implemented through the following steps: storing the ripple normal direction information into the R channel and G channel; storing the water surface height information into the B channel; and storing the foam concentration information into the A channel.
[0137] In an optional implementation, based on the aforementioned scheme, the above-mentioned rendering of water ripple effects on the target water surface on the screen through the middleware of the screen space can be achieved through the following steps: according to the storage information of the middleware of the screen space, using a second material, fitting the water ripple effect on the target water surface, and rendering the water ripple effect on the target water surface on the screen; wherein, the second material is a transparent or semi-transparent material.
[0138] In the above steps, by storing the dynamic ripple information generated when the target water surface is hit into the middleware of the screen space, and using the middleware of the screen space to render the water ripple effect, the rendering effect is not only stable, but also has low memory and performance overhead, strong real-time interactive performance, and can support large-scale scenes.
[0139] Bus 730 is used to connect different components of electronic device 700 and may include a data bus, an address bus and a control bus.
[0140] Electronic device 700 can communicate with one or more external devices 800 (such as keyboard, mouse, external controller, etc.) through I / O interface 740.
[0141] Electronic device 700 can communicate with one or more networks via network adapter 750. For example, network adapter 750 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication. Network adapter 750 can communicate with other modules of electronic device 700 via bus 730.
[0142] Electronic device 700 can display a graphical user interface, etc., via display 760.
[0143] although Figure 7 As not shown in the diagram, other hardware and / or software modules may also be configured in the electronic device 700, including but not limited to: a display, microcode, device driver, redundant processor, external disk drive array, RAID (Redundant Arrays of Independent Disks) system, tape drive, and data backup storage system.
[0144] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0145] Those skilled in the art will understand that various aspects of this disclosure can be implemented as systems, methods, or program products. Therefore, various aspects of this disclosure can be embodied in entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuit,” “module,” or “system.” Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0146] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is defined only by the appended claims.
Claims
1. A method for rendering virtual water ripples, characterized in that, The method includes: When the target water surface is hit, the impact information of the target water surface is determined, and the dynamic ripple information of the target water surface is determined based on the impact information of the target water surface. The dynamic ripple information of the target water surface is stored in the middleware of the screen space; The screen space middleware renders a water ripple effect on the target water surface on the screen.
2. The method according to claim 1, characterized in that, When the target water surface is struck, determining the impact information of the target water surface and, based on the impact information, determining the dynamic ripple information of the target water surface includes: Based on the target water surface impact object, receive the impact signal of the target water surface; Based on the impact signal on the target water surface, determine the impact information corresponding to the impact signal; wherein, the impact information includes any one or more of the following: impact location, impact direction, and impact force; Based on the impact information corresponding to the impact signal, the dynamic ripple information of the target water surface is determined.
3. The method according to claim 2, characterized in that, The step of determining the dynamic ripple information of the target water surface based on the impact information corresponding to the impact signal includes: Based on the impact location corresponding to the impact signal and the ripple map, water ripple particles are emitted to generate a drawable ripple mesh. Based on the impact direction and impact force corresponding to the impact signal, the drawable ripple mesh is triggered to simulate the impact, thereby obtaining the dynamic ripple information of the target water surface.
4. The method according to claim 1, characterized in that, The middleware for storing the dynamic ripple information of the target water surface into the screen space includes: Using a first material, the dynamic ripple information of the target water surface is stored in the middleware of the screen space in the water rendering channel; wherein the first material is a water material.
5. The method according to claim 4, characterized in that, The water rendering channel uses shader parameter volume to reuse view projection parameters. The view projection parameters are used to project the drawable ripple mesh from the three-dimensional coordinates of the terrain scene where the target water surface is located to the two-dimensional coordinates of the screen space. The drawable ripple mesh is triggered by a particle emitter.
6. The method according to claim 1, characterized in that, The dynamic ripple information includes any one or more of the following: Information on ripple normal direction, water surface height, and foam concentration.
7. The method according to claim 6, characterized in that, The middleware of the screen space includes a target texture map that is the same size as the screen, and the target texture map includes an R channel, a G channel, a B channel, and an A channel.
8. The method according to claim 7, characterized in that, The middleware for storing the dynamic ripple information of the target water surface into the screen space includes: Store the ripple normal direction information into the R channel and the G channel; The water level information is stored in channel B; The foam concentration information is stored in channel A.
9. The method according to claim 1, characterized in that, The process of rendering a water ripple effect on the target water surface on the screen using the middleware in the screen space includes: Based on the storage information of the middleware in the screen space, a second material is used to fit the water ripple effect for the target water surface, and the water ripple effect of the target water surface is rendered on the screen; wherein, the second material is a transparent or semi-transparent material.
10. A virtual water ripple rendering device, characterized in that, The device includes: The ripple information determination module is used to determine the impact information of the target water surface when the target water surface is impacted, and to determine the dynamic ripple information of the target water surface based on the impact information. A ripple information caching module is used to store the dynamic ripple information of the target water surface into middleware in the screen space; The ripple information rendering module is used to render water ripple effects on the target water surface on the screen through the middleware of the screen space.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 9.
12. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 9 by executing the executable instructions.