Virtual sea surface generation method and device, computer program product and electronic equipment

By generating a virtual sea surface and using the camera's motion trajectory to generate point clouds and meshes, the problems of insufficient detail in the foreground and wasted performance in the background are solved, thus optimizing computing resources and improving rendering efficiency.

CN121120987APending Publication Date: 2025-12-12NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511216938.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

In existing technologies, virtual sea surface generation methods suffer from insufficient detail in the foreground and wasted performance in the background, resulting in excessive consumption of computing resources.

Method used

By acquiring the camera's motion trajectory, a first point cloud and a second point cloud are generated to construct a sea surface mesh. The mesh is then rendered using preset material textures to increase the number of near-field faces and decrease the number of far-field faces, thus optimizing the mesh density.

Benefits of technology

Without increasing the total number of points, it improves near-field detail, reduces far-field computational resource consumption, achieves uniform mesh density, and saves computational resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121120987A_ABST
    Figure CN121120987A_ABST
Patent Text Reader

Abstract

The invention discloses a virtual sea surface generation method and device, a computer program product and electronic equipment, and relates to the technical field of computers. The method comprises the following steps: acquiring a lens movement track, and determining a sea level according to the lens movement track; mapping the lens movement track to the sea level, and generating a first point cloud and a second point cloud in the sea level based on the lens movement track; obtaining a target point cloud according to the first point cloud and the second point cloud, and constructing a sea surface grid according to the target point cloud; rendering the sea surface grid by using a preset texture map to obtain a target virtual sea surface; finer close-shot details in the sea surface are realized, and performance consumption of long-shot rendering is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a method and apparatus for generating a virtual sea surface, a computer program product, and an electronic device. Background Technology

[0002] In typical special effects shots, ocean-related shots usually require a huge number of polygons.

[0003] In related technologies, a basic sea surface effect is obtained by using a uniform cross-shaped mesh model and a marine procedural texture deformer to dynamically shape the mesh model points.

[0004] However, in lens production, shots related to the sea surface are always close to the water, resulting in a lower grid density in the foreground and a higher grid density in the background. Foreground elements often occupy a large portion of the frame, and a low grid count in the foreground can lead to harsh edges and insufficient detail; conversely, a low background frame count results in wasted performance. To improve detail, the overall subdivision level needs to be increased. While meeting the requirements of the foreground, this also significantly increases the number of geometric points and faces in the background. An excessively high number of geometric points and faces consumes substantial computational resources, and the amount of data consumed increases exponentially with subsequent dynamic changes to the sea surface. Summary of the Invention

[0005] This disclosure provides a method for generating a virtual sea surface, which at least partially solves the problems of insufficient detail in the foreground and performance waste in the background in related technologies.

[0006] According to a first aspect of this disclosure, a method for generating a virtual sea surface is provided, the method comprising:

[0007] Acquire the camera movement trajectory and determine the sea level based on the camera movement trajectory;

[0008] The lens motion trajectory is mapped onto the sea surface, and a first point cloud and a second point cloud are generated on the sea surface based on the lens motion trajectory.

[0009] A target point cloud is obtained based on the first point cloud and the second point cloud, and a sea surface grid is constructed based on the target point cloud;

[0010] The sea surface mesh is rendered using a preset material texture to obtain the target virtual sea surface.

[0011] According to a second aspect of this disclosure, a virtual sea surface generation apparatus is provided, the apparatus comprising:

[0012] The motion trajectory acquisition module is used to acquire the lens motion trajectory and determine the sea level based on the lens motion trajectory;

[0013] A point cloud generation module is used to map the lens motion trajectory onto the sea surface, and generate a first point cloud and a second point cloud on the sea surface based on the lens motion trajectory.

[0014] The grid construction module is used to obtain a target point cloud based on the first point cloud and the second point cloud, and to construct a sea surface grid based on the target point cloud;

[0015] The rendering module is used to render the sea surface mesh using a preset material texture to obtain the target virtual sea surface.

[0016] According to a third aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method of the first aspect described above and possible implementations thereof.

[0017] According to a fourth aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of the first aspect and possible implementations thereof by executing the executable instructions.

[0018] This disclosure provides a method for generating a virtual sea surface, which involves acquiring a camera motion trajectory, determining a sea level based on the camera motion trajectory, mapping the camera motion trajectory onto the sea level, generating a first point cloud and a second point cloud on the sea level based on the camera motion trajectory, obtaining a target point cloud based on the first point cloud and the second point cloud, constructing a sea surface mesh based on the target point cloud, and rendering the sea surface mesh using a preset material texture to obtain a target virtual sea surface. On one hand, acquiring a camera motion trajectory, determining a sea level based on the camera motion trajectory, mapping the camera motion trajectory onto the sea level, generating a first point cloud and a second point cloud on the sea level based on the camera motion trajectory, obtaining a target point cloud based on the first point cloud and the second point cloud, and constructing a sea surface mesh based on the target point cloud—in this process, the mesh topology of the sea surface is regenerated through the camera motion trajectory, thereby resetting the density of the polygon mesh. That is, the number of near-field faces is increased and the number of far-field faces is reduced through the target point cloud, making the ratio of geometric mesh area to image pixel area more uniform in the camera view. On the other hand, with the total number of points in the model remaining unchanged, the number of grids in the foreground is increased by constructing a sea surface mesh through the target point cloud, which achieves more refined foreground details. At the same time, the number of geometric points and faces in the background is reduced, saving computing resources and reducing performance consumption during rendering. Attached Figure Description

[0019] Figure 1 This illustrates a grid distribution in a marine shot image according to this exemplary embodiment;

[0020] Figure 2A flowchart illustrating a virtual sea surface generation method in this exemplary embodiment is shown;

[0021] Figure 3 A schematic diagram illustrating a lens motion trajectory in this exemplary embodiment is shown;

[0022] Figure 4 This illustration shows a schematic diagram of mapping a lens motion trajectory onto a first sea level in this exemplary embodiment;

[0023] Figure 5 This illustration shows a schematic diagram in which the attenuation distance of the color of the lens motion trajectory is set as a first attenuation distance in one of the exemplary embodiments of the present invention;

[0024] Figure 6 A schematic diagram of a first point cloud generated in this example embodiment is shown;

[0025] Figure 7 This illustration shows a schematic diagram of a generated second point cloud in this example embodiment;

[0026] Figure 8 This illustration shows a schematic diagram of a sea surface grid generated from a target point cloud in this example embodiment;

[0027] Figure 9 This illustration shows a schematic diagram of a three-dimensional sea surface obtained by adjusting the sea surface grid in this example embodiment;

[0028] Figure 10 This illustration shows a schematic diagram of a target virtual sea surface in this example embodiment;

[0029] Figure 11 A block diagram of a virtual sea surface generation device is shown in this exemplary embodiment;

[0030] Figure 12 A schematic diagram of the structure of an electronic device in this exemplary embodiment is shown. Detailed Implementation

[0031] Exemplary embodiments of this disclosure will be described more fully below with reference to the accompanying drawings.

[0032] The accompanying drawings are schematic illustrations of this disclosure and are not necessarily drawn to scale. Some block diagrams shown in the drawings may be functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in hardware modules or integrated circuits, or in networks, processors, or microcontrollers. Implementations can be carried out in various forms and should not be construed as limited to the examples set forth herein. The features, structures, or characteristics described in this disclosure can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough description of embodiments of this disclosure. However, those skilled in the art will recognize that one or more specific details may be omitted when implementing the technical solutions of this disclosure, or other methods, components, apparatuses, steps, etc., may be used to replace one or more specific details.

[0033] In the production of typical special effects shots, ocean-related shots generally require a huge number of polygons, complex shot production, massive amounts of data, long calculation time, and even a slight mistake during production can cause system crashes.

[0034] Related technologies utilize a dense cross-shaped mesh model and a procedural ocean texture deformer to dynamically shape the mesh model points, achieving a basic sea surface effect. Higher subdivision levels result in better detail.

[0035] However, in the production of ocean shots, the lens is always close to the sea surface, for reference. Figure 1 As shown, in a camera view, the mesh density is lower in the foreground and higher in the background. Foreground elements often occupy a large portion of the frame, and a low mesh count in the foreground can result in harsh edges and insufficient detail. Conversely, a low background frame count leads to wasted performance. To improve detail, the overall subdivision level needs to be increased. While meeting the requirements for foreground elements, this also results in a massive increase in the number of geometric points and faces in the background. An excessively high number of geometric points and faces consumes significant computational resources, and the amount of data consumed increases exponentially with subsequent dynamic changes in the sea surface, potentially causing device lag and system crashes.

[0036] In view of the above problems, an exemplary embodiment of this disclosure provides a method for generating a virtual sea surface. (See reference...) Figure 2 As shown, the virtual sea surface generation method may include the following steps:

[0037] Step S210. Obtain the lens motion trajectory and determine the sea level based on the lens motion trajectory;

[0038] Step S220. Map the lens motion trajectory onto the sea surface, and generate a first point cloud and a second point cloud on the sea surface based on the lens motion trajectory;

[0039] Step S230. Obtain a target point cloud based on the first point cloud and the second point cloud, and construct a sea surface grid based on the target point cloud;

[0040] Step S240. Render the sea surface mesh using a preset material texture to obtain the target virtual sea surface.

[0041] In the above-described virtual sea surface generation method, the camera motion trajectory is acquired, and the sea level is determined based on the camera motion trajectory. The camera motion trajectory is mapped onto the sea level, and a first point cloud and a second point cloud are generated on the sea level based on the camera motion trajectory. A target point cloud is obtained based on the first point cloud and the second point cloud, and a sea surface mesh is constructed based on the target point cloud. The sea surface mesh is rendered using a preset material texture to obtain the target virtual sea surface. On one hand, acquiring the camera motion trajectory, determining the sea level based on the camera motion trajectory, mapping the camera motion trajectory onto the sea level, and generating a first point cloud and a second point cloud on the sea level based on the camera motion trajectory, obtaining the target point cloud, and constructing a sea surface mesh all involve regenerating the sea surface mesh topology through the camera motion trajectory. This achieves a reset of the polygon mesh density, that is, by increasing the number of near-field faces and decreasing the number of far-field faces through the target point cloud, the ratio of geometric mesh area to image pixel area in the camera view becomes more uniform. On the other hand, with the total number of points in the model remaining unchanged, the number of grids in the foreground is increased by constructing a sea surface mesh through the target point cloud, which achieves more refined foreground details. At the same time, the number of geometric points and faces in the background is reduced, saving computing resources and reducing performance consumption during rendering.

[0042] The following will provide further explanation and description of steps S210-S240.

[0043] In step S210, the lens motion trajectory is acquired, and the sea level is determined based on the lens motion trajectory.

[0044] The camera motion trajectory can be obtained from a preset camera motion animation, which includes a pre-designed camera path. After obtaining the camera motion animation, the position of the camera in each frame can be obtained, and the camera motion trajectory can be obtained based on the position of the camera in each frame. After obtaining the camera motion trajectory, the sea level can be determined based on the camera motion trajectory. The sea level is a plane containing multiple grids.

[0045] In one exemplary embodiment, acquiring the lens motion trajectory includes:

[0046] Obtain a preset camera motion animation and determine the time frames included in the camera motion animation;

[0047] The position point of the lens at the specified time frame is obtained, and the position points are connected to obtain the lens motion trajectory.

[0048] Specifically, after obtaining the preset camera motion animation, the time frames included in the preset camera motion animation can be determined. For each time frame, the position point of the camera is obtained, and the position points corresponding to each time frame are connected to obtain the camera motion trajectory.

[0049] For example, a preset camera motion animation can be used as input to a `trail` node. Since the core of the `trail` node is recording the mapping relationship between time frames and positions, the position points of the camera corresponding to each time frame can be directly output through this node. Furthermore, the `time shift` node is mainly used to control the timeline of the camera motion animation. Therefore, all time frames included in the preset camera motion animation can be obtained through the `time shift` node. Combined with the `trail` node, the position point of the camera at each time frame in the preset camera motion animation can be obtained. After obtaining the position points at all time frames, each position point is connected to obtain the camera motion trajectory. When the preset camera motion animation has 60 frames, the obtained camera motion trajectory is as follows: Figure 3 As shown.

[0050] In one exemplary embodiment, after obtaining the lens motion trajectory, the sea level can be determined based on the range of the lens motion trajectory. The shape of the sea level can be square or circular; in this example embodiment, the shape of the sea level is not specifically limited. The sea level is a two-dimensional grid plane, comprising multiple grids.

[0051] In step S220, the lens motion trajectory is mapped onto the sea surface, and a first point cloud and a second point cloud are generated on the sea surface based on the lens motion trajectory.

[0052] After determining the camera movement trajectory and the sea level, the color attribute of the sea level can be set, mapping the camera movement trajectory onto the sea level. When mapping the camera movement trajectory, its color can be set, and this color differs from the sea level color. A first and second point cloud can be generated on the sea level based on the camera movement trajectory. In generating the first and second point clouds, the number of points can be determined based on the color attribute; that is, the number of points varies with the color.

[0053] In one exemplary embodiment, mapping the lens motion trajectory onto the sea surface and generating a first point cloud on the sea surface based on the lens motion trajectory includes:

[0054] Set the color of the sea surface to a first color, and map the camera movement trajectory to the first sea surface;

[0055] Set the color of the lens motion trajectory in the first sea level to the second color, and set the attenuation distance of the second color to the first attenuation distance;

[0056] A first point cloud is constructed based on the colors of the pixels in the first sea level.

[0057] Specifically, before mapping the camera movement trajectory, the color of the first sea surface can be set as a first color, and the camera movement trajectory can be mapped onto the first sea surface of this first color. Then, the color of the camera movement trajectory can be set to a second color, which is different from the first color. Furthermore, the color attenuation distance of the second color of the camera movement trajectory can be set as a first attenuation distance. After setting the first attenuation distance to the first color, the color between each pixel in the camera movement trajectory and its surrounding pixels at a distance equal to the first attenuation distance decreases as the distance increases. Finally, a first point cloud is constructed based on the color attributes of each pixel in the first sea surface. The number of points in the first point cloud varies depending on the color. The first color can be black, and the second color can be white; in this example embodiment, the first and second colors are not specifically limited. The first attenuation distance can be 50; in this example embodiment, the first attenuation distance is not specifically limited.

[0058] For example, after setting the color of the first sea level to black (0, 0, 0), it can be referenced via the Ray node. Figure 4 As shown, the camera motion trajectory can be mapped onto the first sea level. The core of this Ray node is to establish a ray interaction between the source geometry and the target geometry, enabling attribute transfer by passing the attributes of the target geometry to the source geometry. After mapping to the first sea level, the color of the camera motion trajectory is set to white (1,1,1), and the color information of the camera motion trajectory is transferred to the first sea level through the AttribTransfer node. Simultaneously, the attenuation distance of the camera motion trajectory color is set to 50. The resulting camera motion trajectory is as follows: Figure 5As shown; the core of the AttribTransfer node is to establish the association between the source geometry and the target geometry. By calculating the spatial relationship (distance, normal direction, etc.) between the target point and the source point, the attributes of the source geometry (such as Cd color, N normal) are transferred to the target geometry. Finally, the Scatter node generates the first point cloud based on the color attributes in the first sea level; the core of the Scatter node is to generate new points on the source geometry according to specified rules. The distribution of points can be adjusted by the color attributes. In this example embodiment, the number of points generated can be reduced as the color changes from white to black, and no point cloud is generated in areas where the pixel is black. The generated first point cloud is as follows. Figure 6 As shown. The first point cloud generated can be the point cloud corresponding to the close-up view of the shot.

[0059] In one exemplary embodiment, mapping the lens motion trajectory onto the sea surface and generating a first point cloud on the sea surface based on the lens motion trajectory includes:

[0060] Set the color of the sea level to a third color, and map the camera movement trajectory to a second sea level;

[0061] Set the color of the lens motion trajectory in the second sea level to the fourth color, and set the attenuation distance of the fourth color to the second attenuation distance;

[0062] A second point cloud is constructed based on the colors of the pixels in the second sea level.

[0063] Specifically, before mapping the camera movement trajectory, the color of the second sea level can be set to a third color, and the camera movement trajectory can be mapped onto the second sea level of this third color. Then, the color of the camera movement trajectory can be set to a fourth color, which is different from the third color. The color attenuation distance of the fourth color of the camera movement trajectory can also be set to a second attenuation distance. After setting the second attenuation distance for the fourth color, the color between each pixel in the camera movement trajectory and its surrounding pixels at a distance equal to the second attenuation distance weakens as the distance increases. Finally, a second point cloud is constructed based on the color attributes of each pixel in the second sea level. The number of points in the second point cloud varies depending on the color. The third color can be dark black, and the fourth color can be light gray; in this example embodiment, the third and fourth colors are not specifically limited. The second attenuation distance can be 200; in this example embodiment, the first attenuation distance is not specifically limited.

[0064] For example, after setting the color of the second sea level to dark black (0.1, 0.1, 0.1), the camera motion trajectory can be mapped onto the second sea level using a Ray node. The core of this Ray node is to establish a ray interaction between the source geometry and the target geometry, enabling attribute transfer by passing the attributes of the target geometry to the source geometry. After mapping to the second sea level, the color of the camera motion trajectory is set to light gray (0.9, 0.9, 0.9), and the color information of the camera motion trajectory is transferred to the second sea level using an AttribTransfer node, while setting the attenuation distance of the camera motion trajectory color to 200. The core of the AttribTransfer node is to establish the association between the source geometry and the target geometry by calculating the spatial relationship (distance, normal direction, etc.) between the target point and the source point, and transferring the attributes of the source geometry (such as Cd color, N normal) to the target geometry. Finally, a second point cloud is generated using the Scatter node based on the color attributes of the first sea level. The core of the Scatter node is to generate new points on the source geometry according to specified rules. The distribution of points can be adjusted using color attributes. In this example embodiment, the number of generated points can be reduced as the color changes from light gray to dark black. The generated second point cloud is as follows: Figure 7 As shown. The generated second point cloud can be the point cloud corresponding to the distant view in the shot.

[0065] In step S230, a target point cloud is obtained based on the first point cloud and the second point cloud, and a sea surface grid is constructed based on the target point cloud.

[0066] In one exemplary embodiment, obtaining a target point cloud based on the first point cloud and the second point cloud, and constructing a sea surface grid based on the target point cloud, includes:

[0067] The target point cloud is obtained by superimposing the first point cloud and the second point cloud;

[0068] The target point cloud is triangulated to obtain the sea surface grid.

[0069] Specifically, after obtaining the first point cloud and the second point cloud, all points in the first point cloud and all points in the second point cloud can be superimposed to obtain the target point cloud. After obtaining the target point cloud, the points in the target point cloud can be triangulated to obtain the sea surface mesh.

[0070] For example, the first point cloud and the second point cloud are overlaid to obtain the target point cloud. Then, using the Triangulate2D node, the points in the target point cloud are triangulated to obtain the following result: Figure 9 The sea surface grid shown. Figure 8In the shown sea surface mesh, a three-level density variation with near, middle, and far density decay can be observed based on the distance from the camera. The Delaunay triangulation algorithm can be used to triangulate the points in the target point cloud. Its core logic is: in a two-dimensional plane, connect all points to form triangles, ensuring that the circumcircle of each triangle does not contain other points, thereby maximizing the minimum angle and avoiding the generation of elongated or distorted triangles.

[0071] In one exemplary embodiment, the lens motion trajectory can also be mapped onto the sea surface according to the above-described process of mapping the lens motion trajectory, and the attenuation distance of the lens motion trajectory color can be set as a third attenuation distance, and a third point cloud can be generated. The first point cloud, the second point cloud, and the third point cloud can then be superimposed. This example embodiment does not impose specific limitations on this; those skilled in the art can set multiple attenuation distances as needed to generate multiple point clouds, and superimpose these multiple point clouds to obtain a more refined target mesh.

[0072] By using target point clouds, the number of topological points is increased for foreground objects and decreased for background objects. This results in a more uniform ratio of geometric mesh count to pixel area within the camera's view.

[0073] In one exemplary embodiment, after obtaining the sea surface grid, the method further includes:

[0074] The sea surface mesh is inspected to obtain the intersecting surfaces and isolated nodes included in the sea surface mesh;

[0075] The intersecting surface and the isolated node are optimized.

[0076] Specifically, after generating the sea surface mesh, the mesh can be inspected to identify intersecting surfaces and isolated nodes. Isolated nodes are points not connected to other points and can be deleted. Intersecting surfaces are instances where two or more polygonal faces partially or completely overlap, intersect, or penetrate each other in three-dimensional space. For intersecting surfaces, the spatial intersection relationships between polygonal faces can be detected, and the intersection areas can be adjusted according to set rules. These rules can be either segmentation or stitching, but are not specifically limited in this example embodiment.

[0077] For example, after generating the sea surface mesh, a PolyDoctor node can be used to inspect the mesh for topological issues, such as intersecting surfaces or isolated nodes. If isolated nodes exist, they are deleted; if intersecting surfaces exist, they are optimized by splitting or stitching them. Optimizing the sea surface mesh provides a healthy geometric foundation for subsequent rendering.

[0078] In step S240, the sea surface mesh is rendered using a preset material texture to obtain the target virtual sea surface.

[0079] After obtaining the sea surface mesh, it can be rendered. Before rendering, the sea surface mesh can be adjusted to create variations in the sea's undulations. After rendering the sea surface mesh using preset material maps, lighting effects can be added to the scene to enhance the rendering quality.

[0080] In one exemplary embodiment, rendering the sea surface mesh using a preset material texture to obtain a target virtual sea surface includes:

[0081] Obtain a preset wave spectrum, and determine the wave characteristics based on the wave spectrum;

[0082] The sea surface grid is adjusted according to the wave characteristics to generate a three-dimensional sea surface;

[0083] The preset material texture is used to render the three-dimensional sea surface to obtain the target virtual sea surface.

[0084] Specifically, a preset wave spectrum can be obtained, and the statistical characteristics of the waves can be determined based on this spectrum. These statistical characteristics may include wave height, wave energy, wave propagation direction, overall scaled wave size, and wave breaking degree, etc. In this example embodiment, the wave characteristics are not specifically limited. After obtaining the wave characteristics, the sea surface mesh can be adjusted according to the wave characteristics to generate a three-dimensional sea surface. After obtaining the three-dimensional sea surface, a preset material texture is used to render the three-dimensional sea surface to obtain the target virtual sea surface.

[0085] For example, the Ocean Spectrum and Ocean Evaluate nodes can be used to create highly realistic ocean surface undulations. These two nodes work together to simulate the physical properties of the ocean. First, create an Ocean Spectrum node. Through this node, you can set the basic properties of the waves, including: overall scale of wave size, wave height, wind speed, wind direction, and wave breaking. Wind speed determines wave energy, and wind direction controls the direction of wave propagation. By setting these properties, you obtain the wave characteristics. Then, input the wave characteristics and the ocean surface mesh into the Ocean Evaluate node. The Ocean Evaluate node is used to adjust the ocean surface mesh to obtain the desired effect. Figure 9 The 3D sea surface shown is rendered using preset material textures after it has been obtained, resulting in the following: Figure 10The target virtual sea surface shown can be a sea surface texture map or a foam texture map.

[0086] In one exemplary embodiment, after obtaining the target virtual sea surface, the method further includes:

[0087] Acquire the target light source and determine the illumination result of each pixel in the target virtual sea surface;

[0088] The target virtual sea surface is rendered based on the lighting results.

[0089] Specifically, it can also acquire the target light source, determine the lighting results of each pixel in the target virtual sea surface based on the target light source, and render the target virtual sea surface based on the lighting results.

[0090] In one exemplary embodiment, after rendering the target virtual sea surface, a target sea surface video can be generated based on the target virtual sea surface. That is, after generating the target virtual sea surface, a timeline is added to the target virtual sea surface, and the target sea surface video is generated based on the changes of the target virtual sea surface at each time point in the timeline.

[0091] The virtual sea surface generation method provided by the exemplary embodiments of this disclosure has at least the following advantages: On the one hand, it acquires the camera motion trajectory, determines the sea level based on the camera motion trajectory, maps the camera motion trajectory to the sea level, and generates a first point cloud and a second point cloud on the sea level based on the camera motion trajectory. A target point cloud is obtained based on the first and second point clouds, and a sea surface mesh is constructed based on the target point cloud. In this process, the mesh topology of the sea surface is regenerated through the camera motion trajectory, thereby resetting the density of the polygon mesh. That is, the number of near-field faces is increased and the number of far-field faces is reduced through the target point cloud, making the ratio of geometric mesh to image pixel area more uniform in the camera view. On the other hand, with the total number of points in the model remaining unchanged, constructing the sea surface mesh through the target point cloud increases the number of meshes in the near-field, achieving finer near-field details, while reducing the number of geometric points and faces in the far-field, saving computational resources and reducing performance consumption.

[0092] Exemplary embodiments of this disclosure also provide a virtual sea surface generation apparatus, with reference to Figure 11 As shown, it includes:

[0093] The motion trajectory acquisition module 1110 is used to acquire the lens motion trajectory and determine the sea level based on the lens motion trajectory;

[0094] The point cloud generation module 1120 is used to map the lens motion trajectory onto the sea surface and generate a first point cloud and a second point cloud on the sea surface based on the lens motion trajectory.

[0095] Mesh construction module 1130 is used to obtain a target point cloud based on the first point cloud and the second point cloud, and to construct a sea surface mesh based on the target point cloud;

[0096] The rendering module 1140 is used to render the sea surface mesh using a preset material texture to obtain the target virtual sea surface.

[0097] In one exemplary embodiment, the motion trajectory acquisition module includes:

[0098] The time frame determination module is used to acquire a preset camera motion animation and determine the time frames included in the camera motion animation.

[0099] The position point connection module is used to obtain the position point of the lens in the time frame, connect the position points, and obtain the lens motion trajectory.

[0100] In one exemplary embodiment, the point cloud generation module includes:

[0101] The first color setting module is used to set the color of the sea surface to a first color and to map the camera movement trajectory to the first sea surface;

[0102] The first color attenuation distance setting module is used to set the color of the lens motion trajectory in the first sea level to the second color, and set the attenuation distance of the second color to the first attenuation distance;

[0103] The first point cloud generation module is used to construct a first point cloud based on the colors of pixels in the first sea surface.

[0104] In one exemplary embodiment, the point cloud generation module includes:

[0105] The third color setting module is used to set the color of the sea level to the third color and map the camera movement trajectory to the second sea level;

[0106] The second color attenuation distance setting module is used to set the color of the lens motion trajectory in the second sea level to the fourth color, and set the attenuation distance of the fourth color to the second attenuation distance;

[0107] The second point cloud construction module is used to construct a second point cloud based on the colors of pixels in the second sea level.

[0108] In one exemplary embodiment, the mesh building module includes:

[0109] A point cloud overlay module is used to overlay the first point cloud and the second point cloud to obtain the target point cloud;

[0110] The sea surface mesh generation module is used to triangulate the target point cloud to obtain the sea surface mesh.

[0111] In one exemplary embodiment, the mesh building module includes:

[0112] The sea surface grid detection module is used to detect the sea surface grid and obtain the intersecting surfaces and isolated nodes included in the sea surface grid.

[0113] The mesh optimization module is used to optimize the intersecting surfaces and the isolated nodes.

[0114] In one exemplary embodiment, the rendering module includes:

[0115] The wave characteristics determination module is used to obtain a preset wave spectrum and determine the wave characteristics based on the wave spectrum.

[0116] The sea surface grid adjustment module is used to adjust the sea surface grid according to the wave characteristics to generate a three-dimensional sea surface;

[0117] The sea surface rendering module is used to render the three-dimensional sea surface using the preset material texture to obtain the target virtual sea surface.

[0118] In one exemplary embodiment, the rendering module includes:

[0119] The lighting calculation module is used to acquire the target light source and determine the lighting result of each pixel in the target virtual sea surface;

[0120] The lighting result rendering module is used to render the target virtual sea surface based on the lighting result.

[0121] The specific details of each part of the above-mentioned device have been described in detail in the method section of the implementation plan. For any undisclosed details, please refer to the implementation plan of the method section, and therefore will not be repeated here.

[0122] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0123] Furthermore, although the steps of the method in this invention are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0124] In an exemplary embodiment of the present invention, an electronic device capable of implementing the above-described method is also provided.

[0125] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuits,” “modules,” or “systems.”

[0126] The following reference Figure 12 To describe an electronic device 1200 according to this embodiment of the present invention. Figure 12 The electronic device 1200 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0127] like Figure 12 As shown, the electronic device 1200 is presented in the form of a general-purpose computing device. The components of the electronic device 900 may include, but are not limited to: at least one processing unit 1210, at least one storage unit 1220, a bus 1230 connecting different system components (including storage unit 1220 and processing unit 1210), and a display unit 1240.

[0128] The storage unit stores program code that can be executed by the processing unit 1210, causing the processing unit 1210 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 1210 can perform actions such as... Figure 2 The steps shown are as follows: Step S210: Obtain the camera motion trajectory and determine the sea level based on the camera motion trajectory; Step S220: Map the camera motion trajectory to the sea level and generate a first point cloud and a second point cloud on the sea level based on the camera motion trajectory; Step S230: Obtain a target point cloud based on the first point cloud and the second point cloud, and construct a sea surface mesh based on the target point cloud; Step S240: Render the sea surface mesh using a preset material texture to obtain the target virtual sea surface.

[0129] Storage unit 1220 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 12201 and / or cache memory 12202, and may further include a read-only memory (ROM) 12203.

[0130] Storage unit 1220 may also include a program / utility 12204 having a set (at least one) of program modules 12205, such program modules 12205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0131] Bus 1230 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

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

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

[0134] In exemplary embodiments of the present invention, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the present invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the present invention described in the "Exemplary Methods" section above.

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

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

[0137] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0138] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF (Radio Frequency), etc., or any suitable combination thereof.

[0139] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0140] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0141] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention described herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not invented herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the claims.

Claims

1. A method for generating a virtual sea surface, characterized in that, include: Acquire the camera movement trajectory and determine the sea level based on the camera movement trajectory; The lens motion trajectory is mapped onto the sea surface, and a first point cloud and a second point cloud are generated on the sea surface based on the lens motion trajectory. A target point cloud is obtained based on the first point cloud and the second point cloud, and a sea surface grid is constructed based on the target point cloud; The sea surface mesh is rendered using a preset material texture to obtain the target virtual sea surface.

2. The method according to claim 1, characterized in that, The acquisition of the camera motion trajectory includes: Obtain a preset camera motion animation and determine the time frames included in the camera motion animation; The position point of the lens at the specified time frame is obtained, and the position points are connected to obtain the lens motion trajectory.

3. The method according to claim 1, characterized in that, The step of mapping the lens motion trajectory onto the sea surface and generating a first point cloud on the sea surface based on the lens motion trajectory includes: Set the color of the sea surface to a first color, and map the camera movement trajectory to the first sea surface; Set the color of the lens motion trajectory in the first sea level to the second color, and set the attenuation distance of the second color to the first attenuation distance; A first point cloud is constructed based on the colors of the pixels in the first sea level.

4. The method according to claim 1, characterized in that, The step of mapping the lens motion trajectory onto the sea surface and generating a first point cloud on the sea surface based on the lens motion trajectory includes: Set the color of the sea level to a third color, and map the camera movement trajectory to a second sea level; Set the color of the lens motion trajectory in the second sea level to the fourth color, and set the attenuation distance of the fourth color to the second attenuation distance; A second point cloud is constructed based on the colors of the pixels in the second sea level.

5. The method according to claim 1, characterized in that, The step of obtaining a target point cloud based on the first point cloud and the second point cloud, and constructing a sea surface grid based on the target point cloud, includes: The target point cloud is obtained by superimposing the first point cloud and the second point cloud; The target point cloud is triangulated to obtain the sea surface grid.

6. The method according to claim 5, characterized in that, After obtaining the sea surface grid, the method further includes: The sea surface mesh is inspected to obtain the intersecting surfaces and isolated nodes included in the sea surface mesh; The intersecting surface and the isolated node are optimized.

7. The method according to claim 1, characterized in that, The process of rendering the sea surface mesh using a preset material texture to obtain the target virtual sea surface includes: Obtain a preset wave spectrum, and determine the wave characteristics based on the wave spectrum; The sea surface grid is adjusted according to the wave characteristics to generate a three-dimensional sea surface; The preset material texture is used to render the three-dimensional sea surface to obtain the target virtual sea surface.

8. The method according to claim 1, characterized in that, After obtaining the target virtual sea surface, the method further includes: Acquire the target light source and determine the illumination result of each pixel in the target virtual sea surface; The target virtual sea surface is rendered based on the lighting results.

9. A virtual sea surface generation device, characterized in that, include: The motion trajectory acquisition module is used to acquire the lens motion trajectory and determine the sea level based on the lens motion trajectory; A point cloud generation module is used to map the lens motion trajectory onto the sea surface, and generate a first point cloud and a second point cloud on the sea surface based on the lens motion trajectory. The grid construction module is used to obtain a target point cloud based on the first point cloud and the second point cloud, and to construct a sea surface grid based on the target point cloud; The rendering module is used to render the sea surface mesh using a preset material texture to obtain the target virtual sea surface.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 8.

11. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 8 by executing the executable instructions.