Virtual ocean wave generation method, device, storage medium and electronic device

By obtaining background images and target maps, generating virtual film models and adding maps, the problem of difficult and inefficient rendering of virtual waves is solved, and efficient wave synthesis effect is achieved.

CN115100340BActive Publication Date: 2025-05-13NETEASE (SHANGHAI) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210726971.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-24
Publication Date
2025-05-13
Estimated Expiration
2042-06-24

AI Technical Summary

Technical Problem

In the prior art, virtual wave rendering methods have problems such as high rendering difficulty and low efficiency, especially in scenarios with complex requirements, it is difficult to achieve efficient virtual wave foam effect rendering.

Method used

By obtaining the background image and target map to be superimposed, a virtual film model is generated based on the target boundary, and the target map is added to the virtual film model to obtain the processing results of the wave foam effect, and then superimpose the background image and the processing results to generate the wave synthesis effect.

Benefits of technology

It realizes improving the rendering efficiency of virtual waves at low cost, solves the problems of high rendering difficulty and low efficiency, and can generate high-quality wave synthesis effects in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115100340B_ABST
    Figure CN115100340B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, storage medium and electronic device for generating virtual ocean waves. The method comprises: obtaining a background image to be superimposed, wherein the display content in the background image comprises: a target boundary; generating a virtual film model based on the target boundary, wherein the virtual film model is used to determine the virtual wave surface to be displayed at the target boundary; obtaining a target map, wherein the target map is used to determine the virtual waves to be displayed at the target boundary; adding the target map to the virtual film model to obtain a first processing result, wherein the first processing result is used to determine the ocean wave foam effect to be displayed at the target boundary; superimposing the background image and the first processing result to obtain a second processing result, wherein the second processing result is used to generate an ocean wave synthesis effect at the target boundary. The present invention solves the technical problems of the virtual ocean wave rendering method provided by the related art, which has high rendering difficulty and low efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, storage medium and electronic device for generating virtual ocean waves. Background Art

[0002] In the production of virtual scenes or computer animations, the rendering and design of virtual wave foam effects are often involved. In the related art, there are mainly two methods for rendering virtual waves.

[0003] The first method is to match the screen with the pre-made dynamic wave foam material through the grid deformation function in the design software (such as AE) to achieve the virtual wave foam effect in the screen. This method is low-cost and suitable for application scenarios with simple requirements. However, it is difficult to apply to scenes with complex requirements (such as large or irregular areas to be rendered), and it is more dependent on the original material and has poor scalability.

[0004] The second method is to perform 3D fluid calculation according to the virtual camera position in the virtual scene, and then render the virtual wave foam effect. This method has high rendering accuracy and good effect, but it is difficult to render and has low efficiency.

[0005] Therefore, how to render virtual sea foam effects efficiently based on two-dimensional packaging requirements has become one of the important issues in the relevant technical field. Currently, no effective solution has been proposed for the above-mentioned problem.

[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0007] The embodiments of the present invention provide a method, device, storage medium and electronic device for generating virtual ocean waves, so as to at least solve the technical problems of the virtual ocean wave rendering method provided by the related art, that is, the rendering method is difficult and inefficient.

[0008] According to one aspect of an embodiment of the present invention, there is provided a method for generating a virtual ocean wave, comprising:

[0009] A background image to be superimposed is obtained, wherein the display content in the background image includes: a target boundary, which is a boundary where a virtual water surface area contacts a virtual land area; a virtual film model is generated based on the target boundary, wherein the virtual film model is used to determine a virtual wave surface to be displayed at the target boundary; a target map is obtained, wherein the target map is used to determine virtual waves to be displayed at the target boundary; the target map is added to the virtual film model to obtain a first processing result, wherein the first processing result is used to determine a wave foam effect to be displayed at the target boundary; and the background image and the first processing result are superimposed to obtain a second processing result, wherein the second processing result is used to generate a wave synthesis effect at the target boundary.

[0010] Optionally, obtaining the background image includes: projecting the original image onto the target grid, wherein the display content in the original image includes: a plurality of candidate boundaries; and adjusting the camera viewing angle of the virtual camera to shoot the target grid to obtain the background image.

[0011] Optionally, generating a virtual film model based on a target boundary includes: drawing a target line according to the target boundary; determining a first direction and a second direction of the target line, wherein the first direction is a path direction of the target line and the second direction is a direction perpendicular to the first direction; determining a width of the target line in the second direction; and generating a virtual film model based on the width.

[0012] Optionally, the above-mentioned virtual ocean wave generation method also includes: determining the texture coordinates to be used according to the first direction and the second direction; creating a multi-layer texture mask based on the texture coordinates to be used, wherein the multi-layer texture mask is used to randomly adjust the display effect of the virtual waves in the time dimension.

[0013] Optionally, obtaining the target map includes: obtaining a virtual initial wave surface; adjusting the morphological parameters of the virtual initial wave surface to obtain a virtual target wave surface; determining multiple target points on the virtual target wave surface, wherein the multiple target points are used to determine the generation position of the wave foam effect; performing speed adjustment and disturbance processing on the multiple target points to obtain a third processing result, wherein the third processing result is used to determine the tail effect of the wave foam; performing volume conversion on the third processing result to generate a target map.

[0014] Optionally, the morphological parameters include one or more of the following: a first morphological parameter, wherein the first morphological parameter is used to adjust the texture accuracy of the virtual initial wave surface; a second morphological parameter, wherein the second morphological parameter is used to adjust the texture tiling size of the virtual initial wave surface; a third morphological parameter, wherein the third morphological parameter is used to adjust the speed attribute of the virtual initial wave surface; a fourth morphological parameter, wherein the fourth morphological parameter is used to adjust the movement direction of the virtual initial wave surface; a fifth morphological parameter, wherein the fifth morphological parameter is used to adjust the wave crest attribute of the virtual initial wave surface.

[0015] Optionally, determining a plurality of target points on the virtual target wave surface includes: randomly distributing a plurality of candidate points on the virtual target wave surface; and selecting a plurality of target points from the plurality of candidate points based on a fifth morphological parameter.

[0016] Optionally, performing volume conversion on the third processing result to generate a target map includes: performing volume conversion on the third processing result to generate an initial map; performing seam processing and feathering processing on the initial map to obtain the target map.

[0017] Optionally, adding the target map to the virtual patch model to obtain the first processing result includes: adding the target map to the virtual patch model based on the texture coordinates to be used to obtain a fourth processing result; and mixing the fourth processing result with a multi-layer texture mask to obtain the first processing result.

[0018] According to another aspect of an embodiment of the present invention, there is further provided a virtual ocean wave generating device, comprising:

[0019] The first acquisition module is used to acquire the background image to be superimposed, wherein the display content in the background image includes: a target boundary, which is the boundary where the virtual water surface area contacts the virtual land area; the first processing module is used to generate a virtual film model based on the target boundary, wherein the virtual film model is used to determine the virtual wave surface to be displayed at the target boundary; the second acquisition module is used to acquire a target map, wherein the target map is used to determine the virtual waves to be displayed at the target boundary; the second processing module is used to add the target map to the virtual film model to obtain a first processing result, wherein the first processing result is used to determine the wave foam effect to be displayed at the target boundary; the third processing module is used to superimpose the background image and the first processing result to obtain a second processing result, wherein the second processing result is used to generate a wave synthesis effect at the target boundary.

[0020] Optionally, the first acquisition module is further used to: project the original image onto the target grid, wherein the display content in the original image includes: a plurality of candidate boundaries; and adjust the camera viewing angle of the virtual camera to shoot the target grid to obtain a background image.

[0021] Optionally, the above-mentioned first processing module is also used to: draw a target line according to the target boundary; determine a first direction and a second direction of the target line, wherein the first direction is the path direction of the target line and the second direction is a direction perpendicular to the first direction; determine the width of the target line in the second direction; and generate a virtual film model based on the width.

[0022] Optionally, the above-mentioned virtual ocean wave generating device also includes: an adjustment module, used to determine the texture coordinates to be used according to the first direction and the second direction; create a multi-layer texture mask based on the texture coordinates to be used, wherein the multi-layer texture mask is used to randomly adjust the display effect of the virtual waves in the time dimension.

[0023] Optionally, the second acquisition module is further used to: acquire a virtual initial wave surface; adjust the morphological parameters of the virtual initial wave surface to obtain a virtual target wave surface; determine a plurality of target points on the virtual target wave surface, wherein the plurality of target points are used to determine the generation position of the wave foam effect; perform speed adjustment and disturbance processing on the plurality of target points to obtain a third processing result, wherein the third processing result is used to determine the tailing effect of the wave foam; perform volume conversion on the third processing result to generate a target map.

[0024] Optionally, in the above-mentioned second acquisition module, the morphological parameters include one or more of the following: a first morphological parameter, wherein the first morphological parameter is used to adjust the texture accuracy of the virtual initial wave surface; a second morphological parameter, wherein the second morphological parameter is used to adjust the texture tiling size of the virtual initial wave surface; a third morphological parameter, wherein the third morphological parameter is used to adjust the speed attribute of the virtual initial wave surface; a fourth morphological parameter, wherein the fourth morphological parameter is used to adjust the movement direction of the virtual initial wave surface; and a fifth morphological parameter, wherein the fifth morphological parameter is used to adjust the wave crest attribute of the virtual initial wave surface.

[0025] Optionally, the second acquisition module is further used to: randomly distribute a plurality of candidate points on the virtual target wave surface; and select a plurality of target points from the plurality of candidate points based on the fifth morphological parameter.

[0026] Optionally, the second acquisition module is further used to: perform volume conversion on the third processing result to generate an initial map; and perform seam processing and feathering processing on the initial map to obtain a target map.

[0027] Optionally, the second processing module is further used to: add the target map to the virtual patch model based on the texture coordinates to be used to obtain a fourth processing result; and mix the fourth processing result with the multi-layer texture mask to obtain the first processing result.

[0028] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute any of the above-mentioned virtual ocean wave generation methods when running.

[0029] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any of the above-mentioned methods for generating virtual ocean waves.

[0030] In at least some embodiments of the present invention, a background image to be superimposed is obtained, wherein the display content in the background image includes: a target boundary, which is a boundary where a virtual water surface area contacts a virtual land area; a virtual film model is generated based on the target boundary, wherein the virtual film model is used to determine a virtual wave surface to be displayed at the target boundary; and a target map is obtained, wherein the target map is used to determine virtual waves to be displayed at the target boundary; a first processing result is obtained by adding the target map to the virtual film model, wherein the first processing result is used to determine a wave foam effect to be displayed at the target boundary; the background image and the first processing result are superimposed to obtain a second processing result, wherein the second processing result is used to generate a wave synthesis effect at the target boundary, thereby achieving the purpose of obtaining a virtual wave effect by superimposing a virtual wave map on the background image, thereby achieving the technical effect of improving the virtual wave rendering efficiency at a relatively low cost, thereby solving the technical problem of the virtual wave rendering method provided by the related art having high rendering difficulty and low efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0032] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for generating virtual ocean waves according to an embodiment of the present invention;

[0033] Figure 2 is a flow chart of a method for generating virtual ocean waves according to one embodiment of the present invention;

[0034] Figure 3 is a schematic diagram of an optional background image according to an embodiment of the present invention;

[0035] Figure 4 is a schematic diagram of an optional virtual slice model according to an embodiment of the present invention;

[0036] Figure 5 is a schematic diagram of an optional virtual target wave surface according to an embodiment of the present invention;

[0037] Figure 6 is a schematic diagram of an optional volume conversion result according to an embodiment of the present invention;

[0038] Figure 7 is a schematic diagram of an optional initial map according to an embodiment of the present invention;

[0039] Figure 8a is a schematic diagram of an optional virtual wave material according to an embodiment of the present invention;

[0040] Figure 8b is a schematic diagram of another optional virtual wave material according to an embodiment of the present invention;

[0041] Fig. 9 is a structural block diagram of a virtual ocean wave generating device according to an embodiment of the present invention;

[0042] Fig.10 is a structural block diagram of an optional virtual ocean wave generating device according to an embodiment of the present invention;

[0043] Fig.11 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

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

[0046] According to one embodiment of the present invention, an embodiment of a method for generating virtual ocean waves is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0047] In one embodiment of the present invention, the virtual ocean wave generation method can be run on a terminal device or a server. The terminal device can be a local terminal device. When the virtual ocean wave generation method is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0048] In an optional embodiment, various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the operation subject of the game program and the game screen presentation subject are separated. The storage and operation of the virtual wave generation method are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the terminal device for information processing is a cloud game server in the cloud. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.

[0049] In an optional embodiment, the terminal device may be a local terminal device. Taking a game as an example, the local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.

[0050] In a possible implementation, an embodiment of the present invention provides a method for generating virtual ocean waves, providing a graphical user interface through a terminal device, wherein the terminal device may be the local terminal device mentioned above, or may be a client device in the cloud interaction system mentioned above.

[0051] Taking a mobile terminal running in a local terminal device as an example, the mobile terminal can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, referred to as MID), a PAD, a game console, and other terminal devices. Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for generating virtual ocean waves according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microprocessor (MCU), a programmable logic device (FPGA), a neural network processor (NPU), a tensor processor (TPU), an artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data. Optionally, the mobile terminal may also include a transmission device 106 for communication functions, an input and output device 108, and a display device 110. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0052] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the virtual wave generation method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above-mentioned virtual wave generation method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0053] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0054] The inputs in the input / output device 108 may come from a plurality of human interface devices (HIDs), such as keyboards and mice, game controllers, and other dedicated game controllers (such as steering wheels, fishing rods, dance mats, remote controls, etc.). In addition to providing input functions, some human interface devices may also provide output functions, such as force feedback and vibration of game controllers, audio output of controllers, etc.

[0055] The display device 110 may be, for example, a head-up display (HUD), a touch-screen liquid crystal display (LCD), and a touch display (also referred to as a "touch screen" or "touch display screen"). The liquid crystal display may enable a user to interact with a user interface of the mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI), and a user may interact with the GUI by finger contacts and / or gestures on a touch-sensitive surface, wherein the human-computer interaction functions here may optionally include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product or a readable storage medium executable by one or more processors.

[0056] In one embodiment of the present invention, the virtual ocean wave generation method can be run on a local terminal device or a server. When the virtual ocean wave generation method is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0057] In an optional implementation, various cloud applications, such as cloud games, can be run under the cloud interaction system. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the virtual wave generation method are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the cloud game server in the cloud is used for information processing. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.

[0058] In an optional embodiment, taking a game as an example, a local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.

[0059] In a possible implementation, an embodiment of the present invention provides a method for generating virtual ocean waves, providing a graphical user interface through a terminal device, wherein the terminal device may be the local terminal device mentioned above, or may be a client device in the cloud interaction system mentioned above. Figure 2 is a flow chart of a method for generating virtual ocean waves according to one embodiment of the present invention, wherein a graphical user interface is provided by a terminal device, and the content displayed by the graphical user interface includes a touch area, such as Figure 2 As shown, the method comprises the following steps:

[0060] Step S21, obtaining a background image to be superimposed, wherein the display content in the background image includes: a target boundary, which is a boundary where a virtual water surface area contacts a virtual land area;

[0061] The background image to be superimposed may be an image frame (full or partial image) of a virtual game scene to be rendered with a virtual wave effect, or an image frame (full or partial image) of a computer animation to be added with a virtual wave effect.

[0062] The display content in the above background image may include the above target boundary. The target boundary may be the boundary where a virtual water surface area (such as oceans, rivers, streams, lakes and other water areas in a virtual scene) and a virtual land area (such as green land, beaches, reefs, bridges, roads and other areas in a virtual scene) touch each other.

[0063] Step S22, generating a virtual sheet model based on the target boundary, wherein the virtual sheet model is used to determine a virtual wave surface to be displayed at the target boundary;

[0064] The virtual film model can be used to determine the virtual wave surface to be displayed at the target boundary. The virtual film model can be a two-dimensional area model corresponding to the area to be rendered for the virtual wave effect.

[0065] For example, for a virtual coastline between a virtual ocean area and a virtual beach area (equivalent to the target boundary), the virtual film model may be a two-dimensional area model near the virtual coastline where the wave foam effect is to be rendered.

[0066] Step S23, obtaining a target map, wherein the target map is used to determine virtual waves to be displayed at the target boundary;

[0067] The target map can be used to determine the virtual waves to be displayed at the target boundary. For example, in an actual application scenario, the target map can be a wave map sequence made based on the initial wave surface model according to the virtual ocean area and the virtual beach area.

[0068] Specifically, obtaining the target map also includes other method steps, which can be referred to the further introduction of the embodiments of the present invention below and will not be described in detail here.

[0069] Step S24, adding the target map to the virtual film model to obtain a first processing result, wherein the first processing result is used to determine the wave foam effect to be displayed at the target boundary;

[0070] The target map is used to determine the virtual waves to be displayed at the target boundary, and the virtual film model is used to determine the virtual wave surface to be displayed at the target boundary. The target map is added to the virtual film model to obtain the first processing result. The first processing result can be used to determine the wave foam effect to be displayed at the target boundary.

[0071] For example, by adding the wave map sequences corresponding to the virtual ocean area and the virtual beach area to the corresponding virtual coastline model, the wave foam effect to be displayed on the virtual coastline can be determined.

[0072] Specifically, the target map is added to the virtual slice model to obtain the first processing result, which also includes other method steps, which can be referred to the further introduction of the embodiment of the present invention below and will not be described in detail here.

[0073] Step S25, superimposing the background image and the first processing result to obtain a second processing result, wherein the second processing result is used to generate a wave synthesis effect at the target boundary.

[0074] The second processing result may be used to generate a wave synthesis effect on a target boundary where the virtual water surface area contacts the virtual land area.

[0075] For example, the image frames corresponding to the virtual ocean area and the virtual beach area (equivalent to the above-mentioned background image) are superimposed with the wave foam effect to be displayed on the virtual coastline, so as to obtain the wave synthesis effect between the virtual ocean area and the virtual beach area. The above-mentioned superimposition processing can be superimposition and post-processing rendering, or optimization adjustment processing and superimposition rendering.

[0076] In at least some embodiments of the present invention, a background image to be superimposed is obtained, wherein the display content in the background image includes: a target boundary, which is a boundary where a virtual water surface area contacts a virtual land area; a virtual film model is generated based on the target boundary, wherein the virtual film model is used to determine a virtual wave surface to be displayed at the target boundary; and a target map is obtained, wherein the target map is used to determine virtual waves to be displayed at the target boundary; a first processing result is obtained by adding the target map to the virtual film model, wherein the first processing result is used to determine a wave foam effect to be displayed at the target boundary; the background image and the first processing result are superimposed to obtain a second processing result, wherein the second processing result is used to generate a wave synthesis effect at the target boundary, thereby achieving the purpose of obtaining a virtual wave effect by superimposing a virtual wave map on the background image, thereby achieving the technical effect of improving the virtual wave rendering efficiency at a relatively low cost, thereby solving the technical problem of the virtual wave rendering method provided by the related art having high rendering difficulty and low efficiency.

[0077] The above method of the embodiment of the present invention is further introduced below.

[0078] Optionally, in step S21, obtaining the background image may include the following execution steps:

[0079] Step S211, projecting the original image onto the target grid, wherein the display content in the original image includes: a plurality of candidate boundaries;

[0080] Step S212, adjusting the camera angle of the virtual camera to shoot the target grid to obtain a background image.

[0081] The original image may be an image frame of a virtual game scene in which a virtual image is to be rendered with a virtual wave effect. The original image may display multiple boundaries of the virtual wave effect to be rendered (which may be boundaries where a virtual water surface area contacts a virtual land area).

[0082] Figure 3 is a schematic diagram of an optional background image according to an embodiment of the present invention, such as Figure 3 As shown, when rendering the virtual wave effect for the annular area 1, the original image showing the annular area 1 is first projected into the target grid grid01 (as shown in FIG. Figure 3Then, according to the virtual camera direction corresponding to the target grid grid01, adjust to restore the horizontal perspective, and obtain the background image corresponding to the annular area 1 by cropping (as shown in Figure 1). Figure 3 2 in the image).

[0083] Optionally, in step S22, generating a virtual slice model based on the target boundary may include the following execution steps:

[0084] Step S221, drawing a target line according to the target boundary;

[0085] Step S222, determining a first direction and a second direction of the target line, wherein the first direction is a path direction of the target line, and the second direction is a direction perpendicular to the first direction;

[0086] Step S223, determining the width of the target line in the second direction;

[0087] Step S224: Generate a virtual slice model based on the width.

[0088] The target boundary is the boundary where the virtual water surface area and the virtual land area touch each other, and the target line is drawn according to the target boundary. The target line is used to determine the position and shape of the virtual film model.

[0089] According to the target line, the path direction of the target line can be determined as the first direction, and the vertical direction of the first reverse direction can be determined as the second direction. The width of the target line is determined in the second direction. The width is used to determine the range of the virtual film model.

[0090] Based on the width of the target line, the virtual sheet model can be generated, which is used to determine the virtual wave surface to be displayed at the target boundary.

[0091] Figure 4 is a schematic diagram of an optional virtual slice model according to an embodiment of the present invention, such as Figure 4 As shown, according to the annular area 1, the corresponding boundary line (equivalent to the above-mentioned target line) is determined; then, the width d of the boundary line is determined in a direction perpendicular to the path of the boundary line; according to the width d, it can be determined as follows Figure 4 The area corresponding to the virtual film model M1 in .

[0092] It should be noted that Figure 4 The area corresponding to the virtual sheet model M1 shown is the area where the virtual wave model is added to the annular area 1.

[0093] Optionally, the above virtual ocean wave generation method may further include the following execution steps:

[0094] Step S26, determining the texture coordinates to be used according to the first direction and the second direction;

[0095] Step S27, creating a multi-layer texture mask based on the texture coordinates to be used, wherein the multi-layer texture mask is used to randomly adjust the display effect of the virtual waves in the time dimension.

[0096] According to the first direction and the second direction of the target line, the texture coordinates to be used may be determined. In an actual application scenario, the texture coordinates to be used may be normalized UV coordinates.

[0097] Based on the texture coordinates to be used, the multi-layer texture mask can be created, which can be used to randomly adjust the display effect of virtual waves in the time dimension. In actual application scenarios, according to the normalized UV coordinates, multiple texture masks can be created to control the lifespan of virtual waves in the virtual ocean (such as appearance time and disappearance time, etc.).

[0098] Still like Figure 4 As shown, in the area corresponding to the virtual film model M1, the texture coordinate grid02 (which can be normalized, that is, with size and direction and its size is normalized to 1) can be determined according to the path direction and the vertical direction of the path of the boundary line of the annular area 1.

[0099] Still for example, when rendering the virtual wave effect for the annular area 1, two masks for controlling the random display effect of the virtual waves in the time dimension can be created based on the texture coordinate grid02, which are respectively recorded as maskA and maskB.

[0100] It should be noted that when creating a texture mask for randomly adjusting the display effect of virtual waves in the time dimension, the number of the texture masks can be determined according to the needs of the actual application scenario. The more texture masks created, the more virtual wave rendering resources are required.

[0101] Optionally, in step S23, obtaining the target map may include the following execution steps:

[0102] Step S231, obtaining a virtual initial wave surface;

[0103] Step S232, adjusting the morphological parameters of the virtual initial wave surface to obtain a virtual target wave surface;

[0104] Step S233, determining a plurality of target points on the virtual target wave surface, wherein the plurality of target points are used to determine the generation position of the wave foam effect;

[0105] Step S234, performing speed adjustment and disturbance processing on the multiple target points to obtain a third processing result, wherein the third processing result is used to determine the tailing effect of the wave foam;

[0106] Step S235, performing volume conversion on the third processing result to generate a target map.

[0107] The virtual initial wave surface may be a virtual wave surface model made using preset software (such as the small-scale ocean tool in Houdini's tool shelf). The virtual wave surface model may include morphological parameters, which are used to control the display morphology of the virtual waves.

[0108] According to the requirements of the actual application scenario, the morphological parameters of the virtual initial wave surface are adjusted to obtain the above-mentioned virtual target wave surface.

[0109] On the virtual target wave surface, the above-mentioned multiple target points can be determined. The multiple target points can be used to determine the generation position of the wave foam effect. For example, the multiple target points can be multiple wave crest emission points on the virtual target wave surface.

[0110] The above-mentioned third processing result can be obtained by performing speed adjustment and disturbance processing on the above-mentioned multiple target points. The third processing result can be used to determine the tailing effect of the sea foam. The speed adjustment can be to determine the initial speed for each target point of the multiple target points, and the disturbance processing can be to determine the disturbance parameter for each target point of the multiple target points.

[0111] The target map can be generated by performing volume conversion on the third processing result. The target map is used to determine the virtual waves to be displayed at the target boundary. The volume conversion can add a volume effect to the display effect of the virtual waves.

[0112] Optionally, in step S232, the morphological parameters include one or more of the following:

[0113] A first morphological parameter, wherein the first morphological parameter is used to adjust the texture accuracy of the virtual initial wave surface;

[0114] A second morphological parameter, wherein the second morphological parameter is used to adjust the texture tiling size of the virtual initial wave surface;

[0115] A third morphological parameter, wherein the third morphological parameter is used to adjust the speed attribute of the virtual initial wave surface;

[0116] A fourth morphological parameter, wherein the fourth morphological parameter is used to adjust the movement direction of the virtual initial wave surface;

[0117] The fifth morphological parameter is used to adjust the wave crest properties of the virtual initial wave surface.

[0118] The above-mentioned morphological parameters for controlling the display morphology of the virtual ocean waves may include one or more items. In actual application scenarios, the morphological parameters specifically include one or more of the above-mentioned first morphological parameters, second morphological parameters, third morphological parameters, fourth morphological parameters and fifth morphological parameters, which may be determined according to scenario requirements or user settings.

[0119] Let's take the rendering of virtual waves in ring area 1 as an example. Figure 5 is a schematic diagram of an optional virtual target wave surface according to an embodiment of the present invention. An initial wave surface P0 is generated using the small-scale ocean tool in Houdini software, and multiple parameters of the initial wave surface P0 are adjusted to obtain the following: Figure 5 The target wave surface P1 shown (equivalent to the virtual target wave surface mentioned above).

[0120] Specifically, adjusting multiple parameters of the initial wave surface P0 includes the following steps:

[0121] Step E51, adjusting the texture precision parameter Resolution Exponent (equivalent to the first morphological parameter) to 9 (the larger the value, the higher the texture precision);

[0122] Step E52, adjusting the texture tiling size parameter Grid Size (equivalent to the above-mentioned second morphological parameter) to 50 (the smaller the value, the higher the repetition of the wave surface texture);

[0123] Step E53, adjusting the speed attribute parameter speed (equivalent to the third morphological parameter) to 17 (the larger the value, the larger the size of the virtual wave);

[0124] Step E54, adjusting the motion direction parameter Directional bias (equivalent to the fourth morphological parameter) to 5 (the smaller the value, the more uniform the motion direction of the virtual waves, and the larger the value, the more chaotic the motion direction of the virtual waves);

[0125] Step E55, adjust the wave crest attribute parameter chop (equivalent to the fifth morphological parameter mentioned above) to 0.6 (the larger the value, the sharper the wave crest of the virtual wave, and the smaller the value, the softer the wave crest of the virtual wave).

[0126] It should be noted that in the above step E55, it is necessary to avoid the virtual waves in the virtual scene from interlacing, and it is also necessary to ensure that the wave crests are sharp enough to facilitate the generation of wave crest attributes.

[0127] Optionally, in step S233, determining a plurality of target points on the virtual target wave surface may include the following execution steps:

[0128] Step S2331, randomly distributing multiple candidate points on the virtual target wave surface;

[0129] Step S2332, selecting multiple target points from multiple candidate points based on the fifth morphological parameter.

[0130] Still taking the rendering of the virtual wave effect in the annular area 1 as an example, randomly scatter points on the virtual target wave surface P1 to obtain multiple candidate points. Then, according to the wave crest attribute parameter chop, some candidate points are deleted from the multiple candidate points to obtain the multiple target points. The multiple target points can be used as wave crest emission points on the virtual target wave surface P1.

[0131] Specifically, the value of the wave crest attribute parameter chop is between 0 and 1, and the closer the value is to 1, the closer it is to the wave crest. According to the needs of the actual scene, points whose values ​​of the wave crest attribute parameter chop are specified values ​​(or are in a specified interval) are deleted from multiple candidate points, thereby obtaining the above multiple target points.

[0132] Still taking the rendering of the virtual wave effect in the annular area 1 as an example, based on the above-mentioned multiple target points, a speed value v0 and a disturbance parameter r0 are determined for each of the multiple target points, and the virtual wave surface P3 (equivalent to the above-mentioned third processing result) can be obtained, and then maskA and maskB are updated to obtain the trailing effect and random display life of the virtual waves.

[0133] Still taking the rendering of the virtual wave effect in the annular area 1 as an example, the particles emitted by the multiple wave crest emission points (equivalent to the multiple target points) corresponding to the virtual wave surface P3 are cached to obtain the cache result L0. The number of cached frames can take a larger value to obtain more materials to ensure the richness of the virtual wave foam effect.

[0134] Optionally, in step S235, performing volume conversion on the third processing result to generate a target map may include the following execution steps:

[0135] Step S2351, performing volume conversion on the third processing result to generate an initial map;

[0136] Step S2352, performing seam processing and feathering processing on the initial texture to obtain a target texture.

[0137] The third processing result for determining the trailing effect of the sea foam is subjected to volume conversion processing to generate an initial map. Further, the initial map is subjected to seam processing and feathering processing to obtain the target map. The target map is used to determine the virtual waves to be displayed at the target boundary.

[0138] Still taking the rendering of the virtual wave effect in the annular area 1 as an example, the cache result L0 corresponding to the multiple wave crest emission points (equivalent to the multiple target points) corresponding to the virtual wave surface P3 is volume-converted to obtain the initial map.

[0139] Specifically, a density attribute is added to the particles in the cache result L0, and the density attribute is initialized to 1. A pscale attribute is added to the particles in the cache result L0 to control the size of the particles: the pscale attribute value can be obtained by randomly processing the life of the particles; the pscale attribute value can be a specified fixed value (such as 0.01); the pscale attribute value can be a random number within a specified range.

[0140] It should be noted that the value of the pscale attribute needs to be adjusted according to the display size of the particle after volume conversion.

[0141] Figure 6 is a schematic diagram of an optional volume conversion result according to an embodiment of the present invention. By using the volume rasterize node in Houdini, the particles in the cache result L0 are converted into volumes according to the density attribute of the particles. Specifically, the Voxel Size parameter is set to 0.1; the Particle Scale parameter is set to 1; the Minimum FilterSize parameter is set to 0.75; the Shutter parameter is set to 0.5; the Shutter Offset parameter is set to 1; the BlurSamples parameter is set to 4; and the Coverage Scale parameter is set to 1. The volume conversion result is as follows: Figure 6 shown.

[0142] Figure 7 is a schematic diagram of an optional initial map according to an embodiment of the present invention, such as Figure 7 As shown, based on the volume conversion result, a camera rendering sequence is obtained according to the top view of the volume conversion result, and then the following is obtained: Figure 7 The initial texture asset shown in .

[0143] Still taking the rendering of virtual waves effect in annular area 1 as an example, Figure 7 The initial texture material shown is imported into post-processing software (such as AE) for left-right seamless processing and up-down feathering disappearance processing to obtain the target texture material P4. The target texture material can be returned to Houdini to obtain an updated camera rendering sequence.

[0144] It should be noted that performing left-right seamless processing on the initial texture material can avoid the seam effect of the virtual waves; performing up-down feathering disappearance processing on the initial texture material can avoid the hard cutting effect of the virtual waves.

[0145] Optionally, in step S24, adding the target map to the virtual slice model to obtain the first processing result may include the following execution steps:

[0146] Step S241, adding the target map to the virtual patch model based on the texture coordinates to be used, to obtain a fourth processing result;

[0147] Step S242, mixing the fourth processing result with the multi-layer texture mask to obtain the first processing result.

[0148] The texture coordinates to be used may be normalized UV coordinates determined according to the first direction and the second direction of the target line. Based on the texture coordinates to be used, the target map may be added to the virtual slice model to obtain the fourth processing result.

[0149] Still taking the rendering of the virtual wave effect in the annular area 1 as an example, according to the texture coordinate grid02, the camera rendering sequence corresponding to the target map material P4 is added to the virtual wave surface P3, and the virtual wave surface P5 (equivalent to the fourth processing result mentioned above) can be obtained.

[0150] It should be noted that for the camera rendering sequence corresponding to the target texture material P4, AE or Houdini can be used for time frame error processing to enhance the randomness of the virtual waves in the time dimension, avoid the repetition of virtual waves in the virtual waves, and enhance the virtual reality effect of the virtual waves.

[0151] The virtual wave surface P5 is mixed with maskA and maskB to obtain a virtual wave model P6 (equivalent to the first processing result). The virtual wave model P6 can be used to determine the wave foam effect to be displayed on the coastline corresponding to the annular area 1.

[0152] Figure 8a is a schematic diagram of an optional virtual spray material according to an embodiment of the present invention, such as Figure 8a The figure shows a schematic diagram of the wave material in maskA; Figure 8b is a schematic diagram of another optional virtual spray material according to an embodiment of the present invention, such as Figure 8b The following is a schematic diagram of the wave material in maskB. Figure 8a and Figure 8b As shown, the wave materials in maskA and maskB can be set as self-luminous materials, without calculating the light and shadow information of the virtual waves, thereby improving the rendering efficiency of the virtual waves.

[0153] Still taking the rendering of the virtual wave effect of the annular area 1 as an example, the virtual wave model P6 is superimposed on the background image corresponding to the annular area 1, and then the virtual wave foam effect corresponding to the annular area 1 can be obtained.

[0154] It is easy to notice that according to the method provided by the embodiment of the present invention, a virtual ocean wave effect is obtained by superimposing a virtual wave texture on a background image, which has the beneficial effect of improving the efficiency of virtual ocean wave rendering at a relatively low cost.

[0155] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0156] In the present embodiment, a virtual wave generating device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0157] Fig. 9 is a structural block diagram of a virtual wave generating device according to an embodiment of the present invention, wherein a graphical user interface is provided through a terminal device, and the content displayed by the graphical user interface includes a touch area, such as Fig. 9 As shown, the device includes: a first acquisition module 91, used to acquire a background image to be superimposed, wherein the display content in the background image includes: a target boundary, which is a boundary where a virtual water surface area contacts a virtual land area; a first processing module 92, used to generate a virtual film model based on the target boundary, wherein the virtual film model is used to determine a virtual wave surface to be displayed at the target boundary; a second acquisition module 93, used to acquire a target map, wherein the target map is used to determine virtual waves to be displayed at the target boundary; a second processing module 94, used to add the target map to the virtual film model to obtain a first processing result, wherein the first processing result is used to determine a wave foam effect to be displayed at the target boundary; a third processing module 95, used to superimpose the background image and the first processing result to obtain a second processing result, wherein the second processing result is used to generate a wave synthesis effect at the target boundary.

[0158] Optionally, the first acquisition module 91 is further used to: project the original image onto the target grid, wherein the display content in the original image includes: a plurality of candidate boundaries; and adjust the camera angle of the virtual camera to shoot the target grid to obtain a background image.

[0159] Optionally, the above-mentioned first processing module 92 is also used to: draw a target line according to the target boundary; determine a first direction and a second direction of the target line, wherein the first direction is the path direction of the target line, and the second direction is a direction perpendicular to the first direction; determine the width of the target line in the second direction; and generate a virtual film model based on the width.

[0160] Optionally, Fig.10 is a structural block diagram of an optional virtual ocean wave generating device according to an embodiment of the present invention, such as Fig.10 As shown, the device includes Fig. 9 In addition to all the modules shown, it also includes: an adjustment module 96, which is used to determine the texture coordinates to be used according to the first direction and the second direction; create a multi-layer texture mask based on the texture coordinates to be used, wherein the multi-layer texture mask is used to randomly adjust the display effect of the virtual waves in the time dimension.

[0161] Optionally, the second acquisition module 93 is further used to: acquire a virtual initial wave surface; adjust the morphological parameters of the virtual initial wave surface to obtain a virtual target wave surface; determine a plurality of target points on the virtual target wave surface, wherein the plurality of target points are used to determine the generation position of the wave foam effect; perform speed adjustment and disturbance processing on the plurality of target points to obtain a third processing result, wherein the third processing result is used to determine the tailing effect of the wave foam; perform volume conversion on the third processing result to generate a target map.

[0162] Optionally, in the above-mentioned second acquisition module 93, the morphological parameters include one or more of the following: a first morphological parameter, wherein the first morphological parameter is used to adjust the texture accuracy of the virtual initial wave surface; a second morphological parameter, wherein the second morphological parameter is used to adjust the texture tiling size of the virtual initial wave surface; a third morphological parameter, wherein the third morphological parameter is used to adjust the speed attribute of the virtual initial wave surface; a fourth morphological parameter, wherein the fourth morphological parameter is used to adjust the movement direction of the virtual initial wave surface; and a fifth morphological parameter, wherein the fifth morphological parameter is used to adjust the wave crest attribute of the virtual initial wave surface.

[0163] Optionally, the second acquisition module 93 is further used to: randomly distribute a plurality of candidate points on the virtual target wave surface; and select a plurality of target points from the plurality of candidate points based on the fifth morphological parameter.

[0164] Optionally, the second acquisition module 93 is further used to: perform volume conversion on the third processing result to generate an initial map; and perform seam processing and feathering processing on the initial map to obtain a target map.

[0165] Optionally, the second processing module 94 is further used to: add the target map to the virtual patch model based on the texture coordinates to be used to obtain a fourth processing result; and mix the fourth processing result with the multi-layer texture mask to obtain the first processing result.

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

[0167] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0168] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

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

[0170] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: obtaining a background image to be superimposed, wherein the display content in the background image includes: a target boundary, which is a boundary where a virtual water surface area contacts a virtual land area; generating a virtual film model based on the target boundary, wherein the virtual film model is used to determine a virtual wave surface to be displayed at the target boundary; obtaining a target map, wherein the target map is used to determine virtual waves to be displayed at the target boundary; adding the target map to the virtual film model to obtain a first processing result, wherein the first processing result is used to determine a wave foam effect to be displayed at the target boundary; and superimposing the background image with the first processing result to obtain a second processing result, wherein the second processing result is used to generate a wave synthesis effect at the target boundary.

[0171] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: projecting an original image onto a target grid, wherein the display content in the original image includes: multiple candidate boundaries; adjusting the camera angle of the virtual camera to shoot the target grid to obtain a background image.

[0172] Optionally, the above-mentioned computer-readable storage medium is also configured to store program codes for executing the following steps: drawing a target line according to a target boundary; determining a first direction and a second direction of the target line, wherein the first direction is a path direction of the target line and the second direction is a direction perpendicular to the first direction; determining a width of the target line in the second direction; and generating a virtual film model based on the width.

[0173] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: determining the texture coordinates to be used according to the first direction and the second direction; creating a multi-layer texture mask based on the texture coordinates to be used, wherein the multi-layer texture mask is used to randomly adjust the display effect of virtual waves in the time dimension.

[0174] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: obtaining a virtual initial wave surface; adjusting the morphological parameters of the virtual initial wave surface to obtain a virtual target wave surface; determining a plurality of target points on the virtual target wave surface, wherein the plurality of target points are used to determine the generation position of the wave foam effect; performing speed adjustment and disturbance processing on the plurality of target points to obtain a third processing result, wherein the third processing result is used to determine the tailing effect of the wave foam; performing volume conversion on the third processing result to generate a target map.

[0175] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: the morphological parameters include one or more of the following: a first morphological parameter, wherein the first morphological parameter is used to adjust the texture accuracy of the virtual initial wave surface; a second morphological parameter, wherein the second morphological parameter is used to adjust the texture tiling size of the virtual initial wave surface; a third morphological parameter, wherein the third morphological parameter is used to adjust the speed attribute of the virtual initial wave surface; a fourth morphological parameter, wherein the fourth morphological parameter is used to adjust the movement direction of the virtual initial wave surface; a fifth morphological parameter, wherein the fifth morphological parameter is used to adjust the wave crest attribute of the virtual initial wave surface.

[0176] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: randomly distributing a plurality of candidate points on a virtual target wave surface; and selecting a plurality of target points from the plurality of candidate points based on a fifth morphological parameter.

[0177] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: performing volume conversion on the third processing result to generate an initial map; performing seam processing and feathering processing on the initial map to obtain a target map.

[0178] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: adding the target map to the virtual patch model based on the texture coordinates to be used to obtain a fourth processing result; and mixing the fourth processing result with a multi-layer texture mask to obtain the first processing result.

[0179] In the computer-readable storage medium of this embodiment, a technical solution of a method for generating virtual ocean waves is provided. A background image to be superimposed is obtained, wherein the display content in the background image includes: a target boundary, which is a boundary where a virtual water surface area contacts a virtual land area, a virtual film model is generated based on the target boundary, wherein the virtual film model is used to determine a virtual wave surface to be displayed at the target boundary, and a target map is obtained, wherein the target map is used to determine virtual spray to be displayed at the target boundary, a first processing result is obtained by adding the target map to the virtual film model, wherein the first processing result is used to determine the wave foam effect to be displayed at the target boundary, the background image is superimposed with the first processing result to obtain a second processing result, wherein the second processing result is used to generate a wave synthesis effect at the target boundary, and the purpose of obtaining a virtual ocean wave effect by superimposing a virtual spray map on the background image is achieved, thereby achieving the technical effect of improving the virtual ocean wave rendering efficiency at a relatively low cost, thereby solving the technical problem of the virtual ocean wave rendering method provided by the related art having high rendering difficulty and low efficiency.

[0180] Through the description of the above implementation modes, it is easy for those skilled in the art to understand that the example implementation modes described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation mode of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation mode of the present invention.

[0181] In an exemplary embodiment of the present invention, a program product capable of implementing the above method of the present embodiment is stored on a computer-readable storage medium. In some possible implementations, various aspects of the present embodiment can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary implementations of the present invention described in the above "Exemplary Method" section of the present embodiment.

[0182] The program product for implementing the above method according to the embodiment of the present invention may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the embodiment of the present invention is not limited thereto. In the embodiment of the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.

[0183] The program product may be in any combination of one or more computer-readable media. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive) of computer-readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0184] It should be noted that the program code contained in the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0185] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

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

[0187] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program: obtaining a background image to be superimposed, wherein the display content in the background image includes: a target boundary, which is a boundary where a virtual water surface area contacts a virtual land area; generating a virtual film model based on the target boundary, wherein the virtual film model is used to determine a virtual wave surface to be displayed at the target boundary; obtaining a target map, wherein the target map is used to determine virtual waves to be displayed at the target boundary; adding the target map to the virtual film model to obtain a first processing result, wherein the first processing result is used to determine a wave foam effect to be displayed at the target boundary; and superimposing the background image and the first processing result to obtain a second processing result, wherein the second processing result is used to generate a wave synthesis effect at the target boundary.

[0188] Optionally, the processor may also be configured to perform the following steps through a computer program: projecting the original image onto a target grid, wherein the display content in the original image includes: a plurality of candidate boundaries; and adjusting the camera viewing angle of the virtual camera to shoot the target grid to obtain a background image.

[0189] Optionally, the processor can also be configured to perform the following steps through a computer program: draw a target line according to a target boundary; determine a first direction and a second direction of the target line, wherein the first direction is a path direction of the target line and the second direction is a direction perpendicular to the first direction; determine a width of the target line in the second direction; and generate a virtual film model based on the width.

[0190] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: determine the texture coordinates to be used according to the first direction and the second direction; create a multi-layer texture mask based on the texture coordinates to be used, wherein the multi-layer texture mask is used to randomly adjust the display effect of the virtual waves in the time dimension.

[0191] Optionally, the processor may also be configured to perform the following steps through a computer program: obtaining a virtual initial wave surface; adjusting the morphological parameters of the virtual initial wave surface to obtain a virtual target wave surface; determining a plurality of target points on the virtual target wave surface, wherein the plurality of target points are used to determine the generation position of the wave foam effect; performing speed adjustment and disturbance processing on the plurality of target points to obtain a third processing result, wherein the third processing result is used to determine the tailing effect of the wave foam; performing volume conversion on the third processing result to generate a target map.

[0192] Optionally, the processor may also be configured to perform the following steps through a computer program: the morphological parameters include one or more of the following: a first morphological parameter, wherein the first morphological parameter is used to adjust the texture accuracy of the virtual initial wave surface; a second morphological parameter, wherein the second morphological parameter is used to adjust the texture tiling size of the virtual initial wave surface; a third morphological parameter, wherein the third morphological parameter is used to adjust the speed attribute of the virtual initial wave surface; a fourth morphological parameter, wherein the fourth morphological parameter is used to adjust the movement direction of the virtual initial wave surface; and a fifth morphological parameter, wherein the fifth morphological parameter is used to adjust the wave crest attribute of the virtual initial wave surface.

[0193] Optionally, the processor may also be configured to perform the following steps through a computer program: randomly distributing a plurality of candidate points on a virtual target wave surface; and selecting a plurality of target points from the plurality of candidate points based on a fifth morphological parameter.

[0194] Optionally, the processor may also be configured to execute the following steps through a computer program: performing volume conversion on the third processing result to generate an initial map; performing seam processing and feathering processing on the initial map to obtain a target map.

[0195] Optionally, the processor may also be configured to perform the following steps through a computer program: adding the target map to the virtual patch model based on the texture coordinates to be used to obtain a fourth processing result; and mixing the fourth processing result with a multi-layer texture mask to obtain the first processing result.

[0196] In the computer-readable storage medium of this embodiment, a technical solution of a method for generating virtual ocean waves is provided. A background image to be superimposed is obtained, wherein the display content in the background image includes: a target boundary, which is a boundary where a virtual water surface area contacts a virtual land area, a virtual film model is generated based on the target boundary, wherein the virtual film model is used to determine a virtual wave surface to be displayed at the target boundary, and a target map is obtained, wherein the target map is used to determine virtual spray to be displayed at the target boundary, a first processing result is obtained by adding the target map to the virtual film model, wherein the first processing result is used to determine the wave foam effect to be displayed at the target boundary, the background image is superimposed with the first processing result to obtain a second processing result, wherein the second processing result is used to generate a wave synthesis effect at the target boundary, and the purpose of obtaining a virtual ocean wave effect by superimposing a virtual spray map on the background image is achieved, thereby achieving the technical effect of improving the virtual ocean wave rendering efficiency at a relatively low cost, thereby solving the technical problem of the virtual ocean wave rendering method provided by the related art having high rendering difficulty and low efficiency.

[0197] Fig.11 is a schematic diagram of an electronic device according to an embodiment of the present invention. Fig.11 As shown, the electronic device 1100 is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0198] like Fig.11 As shown, the electronic device 1100 is in the form of a general computing device. The components of the electronic device 1100 may include but are not limited to: the at least one processor 1110, the at least one memory 1120, a bus 1130 connecting different system components (including the memory 1120 and the processor 1110), and a display 1140.

[0199] The memory 1120 stores program codes, which can be executed by the processor 1110, so that the processor 1110 executes the steps according to various exemplary implementations of the present invention described in the method part of the embodiment of the present invention.

[0200] The memory 1120 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 11201 and / or a cache memory unit 11202, and may further include a read-only memory unit (ROM) 11203, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.

[0201] In some examples, the memory 1120 may also include a program / utility 11204 having a set (at least one) of program modules 11205, such program modules 11205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. The memory 1120 may further include a memory remotely disposed relative to the processor 1110, and these remote memories may be connected to the electronic device 1100 via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0202] The bus 1130 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a local bus of the processor 1110, or a bus using any of a variety of bus architectures.

[0203] The display 1140 may be, for example, a touch screen type liquid crystal display (LCD) that enables a user to interact with a user interface of the electronic device 1100 .

[0204] Optionally, the electronic device 1100 may also communicate with one or more external devices 1200 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 1100, and / or any device that enables the electronic device 1100 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 1150. Furthermore, the electronic device 1100 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 1160. Fig.11 As shown, the network adapter 1160 communicates with other modules of the electronic device 1100 via the bus 1130. It should be understood that although Fig.11 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

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

[0206] It can be understood by those skilled in the art that Fig.11 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.11 More or fewer components as shown, or with Fig.11 The memory 1120 may be used to store computer programs and corresponding data, such as the computer programs and corresponding data corresponding to the virtual ocean wave generation method in the embodiment of the present invention. The processor 1110 executes various functional applications and data processing by running the computer programs stored in the memory 1120, that is, implements the above-mentioned virtual ocean wave generation method.

[0207] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0208] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

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

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

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

[0212] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0213] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for generating virtual ocean waves, characterized in that: include: Acquire a background image to be superimposed, wherein the display content in the background image includes: a target boundary, and the target boundary is a boundary where a virtual water surface area contacts a virtual land area; generating a virtual sheet model based on the target boundary, wherein the virtual sheet model is used to determine a virtual wave surface to be displayed at the target boundary; The morphological parameters of the virtual initial wave surface are adjusted to obtain the virtual target wave surface; Generate a target map based on the virtual target wave surface and the generation position of the wave foam effect on the virtual target wave surface, wherein the target map is used to determine the virtual waves to be displayed at the target boundary; Adding the target map to the virtual film model to obtain a first processing result, wherein the first processing result is used to determine a wave foam effect to be displayed at the target boundary; The background image and the first processing result are superimposed to obtain a second processing result, wherein the second processing result is used to generate a wave synthesis effect at the target boundary.

2. The method for generating virtual ocean waves according to claim 1, characterized in that: Acquiring the background image includes: Projecting the original image onto the target grid, wherein the display content in the original image includes: a plurality of candidate boundaries; The camera angle of view of the virtual camera shooting the target grid is adjusted to obtain the background image.

3. The method for generating virtual ocean waves according to claim 1, characterized in that: Generating the virtual slice model based on the target boundary includes: Draw a target line according to the target boundary; Determine a first direction and a second direction of the target line, wherein the first direction is a path direction of the target line, and the second direction is a direction perpendicular to the first direction; determining a width of the target line in the second direction; The virtual slice model is generated based on the width.

4. The method for generating virtual ocean waves according to claim 3, characterized in that: The virtual ocean wave generation method further comprises: Determine texture coordinates to be used according to the first direction and the second direction; A multi-layer texture mask is created based on the texture coordinates to be used, wherein the multi-layer texture mask is used to randomly adjust the display effect of the virtual waves in the time dimension.

5. The method for generating virtual ocean waves according to claim 1, characterized in that: Based on the virtual target wave surface and the generation position of the wave foam effect on the virtual target wave surface, generating a target map includes: Determining a plurality of target points on the virtual target wave surface, wherein the plurality of target points are used to determine the generation position of the wave foam effect; Performing speed adjustment and disturbance processing on the multiple target points to obtain a third processing result, wherein the third processing result is used to determine the tailing effect of the wave foam; Perform volume conversion on the third processing result to generate the target map.

6. The method for generating virtual ocean waves according to claim 5, characterized in that: The morphological parameters include one or more of the following: A first morphological parameter, wherein the first morphological parameter is used to adjust the texture accuracy of the virtual initial wave surface; A second morphological parameter, wherein the second morphological parameter is used to adjust the texture tiling size of the virtual initial wave surface; a third morphological parameter, wherein the third morphological parameter is used to adjust a velocity attribute of the virtual initial wave surface; a fourth morphological parameter, wherein the fourth morphological parameter is used to adjust the movement direction of the virtual initial wave surface; A fifth morphological parameter, wherein the fifth morphological parameter is used to adjust the wave crest attribute of the virtual initial wave surface.

7. The method for generating virtual ocean waves according to claim 6, characterized in that: Determining the plurality of target points on the virtual target wave surface comprises: Randomly distributing a plurality of candidate points on the virtual target wave surface; The multiple target points are selected from the multiple candidate points based on the fifth morphological parameter.

8. The method for generating virtual ocean waves according to claim 5, characterized in that: Performing volume conversion on the third processing result to generate the target map includes: Performing volume conversion on the third processing result to generate an initial map; The initial map is subjected to seam processing and feathering processing to obtain the target map.

9. The method for generating virtual ocean waves according to claim 4, characterized in that: Adding the target map to the virtual slice model to obtain the first processing result includes: adding the target map to the virtual patch model based on the texture coordinates to be used to obtain a fourth processing result; The fourth processing result is mixed with the multi-layer texture mask to obtain the first processing result.

10. A virtual ocean wave generating device, characterized in that: include: A first acquisition module is used to acquire a background image to be superimposed, wherein the display content in the background image includes: a target boundary, and the target boundary is a boundary where a virtual water surface area contacts a virtual land area; A first processing module, configured to generate a virtual sheet model based on the target boundary, wherein the virtual sheet model is used to determine a virtual wave surface to be displayed at the target boundary; A second acquisition module is used to adjust the morphological parameters of the virtual initial wave surface to obtain a virtual target wave surface; based on the virtual target wave surface and the generation position of the wave foam effect on the virtual target wave surface, a target map is generated, wherein the target map is used to determine the virtual waves to be displayed at the target boundary; A second processing module, used for adding the target map to the virtual film model to obtain a first processing result, wherein the first processing result is used to determine the wave foam effect to be displayed at the target boundary; The third processing module is used to superimpose the background image and the first processing result to obtain a second processing result, wherein the second processing result is used to generate a wave synthesis effect at the target boundary.

11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method for generating virtual ocean waves as claimed in any one of claims 1 to 9 when running.

12. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the method for generating virtual ocean waves as claimed in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Water wave special effect generation method and device, storage medium and computer equipment

    CN112967367A

  • Sea surface model rendering method and device

    CN113450443A